python-stdnum-1.8.1/0000755000000000000000000000000013224171744014315 5ustar rootroot00000000000000python-stdnum-1.8.1/setup.py0000755000000000000000000000605213224165073016033 0ustar rootroot00000000000000#!/usr/bin/env python # setup.py - python-stdnum installation script # # Copyright (C) 2010-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """python-stdnum installation script.""" import os import sys from setuptools import setup, find_packages import stdnum # fix permissions for sdist if 'sdist' in sys.argv: os.system('chmod -R a+rX .') os.umask(int('022', 8)) base_dir = os.path.dirname(__file__) with open(os.path.join(base_dir, 'README'), 'rb') as fp: long_description = fp.read().decode('utf-8') setup(name='python-stdnum', version=stdnum.__version__, description='Python module to handle standardized numbers and codes', long_description=long_description, author='Arthur de Jong', author_email='arthur@arthurdejong.org', url='https://arthurdejong.org/python-stdnum/', license='LGPL', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Intended Audience :: Financial and Insurance Industry', 'Intended Audience :: Information Technology', 'Intended Audience :: Telecommunications Industry', 'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Office/Business :: Financial', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Processing :: General', ], packages=find_packages(), package_data={'': ['*.dat']}, extras_require={ # The SOAP feature is only required for a number of online tests # of numbers such as the EU VAT VIES lookup, the Dominican Republic # DGII services or the Turkish T.C. Kimlik validation. 'SOAP': ['zeep'], # recommended implementation 'SOAP-ALT': ['suds'], # but this should also work 'SOAP-FALLBACK': ['PySimpleSOAP'], # this is a fallback }, ) python-stdnum-1.8.1/tests/0000755000000000000000000000000013224171744015457 5ustar rootroot00000000000000python-stdnum-1.8.1/tests/test_eu_vat.py0000644000000000000000000000346213223166521020354 0ustar rootroot00000000000000# test_eu_vat.py - functions for testing the online VIES VAT validation # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # This is a separate test file because it should not be run regularly # because it could negatively impact the VIES service. """Extra tests for the stdnum.eu.vat module.""" import os import unittest from stdnum.eu import vat @unittest.skipIf( not os.environ.get('ONLINE_TESTS'), 'Do not overload online services') class TestVies(unittest.TestCase): """Test the VIES web service provided by the European commission for validation VAT numbers of European countries.""" def test_check_vies(self): """Test stdnum.eu.vat.check_vies()""" result = vat.check_vies('BE555445') self.assertEqual(result['countryCode'], 'BE') self.assertEqual(result['vatNumber'], '555445') def test_check_vies_approx(self): """Test stdnum.eu.vat.check_vies_approx()""" result = vat.check_vies_approx('BE555445', 'BE555445') self.assertEqual(result['countryCode'], 'BE') self.assertEqual(result['vatNumber'], '555445') python-stdnum-1.8.1/tests/test_verhoeff.doctest0000644000000000000000000000366713156325253021725 0ustar rootroot00000000000000test_verhoeff.doctest - more detailed doctests for stdnum.verhoeff module Copyright (C) 2010, 2011, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.verhoeff module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import verhoeff These are normal variations that should just work. Calculating checksums: >>> verhoeff.checksum('654') 1 >>> verhoeff.checksum('1428570') 0 >>> verhoeff.checksum('398438246238642378648236487236482734') 3 The same numbers but now simply ask for validation: >>> verhoeff.validate('654') Traceback (most recent call last): ... InvalidChecksum: ... >>> verhoeff.validate('1428570') '1428570' >>> verhoeff.validate('398438246238642378648236487236482734') Traceback (most recent call last): ... InvalidChecksum: ... Adding a check digit to the numbers so they are all valid: >>> verhoeff.calc_check_digit('654') '8' >>> verhoeff.validate('6548') '6548' >>> verhoeff.calc_check_digit('1428570') '8' >>> verhoeff.validate('1428570') '1428570' >>> verhoeff.calc_check_digit('398438246238642378648236487236482734') '7' >>> verhoeff.validate('3984382462386423786482364872364827347') '3984382462386423786482364872364827347' python-stdnum-1.8.1/tests/test_de_idnr.doctest0000644000000000000000000000426213223166521021511 0ustar rootroot00000000000000test_de_idnr.doctest - more detailed doctests for stdnum.de.idnr module Copyright (C) 2017 Holvi Payment Services Oy Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.de.idnr module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.de import idnr The number should be 11 digits long, should contain only numbers and cannot start with a zero. >>> idnr.validate('116574261809') Traceback (most recent call last): ... InvalidLength: ... >>> idnr.validate('A6574261809') Traceback (most recent call last): ... InvalidFormat: ... >>> idnr.validate('01234567896') Traceback (most recent call last): ... InvalidFormat: ... The first 10 digits of the IdNr is supposed to contain extactly one digit twice (or three times since 2016) and all other digits in the number can only appear once. This tries to catch some corner cases. Note that only the first 10 digits are considered for this. >>> idnr.validate('1234567890 3') # each digit once Traceback (most recent call last): ... InvalidFormat: ... >>> idnr.validate('1123456789 0') # one digit twice '11234567890' >>> idnr.validate('1112345678 6') # one digit three times '11123456786' >>> idnr.validate('1111234567 8') # one digit four times Traceback (most recent call last): ... InvalidFormat: ... >>> idnr.validate('1122345678 5') # two digits more than once Traceback (most recent call last): ... InvalidFormat: ... python-stdnum-1.8.1/tests/test_luhn.doctest0000644000000000000000000000354613156325253021063 0ustar rootroot00000000000000test_luhn.doctest - more detailed doctests for stdnum.luhn module Copyright (C) 2010, 2011, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.luhn module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import luhn These are normal variations that should just work. Calculating checksums: >>> luhn.checksum('4992739871') 9 >>> luhn.checksum('490154203237518') 0 >>> luhn.checksum('abcdefe', alphabet='abcdef') 0 The same numbers but now simply ask for validation: >>> luhn.validate('4992739871') Traceback (most recent call last): ... InvalidChecksum: ... >>> luhn.validate('490154203237518') '490154203237518' >>> luhn.validate('abcdefe', alphabet='abcdef') 'abcdefe' Adding a check digit to the numbers so they are all valid: >>> luhn.calc_check_digit('4992739871') '6' >>> luhn.validate('49927398716') '49927398716' >>> luhn.calc_check_digit('142857') '2' >>> luhn.validate('1428572') '1428572' >>> luhn.calc_check_digit('398438246238642378648236487236482734') '7' >>> luhn.validate('3984382462386423786482364872364827347') '3984382462386423786482364872364827347' python-stdnum-1.8.1/tests/test_ru_inn.doctest0000644000000000000000000000302213156325253021374 0ustar rootroot00000000000000test_ru_inn.doctest - more detailed doctests for the stdnum.ru.inn module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ru.inn module. It tries to validate a number of numbers that have been found online. >>> from stdnum.ru import inn >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 005826107187 ... 0108003670 ... 0273074555 ... 0279111370 ... 0716007984 ... 5190187770 ... 6223002330 ... 6440019934 ... 6672238301 ... 6903022126 ... 6908012650 ... 6911001698 ... 7609000881 ... 7709442668 ... 7716450028 ... 7724051595 ... 7726485118 ... 7727705694 ... 7728127936 ... 7813045547 ... 7825498171 ... 8614008550 ... 8906008726 ... 8906008740 ... ... ''' >>> [x for x in numbers.splitlines() if x and not inn.is_valid(x)] [] python-stdnum-1.8.1/tests/test_damm.doctest0000644000000000000000000000500413223166521021016 0ustar rootroot00000000000000test_damm.doctest - more detailed doctests for stdnum.damm module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.damm module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import damm These are normal variations that should just work. Calculating checksums: >>> damm.checksum('572') 4 >>> damm.checksum('5724') 0 >>> damm.checksum('43881234567') 9 >>> damm.checksum('438812345679') 0 The same numbers but now simply ask for validation: >>> damm.validate('572') Traceback (most recent call last): ... InvalidChecksum: ... >>> damm.validate('5724') '5724' >>> damm.validate('43881234567') Traceback (most recent call last): ... InvalidChecksum: ... >>> damm.validate('438812345679') '438812345679' Adding a check digit to the numbers so they are all valid: >>> damm.calc_check_digit('572') '4' >>> damm.validate('5724') '5724' >>> damm.calc_check_digit('5724') '0' >>> damm.validate('57240') '57240' >>> damm.calc_check_digit('43881234567') '9' >>> damm.validate('438812345679') '438812345679' >>> damm.calc_check_digit('438812345679') '0' >>> damm.validate('4388123456790') '4388123456790' We can also use a different table if we really need to. This one is from http://www.md-software.de/math/DAMM_Quasigruppen.txt >>> table = ( ... (0, 2, 3, 4, 5, 6, 7, 8, 9, 1), ... (2, 0, 4, 1, 7, 9, 5, 3, 8, 6), ... (3, 7, 0, 5, 2, 8, 1, 6, 4, 9), ... (4, 1, 8, 0, 6, 3, 9, 2, 7, 5), ... (5, 6, 2, 9, 0, 7, 4, 1, 3, 8), ... (6, 9, 7, 3, 1, 0, 8, 5, 2, 4), ... (7, 5, 1, 8, 4, 2, 0, 9, 6, 3), ... (8, 4, 6, 2, 9, 5, 3, 0, 1, 7), ... (9, 8, 5, 7, 3, 1, 6, 4, 0, 2), ... (1, 3, 9, 6, 8, 4, 2, 7, 5, 0)) >>> damm.checksum('816', table=table) 9 >>> damm.checksum('8169', table=table) 0 python-stdnum-1.8.1/tests/test_robustness.doctest0000644000000000000000000000247213223166521022315 0ustar rootroot00000000000000test_robustness.doctest - test is_valid() functions to not break Copyright (C) 2011-2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains some tests for modules in the stdnum package to check whether all provided is_valid() functions can handle clearly invalid junk. >>> testvalues = ( ... None, '*&^%$', '', 0, False, object(), 'Z', 'QQ', '3', '€', u'€', ... '😴', '¥') >>> from stdnum.util import get_number_modules Go over each module and try every value. >>> for mod in get_number_modules(): ... results = [ x for x in testvalues if mod.is_valid(x) != False ] ... if results: ... print(mod.__name__, results) python-stdnum-1.8.1/tests/test_isan.doctest0000644000000000000000000000771413156325253021050 0ustar rootroot00000000000000test_isan.doctest - more detailed doctests for stdnum.isan module Copyright (C) 2010, 2012, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.isan module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import isan This is how numbers should be split (possible with and without episode number): >>> isan.split('000000018947000000000000') ('000000018947', '0000', '', '00000000', '') >>> isan.split('0000-0000-D07A-0090-Q-0000-0000-X') ('00000000D07A', '0090', 'Q', '00000000', 'X') >>> isan.split('000000018947000000000000') ('000000018947', '0000', '', '00000000', '') >>> isan.split('1881-66C7-3420-6541-Y') ('188166C73420', '6541', 'Y', '', '') >>> isan.split('1881-66C7-3420-6541') ('188166C73420', '6541', '', '', '') Compacting should also work: >>> isan.compact('000000018947000000000000') '000000018947000000000000' >>> isan.compact('0000-0000-D07A-0090-Q-0000-0000-X') '00000000D07A009000000000' >>> isan.compact('0000-0000-D07A-0090-Q-0000-0000-X', strip_check_digits=False) '00000000D07A0090Q00000000X' >>> isan.compact('000000018947000000000000') '000000018947000000000000' >>> isan.compact('1881-66C7-3420-6541-Y') '188166C734206541' >>> isan.compact('1881-66C7-3420-6541-Y', strip_check_digits=False) '188166C734206541Y' >>> isan.compact('1881-66C7-3420-6541') '188166C734206541' These should be valid numbers: >>> isan.validate('0000-0000-D07A-0090-Q-0000-0000-X') '00000000D07A0090Q00000000X' >>> isan.validate('1881-66C7-3420-6541-Y-9F3A-0245-O') '188166C734206541Y9F3A0245O' >>> isan.validate('0000-0000-D07A-0090-Q-0000-0000-X') '00000000D07A0090Q00000000X' >>> isan.validate('0000-0000-D07A-0090-Q') '00000000D07A0090Q' And these should be invalid: >>> isan.validate('00000000D07A0090-Z') Traceback (most recent call last): ... InvalidChecksum: ... >>> isan.validate('3abc6800-0041X1-20') Traceback (most recent call last): ... InvalidFormat: ... >>> isan.validate('3abc6800-0041') Traceback (most recent call last): ... InvalidLength: ... The format() function can add the check digit if needed. It should leave alone existing check digits (even invalid ones) and respect the presence or absence of a version number. >>> isan.format('00000000D07A0090') '0000-0000-D07A-0090-Q' >>> isan.format('1881-66C734206541-9F3A-0245') '1881-66C7-3420-6541-Y-9F3A-0245-O' >>> isan.format('1881-66C7-3420-6541-?-9F3A-0245-?', strip_check_digits=True, add_check_digits=False) '1881-66C7-3420-6541-9F3A-0245' >>> isan.format('1881-66C7-3420-6541-?-9F3A-0245-?', strip_check_digits=True, add_check_digits=True) '1881-66C7-3420-6541-Y-9F3A-0245-O' The validate() function also allows stripping and (re)adding check digits. >>> isan.validate('1881-66C7-3420-6541-Y-9F3A-0245-O', strip_check_digits=True) '188166C7342065419F3A0245' >>> isan.validate('188166C7342065419F3A0245', add_check_digits=True) '188166C734206541Y9F3A0245O' >>> isan.validate('1881-66C7-3420-6541-X-9F3A-0245-A', strip_check_digits=True, add_check_digits=True) '188166C734206541Y9F3A0245O' A simple test for the to_binary() function. >>> import binascii >>> import sys >>> x = binascii.b2a_hex(isan.to_binary('0000-0000-D07A-0090-Q')) >>> if sys.version > '3': ... x = str(x, encoding='ascii') >>> x '00000000d07a0090' python-stdnum-1.8.1/tests/test_au_abn.doctest0000644000000000000000000000553713223166521021340 0ustar rootroot00000000000000test_au_abn.doctest - more detailed doctests for the stdnum.au.abn module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.au.abn module. It tries to validate a number of numbers that have been found online. >>> from stdnum.au import abn >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 11574456001 ... 12 123 552 732 ... 12197960056 ... 14 007 145 637 ... 14 085 537 097 ... 15 071 884 994 ... 16 050 539 350 ... 16 875 959 817 ... 16207643640 ... 17 088 952 023  ... 17 091 664 318 ... 17798019840 ... 18657363620 ... 18986035694 ... 19406270520 ... 20 080 574 616 ... 21 006 741 420 ... 211 082 588 59 ... 21276698420 ... 22752397988 ... 25 009 256 179 ... 25 078 164 020 ... 26 128 975 842 ... 27146513745 ... 29 176 219 543 ... 30194533815 ... 30319635949 ... 30753140115 ... 32510077067 ... 32967065962 ... 34180019054 ... 35 061 659 185 ... 35367869361 ... 36562063587 ... 38032136826 ... 38689369989 ... 42350020583 ... 42793074259 ... 43 002 724 334 ... 45138393975 ... 45686492545 ... 46 003 855 561 ... 46 003 855 561  ... 46065060376 ... 46080667721 ... 46241363405 ... 48110267900 ... 49046814670 ... 50 001 065 096 ... 50785233431 ... 51 824 753 556 ... 51120335948 ... 51424722884 ... 51974674048 ... 52 007 061 930 ... 54159269665 ... 55344832020 ... 55593511022 ... 57 064 001 270 ... 57356639841 ... 58437726834 ... 60431599619 ... 61173792360 ... 61483329243 ... 62128948118 ... 62361423248 ... 62826560160 ... 66 098 752 319 ... 66870124640 ... 68515519306 ... 69629520833 ... 73401973717 ... 73420076995 ... 74756347129 ... 74823923971 ... 75 091 431 202 ... 79772126259 ... 81 633 873 422 ... 83562801946 ... 84 002 705 224 ... 84598062158 ... 84696968277 ... 84771313085 ... 85 192 178 954 ... 85573270719 ... 86760778045 ... 87252821098 ... 88 775 098 848 ... 88278681363 ... 90 006 091 774 ... 90399103769 ... 91 010 334 915 ... 91044249923 ... 91957581192 ... 92 104 128 001 ... 93915085021 ... 96196152632 ... 97522448851 ... 98 116 306 453 ... 98977939326 ... 99870624871 ... ... ''' >>> [x for x in numbers.splitlines() if x and not abn.is_valid(x)] [] python-stdnum-1.8.1/tests/test_iban.doctest0000644000000000000000000001576413223166521021027 0ustar rootroot00000000000000test_iban.doctest - more detailed doctests for the stdnum.iban module Copyright (C) 2011-2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.iban module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import iban These should all be valid numbers and are from the IBAN REGISTRY as sample numbers: >>> numbers = ''' ... AD12 0001 2030 2003 5910 0100 ... AD1200012030200359100100 ... AE070331234567890123456 ... AL47 2121 1009 0000 0002 3569 8741 ... AL47212110090000000235698741 ... AT61 1904 3002 3457 3201 ... AT611904300234573201 ... AZ21NABZ00000000137010001944 ... BA39 1290 0794 0102 8494 ... BA391290079401028494 ... BE68 5390 0754 7034 ... BE68539007547034 ... BG80 BNBG 9661 1020 3456 78 ... BG80BNBG96611020345678 ... BH67BMAG00001299123456 ... BR1800000000141455123924100C2 ... BR9700360305000010009795493P1 ... CH93 0076 2011 6238 5295 7 ... CH9300762011623852957 ... CY17 0020 0128 0000 0012 0052 7600 ... CY17002001280000001200527600 ... CZ65 0800 0000 1920 0014 5399 ... CZ6508000000192000145399 ... CZ94 5500 0000 0010 1103 8930 ... CZ9455000000001011038930 ... DE89 3704 0044 0532 0130 00 ... DE89370400440532013000 ... DK50 0040 0440 1162 43 ... DK5000400440116243 ... DO28BAGR00000001212453611324 ... EE38 2200 2210 2014 5685 ... EE382200221020145685 ... ES 58 0049 0290 3424 1352 8341 ... ES04 0075 0078 0605 0005 0355 ... ES0521053014113400002160 ... ES10 0075 0080 11 0600658108 ... ES15-0049-1806-9121-1186-9374 ... ES2030810089311100269222 ... ES24 2090 3191 1400 4012 1040 ... ES27 3183 1500 9600 0121 0562 ... ES28 2104 0485 5390 6968 2983 ... ES29 2100 2815 9822 0059 9427 ... ES37 2038 8700 7861 0000 9781 ... ES39 0081 0294 66 0001238624 ... ES58 1465 0100 9719 0014 4593 ... ES59 0049 5030 1129 1601 1246 ... ES62 2100 4288 5922 0010 4465 ... ES72 2013-0692-81-0201150993 ... ES72 2048 1075 8334 0000 2171 ... ES81 0081 5515 2900 0157 5763 ... ES8521005731710200031769 ... ES86 2013 0095 1102 0142 6812 ... ES86 30580157682720001384 ... ES88 2095 0497 9191 0708 8631 ... ES91 2100 0418 4502 0005 1332 ... ES9121000418450200051332 ... ES98 0049 5442 2227 1606 6973 ... FI21 1234 5600 0007 85 ... FI2112345600000785 ... FI5542345670000081 ... FO62 6460 0001 6316 34 ... FO6264600001631634 ... FR14 2004 1010 0505 0001 3M02 606 ... FR1420041010050500013M02606 ... GB29 NWBK 6016 1331 9268 19 ... GB29NWBK60161331926819 ... GE29 NB00 0000 0101 9049 17 ... GE29NB0000000101904917 ... GI75 NWBK 0000 0000 7099 453 ... GI75NWBK000000007099453 ... GL89 6471 0001 0002 06 ... GL8964710001000206 ... GR16 0110 1250 0000 0001 2300 695 ... GR1601101250000000012300695 ... GT82TRAJ01020000001210029690 ... HR12 1001 0051 8630 0016 0 ... HR1210010051863000160 ... HU42 1177 3016 1111 1018 0000 0000 ... HU42117730161111101800000000 ... IE29 AIBK 9311 5212 3456 78 ... IE29AIBK93115212345678 ... IL62 0108 0000 0009 9999 999 ... IL620108000000099999999 ... IS14 0159 2600 7654 5510 7303 39 ... IS140159260076545510730339 ... IT60 X054 2811 1010 0000 0123 456 ... IT60X0542811101000000123456 ... JO94CBJO0010000000000131000302 ... KZ86125KZT5004100100 ... LB62 0999 0000 0001 0019 0122 9114 ... LB62099900000001001901229114 ... LI21 0881 0000 2324 013A A ... LI21088100002324013AA ... LT12 1000 0111 0100 1000 ... LT121000011101001000 ... LU28 0019 4006 4475 0000 ... LU280019400644750000 ... LV80 BANK 0000 4351 9500 1 ... LV80BANK0000435195001 ... MC11 1273 9000 7000 1111 1000 h79 ... MC1112739000700011111000h79 ... MD24AG000225100013104168 ... ME25 5050 0001 2345 6789 51 ... ME25505000012345678951 ... MK072 5012 0000 0589 84 ... MK07250120000058984 ... MR13 0002 0001 0100 0012 3456 753 ... MR1300020001010000123456753 ... MT84 MALT 0110 0001 2345 MTLC AST0 01S ... MT84MALT011000012345MTLCAST001S ... MU17 BOMM 0101 1010 3030 0200 000M UR ... MU17 BOMM0101101030300200000MUR ... NL91 ABNA 0417 1643 00 ... NL91ABNA0417164300 ... NO93 8601 1117 947 ... NO9386011117947 ... PK36SCBL0000001123456702 ... PL61 1090 1014 0000 0712 1981 2874 ... PL61109010140000071219812874 ... PS92PALS000000000400123456702 ... PT50 0002 0123 1234 5678 9015 4 ... PT50000201231234567890154 ... QA58DOHB00001234567890ABCDEFG ... RO49 AAAA 1B31 0075 9384 0000 ... RO49AAAA1B31007593840000 ... RS35 2600 0560 1001 6113 79 ... RS35260005601001611379 ... SA03 8000 0000 6080 1016 7519 ... SA0380000000608010167519 ... SE45 5000 0000 0583 9825 7466 ... SE4550000000058398257466 ... SI56 1910 0000 0123 438 ... SI56191000000123438 ... SK31 1200 0000 1987 4263 7541 ... SK3112000000198742637541 ... SM86 U032 2509 8000 0000 0270 100 ... SM86U0322509800000000270100 ... TL 38 008 00123456789101 57 ... TN59 1000 6035 1835 9847 8831 ... TN5910006035183598478831 ... TR33 0006 1005 1978 6457 8413 26 ... TR330006100519786457841326 ... VG96VPVG0000012345678901 ... XK051212012345678906 ... ''' >>> [ x for x in numbers.splitlines() if x and not iban.is_valid(x) ] [] These all have broken checksums or are mangled: >>> numbers = ''' ... AL48212110090000000235698741 ... AD1210012030200359100100 ... AT611804300234573201 ... BE68530907547034 ... BA391290709401028494 ... BG80BNBG99611020345678 ... HR1210010052863000160 ... CY17002001281000001200527600 ... CZ6508000000129000145399 ... CZ9455000000000101038930 ... DK5000400440116342 ... ''' >>> [ x for x in numbers.splitlines() if x and iban.is_valid(x) ] [] These are the wrong length but otherwise have valid checksums: >>> numbers = ''' ... AD48 0001 2030 2003 5910 01 ... AT93 1904 3002 3457 3201 99 ... BE36 5390 0754 7034 1234 ... BA30 1290 0794 0102 84 ... ''' >>> [ x for x in numbers.splitlines() if x and iban.is_valid(x) ] [] These are mostly valid except that they have alphabetic characters where they are not allowed or numbers where alphabetic characters are expected or have an unknown country code: >>> numbers = ''' ... BG93 BNBG 9661 1A20 3456 78 ... GI22 NW3K 0000 0000 7099 453 ... NL56 3003 0A17 1643 00 ... QQ93 1234 5678 ... ''' >>> [ x for x in numbers.splitlines() if x and iban.is_valid(x) ] [] These are mostly for the normal IBAN check but they are not correct according to the country-specific validation. >>> numbers = ''' ... ES2121000418450200051331 ... ES89 3183 1500 9500 0121 0562 ... ''' >>> [ x for x in numbers.splitlines() if x and not iban.is_valid(x, check_country=False) ] [] >>> [ x for x in numbers.splitlines() if x and iban.is_valid(x) ] [] python-stdnum-1.8.1/tests/test_do_ncf.py0000644000000000000000000000450713223166521020322 0ustar rootroot00000000000000# test_do_ncf.py - functions for testing the online NCF validation # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # This is a separate test file because it should not be run regularly # because it could negatively impact the online service. """Extra tests for the stdnum.do.ncf module.""" import os import unittest from stdnum.do import ncf from stdnum.exceptions import * @unittest.skipIf( not os.environ.get('ONLINE_TESTS'), 'Do not overload online services') class TestDGII(unittest.TestCase): """Test the web services provided by the the Dirección General de Impuestos Internos (DGII), the Dominican Republic tax department.""" def test_check_dgii(self): """Test stdnum.do.ncf.check_dgii()""" # Test a normal valid number result = ncf.check_dgii('130546312', 'A010010011500000038') self.assertTrue(all( key in result.keys() for key in ['name', 'proof', 'is_valid', 'validation_message', 'rnc', 'ncf'])) self.assertEqual(result['rnc'], '130546312') self.assertEqual(result['ncf'], 'A010010011500000038') # Test an invalid combination self.assertIsNone(ncf.check_dgii('501620371', 'A010010011500000038')) # Another valid example self.assertTrue(ncf.check_dgii('1-31-56633-2', 'A010010010100000001')) self.assertTrue(ncf.check_dgii('1-31-56633-2', 'A010010010100000100')) # These types have not been requested with the regulator self.assertFalse(ncf.check_dgii('1-31-56633-2', 'A030010010100000001')) self.assertFalse(ncf.check_dgii('1-31-56633-2', 'A010020010100000001')) python-stdnum-1.8.1/tests/test_pl_regon.doctest0000644000000000000000000000417013156325253021714 0ustar rootroot00000000000000test_pl_regon.doctest - more detailed doctests for the stdnum.pl.regon module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.pl.regon module. It tries to validate a number of numbers that have been found online. >>> from stdnum.pl import regon >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 000144992 ... 000262289 ... 000569734 ... 001123710 ... 001130740 ... 001130762 ... 001130785 ... 004611261 ... 010925233 ... 011370116 ... 015615046 ... 015831301 ... 017282442 ... 021425170 ... 021493503 ... 061245300 ... 080121017 ... 101286521 ... 101624716 ... 101702037 ... 120444729 ... 120812966 ... 122903064 ... 122989806 ... 140006787 ... 140124720 ... 140567178 ... 140906290 ... 141215688 ... 147244188 ... 160178314 ... 180405830 ... 180562050 ... 190248215 ... 190384415 ... 191305139 ... 192976380 ... 200197338 ... 220218697 ... 221997249 ... 241675487 ... 271747631 ... 276273209 ... 280002520 ... 292449593 ... 300613124 ... 302406613 ... 357126121 ... 360935507 ... 362392991 ... 362501144 ... 362509447 ... 362509460 ... 362509476 ... 362523660 ... 370418951 ... 370452988 ... 432740426 ... 570007868 ... 570135170 ... 570271370 ... 570860528 ... 572134252 ... 630679076 ... 632154969 ... 634389910 ... 670141210 ... 810033277 ... 812663628 ... ... ''' >>> [x for x in numbers.splitlines() if x and not regon.is_valid(x)] [] python-stdnum-1.8.1/tests/test_ch_uid.doctest0000644000000000000000000000777313156325253021356 0ustar rootroot00000000000000test_ch_uid.doctest - more detailed doctests for the stdnum.ch.uid module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ch.uid module. >>> from stdnum.ch import uid >>> from stdnum.exceptions import * Some more detailed tests. >>> uid.validate('ZZZ-107.787.577') Traceback (most recent call last): ... InvalidComponent: ... >>> uid.validate('CHE-10A.787.577') Traceback (most recent call last): ... InvalidFormat: ... These have been found online and should all be valid numbers. >>> numbers = ''' ... ... CHE 113.042.942. ... CHE-101.415.551 ... CHE-105.067.880 ... CHE-105.616.108 ... CHE-105.838.471 ... CHE-106.222.918 ... CHE-108.902.220 ... CHE-112.786.448 ... CHE-113.606.230 ... CHE-113.606.253 ... CHE-113.614.519 ... CHE-113.617.417 ... CHE-113.638.690 ... CHE-113.690.319 ... CHE-113.706.877 ... CHE-113.840.903 ... CHE-114.165.895 ... CHE-114.332.288 ... CHE-114.365.477 ... CHE-114.557.166 ... CHE-114.587.210 ... CHE-114.764.713 ... CHE-114.921.562 ... CHE-115.117.491 ... CHE-115.188.717 ... CHE-115.257.146 ... CHE-115.401.147 ... CHE-115.681.283 ... CHE-115.702.784 ... CHE-115.901.131 ... CHE-116.018.087 ... CHE-116.022.172 ... CHE-116.024.389 ... CHE-116.066.413 ... CHE-116.066.436 ... CHE-116.066.459 ... CHE-116.066.465 ... CHE-116.066.471 ... CHE-116.066.488 ... CHE-116.068.168 ... CHE-116.068.180 ... CHE-116.068.257 ... CHE-116.068.369 ... CHE-116.068.375 ... CHE-116.068.398 ... CHE-116.068.435 ... CHE-116.068.470 ... CHE-116.068.524 ... CHE-116.068.582 ... CHE-131.608.474 ... CHE-132.071.565 ... CHE-133.192.355 ... CHE-145.202.776 ... CHE-146.680.598 ... CHE-154.748.703 ... CHE-154.936.162 ... CHE-157.957.462 ... CHE-164.589.300 ... CHE-165.355.615 ... CHE-170.094.053 ... CHE-172.763.936 ... CHE-187.271.257 ... CHE-188.858.471 ... CHE-190.214.202 ... CHE-193.052.812 ... CHE-199.027.184 ... CHE-199.213.611 ... CHE-200.143.304 ... CHE-200.474.557 ... CHE-201.091.609 ... CHE-208.913.684 ... CHE-211.403.691 ... CHE-221.032.573 ... CHE-221.432.665 ... CHE-222.251.936 ... CHE-222.259.895 ... CHE-226.253.064 ... CHE-226.598.037 ... CHE-247.670.953 ... CHE-254.168.819 ... CHE-255.108.719 ... CHE-255.286.924 ... CHE-261.860.174 ... CHE-263.297.189 ... CHE-264.708.255 ... CHE-265.476.805 ... CHE-268.880.226 ... CHE-276.015.555 ... CHE-276.258.224 ... CHE-279.426.498 ... CHE-288.910.965 ... CHE-304.459.014 ... CHE-313.282.453 ... CHE-316.510.171 ... CHE-317.089.412 ... CHE-319.639.393 ... CHE-320.640.339 ... CHE-322.193.357 ... CHE-325.352.422 ... CHE-327.285.558 ... CHE-335.670.007 ... CHE-360.001.499 ... CHE-363.192.993 ... CHE-367.908.992 ... CHE-378.338.277 ... CHE-379.051.878 ... CHE-383.713.530 ... CHE-392.445.860 ... CHE-397.984.845 ... CHE-400.352.783 ... CHE-402.703.876 ... CHE-403.244.345 ... CHE-404.107.716 ... CHE-405.509.388 ... CHE-415.481.515 ... CHE-420.485.329 ... CHE-422.892.792 ... CHE-424.195.422 ... CHE-430.271.592 ... CHE-433.064.977 ... CHE-443.047.638 ... CHE-444.796.174 ... CHE-444.901.873 ... CHE-445.737.990 ... CHE-446.609.550 ... CHE-447.518.447 ... CHE-447.564.660 ... CHE-449.312.098 ... CHE-450.220.178 ... CHE-460.147.005 ... CHE-467.023.568 ... CHE-468.593.911 ... CHE-475.427.548 ... CHE-478.406.525 ... CHE-488.502.886 ... CHE-488.972.766 ... CHE-489.713.641 ... ... ''' >>> [x for x in numbers.splitlines() if x and not uid.is_valid(x)] [] python-stdnum-1.8.1/tests/test_fr_siret.doctest0000644000000000000000000000440413156325253021724 0ustar rootroot00000000000000test_fr_siret.doctest - more detailed doctests for the stdnum.fr.siret module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.fr.siret module. >>> from stdnum.fr import siret >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 0 5 7 8 1 3 1 3 1 0 0 0 2 6 ... 1 800 700 39 00 110 ... 2 00 03 00 13 000 11 ... 2 101 005 33 000 12 ... 2 777 000 43 000 15 ... 3 1 0 1 8 8 4 2 0 00 0 8 0 ... 3 12 494 529 000 34 ... 3 24 34 54 20 000 40 ... 30206838200050 ... 314 901 323 00043 ... 31719324100013 ... 32228438100017 ... 32650798500058 ... 32738082000032 ... 329.338.88300153 ... 32929695800039 ... 33770320100034 ... 34530016400018 ... 380 321 430 00023 ... 38446899700034 ... 38536958200023 ... 389 011 529 00036 ... 38981890700203 ... 39039475700020 ... 39102766100050 ... 4 0 0 9 0 8 5 0 5 0 0 0 11 ... 4 0 3 3 1 4 6 6 9 0 0 0 4 1 ... 4 0 9 0 8 5 2 1 4 0 0 0 2 4 ... 4 2 0 3 0 9 6 2 7 0 0 0 3 2 ... 4 4 3 4 8 9 2 7 3 0 0 0 1 3 ... 4 4 3 5 4 9 8 7 8 0 0 0 4 1 ... 4 8 2 7 8 1 9 11 0 0 0 11 ... 40300300700032 ... 44126652500019 ... 44142526100019 ... 44796433900017 ... 479 461 675 00049 ... 5 12 326 653 000 15 ... 5 17 758 173 000 10 ... 50397442000021 ... 513 133 637 000 35 ... 52524288900042 ... 542 097 324 0006 6 ... 652 059 213 00023 ... 7 7821 0526 00019 ... 775.563.232.00104 ... 778 239 798 000 11 ... 79068156300017 ... 8 1 0 2 4 7 3 8 7 0 0 0 1 4 ... 8 1002665800015 ... 8 21 114 55000014 ... ... ''' >>> [x for x in numbers.splitlines() if x and not siret.is_valid(x)] [] python-stdnum-1.8.1/tests/test_ar_cuit.doctest0000644000000000000000000001045613156325253021541 0ustar rootroot00000000000000test_ar_cuit.doctest - more detailed doctests for the stdnum.ac.cuit module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ac.cuit module. It tries to validate a number of numbers that have been found online. >>> from stdnum.ar import cuit >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 20040356437 ... 20047433747 ... 20050573452 ... 20054613009 ... 20058481425 ... 20058723410 ... 20058879089 ... 20073562954 ... 20073659486 ... 20076084735 ... 20077530127 ... 20081042404 ... 20086295106 ... 20086607043 ... 20101376630 ... 20102289855 ... 20103055475 ... 20105567643 ... 20108146304 ... 20108524244 ... 20108909170 ... 20110831243 ... 20112806440 ... 20113951517 ... 20120774019 ... 20121388570 ... 20125491783 ... 20128032801 ... 20129599058 ... 20131707992 ... 20132002755 ... 20136310136 ... 20143455905 ... 20144779674 ... 20145053294 ... 20146234306 ... 20171104042 ... 20171823960 ... 20182886530 ... 20184230446 ... 20187687137 ... 20202569456 ... 20203954795 ... 20204393363 ... 20205752766 ... 20209954088 ... 20213601785 ... 20220030165 ... 20223730907 ... 20224293578 ... 20225121169 ... 20227716011 ... 20237525613 ... 20238697752 ... 20245079541 ... 20248651793 ... 20250926155 ... 20255761367 ... 20259636117 ... 20261576393 ... 20262358977 ... 20271280344 ... 20272201588 ... 20275121364 ... 20282423910 ... 20283621759 ... 20285115664 ... 20287747722 ... 20290072981 ... 20293386162 ... 20298479932 ... 20300953655 ... 20305216950 ... 20314469616 ... 20314970951 ... 20319011987 ... 20320639361 ... 20321768165 ... 20323118249 ... 20324215809 ... 20324381709 ... 20324794043 ... 20328504708 ... 20344135763 ... 20344379131 ... 20347620204 ... 20354205271 ... 20355854974 ... 20360612679 ... 20373308359 ... 20922078182 ... 20922312401 ... 20929597916 ... 23042708194 ... 23045174999 ... 23081181489 ... 23102532279 ... 23161822434 ... 23175636404 ... 23214238519 ... 23233647969 ... 23244989004 ... 23270774199 ... 23278857069 ... 23279103009 ... 23314669649 ... 23324786244 ... 23334052729 ... 23338909764 ... 23355601684 ... 23935319099 ... 24276145513 ... 27018259899 ... 27023396861 ... 27032487705 ... 27056528240 ... 27057490638 ... 27060695488 ... 27063049366 ... 27066515678 ... 27066595485 ... 27098767849 ... 27107931738 ... 27114547382 ... 27121262059 ... 27122342420 ... 27127539923 ... 27130430142 ... 27134454569 ... 27172336472 ... 27173495094 ... 27175432812 ... 27177192010 ... 27177721994 ... 27179361642 ... 27180795672 ... 27185685298 ... 27201493841 ... 27205913209 ... 27215060417 ... 27216654523 ... 27216824178 ... 27221319619 ... 27232710921 ... 27234685568 ... 27243584871 ... 27245896609 ... 27247110831 ... 27248949770 ... 27250076679 ... 27259106430 ... 27259522078 ... 27261420215 ... 27262935081 ... 27267742249 ... 27273160103 ... 27276663084 ... 27278570601 ... 27279026271 ... 27281657025 ... 27283110546 ... 27284491675 ... 27284753505 ... 27288128389 ... 27296108591 ... 27303521211 ... 27304599451 ... 27310947828 ... 27312481389 ... 27314396036 ... 27316481677 ... 27335804088 ... 27354548165 ... 27366029902 ... 27366146259 ... 27372855350 ... 27373316690 ... 27937240444 ... 27938621395 ... 27940212664 ... 27949019387 ... 30653311857 ... 30670349760 ... 30691769336 ... 30700596210 ... 30710422636 ... 30710916574 ... 30711016046 ... 30711067074 ... 30711271003 ... 30711683166 ... 30712071199 ... 30712417419 ... 30714322296 ... 30714468088 ... 30714789062 ... 33534828379 ... 33708972679 ... 33712308589 ... 33714423709 ... ... ''' >>> [x for x in numbers.splitlines() if x and not cuit.is_valid(x)] [] python-stdnum-1.8.1/tests/test_bg_vat.doctest0000644000000000000000000000317313156325253021353 0ustar rootroot00000000000000test_bg_vat.doctest - more detailed doctests for stdnum.bg.vat module Copyright (C) 2012, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.bg.vat module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.bg import vat Normal values that should just work. >>> vat.validate('103873594') # 9-digit legal entity '103873594' >>> vat.validate('131272009') # legal entity with fallback checksum '131272009' >>> vat.validate('7501020018') # physical person '7501020018' >>> vat.validate('8001010008') # physical person '8001010008' >>> vat.validate('8032056031') # physical person '8032056031' >>> vat.validate('7111042925') # foreigners '7111042925' >>> vat.validate('7153849522') # others '7153849522' Invalid checksum: >>> vat.validate('175074751') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... python-stdnum-1.8.1/tests/test_eu_vat.doctest0000644000000000000000000004004613223166521021370 0ustar rootroot00000000000000test_eu_vat.doctest - more detailed doctests for the stdnum.eu.vat module Copyright (C) 2012-2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.eu.vat module. It tries to validate a number of VAT numbers that have been found online. >>> from stdnum.eu import vat >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... ATU 142 43 102 ... ATU 15159209 ... ATU 28560205 ... ATU 34172105 ... ATU 40698107 ... ATU 46276408 ... ATU 49362201 ... ATU 54299806 ... ATU 54300000 ... ATU 56377717 ... ATU 57194903 ... ATU 64487479 ... ATU 64762368 ... ATU 64938009 ... ATU 65020906 ... ATU 65033803 ... ATU 65034704 ... ATU 65480455 ... ATU13585627 ... ATU46080404 ... ATU61195628 ... ... BE (0)468.561.072 ... BE 0202.239.951 ... BE 0220.764.971 ... BE 0248.015.142 ... BE 0402 918 402 ... BE 0407.139.583 ... BE 0408 299 922 ... BE 0441.928.931 ... BE 0450 118 996 ... BE 0462423150 ... BE 0474 621 394 ... BE 0795 013 186 ... BE 0897290877 ... BE 444.503.092 ... BE 456.973.433 ... BE 464 401 356 ... BE0428759497 ... BE413562567 ... BE697449992 ... ... BG 103873594 ... BG 124 551 319 ... BG 130 358 310 ... BG 131 272 009 ... BG 131202360 ... BG 147137471 ... BG 175074752 ... BG 175186242 ... BG 200182590 ... BG 200950556 ... BG130544585 ... BG175074752 ... BG7111042925 ... BG7523169263 ... BG7542011030 ... BG8032056031 ... Bg 200442771 ... ... CY 10246672X ... CY 10263870R ... CY 10274231F ... CY 10285193Z ... CY- 10277198H ... CY-10008489 A ... CY-10189098G ... CY-10258074Y ... CY-10259033P ... CY00632993 F ... ... CZ 25123891 ... CZ 25577581 ... CZ 26852357 ... CZ 60 72 77 72 ... CZ 61467839 ... CZ 640229/4448 ... CZ 640903926 ... CZ 64628060 ... CZ 654123789 ... CZ 682127228 ... CZ 6956220612 ... CZ 736028/5163 ... CZ 8058012314 ... CZ00023205 ... CZ24158313 ... CZ26780259 ... CZ450 33 145 ... CZ48207926 ... CZ49620819 ... CZ6011270177 ... CZ6109220348 ... CZ61989100 ... CZ6306150004 ... CZ7205151536 ... CZ7652046248 ... ... DE - 113866163 ... DE - 231969187 ... DE - 265265318 ... DE - 267297673 ... DE 118619592 ... DE 125014955 ... DE 129304291 ... DE 168347747 ... DE 181 207 708 ... DE 195131068 ... DE 204 760 908 ... DE 213 806 597 ... DE 221.304.969 ... DE 246 595 415 ... DE 811 363 057 ... DE 811125440 ... DE 811305931 ... DE 813 11 38 75 ... DE 813 184868 ... DE119263782 ... DE129390950 ... DE136308783 ... DE812847601 ... ... DK 10 50 32 80 ... DK 11 97 56 58 ... DK 12 14 48 22 ... DK 13 20 24 35 ... DK 13 31 04 59 ... DK 16 89 50 16 ... DK 25 18 63 11 ... DK 25 76 63 69 ... DK 25 86 35 26 ... DK 2566 2202 ... DK 26 09 77 89 ... DK 26 57 61 64 ... DK 28 01 76 34 ... DK 28107773 ... DK 29523215 ... DK 30 06 09 46 ... DK 32 27 15 02 ... DK 32329853 ... DK 65 07 04 13 ... DK 90 30 16 59 ... DK-20 04 52 72 ... DK-20 64 64 46 ... DK-27630308 ... DK-27926592 ... DK-28840926 ... DK-31882095 ... DK-33053266 ... DK10150817 ... DK10290813 ... DK26210895 ... DK36149213 ... DK: 21599336 ... ... EE 100 931 558 ... EE 100523487 ... EE 100572933 ... EE 100578209 ... EE 100594102 ... EE 100594403 ... EE 100832107 ... EE 100834066 ... EE 101031389 ... EE 101286639 ... EE 101288941 ... EE101256753 ... ... ES - Q0818001J ... ES 54362315K ... ES A-28184661 ... ES A-60631835 ... ES A-60997582 ... ES A08370314 ... ES A17028366 ... ES B-58378431 ... ES B64240914 ... ES B64717838 ... ES B79110482 ... ES B80975063 ... ES F13005293 ... ES J99216582 ... ES Q-2818015-F ... ES R9600075G ... ES U99216426 ... ES U99216632 ... ES V99218067 ... ES W4003922D ... ES X-5253868-R ... ES X5277343Q ... ES Y5277343F ... ES Z5277343K ... ES- A84409408 ... ES-A08074908 ... ES-B 60432291 ... ES-B18889204 ... ES-B55015432 ... ES-B64995111 ... ES-B96902531 ... ES-x-2482300w ... ESA78109592 ... Es-a58951310 ... ... EL 039868210 ... EL 044824428 ... EL 072130053 ... EL 082499478 ... EL 094012834 ... EL 094064321 ... EL 094068633 ... EL 094237076 ... EL 094263543 ... EL 095217179 ... EL 095304080 ... EL 099548630 ... EL 94051189 ... EL 998386804 ... EL 998408192 ... EL 998722134 ... EL 999038150 ... EL 999107669 ... EL 999533911 ... EL 999698730 ... EL 999715835 ... EL-082857563 ... EL094501040 ... EL098099809 ... EL: 094279805 ... El 800 179 925 ... ... FI 02459042 ... FI 0982651-1 ... FI 10320534 ... FI 18949388 ... FI 20194885 ... FI 20774740 ... FI 2094606-3 ... FI 24416318 ... FI- 01968312 ... FI- 22291259 ... FI-214 95 540 ... FI-22291240 ... FI-24163066 ... FI18261444 ... ... FR 04409414364 ... FR 09434086930 ... FR 114 248 728 36 ... FR 13 393 892 815 ... FR 163 041 877 01 ... FR 18 349 685 099 ... FR 19 552 008 443 ... FR 19552143273 ... FR 20 329 450 738 ... FR 21 448 834 911 ... FR 2143 2146 546 ... FR 22 326 565 603 ... FR 22 379 160 070 ... FR 26 495 205 213 ... FR 28337893168 ... FR 355 92065536 ... FR 36 380 610 451 ... FR 36502095094 ... FR 38 353427495 ... FR 41-343848552 ... FR 53418304010 ... FR 60391548955 ... FR 61 954 506 077 ... FR 63 334 214 293 ... FR 65 444 243 075 ... FR 68 378 838 692 ... FR 70492082151 ... FR 72 483 995 197 ... FR 734 836 491 66 ... FR 736 220 50 318 ... FR 74 397 888 330 ... FR 77 055 501 902 ... FR 77 384 627 170 ... FR 78528824428 ... FR 79 410 964 837 ... FR 83 404 833 048 ... FR 84 323 140 392 ... FR 86 394 303 796 ... FR 86 542 103 569 ... FR 88775649726 ... FR 94016950842 ... FR K 7399859412 ... FR01712030113 ... FR64333266765 ... FR82542065479 ... FR83404833048 ... FR86451397608 ... FR95483929956 ... Fr 40 303 265 045 ... Fr 96 631 620 572 ... fr 71383076817 ... ... FR16000063601 ... FR23000047372 ... FR26000040583 ... FR28000113851 ... FR30000017854 ... FR32000000330 ... FR36000006022 ... FR40000066034 ... FR43000020445 ... FR48000052489 ... FR54000065101 ... FR64000063908 ... FR65000100833 ... FR79000030642 ... FR83000065143 ... FR83000113158 ... FR84000082668 ... FR87000018746 ... FR88000008820 ... FR88000053537 ... FR96000110899 ... ... GB 002 4257 28 ... GB 003232345 ... GB 100 1950 75 ... GB 100190874 ... GB 102675046 ... GB 232177091 ... GB 242338087388 ... GB 311 405 025 ... GB 362 5866 29 ... GB 417 2280 71 ... GB 436 0630 72 ... GB 495 2781 05 ... GB 507 5768 25 ... GB 521 6763 52 ... GB 586 367 295 ... GB 591 9373 01 ... GB 605 8678 15 ... GB 662 8564 06 ... GB 698 550 577 ... GB 733 4428 41 ... GB 770 381 235 ... GB 784 9117 89 ... GB 808 6365 12 ... GB 812 8333 44 ... GB 818243334 ... GB 823 531 352 ... GB 829 9594 59 ... GB 845788960 ... GB 879 7056 62 ... GB 881 3758 91 ... GB 913 3041 68 ... GB 933210951 ... GB 975 8664 50 ... GB 977 4872 51 ... GB 980780684 ... GB 997 7094 44 ... GB260311213 ... GB653599494 ... GB974053902 ... ... HU -12509403 ... HU 10672101 ... HU 10766172 ... HU 11444923 ... HU 12723650 ... HU 12840937 ... HU 13851909 ... HU 18206373 ... HU 23157653 ... HU 64241281 ... HU-10402434 ... HU-12892312 ... HU-14528114 ... HU11377304 ... HU12078503 ... HU13852467 ... ... IE 0005306C ... IE 4550159S ... IE 4693875V ... IE 4731823J ... IE 632 3420 C ... IE 6324720T ... IE 6339273F ... IE 635 430 5C ... IE 6388047V ... IE 6397893P ... IE 6433435F ... IE 6436390B ... IE 6791517I ... IE 8223200u ... IE 9502346O ... IE 9574173P ... IE 9679477V ... IE 9719156S ... IE 9741812E ... IE 9742129V ... IE-9696131F ... IE6433435IH ... IE6433435OA ... IE6599001W ... IE8D79739I ... IE9Y71814N ... ... IT - 01404480202 ... IT 0 0 6 1 8 2 8 0 4 9 9 ... IT 00 595 000 217 ... IT 00118439991 ... IT 00193180932 ... IT 00520800319 ... IT 00571320076 ... IT 00687120980 ... IT 01189820689 ... IT 01413270396 ... IT 01465210449 ... IT 01501180333 ... IT 01606120226 ... IT 01687870137 ... IT 01720020344 ... IT 01822890388 ... IT 02100550264 ... IT 02109480976 ... IT 02153481201 ... IT 02359210354 ... IT 02408660211 ... IT 02829410980 ... IT 03274440241 ... IT 03367280363 ... IT 04894530635 ... IT 05366960010 ... IT 05460820961 ... IT 05617370969 ... IT 06075960010 ... IT 06729900966 ... IT 06863340961 ... IT 09596821000 ... IT 12920760159 ... IT-01626160210 ... IT-03700020104 ... IT-03827740402 ... IT-09159800011 ... IT00743110157 ... IT02087050155 ... IT: 02331250163 ... ... LT 100001354118 ... LT 100001509912 ... LT 100001799517 ... LT 100001890913 ... LT 100001906711 ... LT 100001919017 ... LT 100002645517 ... LT 100002922012 ... LT 100003619917 ... LT 100005066013 ... LT 100005929611 ... LT 119511515 ... LT 235449811 ... LT 250266219 ... LT 258596610 ... LT 354991917 ... LT 616414610 ... LT 757118413 ... LT-100000979812 ... LT100001251914 ... LT100002894215 ... LT100004801610 ... LT290068995116 ... ... LU 10059929 ... LU 10590281 ... LU 109 676 28 ... LU 11082217 ... LU 13178262 ... LU 150 274 42 ... LU 1871 0830 ... LU 19184853 ... LU 19406747 ... LU 19979983 ... LU 20981643 ... LU 21989666 ... LU 22 22 12 68 ... LU 22690342 ... LU 22991225 ... LU.248.70.640 ... LU: 20993674 ... LU: 2294 4200 ... Lu 19980500 ... ... LV 4000 3521 600 ... LV 40003189718 ... LV 40003282138 ... LV 40003449366 ... LV 40003655379 ... LV 40003718068 ... LV 40003754957 ... LV 40003777428 ... LV 40003939038 ... LV 40008000102 ... LV 40103077610 ... LV 40103157009 ... LV 40103179665 ... LV 40103264016 ... LV 43603009384 ... LV 44103040262 ... LV 5000 399 3021 ... LV 50003087101 ... LV 90000528023 ... LV-40003241337 ... LV-40003467376 ... LV-42103016370 ... LV-42103048183 ... ... MT 1039-6417 ... MT 1167-9112 ... MT 1465 8213 ... MT 1613-4207 ... MT 17025737 ... MT 18740407 ... MT 1894 0705 ... MT 1966 1023 ... MT 19784818 ... MT 2029 1423 ... MT 20630321 ... ... NL 001241 643 B01 ... NL 009122746 B01 ... NL 806753742B01 ... NL 820605876B01 ... NL 8225.69.759 b01 ... NL-812421267 B01 ... NL-8197.38.116.B.01 ... NL.0094.10.806.B.01 ... NL.8143.26.584.B.01 ... NL.8186.43.778.B.01 ... NL001309675B01 ... NL001545668B01 ... NL003376734B77 ... NL00449544B01 ... NL006375054B01 ... NL006866049B01 ... NL007394913B01 ... NL009093503B01 ... NL019077312B01 ... NL066593931B01 ... NL068357370B01 ... NL117621729B01 ... NL167647672B01 ... NL4495445B01 ... NL68357370B01 ... NL802003217B01 ... NL808373894B01 ... NL811705262B01 ... NL813411786B01 ... ... PL 5211355116 ... PL 5211754253 ... PL 5220205853 ... PL 5342152448 ... PL 5423074698 ... PL 584-030-44-72 ... PL 5840154038 ... PL 5840304472 ... PL 5860224115 ... PL 6330005110 ... PL 645-000-67-50 ... PL 6651344956 ... PL 6661913137 ... PL 6772320831 ... PL 6792831859 ... PL 6831810615 ... PL 6842599822 ... PL 687-16-26-585 ... PL 7010098470 ... PL 7271676569 ... PL 764-23-05-489 ... PL 764-23-05-495 ... PL 764-23-05-503 ... PL 764-23-05-526 ... PL 764-23-05-549 ... PL 764-23-05-555 ... PL 764-23-05-578 ... PL 767-000-06-78 ... PL 767-13-25-342 ... PL 767-14-25-718 ... PL 767-14-47-329 ... PL 768-000-24-66 ... PL 7711598811 ... PL 777 26 68 285 ... PL 7780104605 ... PL 7881154591 ... PL 7961373674 ... PL 8393173893 ... PL 851-020-66-96 ... PL 867-16-19-297 ... PL 8722342429 ... PL 8771130532 ... PL 8971772896 ... PL 8992708633 ... PL 9241826918 ... PL 9452174677 ... PL 9462485048 ... PL 9542705026 ... PL 9562197426 ... PL-7532365958 ... PL-951-157-77-68 ... PL5261025421 ... PL6772135826 ... ... PT 500 019 720 ... PT 500135.495 ... PT 501 507 930 ... PT 501 519 246 ... PT 501 964 843 ... PT 502448911 ... PT 502971142 ... PT 504141066 ... PT 506 030 636 ... PT 506835669 ... PT 507 223 730 ... PT 507 757 505 ... PT 507 859 146 ... PT 507297687 ... PT 508 081 327 ... PT 509 250 505 ... PT 509284930 ... PT-505 856 468 ... PT503038083 ... ... RO 11358544 ... RO 13837330 ... RO 14840784 ... RO 1630615123457 ... RO 16621241 ... RO 17832344 ... RO 1822964 ... RO 18341035 ... RO 185 472 90 ... RO 18779508 ... RO 20950021 ... RO 21356044 ... RO 21996566 ... RO 241 30 20 ... RO 24736200 ... RO 3087444 ... RO 4003786 ... RO 4019740 ... RO 4257679 ... RO 573768 ... RO 6010151 ... RO 6322498 ... RO 6655328 ... RO-23867797 ... RO-27849238 ... RO16241790 ... Ro 15071875 ... ... SE 202 100-5000 01 ... SE 390 806 051 401 ... SE 55 62 00-0777 01 ... SE 55 67 59 32 48 01 ... SE 556.383.740.901 ... SE 556058115801 ... SE 556126249301 ... SE 556433592401 ... SE 556700 3552 01 ... SE 556708202801 ... SE 556728341001 ... SE 556848115301 ... SE 720 522 241 201 ... SE-502053602401 ... SE-556 644 662 001 ... SE-556 792 355 101 ... SE-5562245190-01 ... SE-556271210801 ... SE-556666-4438-01 ... SE556043606401 ... Se 556250398601 ... ... SI 26808498 ... SI 29664373 ... SI 3609 7152 ... SI 48673820 ... SI 50223054 ... SI 56633360 ... SI 56951442 ... SI 68297530 ... SI 70310815 ... SI 73567906 ... SI 85390518 ... SI 92351069 ... SI-83815201 ... SI-89036999 ... ... SK 1078449064 ... SK 202 274 96 19 ... SK 2020 237 945 ... SK 2020257679 ... SK 2021 6858 20 ... SK 2021853504 ... SK 2021998528 ... SK 2022193459 ... SK2022193459 ... ... ''' >>> [x for x in numbers.splitlines() if x and not vat.is_valid(x)] [] The following numbers are wrong in one way or another. First we need a function to be able to determine the kind of error. >>> def caught(number, exception): ... try: ... vat.validate(number) ... return False ... except exception: ... return True ... These numbers should be mostly valid except that they have been mangled so their check digit is wrong. >>> numbers = ''' ... ... ATU 143 43 102 ... ATU 15169209 ... ATU46080904 ... ATU61191628 ... ... BE 0406.139.583 ... BE 0793 013 186 ... BE 456.973.432 ... BE697449982 ... ... BG 1037735942 ... BG 131 172 009 ... BG 147147471 ... BG 200940556 ... ... CY 10246672F ... CY-10009489 A ... CY-10257074Y ... CY00632893 F ... ... CZ 25557481 ... CZ 48207726 ... CZ 640913926 ... CZ 8058018314 ... ... DE 125014855 ... DE 246 495 415 ... DE 813 91 38 75 ... DE - 266297673 ... ... DK 11 96 56 58 ... DK 2565 2202 ... DK-27996592 ... DK10159817 ... ... EE 100 941 558 ... EE 100525487 ... EE 101586639 ... EE101256754 ... ... ES 54362415K ... ES K-2814015-F ... ES-x-2322300w ... Es-a48951310 ... ... EL 094013834 ... EL 094068733 ... EL094501140 ... EL: 094269805 ... ... FR 04409414264 ... FR 21 326 565 603 ... FR K 7399859312 ... FR L 7399859412 ... ... IE 4731823H ... IE 632 3421 C ... IE 5339273F ... IE8D79729I ... ... LV 40003189715 ... LV 90000528022 ... LV-10103241337 ... LV-42103048181 ... ... SK 1078449164 ... SK 302 274 96 19 ... SK 2030 237 945 ... SK 2020457679 ... ... ''' >>> [x for x in numbers.splitlines() if x and not caught(x, InvalidChecksum)] [] These numbers should be mostly valid except that they have some formatting flaws. >>> numbers = ''' ... ... AT1 142 43 102 ... ATU 1515B209 ... ... BE 02A2.239.951 ... BE 0220,764.971 ... ... BG 10X8735941 ... ... CY-102590Z3P ... ... DE 246X595 415 ... DE 011125440 ... ... IE 4550C59S ... IE 069385V8 ... ... NL 001241643801 ... NL 009122746B00 ... NL B06753742B01 ... NL 82X569759b01 ... ... SK A078449064 ... SK 012 274 96 19 ... SK 2010 237 945 ... ... ''' >>> [x for x in numbers.splitlines() if x and not caught(x, InvalidFormat)] [] These numbers should be mostly valid except that they have some component that contains an invalid or unknown value. >>> numbers = ''' ... ... CY-12259033P ... ... CZ 95123891 ... ... IT 00687129980 ... ... LT 100001354 ... LT 100001509922 ... ... QQ 124567 ... ... ''' >>> [x for x in numbers.splitlines() if x and not caught(x, InvalidComponent)] [] >>> vat.compact('QQ 124567') Traceback (most recent call last): ... InvalidComponent: ... These numbers should be mostly valid except that they have the wrong length. >>> numbers = ''' ... ... ATU 151592092 ... ... CY-1225903322 ... ... ES B-583784312 ... ... FR000076090 ... ... NL006866304B021 ... ... SE 55643359201 ... SE 5567003255201 ... ... ''' >>> [x for x in numbers.splitlines() if x and not caught(x, InvalidLength)] [] python-stdnum-1.8.1/tests/test_ie_vat.doctest0000644000000000000000000000274313156325253021362 0ustar rootroot00000000000000test_ie_vat.doctest - more detailed doctests for stdnum.ie.vat module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ie.vat module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.ie import vat Extra tests for length checking and corner cases: >>> vat.validate('111222333') # check digits should be letters Traceback (most recent call last): ... InvalidFormat: ... >>> vat.validate('1234567ABC') # too long Traceback (most recent call last): ... InvalidLength: ... The convert() function should leave invalid or already converted values alone. >>> vat.convert('IE8D79739I') '0797398I' >>> vat.convert('IE 632 3420 C') '6323420C' >>> vat.convert('123') '123' python-stdnum-1.8.1/tests/test_fi_hetu.doctest0000644000000000000000000000435713156325253021541 0ustar rootroot00000000000000test_fi_hetu.doctest - more detailed doctests for stdnum.fi.hetu module Copyright (C) 2011 Jussi Judin Copyright (C) 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.fi.hetu. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.fi import hetu >>> from stdnum.exceptions import * Normal values that should just work. >>> hetu.validate('131052-308T') '131052-308T' >>> hetu.validate('131052+308T') '131052+308T' >>> hetu.validate('131052A308T') '131052A308T' >>> hetu.validate('131052a308t') '131052A308T' Invalid checksum: >>> hetu.validate('131052-308U') Traceback (most recent call last): ... InvalidChecksum: ... Invalid century indicator: >>> hetu.validate('131052/308T') Traceback (most recent call last): ... InvalidFormat: ... >>> hetu.validate('131052T308T') Traceback (most recent call last): ... InvalidFormat: ... Invalid birth date: >>> hetu.validate('310252-308Y') Traceback (most recent call last): ... InvalidComponent: ... >>> hetu.validate('130052-308R') Traceback (most recent call last): ... InvalidComponent: ... Leaving out the first zero is wrong: >>> hetu.validate('10101-0101') Traceback (most recent call last): ... InvalidFormat: ... Invalid individual number: (for historical reasons individual IDs start from 002) >>> hetu.validate('131052-000V') Traceback (most recent call last): ... InvalidComponent: ... compact() and format() don't do much special: >>> hetu.compact('131052a308t') '131052A308T' python-stdnum-1.8.1/tests/test_do_ncf.doctest0000644000000000000000000001006613223166521021334 0ustar rootroot00000000000000test_do_ncf.doctest - more detailed doctests for stdnum.do.ncf module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.do.ncf module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.do import ncf Some basic tests for invalid numbers: >>> ncf.validate('FJ10010010100000004') Traceback (most recent call last): ... InvalidFormat: ... >>> ncf.validate('A0100100101000000') Traceback (most recent call last): ... InvalidLength: ... >>> ncf.validate('A01001001010000003234') Traceback (most recent call last): ... InvalidLength: ... >>> ncf.validate('A010010010500000004') Traceback (most recent call last): ... InvalidComponent: ... >>> ncf.validate('Z010010011600000004') Traceback (most recent call last): ... InvalidFormat: ... These have been found online and should all be valid numbers. >>> numbers = ''' ... ... A010010010100000052 ... A010010010100001688 ... A010010010100003508 ... A010010010100003509 ... A010010011500000008 ... A010010011500000012 ... A010010011500000019 ... A010010011500000025 ... A010010011500000027 ... A010010011500000031 ... A010010011500000037 ... A010010011500000042 ... A010010011500000043 ... A010010011500000059 ... A010010011500000063 ... A010010011500000066 ... A010010011500000071 ... A010010011500000081 ... A010010011500000084 ... A010010011500000105 ... A010010011500000108 ... A010010011500000128 ... A010010011500000149 ... A010010011500000154 ... A010010011500000200 ... A010010011500000205 ... A010010011500000232 ... A010010011500000293 ... A010010011500000320 ... A010010011500000329 ... A010010011500000535 ... A010010011500000547 ... A010010011500000557 ... A010010011500000828 ... A010010011500000829 ... A010010011500000830 ... A010010011500000832 ... A010010011500000840 ... A010010011500000841 ... A010010011500000843 ... A010010011500000896 ... A010010011500000925 ... A010010011500000942 ... A010010011500001003 ... A010010011500001082 ... A010010011500001101 ... A010010011500001495 ... A010010011500002048 ... A010010011500002056 ... A010010011500002061 ... A010010011500002246 ... A010010011500002309 ... A010010011500002314 ... A010010011500002321 ... A010010011500002392 ... A010010011500003273 ... A010010011500003274 ... A010010011500003515 ... A010010011500003677 ... A010010011500004073 ... A010010011500004151 ... A010010011500004343 ... A010010011500004745 ... A010010011500005192 ... A010010011500005248 ... A010010011500005445 ... A010010011500005640 ... A010010011500005727 ... A010010011500006427 ... A010010011500007175 ... A010010011500007508 ... A010010011500007510 ... A010010011500008501 ... A010010011500012641 ... A010010011500012649 ... A010010011500013333 ... A010010011500042367 ... A010010011501344909 ... A010010011501344910 ... A010010011501500383 ... A010010031500051556 ... A010020011500000727 ... A010020011500000734 ... A010070051500004287 ... A010070051500004896 ... A010070051500004909 ... A010070051500004929 ... A020010011500002311 ... A020010011500003095 ... A020010011500024073 ... A020010011500431422 ... A020010230100003922 ... A020020011500000180 ... A020020011500000181 ... A030030011500002297 ... A040010011500010708 ... A040010011500012279 ... P010010011501235539 ... P010010011501528319 ... P010010011501528378 ... ... ''' >>> [x for x in numbers.splitlines() if x and not ncf.is_valid(x)] [] python-stdnum-1.8.1/tests/test_ec_ruc.doctest0000644000000000000000000001667113156325253021360 0ustar rootroot00000000000000test_ec_ruc.doctest - more detailed doctests for stdnum.ec.ruc module Copyright (C) 2014 Jonathan Finlay Copyright (C) 2014-2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ec.ruc. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.ec import ruc >>> from stdnum.exceptions import * Normal natural RUC values (third digit less than 6) that should just work. >>> numbers = ''' ... 0101016905001 ... 0602910945001 ... 0910005917001 ... 0926687856001 ... 1001152287001 ... 1102755442001 ... 1104552037001 ... 1311919078001 ... 1700672486001 ... 1702264233001 ... 1704159860001 ... 1710034065001 ... 1710585264001 ... 1710589373001 ... 1713238234001 ... 1714307103001 ... 1721788659001 ... 1803557964001 ... ''' >>> [x for x in numbers.splitlines() if x and not ruc.is_valid(x)] [] Normal public RUC values (third digit is 6) that should just work. >>> numbers = ''' ... 0160000510001 ... 0160001910001 ... 0160002210001 ... 0160037780001 ... 0260000250001 ... 0260000330001 ... 0260000760001 ... 0260001060001 ... 0260001140001 ... 0360000230001 ... 0360000580001 ... 0360001040001 ... 0360016230001 ... 0360023950001 ... 0460000130001 ... 0460000210001 ... 0460000560001 ... 0460000640001 ... 0460000720001 ... 0460001020001 ... 0460014860001 ... 0460020670001 ... 0460022020001 ... 0460022100001 ... 0460022370001 ... 0460023930001 ... 0460024310001 ... 0460024660001 ... 0460024740001 ... 0460026010001 ... 0460027250001 ... 0560000380001 ... 0560000540001 ... 0560000700001 ... 0660000280001 ... 0660000520001 ... 0660000600001 ... 0660000790001 ... 0660000870001 ... 0660000950001 ... 0660001090001 ... 0660001680001 ... 0660820400001 ... 0660828140001 ... 0660831360001 ... 0760000180001 ... 0760000260001 ... 0760000340001 ... 0760000850001 ... 0760000930001 ... 0760001070001 ... 0760001150001 ... 0760001230001 ... 0760001310001 ... 0760001900001 ... 0760033270001 ... 0860000160001 ... 0860000240001 ... 0860013300001 ... 0860014460001 ... 0860017480001 ... 0860019260001 ... 0860019500001 ... 0860032440001 ... 0960000490001 ... 0960000730001 ... 0960001700001 ... 0960005290001 ... 0960006420001 ... 0968529830001 ... 0968566440001 ... 1060000180001 ... 1060000260001 ... 1060000340001 ... 1060000420001 ... 1060000500001 ... 1060000690001 ... 1060000770001 ... 1060008080001 ... 1060014480001 ... 1060016930001 ... 1060018040001 ... 1060019520001 ... 1060021420001 ... 1060024600001 ... 1160000670001 ... 1160000750001 ... 1160001130001 ... 1160001480001 ... 1160008140001 ... 1160028840001 ... 1160037400001 ... 1160039880001 ... 1160836120001 ... 1260000140001 ... 1260000220001 ... 1260000300001 ... 1260000490001 ... 1260000730001 ... 1260001700001 ... 1260001890001 ... 1260002000001 ... 1260002190001 ... 1260006340001 ... 1260006770001 ... 1260033820001 ... 1360000200001 ... 1360000390001 ... 1360000470001 ... 1360000630001 ... 1360000710001 ... 1360001520001 ... 1360001600001 ... 1360001790001 ... 1360001870001 ... 1360002840001 ... 1360003300001 ... 1360014850001 ... 1360024570001 ... 1360029100001 ... 1360047940001 ... 1360052350001 ... 1360052430001 ... 1360055100001 ... 1360059280001 ... 1460000290001 ... 1460000370001 ... 1560000780001 ... 1560001160001 ... 1560001240001 ... 1660000680001 ... 1660011020001 ... 1660012930001 ... 1760000150001 ... 1760001040001 ... 1760001550001 ... 1760003920001 ... 1760004060001 ... 1760004650001 ... 1760009880001 ... 1760013560001 ... 1768007390001 ... 1768022510001 ... 1768034600001 ... 1768045130001 ... 1768048820001 ... 1768085430001 ... 1768102970001 ... 1768119510001 ... 1768123380001 ... 1768133340001 ... 1768152130001 ... 1768153450001 ... 1768155660001 ... 1860000130001 ... 1860000210001 ... 1860000480001 ... 1860000720001 ... 1860000800001 ... 1860000990001 ... 1860001020001 ... 1860001100001 ... 1865011360001 ... 1960001190001 ... 2060000150001 ... 2060000230001 ... 2160000480001 ... 2160011760001 ... ''' >>> [x for x in numbers.splitlines() if x and not ruc.is_valid(x)] [] Normal juridical RUC values (third digit is 9) that should just work. >>> numbers = ''' ... 0190115798001 ... 0190155722001 ... 0290001269001 ... 0290003288001 ... 0390027923001 ... 0490001883001 ... 0490002669001 ... 0590041920001 ... 0590052000001 ... 0690045389001 ... 0790015002001 ... 0790024656001 ... 0990138850001 ... 0990247536001 ... 0990459444001 ... 0991189432001 ... 0991208291001 ... 0991445854001 ... 0992397535001 ... 0992563834001 ... 1090033456001 ... 1090109487001 ... 1190015110001 ... 1190068389001 ... 1390001920001 ... 1390007791001 ... 1390013678001 ... 1390089410001 ... 1390091474001 ... 1690012606001 ... 1790011674001 ... 1790023508001 ... 1790045668001 ... 1790085783001 ... 1790093204001 ... 1790325083001 ... 1790451801001 ... 1790501469001 ... 1790517454001 ... 1790567699001 ... 1790834670001 ... 1791240448001 ... 1791280156001 ... 1791280172001 ... 1791708040001 ... 1791714350001 ... 1791891465001 ... 1791942167001 ... 1792060346001 ... 1792079411001 ... 1792141869001 ... 1792147638001 ... 1792373255001 ... 1890001323001 ... 1890003628001 ... 1890037646001 ... ''' >>> [x for x in numbers.splitlines() if x and not ruc.is_valid(x)] [] Values that are invalid in one way or another: >>> ruc.validate('179206034601') # too short Traceback (most recent call last): ... InvalidLength: ... >>> ruc.validate('17920603A6001') # contains a character Traceback (most recent call last): ... InvalidFormat: ... >>> ruc.validate('0170000610001') # third digit invalid Traceback (most recent call last): ... InvalidComponent: ... >>> ruc.validate('1763154690001') # invalid check digit in natural RUC Traceback (most recent call last): ... InvalidChecksum: ... >>> ruc.validate('0160000610001') # invalid check digit in public RUC Traceback (most recent call last): ... InvalidChecksum: ... >>> ruc.validate('0190115799001') # invalid check digit in juridical RUC Traceback (most recent call last): ... InvalidChecksum: ... >>> ruc.validate('8810034069001') # invalid province code in natural RUC Traceback (most recent call last): ... InvalidComponent: ... >>> ruc.validate('8868152120001') # invalid province code in public RUC Traceback (most recent call last): ... InvalidComponent: ... >>> ruc.validate('8892397539001') # invalid province code in juridical RUC Traceback (most recent call last): ... InvalidComponent: ... >>> ruc.validate('0926687856000') # invalid establishment in natural RUC Traceback (most recent call last): ... InvalidComponent: ... >>> ruc.validate('1760001550000') # invalid establishment in public RUC Traceback (most recent call last): ... InvalidComponent: ... >>> ruc.validate('0992397535000') # invalid establishment in juridical RUC Traceback (most recent call last): ... InvalidComponent: ... python-stdnum-1.8.1/tests/test_do_rnc.doctest0000644000000000000000000000622213223166521021347 0ustar rootroot00000000000000test_do_rnc.doctest - more detailed doctests for stdnum.do.rnc module Copyright (C) 2015-2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.do.rnc module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.do import rnc Some basic tests for invalid numbers: >>> rnc.validate('12345678') Traceback (most recent call last): ... InvalidLength: ... >>> rnc.validate('1234567890') Traceback (most recent call last): ... InvalidLength: ... >>> rnc.validate('123456789012') Traceback (most recent call last): ... InvalidLength: ... >>> rnc.validate('acvbnmkjh') Traceback (most recent call last): ... InvalidFormat: ... >>> rnc.validate('122011226') '122011226' >>> rnc.validate('112031226') Traceback (most recent call last): ... InvalidChecksum: ... >>> rnc.validate('101637587') '101637587' These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 10233317 ... 501050302 ... 501249532 ... 501275452 ... 501402772 ... 501406832 ... 501423982 ... 501430482 ... 501456252 ... 501464492 ... 501470042 ... 501494502 ... 501494812 ... 501496882 ... 501670912 ... 501676936 ... 501690832 ... 501896112 ... 501925082 ... 501934782 ... 502004222 ... 502500262 ... 502571062 ... 502599382 ... 502601972 ... 502612532 ... 502614012 ... 502614802 ... 502858272 ... 502860692 ... 502866062 ... 502867182 ... 502871732 ... 502872372 ... 502873972 ... 502876882 ... 502879652 ... 502880022 ... 502880162 ... 502887132 ... 502889232 ... 502890842 ... 502894112 ... 503972922 ... 503995752 ... 504065782 ... 505030302 ... 505038532 ... 505063502 ... 505072412 ... 505613472 ... 505613502 ... 505613782 ... 505621912 ... 505622552 ... 507032262 ... 507883262 ... 511104382 ... 511106822 ... 512924072 ... 514026622 ... 514035672 ... 515121792 ... 515123442 ... 519505672 ... 522004242 ... 523006132 ... 523012132 ... 523013422 ... 523014062 ... 523015212 ... 523017622 ... 523021182 ... 523022162 ... 523022952 ... 523023592 ... 524001842 ... 524001982 ... 524007352 ... 524010892 ... 525001772 ... 525001802 ... 530001932 ... 531009502 ... 531030722 ... 531032342 ... 531035562 ... 531039622 ... 531042232 ... 531043182 ... 531054192 ... 531056152 ... 531073022 ... 531081602 ... 531085012 ... 531091322 ... 531096782 ... 531132312 ... 531136032 ... 531136962 ... 531137012 ... 531137152 ... ... ''' >>> [x for x in numbers.splitlines() if x and not rnc.is_valid(x)] [] python-stdnum-1.8.1/tests/test_it_codicefiscale.doctest0000644000000000000000000000731113156325253023360 0ustar rootroot00000000000000test_it_codicefiscale.doctest - tests for the stdnum.it.codicefiscale module Copyright (C) 2009-2013 Emanuele Rocca Copyright (C) 2014 Augusto Destrero Copyright (C) 2014 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.it.codicefiscale module. It tries to validate a number of tax codes that have been found online. >>> from stdnum.it import codicefiscale >>> from stdnum.exceptions import * Some valid numbers >>> numbers = ''' ... MRTNTN23M02D969P ... RCCMNL83S18D969H ... MRSMSR81D60Z611H ... CNTCHR83T41D969D ... FOXDRA26C24H872Y ... MAILCU91A25F839D ... RSSMRA45C12F205C ... RSSMRA45C12F20RX ... RSSMRA45C12F2L5N ... RSSMRA45C12F2LRI ... RSSMRAQRCMNFNLRG ... ''' >>> [x for x in numbers.splitlines() if x and not codicefiscale.is_valid(x)] [] These should be invalid: >>> codicefiscale.validate('CSTNGL22I10D086I') # the first 'I' shouldn't be there Traceback (most recent call last): ... InvalidFormat: ... >>> codicefiscale.validate('FOXDRA26C24H872A') Traceback (most recent call last): ... InvalidChecksum: ... >>> codicefiscale.validate('CNTCHR83T32D969H') # invalid date Traceback (most recent call last): ... InvalidComponent: ... Test getting the birth date. >>> codicefiscale.get_birth_date('MRTNTN23M02D969P') datetime.date(1923, 8, 2) >>> codicefiscale.get_birth_date('RCCMNL83S18D969H') datetime.date(1983, 11, 18) >>> codicefiscale.get_birth_date('MRSMSR81D60Z611H') datetime.date(1981, 4, 20) >>> codicefiscale.get_birth_date('CNTCHR83T41D969D') datetime.date(1983, 12, 1) >>> codicefiscale.get_birth_date('FOXDRA26C24H872Y') datetime.date(1926, 3, 24) >>> codicefiscale.get_birth_date('MAILCU91A25F839D') datetime.date(1991, 1, 25) >>> codicefiscale.get_birth_date('RSSMRA45C12F205C') datetime.date(1945, 3, 12) >>> codicefiscale.get_birth_date('RSSMRA45C12F20RX') datetime.date(1945, 3, 12) >>> codicefiscale.get_birth_date('RSSMRA45C12F2L5N') datetime.date(1945, 3, 12) >>> codicefiscale.get_birth_date('RSSMRA45C12F2LRI') datetime.date(1945, 3, 12) >>> codicefiscale.get_birth_date('RSSMRAQRCMNFNLRG') datetime.date(1945, 3, 12) >>> codicefiscale.get_birth_date('MRTNTN23M02D969P') datetime.date(1923, 8, 2) Test getting the gender. >>> codicefiscale.get_gender('MRTNTN23M02D969P') 'M' >>> codicefiscale.get_gender('RCCMNL83S18D969H') 'M' >>> codicefiscale.get_gender('RCDLSN84S16D969Z') 'M' >>> codicefiscale.get_gender('MRSMSR81D60Z611H') 'F' >>> codicefiscale.get_gender('CNTCHR83T41D969D') 'F' >>> codicefiscale.get_gender('FOXDRA26C24H872Y') 'M' >>> codicefiscale.get_gender('MAILCU91A25F839D') 'M' Test calculating the check digit. >>> codicefiscale.calc_check_digit('MRTNTN23M02D969') 'P' >>> codicefiscale.calc_check_digit('MRSMSR81D60Z611') 'H' >>> codicefiscale.calc_check_digit('RCDLSN84S16D969') 'Z' >>> codicefiscale.calc_check_digit('CNTCHR83T41D969') 'D' >>> codicefiscale.calc_check_digit('BNCSFN85T58G702') 'W' >>> codicefiscale.calc_check_digit('RCCMNL83S18D969') 'H' >>> codicefiscale.calc_check_digit('FOXDRA26C24H872') 'Y' >>> codicefiscale.calc_check_digit('MAILCU91A25F839') 'D' python-stdnum-1.8.1/tests/test_isil.doctest0000644000000000000000000001407513156325253021054 0ustar rootroot00000000000000test_isil.doctest - more detailed doctests for the stdnum.isil module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.isil module. It tries to validate a number of numbers that have been found online. >>> from stdnum import isil >>> from stdnum.exceptions import * The number should start with a valid country code or prefix: >>> isil.validate('ZZ-1234') Traceback (most recent call last): ... InvalidComponent: ... The number should not be too long: >>> isil.validate('WW-RM026712423345334534512334534545') Traceback (most recent call last): ... InvalidLength: ... A number with an unknown agency should not be upper-cased: >>> isil.format('zz-RM0267') 'zz-RM0267' These have been found online and should all be valid numbers. >>> numbers = ''' ... ... AT-FHJ-BG ... AT-FHK ... AT-FHK-FE ... AT-FHS-K ... AT-GEOL ... AT-HGMW ... AT-KWPU ... AT-LAST ... AT-LBB ... AT-NMW-Z ... AT-NOeLB ... AT-OBV ... AT-OeAW-BA ... AT-PHK ... AT-PHS ... AT-PHST ... AT-PHT ... AT-PHV ... AT-STICHWORT ... AT-UBG-SH ... AT-UBGL ... AT-UBI-HB ... AT-UBL ... AT-UBMG-HB ... AT-UBMS ... AT-UBMS-MUS ... AT-UBMUL-FBG ... AT-UBMUL-HB ... AT-UBMUW-360 ... AT-UBMUW-400 ... AT-UBMW ... AT-UBTUG-HB ... AT-UBVUW-UB ... AT-UBW ... AT-UBWW ... AT-UBWW-874 ... AT-VMW ... AT-WBR ... AT-WHK ... AT-WSTLA-B ... ... AU-ABC:ARC ... AU-ABC:PL ... AU-ABC:RN ... AU-ANL:AJA ... AU-ANU:ADBO ... AU-ANU:IR ... AU-ANU:ON ... AU-NABC ... AU-NABM ... AU-NACON ... AU-NACU:AA ... AU-NAIM ... AU-NEF ... AU-NJHS ... AU-NNCU:A ... AU-NRNA ... AU-NU ... AU-NU:DF ... AU-NUWS ... AU-QMINT ... AU-QU ... AU-SMUA ... AU-SUSA ... AU-TS:RL ... AU-TU ... AU-VAAPM ... AU-VACMU ... AU-VAGH ... AU-VAHRI ... AU-VAMD ... AU-VANDS ... AU-VDU ... AU-VEMU ... AU-VLGA ... AU-VPM ... AU-VS:NAH ... AU-VSWT ... AU-VU ... AU-WAHB ... AU-XACA ... ... BE-A0510 ... BE-A3004 ... BE-A5000 ... BE-A5001 ... BE-A5002 ... BE-AAR00 ... BE-ALN00 ... BE-ANN03 ... BE-ANT01 ... BE-BDE00 ... BE-BEE00 ... BE-BRL06 ... BE-BRL07 ... BE-BRL10 ... BE-BUE01 ... BE-DIT00 ... BE-DNE00 ... BE-DPE00 ... BE-EKN00 ... BE-GAN00 ... BE-GET02 ... BE-HCT00 ... BE-HED00 ... BE-HEN00 ... BE-HES01 ... BE-JEE00 ... BE-KLT00 ... BE-KNE00 ... BE-KRG00 ... BE-LLE00 ... BE-LNL00 ... BE-LUK01 ... BE-LUN00 ... BE-MSE00 ... BE-NET00 ... BE-OSE00 ... BE-RIT00 ... BE-SJS01 ... BE-ZEE00 ... BE-ZUE00 ... ... CA-QMCB ... ... CH-000050-X ... CH-000051-7 ... CH-000084-8 ... CH-000190-0 ... CH-000244-3 ... CH-000422-7 ... CH-000423-4 ... CH-000425-9 ... CH-000560-3 ... CH-000886-6 ... CH-001008-0 ... CH-001010-9 ... CH-001057-5 ... CH-001059-X ... CH-001113-6 ... CH-001243-0 ... CH-001283-6 ... CH-001350-0 ... CH-001539-4 ... CH-001631-1 ... CH-001644-X ... CH-001645-7 ... CH-001646-4 ... CH-001648-9 ... CH-001649-6 ... CH-001654-6 ... CH-001666-7 ... CH-001669-9 ... CH-001760-9 ... CH-001800-6 ... CH-001815-9 ... CH-001821-6 ... CH-001824-8 ... CH-001825-5 ... CH-001832-X ... CH-001839-0 ... CH-001844-0 ... CH-001845-8 ... CH-001846-5 ... CH-001851-5 ... ... CY-02-CUT ... ... DE-101c ... DE-16-18 ... DE-1769 ... DE-1786 ... DE-180-1-2 ... DE-1834h ... DE-1834k ... DE-1869 ... DE-188-878 ... DE-188-e ... DE-1886 ... DE-1935 ... DE-1939 ... DE-1988 ... DE-1996 ... DE-2300 ... DE-2343 ... DE-360 ... DE-379 ... DE-38-230 ... DE-412 ... DE-416 ... DE-450 ... DE-465M-15 ... DE-469 ... DE-46a ... DE-570 ... DE-6-235 ... DE-6-271 ... DE-6-321 ... DE-7-040 ... DE-7-061 ... DE-718 ... DE-758 ... DE-781 ... DE-82-204 ... DE-82-219 ... DE-Bor4 ... DE-Kn184 ... DE-Tue120 ... ... GB-NiBfQU ... GB-StAlCLS ... GB-StDnUAD ... GB-StGlU ... GB-StPaUWSP ... GB-UK-AbCCL ... GB-UK-DhCL ... GB-UK-LoRCN ... GB-UK-WiU ... GB-UkBrCC ... GB-UkBsBC ... GB-UkCU-TRH ... GB-UkCmUG ... GB-UkCoI ... GB-UkCvUL ... GB-UkCyUK ... GB-UkElC ... GB-UkExU ... GB-UkFlBUFL ... GB-UkHsBUUC ... GB-UkIfBRL ... GB-UkLRCM ... GB-UkLUC ... GB-UkLoBS ... GB-UkLoMdU ... GB-UkLoSTAC ... GB-UkLuBC ... GB-UkMaUHSM ... GB-UkNrSTB ... GB-UkOlOLS ... GB-UkRlWC ... GB-UkSbWC-T ... GB-UkScaSH ... GB-UkSfCL ... GB-UkSfSSSH ... GB-UkSofDA ... GB-UkTeS ... GB-UkWbSWB ... GB-UkWfC ... GB-WlCaUW ... ... IT-RM0267 ... ... NL-04-0041-000 ... NL-AlSARM ... NL-AsdUvA ... NL-AsnDA ... NL-CoGC ... NL-DdvHVA ... NL-DtAD ... NL-DtHHD ... NL-EhvRHCE ... NL-EmnGE ... NL-FwGF ... NL-GnADNG ... NL-GnGRA ... NL-GnPG ... NL-GnUMG ... NL-HAMuscom ... NL-HaKV ... NL-HaNIMH ... NL-HaNRK ... NL-HlGH ... NL-HnWFA ... NL-HvsSAGV ... NL-KrdGA ... NL-LdnRMV ... NL-LnsGDM ... NL-LwPF ... NL-MpGM ... NL-MssHVM ... NL-MtmGM ... NL-NmRAN ... NL-OmnHKO ... NL-OmnOO ... NL-OmsVHO ... NL-RtEUR ... NL-RtSA ... NL-SelGV ... NL-SloGS ... NL-VbGALV ... NL-WtGAW ... NL-WtslGT ... NL-ZhGZ ... Nl-GdSAMH ... ... OCLC-ABI ... OCLC-ATNHK ... OCLC-ATQCO ... OCLC-ATVMV ... OCLC-BEMCH ... OCLC-BRI ... OCLC-CKI ... OCLC-CSF ... OCLC-DEKNV ... OCLC-EMSBC ... OCLC-ENC ... OCLC-EZU ... OCLC-FLNSW ... OCLC-FNL ... OCLC-GYR ... OCLC-I8S ... OCLC-IDT ... OCLC-ILW ... OCLC-JAKUC ... OCLC-JXE ... OCLC-JYY ... OCLC-KW5 ... OCLC-LABMH ... OCLC-MLBVL ... OCLC-MSL ... OCLC-NEZH8 ... OCLC-OME ... OCLC-QBA ... OCLC-QP7 ... OCLC-SMP ... OCLC-SVZ ... OCLC-TXCLY ... OCLC-TY7 ... OCLC-U9V ... OCLC-UDU ... OCLC-WK6 ... OCLC-WYEMB ... OCLC-XOH ... OCLC-YA6 ... OCLC-YEJ ... ... US-DLC ... US-InU-Mu ... US-MdBJ-W ... ... ''' >>> [x for x in numbers.splitlines() if x and not isil.is_valid(x)] [] These have been found online but seem invalid: ... OCLC-B#P ... OCLC-LT$ ... OCLC-RE# ... OCLC-RG$ python-stdnum-1.8.1/tests/test_co_nit.doctest0000644000000000000000000001324213156325253021362 0ustar rootroot00000000000000test_co_nit.doctest - more detailed doctests for the stdnum.co.nit module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.co.nit module. >>> from stdnum.co import nit >>> from stdnum.exceptions import * Some more detailed checks. Some of these were previously in the module docstring. >>> nit.validate('213.123.432-1') '2131234321' >>> nit.validate('2131234351') '2131234351' >>> nit.validate('2131234351') '2131234351' >>> nit.validate('2131234') Traceback (most recent call last): ... InvalidLength: ... >>> nit.validate('213123435A') Traceback (most recent call last): ... InvalidFormat: ... >>> nit.validate('2131234350') Traceback (most recent call last): ... InvalidChecksum: ... Extra checks for format function to see that it works with all kinds of lengths. >>> nit.format('123.456.789-0') '123.456.789-0' >>> nit.format('12.345.678.912-0') '12.345.678.912-0' >>> nit.format('1.234.567-0') '1.234.567-0' These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 1118534248-0 ... 15.252.525-0 ... 17.343.020-1 ... 35324530-0 ... 37547837-0 ... 375478370 ... 51.922.998-7 ... 52.238.803-1 ... 6.386.949-2 ... 79.308.960-7 ... 79.896.529.6 ... 79626331-8 ... 79627373-1 ... 796273731 ... 800.003.122-6 ... 800.020.672-7 ... 800.026.452-0 ... 800.043.909-6 ... 800.100.532-8 ... 800.184.048-4 ... 800.219.488-4 ... 800.231.969-4 ... 800.242.106-2 ... 800.249.704-9 ... 800088702-2 ... 800112806-2 ... 800130907-4 ... 800140949-6 ... 800216278-0 ... 800224808-8 ... 800224827-8 ... 800226098 - 4 ... 800227940-6 ... 800228175 - 2 ... 800229739-0 ... 800231967-1 ... 800231969-4 ... 800240882-0 ... 800242272-7 ... 800250119-1 ... 800251440-6 ... 800253055-2 ... 800256161 - 9 ... 804001273-5 ... 805.014.583-3 ... 805000427-1 ... 805001157-2 ... 805021984-2 ... 811.014.798-1 ... 811019263-6 ... 812.007.765-3 ... 819.006.966-8 ... 830.015.428-5 ... 830.025.281-2 ... 830.035.734-1 ... 830.036-334-1 ... 830.042.619-1 ... 830.056.202-3 ... 830.061.111-1 ... 830.096.401-3 ... 830.136.779-4 ... 830003564-7 ... 830005997 - 1 ... 830005997-1 ... 830006404-0 ... 830008686-1 ... 830009783-0 ... 830074184-5 ... 830096513-1 ... 830097607-8 ... 830113831-0 ... 830125132-2 ... 830130800-4 ... 844.003.225-6 ... 844.003.392-8 ... 860 001 986-1 ... 860.001.986-1 ... 860.002.134-8 ... 860.002.184-6 ... 860.006.606-0 ... 860.007.331-5 ... 860.007.336-1 ... 860.013.433-2 ... 860.013.570-3 ... 860.013.798-5 ... 860.020.309-6 ... 860.033.941-8 ... 860.045.904-7 ... 860.051.784-4 ... 860.065.795-6 ... 860.066.942-7 ... 860.400.538-7 ... 860.400.602-0 ... 860.402.717-8 ... 860.511.071-6 ... 860.516.636-1 ... 860.527.857-8 ... 860001986-1 ... 8600019861 ... 860002183 - 9 ... 860002183-9 ... 860002503 - 2 ... 860002503-2 ... 860002527-9 ... 860002528 - 6 ... 860002964-4 ... 860006606-0 ... 860007331-5 ... 8600073361 ... 860007379-8 ... 860009174-4 ... 860011153 - 6 ... 860011153-6 ... 860013433-2 ... 860013816 - 1 ... 860013816-1 ... 860022137-5 ... 860027404 - 1 ... 860027404-1 ... 860028415 - 5 ... 860066942-7 ... 860503617 - 3 ... 860512237-6 ... 890 981 268 -— 4 ... 890 981 268 — 4 ... 890.000.062-6 ... 890.000.381-0 ... 890.101.994-9 ... 890.102.002-2 ... 890.102.044-1 ... 890.106.291-2 ... 890.201.213-4 ... 890.201.578-7 ... 890.270.275-5 ... 890.303.093-5 ... 890.304.033-8 ... 890.399.025-6 ... 890.480.023-7 ... 890.480.110-1 ... 890.500.516-3 ... 890.500.675-6 ... 890.680.023-5 ... 890.700.148-4 ... 890.700.679-3 ... 890.806.490-5 ... 890.900.840-1 ... 890.900.841-9 ... 890.907.106-5 ... 890000062-6 ... 890000381-0 ... 890102044-1 ... 890303093-5 ... 890480110-1 ... 890680023-5 ... 890704737-0 ... 890900840-1 ... 890900842-6 ... 8909009431 ... 890904996-1 ... 891.080.005-1 ... 891.180.008-2 ... 891.190.047-2 ... 891.190.346-1 ... 891.200.208-6 ... 891.200.337-8 ... 891.380.056-4 ... 891.400.726-8 ... 891.411.166-0 ... 891.480.000-1 ... 891.480.035-9 ... 891.500.182-0 ... 891.600.091-8 ... 891.780.093-3 ... 891.800.213-8 ... 891.856.077-3 ... 891.900.280-0 ... 891.900.452-0 ... 891280008-1 ... 891380003-4 ... 891480000-1 ... 891500182-0 ... 891900280-0 ... 891900452-0 ... 892.115.006-5 ... 892.200.015-5 ... 892.399.989-8 ... 892.400.320-5 ... 899.999.035-7 ... 899999001-7 ... 899999010-3 ... 899999026-0 ... 899999034-1 ... 899999054-7 ... 899999239-2 ... 899999734-7 ... 900 206 480 - 2 ... 900 206 480-2 ... 900 206 483-4 ... 900,206,480-2 ... 900,206,483-4 ... 900.006.334-7 ... 900.018.436-1 ... 900.086.865-8 ... 900.141.702-1 ... 900.187.401-8 ... 900.206,483-4 ... 900.206.480-2 ... 900.206.483-4 ... 900.274.326-6 ... 900.311.121-2 ... 900.320.056-1 ... 900.323.466—1 ... 900.343.302-6 ... 900.433.479-7 ... 900.465.924-0 ... 900.499.432-5 ... 900074992-3 ... 900112778-7 ... 900156264-2 ... 900206480-2 ... 900206483-4 ... 900219251-9 ... 900227140-3 ... 9002271403 ... 900264507-1 ... 900299795-5 ... 900336004-7 ... 900356846-7 ... 900462447-5 ... 900812264-7 ... ... ''' >>> [x for x in numbers.splitlines() if x and not nit.is_valid(x)] [] python-stdnum-1.8.1/tests/test_cl_rut.doctest0000644000000000000000000001005213156325253021373 0ustar rootroot00000000000000test_cl_rut.doctest - more detailed tests for stdnum.cl.rut Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.cl.rut module. >>> from stdnum.cl import rut >>> from stdnum.exceptions import * This is a selection of numbers (which should be valid) found at https://palena.sii.cl/cvc/dte/ee_empresas_emisoras.html >>> numbers = ''' ... ... 10075381-2 ... 10219183-8 ... 10273665-6 ... 10319569-1 ... 10402061-5 ... 10516143-3 ... 10548375-9 ... 10626628-K ... 10726809-K ... 10830138-4 ... 10860841-2 ... 11472349-5 ... 11482004-0 ... 11605334-9 ... 11840208-1 ... 11975507-7 ... 12150075-2 ... 12362626-5 ... 12392004-K ... 12415074-4 ... 12423920-6 ... 12574946-1 ... 12584568-1 ... 12645789-8 ... 12723467-1 ... 12790819-2 ... 13021498-3 ... 13073522-3 ... 13095834-6 ... 13097057-5 ... 13309437-7 ... 13490667-7 ... 13531984-8 ... 13646691-7 ... 13674023-7 ... 13743324-9 ... 13831173-2 ... 13908671-6 ... 13940679-6 ... 13966594-5 ... 13972493-3 ... 14232760-0 ... 14391166-7 ... 14676291-3 ... 14684927-K ... 14693665-2 ... 15187234-4 ... 15261623-6 ... 15264124-9 ... 15450326-9 ... 15930050-1 ... 16045507-1 ... 16607084-8 ... 3528355-2 ... 4769973-8 ... 52000543-9 ... 52003746-2 ... 5314394-6 ... 53311164-5 ... 5666126-3 ... 5759700-3 ... 5843733-6 ... 6188994-9 ... 6447064-7 ... 65700550-9 ... 6592333-5 ... 7092881-7 ... 7116223-0 ... 7341194-7 ... 7362723-0 ... 73968300-9 ... 76001215-7 ... 76001925-9 ... 76005843-2 ... 76007743-7 ... 76008294-5 ... 76009811-6 ... 76011739-0 ... 76012844-9 ... 76014309-K ... 76015107-6 ... 76015662-0 ... 76016096-2 ... 76019921-4 ... 76026514-4 ... 76026754-6 ... 76029043-2 ... 76033711-0 ... 76035895-9 ... 76042275-4 ... 76043207-5 ... 76043478-7 ... 76044777-3 ... 76048222-6 ... 76049323-6 ... 76051527-2 ... 76063318-6 ... 76069188-7 ... 76069621-8 ... 76073759-3 ... 76077253-4 ... 76080924-1 ... 76083398-3 ... 76094260-K ... 76164130-1 ... 76200530-1 ... 76200720-7 ... 76324600-0 ... 76327980-4 ... 76375410-3 ... 76377670-0 ... 76453840-4 ... 76461120-9 ... 76525260-1 ... 76527180-0 ... 76563850-K ... 76565840-3 ... 76624810-1 ... 76650270-9 ... 76653690-5 ... 76654270-0 ... 76670180-9 ... 76688170-K ... 76699320-6 ... 76724000-7 ... 76757480-0 ... 76758840-2 ... 76760580-3 ... 76792810-6 ... 76827950-0 ... 76884020-2 ... 76898760-2 ... 76953260-9 ... 76968400-K ... 77060220-3 ... 77183530-9 ... 77248650-2 ... 77308020-8 ... 77380420-6 ... 77413050-0 ... 77416300-K ... 7741928-4 ... 77451560-7 ... 77753800-4 ... 77827630-5 ... 77948290-1 ... 77962630-K ... 77986680-7 ... 78006840-K ... 78030800-1 ... 78072520-6 ... 78207580-2 ... 78281650-0 ... 78298460-8 ... 78432780-9 ... 78469000-8 ... 78477650-6 ... 78558880-0 ... 78780430-6 ... 78827280-4 ... 78861790-9 ... 78874150-2 ... 79586380-K ... 8005083-6 ... 83156400-8 ... 8352320-4 ... 8378799-6 ... 8379191-8 ... 8649219-9 ... 88830500-9 ... 90753000-0 ... 91520000-1 ... 92648000-6 ... 9290661-2 ... 9334748-K ... 93698000-7 ... 9475529-8 ... 9485538-1 ... 9506985-1 ... 9522447-4 ... 9580657-0 ... 96626570-1 ... 96632300-0 ... 96711760-9 ... 96721090-0 ... 96779280-2 ... 96813830-8 ... 96837220-3 ... 96919970-K ... 96930440-6 ... 96953410-K ... 96967100-K ... 9890042-K ... 9896013-9 ... 99147000-K ... 99512950-7 ... 99540200-9 ... 99561530-4 ... 99568510-8 ... 99595090-1 ... ... ''' >>> [x for x in numbers.splitlines() if x and not rut.is_valid(x)] [] python-stdnum-1.8.1/tests/test_is_kennitala.doctest0000644000000000000000000000247713156325253022560 0ustar rootroot00000000000000test_is_kennitala.doctest - more detailed doctests stdnum.is_.kennitala Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.is_.kennitala module. >>> from stdnum.is_ import kennitala >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 020884-2749 ... 2607565169 ... 4406032540 ... 450401-3150 ... 480408-0550 ... 4905891209 ... 5609091440 ... 580169-1559 ... 580607-0710 ... 641005-1340 ... 670901-2110 ... 670906-0190 ... 7003090610 ... ... ''' >>> [x for x in numbers.splitlines() if x and not kennitala.is_valid(x)] [] python-stdnum-1.8.1/tests/test_isin.doctest0000644000000000000000000001447113156325253021056 0ustar rootroot00000000000000test_isin.doctest - more detailed doctests for the stdnum.isin module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.isin module. It tries to validate a number of numbers that have been found online. >>> from stdnum import isin >>> from stdnum.exceptions import * The number should start with a valid ISO 3166-1 alpha-2 country code: >>> isin.validate('ZZ0378331005') Traceback (most recent call last): ... InvalidComponent: ... These have been found online and should all be valid numbers. >>> numbers = ''' ... ... AU000000AAI6 ... AU000000AAT3 ... AU000000CDD7 ... AU000000HYR2 ... AU000000IIN2 ... AU000000PMI9 ... AU000000QMN7 ... AU000000TAG0 ... AU000000TAN6 ... AU000000YRR1 ... AU00000GPHO9 ... AU00000HAVO0 ... AU00000IMFG2 ... AU00000LSRO2 ... AU00000MEUO4 ... AU00000MFFO2 ... AU00000NMGG0 ... AU00000TGGR6 ... AU00000TISN6 ... AU00000TYXN3 ... AU00000WXHG6 ... AU0000ARUAM8 ... AU0000AVIAL7 ... AU0000AYCAA7 ... AU0000BRKDC2 ... AU0000BWPAK0 ... AU0000CIMAK4 ... AU0000COOAQ5 ... AU0000CXMAK3 ... AU0000DM1AE9 ... AU0000DM1XX1 ... AU0000DNAAK7 ... AU0000ENRAK9 ... AU0000FXJAB1 ... AU0000INDAK0 ... AU0000JALAO0 ... AU0000JKLAN1 ... AU0000LCYAM9 ... AU0000MSCAK3 ... AU0000NANAI0 ... AU0000PGIAO0 ... AU0000RGSAO5 ... AU0000SHKAO8 ... AU0000SIRAW4 ... AU0000SWLAI7 ... AU0000TSMAQ4 ... AU0000UPGDA8 ... AU0000VICAK5 ... AU0000VMXDC4 ... AU0000WBCAB7 ... AU0000WBCPF6 ... AU0000WBCZZ3 ... AU0000YNBAE4 ... AU000AMPJOF0 ... AU000ANZSRX4 ... AU000ARGJOM4 ... AU000CBALOX0 ... AU000CBALOZ5 ... AU000DJXKOB1 ... AU000ETFBSK6 ... AU000ETPCOP1 ... AU000ETPNRG0 ... AU000FMGWOP0 ... AU000GEMJOG9 ... AU000HFRJOT6 ... AU000MMSKOA8 ... AU000ORIKOC0 ... AU000PRYKOU6 ... AU000QANSWH6 ... AU000SFRKOJ2 ... AU000SGPKOF2 ... AU000SHLSSA4 ... AU000SYDIOO7 ... AU000SYISRX9 ... AU000TLSSSN2 ... AU000WBCLOQ8 ... AU000WESSWC6 ... AU000WFDDSN2 ... AU000WORSSR3 ... AU000WPLIOZ6 ... AU000XINABL9 ... AU000XINAHO0 ... AU000XINAKD7 ... AU000XINANQ3 ... AU000XINAV76 ... AU300PUMC025 ... AU60WHT00394 ... BMG4209T1009 ... BMG9834K1505 ... CA4656761042 ... CH0004171952 ... CH0010543905 ... CH0011105639 ... CH0011443832 ... CH0019112892 ... CH0028465273 ... CH0031152017 ... CH0032973528 ... CH0032979764 ... CH0032979871 ... CH0033337277 ... CH0037485627 ... CH0037485734 ... CH0042345089 ... CH0049815712 ... CH0100461042 ... CH0237135386 ... CH0276194575 ... CH0276213797 ... CH0278112146 ... CH0284369565 ... CH0288210914 ... CH0292642904 ... CH0293194293 ... CNE100000114 ... CNE100001M79 ... CWN8141V6954 ... CWN8144F3826 ... DE0005994388 ... DE0005997316 ... DE0007200412 ... DE0007681454 ... DE0007681975 ... DE0007932220 ... DE000A0DMV42 ... DE000A0DMV83 ... DE000A0G9FM3 ... DE000A0Z2946 ... DE000A0Z29G3 ... DE000A0Z3WV9 ... DE000A0Z3Z46 ... DE000A1EW8B3 ... DK0002006113 ... DK0002021690 ... DK0004903424 ... DK0004903770 ... DK0004909033 ... DK0005602439 ... DK0006321633 ... DK0006707070 ... DK0006900741 ... DK0007300339 ... DK0007702054 ... DK0007703458 ... DK0008100290 ... DK0008703150 ... DK0009255002 ... DK0009281511 ... DK0009351900 ... DK0009360141 ... DK0009362519 ... DK0009363087 ... DK0009705063 ... DK0009770471 ... DK0009771529 ... DK0030074216 ... DK0030269220 ... FR0010655753 ... GB0002405495 ... GB0003375820 ... GB0005058408 ... GB0031192486 ... GB0032211095 ... GB00B0599712 ... GB00B0599P95 ... GB00B05CVL88 ... GB00B05DCP29 ... GB00B05DGB62 ... GB00B05DNW68 ... GB00B05DSX21 ... GB00B05F5F96 ... GB00B05F5Q02 ... GB00B05FQ671 ... GB00B05FVH32 ... GB00B05G0029 ... GB00B05G4005 ... GB00B05G5K71 ... GB00B05G9160 ... GB00B0SD8170 ... GB00B0SDJ810 ... GB00B0SDL857 ... GB00B0VMNC71 ... GB00B11DNW78 ... GB00B1893G22 ... GB00B1CQNL45 ... GB00B1CQTJ43 ... GB00B1CQVM10 ... GB00B1KW2C82 ... GB00B2NL0X68 ... GB00B2PVJ269 ... GB00B2PVKX41 ... GB00B2PY1T61 ... GB00B2PY4209 ... GB00B2RBNV18 ... GB00B3BR9475 ... GB00B3CFYP64 ... GB00B3CFZV99 ... GB00B3CG0P10 ... GB00B3CG1L47 ... GB00B3LBXL47 ... GB00B3LFND86 ... GB00B3NVXT01 ... GB00B3Q2HT84 ... GB00B4V4XS73 ... GB00B4ZQ7X29 ... GB00B51RP987 ... GB00B5VJC047 ... GB00B6RRK619 ... GB00B6VQMK23 ... GB00B6VW1G93 ... GB00B6ZXH376 ... GB00B7LDLC53 ... GB00B7MT2J68 ... GB00B80KHR13 ... GB00B8113P38 ... GB00B8B4R053 ... GB00B8J3Q414 ... GB00BJ36MF67 ... GB00BK1PTB77 ... GB00BRKXHJ51 ... GB00BV0MBK93 ... GB00BVVT7780 ... GB00BYZ3J264 ... HK0000096617 ... HK0000179686 ... HK0000227162 ... HK0000230331 ... HK0000244647 ... HK0000245925 ... HK0000246709 ... HK0000248267 ... HK0000248515 ... HK0000249794 ... HK0000250578 ... HK0000253002 ... HK0000258720 ... HK0000262441 ... HK0000263449 ... HK0000265345 ... HK0000267077 ... IE0004906560 ... IE00B4WPHX27 ... IE00BLSNMW37 ... IE00BRHZ0398 ... INE019A07282 ... INE115A07ED1 ... INE115A07GL9 ... INE321N07046 ... INE476M07081 ... INE476M07123 ... INE523E07BF9 ... INE523E07BT0 ... INE549F08434 ... INE651J07036 ... INE691I07AO9 ... INE823G07193 ... INE827N07109 ... INF209K01MJ3 ... JE00B1RJLF86 ... JE00B24DML30 ... JE00B2NFV571 ... KYG198891072 ... KYG4643G1029 ... KYG4708D1016 ... KYG607441022 ... KYG811511131 ... KYG886121097 ... LU0455009182 ... LU0460389678 ... LU0683010093 ... LU0688203917 ... LU0859479155 ... LU1048317298 ... NL0010524690 ... NL0010865176 ... NL0010882288 ... NL0010948949 ... NL0011221981 ... NL0011278445 ... NL0011327101 ... NL0011337290 ... US101137AA59 ... US12591DAC56 ... US17322R1059 ... US26067A1108 ... US26070W1099 ... US36962GXS82 ... US78387GAK94 ... US867363AF06 ... XC0006883695 ... XS0110106365 ... XS0137672381 ... XS0162732951 ... XS0324245116 ... XS0409318309 ... XS0458685913 ... XS0691593114 ... XS0758793342 ... XS0841191991 ... XS0861774635 ... ... ''' >>> [x for x in numbers.splitlines() if x and not isin.is_valid(x)] [] python-stdnum-1.8.1/tests/test_iso7064.doctest0000644000000000000000000000377613156325253021235 0ustar rootroot00000000000000test_doctest - more detailed doctests for the stdnum.iso7064 package Copyright (C) 2010, 2011, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.iso7064 package. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.iso7064 import mod_11_10, mod_11_2, mod_37_2, mod_37_36, mod_97_10 These are normal variations of Mod 11, 10 that should just work. >>> mod_11_10.validate('12323') '12323' >>> mod_11_10.validate('546794') '546794' >>> mod_11_10.calc_check_digit('0794') '5' >>> mod_11_10.validate('07945') '07945' >>> mod_11_10.calc_check_digit('00200667308') '5' >>> mod_11_10.validate('002006673085') '002006673085' >>> mod_11_10.validate('002006673084') Traceback (most recent call last): ... InvalidChecksum: ... >>> mod_11_10.calc_check_digit('00200667309') '3' >>> mod_11_10.calc_check_digit('00200667310') '8' >>> mod_11_10.calc_check_digit('00200667311') '6' >>> mod_11_10.calc_check_digit('00200667312') '4' These normal tests of Mod 11, 2 should just work. >>> mod_11_2.calc_check_digit('0794') '0' >>> mod_11_2.validate('07940') '07940' >>> mod_11_2.calc_check_digit('079') 'X' >>> mod_11_2.validate('079X') '079X' These normal tests of Mod 37, 2 should just work >>> mod_37_2.calc_check_digit('G123498654321') 'H' python-stdnum-1.8.1/tests/test_mx_rfc.doctest0000644000000000000000000002412113223166521021357 0ustar rootroot00000000000000test_mx_rfc.doctest - more detailed doctests for the stdnum.mx.rfc module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.mx.rfc module. >>> from stdnum.mx import rfc >>> from stdnum.exceptions import * The six digits are supposed to form a valid date. >>> rfc.validate('ABCD 123456') Traceback (most recent call last): ... InvalidComponent: ... The last three digits are in a special alphabet and should only contain 1-9A-V, 1-9A-Z and 0-9A for the last digits. >>> rfc.validate('AABN 821103 8\xd12') # \xd1 is the N with tilde Traceback (most recent call last): ... InvalidFormat: ... The first four digits of a personal number should not be one of the blacklisted words. >>> rfc.validate('CACA 580710 NF7') Traceback (most recent call last): ... InvalidComponent: ... Only personal numbers are allowed to be missing the "homoclave" (check digits) part. >>> rfc.validate('AKJ970902') Traceback (most recent call last): ... InvalidLength: ... A large number of numbers that are in use appear to have invalid check digits. This has been found in about 1.5% of all numbers found. For this reason, by default, validation of check digits has been disabled and can be enabled explicitly. >>> rfc.validate('SIN 931116 9P8') 'SIN9311169P8' >>> rfc.validate('SIN 931116 9P8', validate_check_digits=True) Traceback (most recent call last): ... InvalidChecksum: ... >>> rfc.validate('CCM 650122 I06') 'CCM650122I06' >>> rfc.validate('CCM 650122 I06', validate_check_digits=True) Traceback (most recent call last): ... InvalidComponent: ... Some extra formatting checks: >>> rfc.format('VSM140430NQA') 'VSM 140430 NQA' >>> rfc.format('ZUT A770215LK0') 'ZUTA 770215 LK0' These have been found online and should all be valid numbers. Note that these numbers all have valid check digits (also see the list below). >>> numbers = ''' ... ... &&&030828PX7 ... &JE040614N51 ... AA&0607148I0 ... AAA390128530 ... AAAA791128D63 ... AAAL730401TE0 ... AACA700913KZ0 ... AACC421231BH1 ... AADS251231CG0 ... AALC680929LH8 ... AAM090224BC2 ... AARR621113SN7 ... ABA130601BD3 ... ABH0507252D9 ... ACA120116TX5 ... ACO071219F51 ... AEAJ390701E82 ... AEL7407151YA ... AEM100930B11 ... AHO120203E8A ... ALD950921G27 ... ALE8401268K8 ... AMA990219PF8 ... AME040430UM8 ... AME110909530 ... AMM020222UT3 ... ANI0112176N8 ... AON0210014T5 ... AOX040831A59 ... AP&0305026J9 ... APA371201PQ7 ... AQU920317P4A ... ARO020221DQ4 ... ASE9112306M9 ... ATB081212MN5 ... AUD000704II1 ... AUHF891016KE4 ... AWI1206064H1 ... AYP110530D73 ... B&D9605298Y3 ... BADY7101185W6 ... BEE070927MH0 ... BER090921FJ6 ... BIHC5111253I7 ... BLN130425JU7 ... BMI880419PR5 ... BNE110914EY0 ... BSP0603203U3 ... BUGA701115I43 ... CAR910506BW8 ... CBC900829152 ... CCS8512024CA ... CDE110928FR0 ... CEG970917HY3 ... CEI111208UJ8 ... CET790711B43 ... CEX910718C75 ... CFE010608HC8 ... CGB000229SW0 ... CIG120628NQ1 ... CIN831107B41 ... CIT900525168 ... CLO070618EY6 ... CLO110607257 ... CLO850611371 ... CMA7708263Y7 ... CMA970306DZ8 ... CME990423373 ... CMI0507204U8 ... CMO101104D21 ... CNR100325T71 ... COI090127UY5 ... COML8103203QA ... COP891005HV6 ... CPR0611212K8 ... CSB021029689 ... CSI050527PE4 ... CSI900816E23 ... CSM130516IT5 ... CSU000912EH0 ... CTE870318ANA ... CTR0501281A7 ... CTS840406DB5 ... CTV080213S16 ... CUAF680927LM6 ... CVI961129D88 ... DAM121219GU4 ... DCA050617BJ7 ... DCF080331IP7 ... DCP1008179J4 ... DHO100211PP9 ... DIN130417NB8 ... DIP0405273R5 ... DIR070208V76 ... DIS9611059T1 ... DIV050625LE1 ... DMM120201G43 ... DMS121114BV6 ... DPU070904692 ... DVS120703FD1 ... ECM080228KF1 ... EDI000229CA3 ... EEM9110114W4 ... EGA060426LW6 ... EIA870112MW6 ... EIE080701SL6 ... EIM861215GH7 ... EIP971118EE0 ... EITM9103155L7 ... EMA001219M72 ... EME950412SS8 ... ENI731210FS2 ... ENP100804LU4 ... EPL031009LA3 ... EPM990712PX9 ... EPR920313DS8 ... ESI920217GY0 ... EUDC730505US6 ... EYA810212AB7 ... EYO121214DD5 ... FAM000229SB8 ... FCM0512093V7 ... FCR930924UP5 ... FDI060505DD8 ... FERL530506LL2 ... FLO9205187K8 ... FME780808PH2 ... FMP110620626 ... FPC960606SS7 ... FQU040210VB6 ... GABA930110DY7 ... GAD8509039E9 ... GAF091006GL7 ... GAGS8602119P9 ... GAI670926SX4 ... GBE910314CY9 ... GBM110523N11 ... GCT0205243T8 ... GEC091113R94 ... GEN060113JT9 ... GGS1306077E2 ... GIAI6703203N6 ... GIN130711BX1 ... GIN9806308G0 ... GLA1001272R3 ... GMA050607UA0 ... GMI920724CP5 ... GMO030628DI0 ... GMX0912018E6 ... GOAJ7101257MA ... GOBM630601RQ6 ... GOVB6202103B1 ... GTL101217DPA ... GUI990521N70 ... GURK651124IZ6 ... GYA010601HZ2 ... HAKC800506G89 ... HEA080829QE4 ... HEM881018M63 ... HIAD7004306I3 ... HIM950519AS3 ... HST051115KD6 ... HUM131108DJ7 ... IAG960627I24 ... ICR131219UR2 ... ICV111124GA3 ... ICW020809NG4 ... IEO861107K41 ... IET040122JP4 ... IET1402203U2 ... IJC090327V63 ... ILM130517SJ6 ... IME060217HN7 ... IPA090810Q33 ... ISD9609109M3 ... ITE040705LM7 ... ITM040310AX8 ... ITM7002044W3 ... ITM891121LZ9 ... ITO090804L92 ... IUS9207088R5 ... JET0811207A7 ... JINA4912084Z8 ... JJO021128CS9 ... JOFF550129TD7 ... KCO990630SQ4 ... KUC120227CP8 ... LBN120207CE8 ... LEAJ570610M32 ... LED070424K80 ... LIVR600908A58 ... LMX120112CH1 ... LRE050221F14 ... LTR101108SK5 ... LTS000117Q95 ... LUT0504217B1 ... MAC0501069H5 ... MAC050302QU4 ... MAE100225TF0 ... MALR850723RK4 ... MAOA800509SH5 ... MAPA600915DB4 ... MAR960628QU0 ... MAV890913NY0 ... MBU060512RE7 ... MCA851223JI9 ... MCP100710IH6 ... MCS830224156 ... MDM011001DD7 ... MECJ730513KC7 ... MELF7605095R6 ... MIR9812154E0 ... MIT110829255 ... MKE040510HW9 ... MLM020809894 ... MME120612IJ5 ... MME820427S6A ... MME9710313Z4 ... MOCC891114BA9 ... MOD9904275G7 ... MRG900406M6A ... MSI041208CR0 ... MSU121003LR3 ... MTR091125TJ8 ... MUÑ110218LJ6 ... MXS030318BP0 ... NAJ120705J5A ... NARF561006LT9 ... NFI000511G42 ... NIC120302LE4 ... NOCJ750806BJA ... OHA0204186H2 ... OIL080603P74 ... OIN970513LM7 ... OOM060208MC5 ... ORO040505KH3 ... ORS0011148U8 ... OVS041008711 ... PAP041025A11 ... PBC910219RI2 ... PCS091030DZA ... PDI630218N32 ... PEL910625UQ4 ... PGT110128I84 ... PII040123JR9 ... PIN8709103A4 ... PIT1207186S3 ... PLA020617B95 ... PME8308184S4 ... PMI0110161Q4 ... PPM970110676 ... PPT991115IR3 ... PRA071201A18 ... PRA850314FE5 ... PRO060904RR8 ... QVI850529SP8 ... RABT551122827 ... RAO821016K97 ... RCV060828NE3 ... RDI841003QJ4 ... REG070627EF9 ... REI120227C54 ... RIGL6608198W7 ... RME960329V67 ... ROZS700918HL9 ... RRE010202L83 ... RUAA751115C42 ... RUAJ8104018GA ... RZS9003238P5 ... SAGE661012E96 ... SALM760305JP4 ... SAVA810110EN5 ... SBR811009760 ... SCE000520HU0 ... SCI090109TZ2 ... SCO050124QL2 ... SDA8902091QA ... SEP051121DU8 ... SES0601271U0 ... SGY100210UL2 ... SIA0803073Z2 ... SIM080104CM6 ... SIN9904064B4 ... SME011012Q43 ... SME020208GXA ... SME060406U67 ... SME111212CA4 ... SOP0410217V5 ... SOP940502FF5 ... SOR9403107MA ... SOTG740115G1A ... SPL910701FD9 ... STP110106D88 ... TCS0104276P5 ... TEC0306066L6 ... TEE060928R87 ... TME930929DE1 ... TQI090928UR4 ... TSP931104UI0 ... UAI010212HW5 ... UEE110902V5A ... UFA1010116X3 ... VBF951020KT3 ... VCA0903116M7 ... VCO960628NZ0 ... VEFC6503094Q6 ... VEO100223D10 ... VMI820313C9A ... VMU930407NFA ... VSM040108TS6 ... VSO090204AF1 ... XCO111215IM0 ... YAT000229588 ... ZEJ060728K11 ... ZENP8101128Y0 ... ZGU920526T43 ... ZZE040708QJ9 ... ... ''' >>> [x for x in numbers.splitlines() if x and not rfc.is_valid(x, validate_check_digits=True)] [] The following numbers were also found online, and while they appear to be in use and referencing existing persons or organisations, the check digit does not validate. All of these have been checked to be valid on https://portalsat.plataforma.sat.gob.mx/ConsultaRFC/ (note that this website expects ISO-8859-1 encoded numbers) >>> numbers = ''' ... ... AAC0903183F6 ... AAMM450222AJ1 ... ALC920108P18 ... AMC020204AB7 ... AOM920820BEA ... ASA971202EB5 ... ASE0804046M8 ... AÑE9902224Z4 ... BABC300126Q66 ... BAÑ930616R66 ... BER060923LW4 ... BFI981221MG0 ... BLM890223FH1 ... BOJR890112DB9 ... BOR071120HE7 ... CAMG590407QSA ... CAMR620930HG5 ... CAVB360920196 ... CCB080911PV3 ... CCL020604CX0 ... CDO070410V77 ... CLA091217733 ... CLM9407017W4 ... CME030507A29 ... CME9809141L6 ... CME990816951 ... CMS071226LN2 ... COCA8007229UA ... CPC080624C48 ... CTA071106464 ... CUP820427ID9 ... DBE051005PT3 ... DEKR6305193Q2 ... DES8707223AA ... DJT031205MG4 ... DRA950811S25 ... EDG000413BF2 ... EME1006143T6 ... EQU810430193 ... FAE8509042W7 ... FIS0008226ZA ... FME9305279N0 ... FSA080813655 ... FSI900505I74 ... GIR940318DF0 ... GJO891005N53 ... GMA080728MJ0 ... GME9606038V6 ... GOC841221BK0 ... GWS860313JA3 ... HHO900507844 ... HME020215QTA ... ICO990503PG4 ... IDE930601FJ4 ... IME0610197B2 ... ISM0403025G3 ... KAK030512QD7 ... KMN041126K5A ... KZY041011E20 ... LME9405237U7 ... LMI0811119C5 ... LOCB6410225K0 ... LOMM8110052J4 ... MALC721019EV6 ... MDI931014D37 ... MFA840320DX0 ... MGR070820G78 ... MPT000824LH7 ... MSA850111TE1 ... NIÑ7409256U1 ... NSN000704SY3 ... NYL850506BJ8 ... OIC060523UW1 ... OMD100907CJ4 ... OPP010927SA5 ... OTM090818KS6 ... PEJE480914ES9 ... PERL640914HY9 ... PPA100118E37 ... PTS091204M83 ... ROCS550714PC0 ... SIG060311PN2 ... SIT060329RA7 ... SME100414QY9 ... SME9502015F6 ... SMP060331P74 ... SMR011108KB9 ... SOMF730101689 ... SSB9512118M1 ... STM000215AG9 ... TFS011012M18 ... TLO020509RK3 ... TME940420LV5 ... TORE4007065V7 ... TPM06111759A ... TPT0202135S1 ... TPT890516JP5 ... VAME720111AA4 ... WME000218GK3 ... YME9610251W6 ... ... ''' >>> [x for x in numbers.splitlines() if x and not rfc.is_valid(x)] [] python-stdnum-1.8.1/tests/test_br_cnpj.doctest0000644000000000000000000000335013156325253021523 0ustar rootroot00000000000000test_br_cnpj.doctest - more detailed doctests for the stdnum.br.cnpj module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.br.cnpj module. It tries to validate a number of numbers that have been found online. >>> from stdnum.br import cnpj >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 07.195.358/0001-66 ... 08.807.432/0001-10 ... 11.015.248/0001-42 ... 11.017.153/0001-68 ... 11.017.153/0002-49 ... 11.017.153/0003-20 ... 11.017.153/0005-91 ... 11.980.459/0001-15 ... 14.847.283/0001-16 ... 14.847.283/0002-05 ... 14.847.283/0003-88 ... 14.847.283/0004-69 ... 14.847.283/0005-40 ... 16.727.230.0001-97 ... 18.090.575/0001-08 ... 18.090.575/0002-99 ... 18.090.575/0003-70 ... 18.090.575/0004-50 ... 18.090.575/0005-31 ... 22.610.961/0001-50 ... 44.407.989/0001-28 ... 47.080.619/0001-17 ... 53.612.734/0001-98 ... 61882613000194 ... 69.435.154/0001-02 ... ... ''' >>> [x for x in numbers.splitlines() if x and not cnpj.is_valid(x)] [] python-stdnum-1.8.1/tests/numdb-test.dat0000644000000000000000000000026713223166521020234 0ustar rootroot00000000000000# this is a comment line 0-8 prop1="foo" 100-999 prop2="bar" 200,300-399 prop3="baz" 6 prop1="boo" 333 prop4="bla" 90-99 prop1="booz" 00-89 prop2="foo" 900-999 prop2="fooz" python-stdnum-1.8.1/tests/test_in_pan.doctest0000644000000000000000000000244213223166521021347 0ustar rootroot00000000000000test_in_pan.doctest - more detailed doctests for stdnum.in_.pan module Copyright (C) 2017 Srikanth Lakshmanan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.in_.pan module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.in_ import pan >>> from stdnum.exceptions import * These number have been provided and should all be valid PANs. >>> numbers = ''' ... ... AAKFD7113K ... AAPPV8261K ... ABMPA3211G ... ACUPA7085R ... AFZPK7190K ... ... ''' >>> [x for x in numbers.splitlines() if x and not pan.is_valid(x)] [] python-stdnum-1.8.1/tests/test_iso6346.doctest0000644000000000000000000000337313156325253021230 0ustar rootroot00000000000000test_doctest - more detailed doctests for the stdnum.iso6346 package Copyright (C) 2014 Openlabs Technologies & Consulting (P) Limited This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.iso7064 package. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import iso6346 Test with valid numbers: >>> iso6346.validate('CSQU3054383') 'CSQU3054383' >>> iso6346.is_valid('CSQU3054383') True >>> iso6346.validate('csqu3054383') 'CSQU3054383' >>> iso6346.is_valid('csQU3054383') True >>> iso6346.validate('tcnu7200794') 'TCNU7200794' >>> iso6346.validate('tolu4734787') 'TOLU4734787' >>> iso6346.validate('GYOU4047990') 'GYOU4047990' Test with invalid numbers: >>> iso6346.validate('CSQU3054384') Traceback (most recent call last): ... InvalidChecksum: ... >>> iso6346.validate('CSQU305438') Traceback (most recent call last): ... InvalidLength: ... >>> iso6346.is_valid('CSQU3054384') False >>> iso6346.validate('CSQU3054Z83') Traceback (most recent call last): ... InvalidFormat: ... python-stdnum-1.8.1/tests/test_casrn.doctest0000644000000000000000000000470113223166521021211 0ustar rootroot00000000000000test_casrn.doctest - more detailed doctests for the stdnum.casrn module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.casrn module. It contains some corner case tests and tries to validate numbers that have been found online. >>> from stdnum import casrn >>> from stdnum.exceptions import * The number seems to always include separators so we introduce them if they are not present (but will fail validation if they are in the incorrect place or are inconsistently placed). >>> casrn.validate('329-65-7') '329-65-7' >>> casrn.validate('329657') '329-65-7' >>> casrn.validate('32-96-57') Traceback (most recent call last): ... InvalidFormat: ... >>> casrn.validate('32965-7') Traceback (most recent call last): ... InvalidFormat: ... The first component of a CAS RN can be 2 to 7 digits long. >>> casrn.validate('51-43-4') '51-43-4' >>> casrn.validate('1-43-4') Traceback (most recent call last): ... InvalidLength: ... >>> casrn.validate('2040295-03-0') '2040295-03-0' >>> casrn.validate('12040295-03-0') Traceback (most recent call last): ... InvalidLength: ... These should all be valid CAS Registry Numbers. >>> numbers = ''' ... ... 51-43-4 ... 87-86-5 ... 150-05-0 ... 329-65-7 ... 608-93-5 ... 1305-78-8 ... 1344-09-8 ... 1972-08-3 ... 2650-18-2 ... 3087-16-9 ... 3524-62-7 ... 6104-58-1 ... 7440-44-0 ... 7440-47-3 ... 7732-18-5 ... 7782-40-3 ... 7782-42-5 ... 8007-40-7 ... 9031-72-5 ... 9032-02-4 ... 9035-40-9 ... 12627-53-1 ... 14314-42-2 ... 16065-83-1 ... 18540-29-9 ... 49863-03-8 ... 55480-22-3 ... 56182-07-1 ... 60679-64-3 ... 70051-97-7 ... 126266-35-1 ... 126371-03-7 ... 153250-52-3 ... 308067-58-5 ... 2040295-03-0 ... ... ''' >>> [x for x in numbers.splitlines() if x and not casrn.is_valid(x)] [] python-stdnum-1.8.1/tests/test_util.doctest0000644000000000000000000000475113223166521021065 0ustar rootroot00000000000000test_util.doctest - more detailed doctests for the stdnum.util package Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.util package. It tries to test more corner cases and detailed functionality. This module is meant for internal use by stdnum modules and is not guaranteed to remain stable and as such not part of the public API of stdnum. >>> from stdnum.util import ( ... get_number_modules, get_module_name, get_module_description) The get_module_name() function is used in the example WSGI application and release scripts to get the number's name. It should not end in a dot (even though the docstring subject should). >>> from stdnum import isbn >>> get_module_name(isbn) 'ISBN (International Standard Book Number)' >>> any(get_module_name(mod).endswith('.') for mod in get_number_modules()) False The get_module_description() function is used in the example WSGI application to extract the extended description of the number for presentation purposes. The doctests should not be present in the descriptions. >>> from stdnum import isbn >>> get_module_description(isbn).startswith( ... 'The ISBN is the International Standard Book Number') True >>> any('>>>' in get_module_description(mod) for mod in get_number_modules()) False The get_cc_module() function can be used to find a country-specific validation module that can be used to validate the number format. It should handle aliases properly. >>> from stdnum.util import get_cc_module >>> get_cc_module('gb', 'vat').__name__ 'stdnum.gb.vat' >>> get_cc_module('nl', 'vat').__name__ 'stdnum.nl.btw' >>> get_cc_module('is', 'vat').__name__ 'stdnum.is_.vsk' >>> get_cc_module(u'nl', u'vat').__name__ 'stdnum.nl.btw' >>> get_cc_module('unknown', 'vat') is None True >>> get_cc_module('nl', 'unknown') is None True python-stdnum-1.8.1/tests/test_ca_bn.doctest0000644000000000000000000000702213223166521021144 0ustar rootroot00000000000000test_ca_bn.doctest - more detailed doctests for the stdnum.ca.bn module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ca.bn module. >>> from stdnum.ca import bn >>> from stdnum.exceptions import * The number can also be a 15-digit account number (Business Number followed by program identifier and reference number). >>> bn.validate('12302 6635') '123026635' >>> bn.validate('12302 6635 RC 0001') '123026635RC0001' >>> bn.validate('12302 6635 AA 0001') # only some values allowed Traceback (most recent call last): ... InvalidComponent: ... >>> bn.validate('12302 6635 RC OOO1') # only digits allowed in ref nr Traceback (most recent call last): ... InvalidFormat: ... These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 000089987RC1818 ... 100007780RC0001 ... 100026723RC0001 ... 100044833RC0001 ... 100060474RC0001 ... 100074699RC0001 ... 100078294RC0002 ... 100080571RC0001 ... 100287119RC0001 ... 100457266RC0001 ... 101007961RC0001 ... 101060390RC0001 ... 123025645RC0001 ... 123026635RC0001 ... 123222911RC0001 ... 123828493RC0001 ... 700706898RC0001 ... 700783491RC0001 ... 700784499RC0001 ... 700803299RC0001 ... 700859895RC0001 ... 702520891RC0001 ... 702521097RC0001 ... 702529496RC0001 ... 702667122RC0001 ... 751055724RC0001 ... 751119520RC0001 ... 751207697RC0001 ... 751369729RC0001 ... 751446725RC0001 ... 751542895RC0001 ... 751551490RC0001 ... 751756529RC0001 ... 752573725RC0001 ... 752574525RC0001 ... 752628297RC0001 ... 752767327RC0001 ... 752768127RC0001 ... 752805291RC0001 ... 752828293RC0001 ... 752860320RC0001 ... 752944892RC0001 ... 753000298RC0001 ... 753371897RC0001 ... 753372291RC0001 ... 753447127RC0001 ... 753461292RC0001 ... 753946698RC0001 ... 789422128RC0001 ... 789482494RC0001 ... 789538923RC0001 ... 789634326RC0001 ... 795578699RC0001 ... 795606490RC0001 ... 795676121RC0001 ... 795710920RC0001 ... 795848126RC0001 ... 795855527RC0001 ... 795930726RC0001 ... 800500001RC0001 ... 800810657RC0001 ... 800812885RC0001 ... 800826489RC0001 ... 800958118RC0001 ... 800973406RC0001 ... 852093749RC0001 ... 852470673RC0001 ... 852581149RC0001 ... 852615772RC0001 ... 852646900RC0001 ... 852694231RC0001 ... 852750546RC0001 ... 852988633RC0001 ... 855065504RC0001 ... 855102976RC0001 ... 855582995RC0001 ... 855643086RC0001 ... 855696373RC0001 ... 855789004RC0001 ... 855957882RC0001 ... 859043580RC0001 ... 859098337RC0001 ... 859144438RC0001 ... 859363848RC0001 ... 859395162RC0001 ... 859457681RC0001 ... 859620973RC0001 ... 892190364RC0001 ... 892220393RC0002 ... 892462672RC0001 ... 892476565RC0001 ... 892552035RC0001 ... 892737149RC0001 ... 892738741RC0001 ... 892807983RC0001 ... 899099733RC0001 ... 899429443RC0001 ... 899549042RC0001 ... 899558340RC0001 ... 899927438RC0001 ... ... ''' >>> [x for x in numbers.splitlines() if x and not bn.is_valid(x)] [] python-stdnum-1.8.1/tests/test_gb_sedol.doctest0000644000000000000000000000757713156325253021703 0ustar rootroot00000000000000test_sedol.doctest - more detailed doctests for the stdnum.gb.sedol module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.gb.sedol module. It tries to validate a number of numbers that have been found online. >>> from stdnum.gb import sedol >>> from stdnum.exceptions import * Old-style number are fully numeric, new-style numbers start with a letter. >>> sedol.validate('0017505') '0017505' >>> sedol.validate('B07MXC1') 'B07MXC1' >>> sedol.validate('107MXC1') Traceback (most recent call last): ... InvalidFormat: ... No vowels are allowed: >>> sedol.validate('BO7MXC9') Traceback (most recent call last): ... InvalidFormat: ... These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 0016308 ... 0059585 ... 0286941 ... 0371847 ... 0885865 ... 0937636 ... 2181334 ... 2342034 ... 2458113 ... 3111084 ... 3143838 ... 3395349 ... 4178419 ... 4913223 ... 5533976 ... 7142091 ... B012BV2 ... B059874 ... B05CW04 ... B05D467 ... B05D6X8 ... B05D724 ... B05D746 ... B05D7C4 ... B05D7G8 ... B05D9N9 ... B05DCY1 ... B05DKZ8 ... B05DS21 ... B05DSL0 ... B05F6M3 ... B05F7R5 ... B05F7Z3 ... B05FC47 ... B05FFN7 ... B05FFX7 ... B05FHZ3 ... B05FJ02 ... B05FKV0 ... B05FKX2 ... B05FPZ9 ... B05FRQ4 ... B05FXV1 ... B05FZQ0 ... B05FZS2 ... B05G198 ... B05G637 ... B05G7J0 ... B068074 ... B0M6373 ... B0R46X9 ... B0SDR09 ... B0VMH70 ... B0VMJM9 ... B0VMPT8 ... B0XWNB4 ... B0YVBC7 ... B10LNL1 ... B11S1X9 ... B1893V7 ... B18S7B2 ... B1CD9S4 ... B1CDK14 ... B1CQNK3 ... B1CQRH8 ... B1CQRN4 ... B1CQV98 ... B1CQWZ1 ... B1CQY00 ... B1CR0L6 ... B1CR0S3 ... B1KTQX8 ... B1KYVC7 ... B1KYVZ0 ... B1RMWL0 ... B1VCNQ8 ... B1XG8T6 ... B243G00 ... B29LZ80 ... B2N6X76 ... B2PRS50 ... B2PRWF8 ... B2PRWJ2 ... B2PS0H9 ... B2PV5Y0 ... B2PVGZ8 ... B2PVHM2 ... B2PVMB6 ... B2PVP84 ... B2PVRV1 ... B2PY1R4 ... B2PY390 ... B2PY3H8 ... B2PY572 ... B2PY5J4 ... B2Q1N90 ... B2QXZK1 ... B2RKQW0 ... B39DW15 ... B3CFXY8 ... B3CFYB2 ... B3CG1T2 ... B3F8162 ... B3KF8V2 ... B3LFLQ7 ... B3LT1Q9 ... B3LXSJ3 ... B3M3MB2 ... B3M5D48 ... B3M7ZH1 ... B3MPTK6 ... B3MVRM2 ... B3NSQZ8 ... B3NVM93 ... B3P2YG5 ... B3P9Y44 ... B3PHCS8 ... B3PL150 ... B3PQ1W2 ... B3Q3L88 ... B3SC0P3 ... B3VM3R3 ... B3VVG60 ... B3XK5J1 ... B42TM62 ... B45BZT9 ... B4JT339 ... B4MJF52 ... B4PRH35 ... B50HQ74 ... B52LK94 ... B545JR5 ... B5497R3 ... B54V1Z5 ... B599TV6 ... B59TPT6 ... B5BKK36 ... B5BKMR4 ... B5P8YX4 ... B5T42N4 ... B5V3ZY1 ... B5VR9Q3 ... B61BDZ9 ... B626RZ1 ... B6496D9 ... B64JSM2 ... B652H90 ... B657SR0 ... B66G553 ... B6734R8 ... B676F30 ... B67NKZ8 ... B6QDDF0 ... B76V7N7 ... B78DL95 ... B7K2811 ... B7RRJJ4 ... B7RRKB3 ... B7WNMF4 ... B7XCP73 ... B80QGD8 ... B83MH18 ... B8C0D37 ... B8KQFS6 ... B8N44W4 ... B8N45L0 ... B8N46J5 ... B8V9FZ1 ... B9BRCL7 ... B9DQ900 ... BB97138 ... BBGBF31 ... BC7GZX2 ... BCRY644 ... BCW3NW3 ... BCZSZF2 ... BGJZZG8 ... BK1PTB7 ... BKXH0G3 ... BRWQVY5 ... BSBNC63 ... BTF8JJ3 ... BTL1K93 ... BVC3VM2 ... BVXCDJ9 ... BVXLP67 ... BW38RQ9 ... BWWD0R7 ... BWXBQ27 ... BWXTNQ4 ... BX7RKZ9 ... BX7RPQ5 ... BYN8P69 ... BYT3LB5 ... BYTLC94 ... BYW6P64 ... BYXJKZ6 ... BYXX1Y4 ... BZ0S6X3 ... BZ21T08 ... ... ''' >>> [x for x in numbers.splitlines() if x and not sedol.is_valid(x)] [] python-stdnum-1.8.1/tests/test_tr_tckimlik.doctest0000644000000000000000000001031413156325253022420 0ustar rootroot00000000000000test_tr_tckimlik.doctest - more detailed doctests for stdnum.tr.tckimlik Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.tr.tckimlik module. >>> from stdnum.tr import tckimlik These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 10010405214 ... 10036951702 ... 10048987300 ... 10211782428 ... 10328097460 ... 10406257588 ... 10634889650 ... 10942702016 ... 10945940248 ... 10964454474 ... 11015620602 ... 11051965132 ... 11272211322 ... 11510943206 ... 11521565534 ... 11629545766 ... 11678091474 ... 11678588622 ... 11856036426 ... 12245687724 ... 12254905536 ... 12281024156 ... 12629254764 ... 12668958814 ... 12691048056 ... 12743195844 ... 12790164022 ... 12797231260 ... 13159065448 ... 13195732540 ... 13267669224 ... 13331822036 ... 13466947000 ... 13481622074 ... 13649294334 ... 13684258322 ... 13700315886 ... 13789534246 ... 13796225410 ... 14693160156 ... 14834750260 ... 14953629638 ... 15038532782 ... 15076154212 ... 16130649606 ... 16168925222 ... 16412902252 ... 16834076296 ... 16910960518 ... 17311901384 ... 17690240920 ... 18164076700 ... 18535119968 ... 18563796476 ... 18737290298 ... 18766481124 ... 18986317036 ... 19261708150 ... 19304490066 ... 19315991200 ... 19594888024 ... 19649559862 ... 19736210324 ... 19946754342 ... 20923453974 ... 21289134606 ... 22508375282 ... 22514314664 ... 22645425550 ... 22850263862 ... 23128444884 ... 23761367960 ... 23776369980 ... 23803533490 ... 23812308782 ... 23893394292 ... 23945549168 ... 24118906764 ... 24721853608 ... 25171067942 ... 25175346104 ... 25262304970 ... 26465047138 ... 26912437970 ... 27085445038 ... 27352676660 ... 27806346354 ... 27977266680 ... 28040246264 ... 28196469500 ... 28423494398 ... 29008505256 ... 29449926498 ... 29458830458 ... 29660083116 ... 29663288082 ... 29717351038 ... 30229834674 ... 30517382986 ... 30547067204 ... 30713063856 ... 30841564102 ... 31177269242 ... 31261062360 ... 31378085252 ... 31666319410 ... 31972018304 ... 32080659878 ... 32191139436 ... 32276435798 ... 32362147840 ... 32383033566 ... 32806023532 ... 32986865670 ... 33163817956 ... 33370005450 ... 33632324534 ... 33869149092 ... 34399824114 ... 34411781920 ... 34837267190 ... 35209878136 ... 35389844082 ... 35467790720 ... 35740345494 ... 35927206914 ... 35944794678 ... 36412601542 ... 36799571254 ... 37474709214 ... 37561226518 ... 37708357112 ... 37987046004 ... 38065982832 ... 38312029198 ... 38491580480 ... 38818946524 ... 39346988482 ... 39433505530 ... 39488099268 ... 39556079970 ... 39872148282 ... 40285129270 ... 40429332580 ... 41116624858 ... 41314615566 ... 41537123152 ... 41740577612 ... 42529353182 ... 42568749892 ... 42679341534 ... 43198351554 ... 43282542684 ... 43609945662 ... 43846057142 ... 43879752656 ... 44815212906 ... 45358790944 ... 45577460604 ... 46162064740 ... 46186184424 ... 46786024366 ... 47248345760 ... 47353662028 ... 48064083294 ... 48637402194 ... 48637792714 ... 48883810224 ... 49432850678 ... 49636373966 ... 49879800274 ... 50035230828 ... 50479247086 ... 51508004946 ... 51532505860 ... 51865395732 ... 53320726198 ... 53728014842 ... 54439040694 ... 54508382038 ... 54541189670 ... 54781681538 ... 55996400266 ... 56698147152 ... 57025178016 ... 57061155224 ... 59020072634 ... 59464150004 ... 59599009130 ... 59605521564 ... 61579176350 ... 61957262828 ... 62077362474 ... 62224350880 ... 62512131214 ... 63352195206 ... 64756048358 ... 68536141048 ... 69844021374 ... 71467095762 ... ... ''' >>> [x for x in numbers.splitlines() if x and not tckimlik.is_valid(x)] [] python-stdnum-1.8.1/tests/test_al_nipt.doctest0000644000000000000000000000650413223166521021534 0ustar rootroot00000000000000test_al_nitp.doctest - more detailed doctests stdnum.al.nipt Copyright (C) 2015-2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.al.nipt module. >>> from stdnum.al import nipt >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. There is also a validation service at http://www.qkr.gov.al/kerko/kerko-ne-regjistrin-tregtar/kerko-per-subjekt/ >>> numbers = ''' ... ... J 64103842 S ... J 69102564 M ... J 78311939 N ... J 8291 6498 D ... J 91402501 L ... J 98624806 P ... J61807017B ... J61826022R ... J61911008C ... J61922018S ... J61923008Q ... J62903175S ... J62903393F ... J62903470T ... J62903491S ... J64103682L ... J66702410U ... J67902618M ... J69405530G ... J71824003C ... J72603171B ... J73706808B ... J73721043Q ... J74517201G ... J77411245Q ... J81314004P ... J81402004E ... J81508002V ... J81804001C ... J86526614T ... J91305001Q ... J91808007H ... J92006014W ... J92917219S ... J93910409N ... K 01725001F ... K 02727202 O ... K 11715005 L ... K 22013001U ... K 37507987 N ... K 41316001 V ... K 41424801 U ... K 47905861 R ... K 63005203 O ... K 67204202 P ... K 91426008 U ... K11515001T ... K11715005L ... K12113002H ... K14019001H ... K21405003G ... K21622001M ... K22218003V ... K26330201T ... K31404025J ... K31525146H ... K31526056N ... K31823059I ... K31929010K ... K32203501H ... K32801430W ... K33714725W ... K34712418N ... K36308746I ... K36520204A ... K42725403f ... K46621201I ... K51428013Q ... K51518058O ... K59418208E ... K61710508W ... K71903001A ... K72410014H ... K81427030E ... K81428502L ... K81618039O ... K84508002F ... K87101202A ... K91725009J ... K92402023O ... L 21721005U ... L 22614402 H ... L01307052Q ... L01510016S ... L01622006F ... L01909501I ... L02003503P ... L02023501H ... L02226012N ... L02602801H ... L03321203G ... L06426702Q ... L06524402O ... L06901403L ... L06923204C ... L07305201K ... L08711201I ... L09110504G ... L11325024K ... L11625013E ... L11810502T ... L11815018A ... L12003021H ... L12009010A ... L12624002J ... L13020404N ... L14118803B ... L14703202P ... L21310054D ... L21408015A ... L21429502L ... L21508023Q ... L21923507N ... L22201021E ... L22203019C ... L22804207O ... L22825801P ... L22902002B ... L24006002V ... L24018612J ... L26311004G ... L29616001A ... L31511019E ... L31911504A ... L32210507A ... L32319014A ... L32522401O ... L33117002J ... L33318001M ... L41309075A ... L41320026E ... L41410025S ... L42008005H ... L42115015G ... L42206027K ... L42307007E ... L42710403A ... L42720201A ... L44119601E ... L46812703Q ... L47014204F ... L48117101S ... ... ''' >>> [x for x in numbers.splitlines() if x and not nipt.is_valid(x)] [] python-stdnum-1.8.1/tests/test_ch_vat.doctest0000644000000000000000000000356513156325253021362 0ustar rootroot00000000000000test_ch_vat.doctest - more detailed doctests for the stdnum.ch.vat module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ch.vat module. >>> from stdnum.ch import vat >>> from stdnum.exceptions import * Some more detailed tests. >>> vat.validate('CHE-107.787.577 ZZZ') Traceback (most recent call last): ... InvalidComponent: ... >>> vat.validate('ZZZ-107.787.577 MWST') Traceback (most recent call last): ... InvalidComponent: ... These have been found online and should all be valid numbers. >>> numbers = ''' ... ... CHE-1 76.814.97 5 MWST ... CHE-100.155.212 MWST ... CHE-105.048.256 MWST ... CHE-105.838.471 MWST ... CHE-105.969.179 MWST ... CHE-106.222.918 MWST ... CHE-107.787.577 IVA ... CHE-108.113.335 MwST ... CHE-108.446.096 MWST ... CHE-108.703.181 MWST ... CHE-109.578.122 MWST ... CHE-110.576.236 IVA ... CHE-110.576.236 TVA ... CHE-112.142.015 TVA ... CHE-112.487.804 MWST ... CHE-113.330.424 MWST ... CHE-115.606.778 MWST ... CHE-116.046.681 TPV ... CHE-116.274.213 MWST ... CHE-116.320.362 MWST ... CHE-164.589.300 MWST ... CHE-400.352.783 MWST ... ... ''' >>> [x for x in numbers.splitlines() if x and not vat.is_valid(x)] [] python-stdnum-1.8.1/tests/test_au_tfn.doctest0000644000000000000000000000241613223166521021360 0ustar rootroot00000000000000test_au_tfn.doctest - more detailed doctests for the stdnum.au.tfn module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.au.tfn module. It tries to validate a number of numbers that have been found online. >>> from stdnum.au import tfn >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 112474082 ... 459599230 ... 565051603 ... 812 239 321 ... 865414088 ... 876 543 210 ... 907974668 ... ... ''' >>> [x for x in numbers.splitlines() if x and not tfn.is_valid(x)] [] python-stdnum-1.8.1/tests/test_isbn.doctest0000644000000000000000000001561613223166521021045 0ustar rootroot00000000000000test_isbn.doctest - more detailed doctests for stdnum.isbn module Copyright (C) 2010-2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.isbn module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import isbn Tests for mangling and incorrect check digits. >>> isbn.validate('08515x-629-2') # added X in the middle Traceback (most recent call last): ... InvalidFormat: ... >>> isbn.validate('85152-629-1') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> isbn.validate('978-902453827X') # ISBN13 with X check digit Traceback (most recent call last): ... InvalidFormat: ... >>> isbn.validate('978-902453827') # invalid length Traceback (most recent call last): ... InvalidLength: ... >>> isbn.validate('7501031311309') # valid EAN, unknown bookland code Traceback (most recent call last): ... InvalidComponent: ... See if ISBN10 to 13 conversion works. >>> isbn.to_isbn13('978-9024538270') # ISBN13 should stay ISBN13 '978-9024538270' >>> isbn.to_isbn13('1 85798218 5') '978 1 85798218 3' >>> isbn.to_isbn13('1857982185') '9781857982183' >>> isbn.to_isbn13('1-85798-218-5') '978-1-85798-218-3' >>> isbn.validate(isbn.to_isbn13('1 85798218 5')) '9781857982183' >>> isbn.compact('1 85798218 5', convert=True) '9781857982183' >>> isbn.validate('1 85798218 5', convert=True) '9781857982183' Conversion of 9 digit ISBN to ISBN13 also works. >>> isbn.is_valid('12-345678-9') True >>> isbn.validate(isbn.to_isbn13('12-345678-9')) '9780123456786' See if ISBN13 to 10 conversion works. >>> isbn.to_isbn10('1-85798-218-5') # ISBN10 should stay ISBN10 '1-85798-218-5' >>> isbn.to_isbn10('978 1 85798218 3') '1 85798218 5' >>> isbn.to_isbn10('9781857982183') '1857982185' >>> isbn.to_isbn10('978-1-85798-218-3') '1-85798-218-5' >>> isbn.to_isbn10('979-20-1234567-8') # incorrect check digit Traceback (most recent call last): ... InvalidFormat: ... >>> isbn.to_isbn10('9791843123391') Traceback (most recent call last): ... InvalidComponent: ... Regrouping tests. >>> isbn.split('9024538270') # normal ISBN10 ('', '90', '245', '3827', '0') >>> isbn.split('9999678270') # ISBN10, unknown publisher in group ('', '99996', '', '7827', '0') >>> isbn.split('979-20-1234567-8') ('979', '', '', '201234567', '8') >>> isbn.split('5413170121522') # valid check digit, unknown prefix ('', '', '', '541317012152', '2') These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 0-19-963209-X ... 0-201-75041-4 ... 0-7503-0197-X ... 0-7506-9275-8 ... 0-8412-0473-X ... 0-8493-0464-4 ... 0-8493-0504-7 ... 0080423906 ... 013036004X ... 2-225-30547-1 ... 9284401348 ... 978-1-4200-4561-1 ... 978-1-4200-8032-2 ... 978-1-4397-3244-1 ... 978-1-4398-2494-8 ... 978-1-4398-8929-9 ... 978-1-55156-438-8 ... 978-90-208-3866-4 ... 978-90-208-5330-8 ... 978-90-345-0790-7 ... 978-90-345-1183-6 ... 978-90-345-1341-0 ... 978-90-345-2135-4 ... 978-90-345-2248-1 ... 978-90-345-3025-7 ... 978-90-345-3239-8 ... 978-90-345-3629-7 ... 978-90-345-4767-5 ... 978-90-345-4770-5 ... 978-90-345-4934-1 ... 978-90-345-5216-7 ... 978-90-345-5632-5 ... 978-90-345-6767-3 ... 978-963-88880-5-1 ... 9780 8872 76743 ... 9780231501132 ... 9780231506236 ... 9780231507387 ... 9780231508360 ... 9780231527682 ... 9780252092022 ... 9780271055206 ... 9780271055480 ... 9780271056289 ... 9780292717664 ... 9780292752252 ... 9780300058024 ... 9780300091960 ... 9780300097474 ... 9780300110654 ... 9780300115406 ... 9780300133523 ... 9780300156263 ... 9780470010037 ... 9780470012536 ... 9780470026977 ... 9780470027257 ... 9780470027424 ... 9780470058084 ... 9780470149676 ... 9780470180907 ... 9780470317372 ... 9780470358139 ... 9780470358184 ... 9780470358849 ... 9780470519578 ... 9780470706459 ... 9780470707296 ... 9780470723807 ... 9780470757659 ... 9780470760123 ... 9780470773154 ... 9780470774618 ... 9780470841785 ... 9780470863343 ... 9780470869697 ... 9780470987056 ... 9780470996027 ... 9780471024033 ... 9780471206910 ... 9780471221951 ... 9780471444541 ... 9780471445340 ... 9780471619772 ... 9780471623793 ... 9780471713425 ... 9780471718161 ... 9780471723950 ... 9780471740452 ... 9780471790594 ... 9780520205802 ... 9780520217676 ... 9780520230453 ... 9780520238879 ... 9780520238961 ... 9780520244306 ... 9780520255791 ... 9780520911543 ... 9780520928572 ... 9780520937529 ... 9780520939431 ... 9780520939769 ... 9780520945227 ... 9780520945821 ... 9780631211532 ... 9780631224068 ... 9780631225799 ... 9780632038961 ... 9780674061910 ... 9780727917867 ... 9780748621651 ... 9780748625208 ... 9780748633340 ... 9780773506688 ... 9780773528499 ... 9780773528673 ... 9780773530843 ... 9780773563438 ... 9780773563629 ... 9780773566217 ... 9780773567221 ... 9780773570498 ... 9780773572966 ... 9780773574533 ... 9780773582712 ... 9780773587861 ... 9780801447518 ... 9780801467677 ... 9780802009685 ... 9780802043108 ... 9780802078636 ... 9780802081544 ... 9780802088161 ... 9780802096456 ... 9780807845837 ... 9780807871584 ... 9780807871935 ... 9780807872192 ... 9780815730347 ... 9780816604777 ... 9780816606597 ... 9780816647774 ... 9780816655281 ... 9780816659760 ... 9780816665976 ... 9780816681600 ... 9780833035202 ... 9780833048646 ... 9780833059949 ... 9780833077851 ... 9780871545183 ... 9781111525545 ... 9781400821600 ... 9781400822232 ... 9781400826414 ... 9781400828623 ... 9781400828647 ... 9781400840861 ... 9781400842483 ... 9781400845934 ... 9781405131902 ... 9781405175791 ... 9781442602380 ... 9781442612877 ... 9781442613140 ... 9781442641198 ... 9781442644335 ... 9781442670174 ... 9781442670747 ... 9781442674202 ... 9781442685376 ... 9781442688636 ... 9781442693517 ... 9781442696716 ... 9781469606309 ... 9781571136329 ... 9781571138392 ... 9781610447775 ... 9781846156243 ... 9783527283217 ... 9783527298365 ... 9783527305797 ... 9783527307258 ... 9783527311125 ... 9783527406371 ... 9783527602803 ... 9783527604296 ... 9783527606757 ... 9783527615186 ... 9783527615759 ... 9783527619771 ... 9783527621781 ... 9783826334054 ... 9789622091252 ... 9789622099760 ... 9789814319089 ... 9789888052509 ... 9789888139590 ... 981-02-1046-9 ... 9814 253065 ... ... ''' >>> [x for x in numbers.splitlines() if x and not isbn.is_valid(x)] [] python-stdnum-1.8.1/tests/test_fr_siren.doctest0000644000000000000000000000246313156325253021721 0ustar rootroot00000000000000test_fr_siren.doctest - more detailed doctests for the stdnum.fr.siren module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.fr.siren module. >>> from stdnum.fr import siren >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 217601 145 ... 3 1 0 1 8 8 4 2 0 ... 350792008 ... 480318245 ... 500 674 056 ... 529290488 ... 738 205 269 ... 752136200 ... 752490334 ... 775 699 309 ... 775672272 ... 776 944 944 ... 820043784 ... ... ''' >>> [x for x in numbers.splitlines() if x and not siren.is_valid(x)] [] python-stdnum-1.8.1/tests/test_do_cedula.doctest0000644000000000000000000000635613223166521022032 0ustar rootroot00000000000000test_do_cedula.doctest - more detailed doctests for stdnum.do.cedula module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.do.cedula module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.do import cedula Some basic tests for invalid numbers: >>> cedula.validate('1234567890') Traceback (most recent call last): ... InvalidLength: ... >>> cedula.validate('123456789111') Traceback (most recent call last): ... InvalidLength: ... >>> cedula.validate('abcasdqwerz') Traceback (most recent call last): ... InvalidFormat: ... >>> cedula.validate('00114272360') '00114272360' >>> cedula.validate('00114272368') Traceback (most recent call last): ... InvalidChecksum: ... >>> cedula.validate('00105606543') '00105606543' >>> cedula.validate('00113918205') '00113918205' >>> cedula.validate('00113918204') Traceback (most recent call last): ... InvalidChecksum: ... >>> cedula.validate('00113918213') '00113918213' >>> cedula.validate('0011391820x') Traceback (most recent call last): ... InvalidFormat: ... >>> cedula.validate('x0113918205') Traceback (most recent call last): ... InvalidFormat: ... >>> cedula.validate('00113x18205') Traceback (most recent call last): ... InvalidFormat: ... Some numbers have an invalid check digit but were issued nonetheless. The following numbers should all be valid cedulas. >>> numbers = ''' ... ... 00000058035 ... 00000155482 ... 00100288929 ... 00100709215 ... 00100759932 ... 00101552784 ... 00101659661 ... 00101961125 ... 00103754365 ... 00105606543 ... 00108796883 ... 00113918205 ... 00113918213 ... 00114272360 ... 00114532330 ... 00117582001 ... 00121581800 ... 00161884001 ... 00162906003 ... 00163540003 ... 00166533003 ... 00200123640 ... 00200409772 ... 00207327056 ... 00208430205 ... 00222017001 ... 00274652001 ... 00289931003 ... 00300169535 ... 00301200901 ... 00356533003 ... 00516077003 ... 00524571001 ... 00633126023 ... 00686904003 ... 00757398001 ... 00800106971 ... 00848583056 ... 01100620962 ... 01200004166 ... 01200008613 ... 01600026316 ... 02300023225 ... 02600036132 ... 02800021761 ... 02800029588 ... 03103749672 ... 03800032522 ... 04600198229 ... 04700027064 ... 05400038776 ... 05500003079 ... 05500006796 ... 05500022399 ... 05500023407 ... 0710208838 ... 07600000691 ... 09421581768 ... 10061805811 ... 12019831001 ... 22321581834 ... 22400022111 ... 40200401324 ... 90001200901 ... ... ''' >>> [x for x in numbers.splitlines() if x and not cedula.is_valid(x)] [] python-stdnum-1.8.1/tests/test_imei.doctest0000644000000000000000000000425713156325253021040 0ustar rootroot00000000000000test_imei.doctest - more detailed doctests for stdnum.imei module Copyright (C) 2010, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.imei module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import imei Should be valid numbers: >>> imei.validate('49-015420-323751') '49015420323751' >>> imei.validate('35-209900-176148-1') '352099001761481' >>> imei.validate('35-209900-176148-23') '3520990017614823' >>> imei.validate('350077-52-323751-3') '350077523237513' >>> imei.validate('354178036859789') '354178036859789' These are normal variations that should just work. Getting the type: >>> imei.imei_type('35686800-004141-20') 'IMEISV' >>> imei.imei_type('35-417803-685978-9') 'IMEI' >>> imei.imei_type('35-417803-685978-2') is None # invalid check digit True >>> imei.imei_type('3568680000414120') 'IMEISV' The format() function can add the check digit if needed. It should leave alone existing check digits (even invalid ones) and only add them to the 14 digit format. >>> imei.format('354178036859789') '35-417803-685978-9' >>> imei.format('35417803685978') '35-417803-685978' >>> imei.format('354178036859786', add_check_digit=True) '35-417803-685978-6' >>> imei.format('35417803685978', add_check_digit=True) '35-417803-685978-9' >>> imei.format('35686800-004141', add_check_digit=True) '35-686800-004141-8' >>> imei.format('35686800-004141-20', add_check_digit=True) '35-686800-004141-20' python-stdnum-1.8.1/tests/test_lei.doctest0000644000000000000000000000703213223166521020654 0ustar rootroot00000000000000test_lei.doctest - more detailed doctests for the stdnum.lei module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.lei module. >>> from stdnum import lei >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 0YPKKE5F0QW6RC51HE09 ... 1YTX3EVB2EG3PFFYOI09 ... 2138001CY61HDFJ5ZA27 ... 2138001KT6BLFA2SBA38 ... 213800699Y1P5GMARI40 ... 213800DIH9U9264UW504 ... 213800F25B5OHORTSI52 ... 213800KLHG79RR4RVR16 ... 213800KNMQ53LTJQBV92 ... 213800KUD8LAJWSQ9D15 ... 213800Q3CZMOFF9OE643 ... 213800REANX5GCW7AD17 ... 213800THICTTOSR1N623 ... 213800WWDZ5X6SRDF737 ... 213800WWNILTD76WIX72 ... 2594005N6NMJM5WSGE40 ... 2YXI7YIWYFWZG3QHF204 ... 315700EBSH5FQO0A2E52 ... 315700UUG8ME8T3NNN23 ... 337KMNHEWWWR6B7Q7W10 ... 391200J69OE1D0B3ZQ28 ... 3YO0DHNPQLJN0PYQXZ94 ... 5299007DT4PDT06SZM22 ... 5299008A9PK6IQEWE268 ... 529900TODVLNUTNSYF94 ... 529900UJX7YWK7YK5Z47 ... 529900WWBCVXKSBVKS40 ... 529900YGP0ANNLITEF34 ... 529900Z5WSAAJ3OTQU15 ... 549300001TP7X0VE9866 ... 54930000YBLXA2M5DV57 ... 54930007KCQLYRQLSU30 ... 5493000MYJ7H0E3KKG91 ... 54930017EFV0P0QWP015 ... 54930018TDVHWGLNZ954 ... 5493001BD9HCE74UH411 ... 5493004NJH3JGW7MVS62 ... 5493004QRTOY0WERIJ41 ... 54930066SVUPVIHE5U21 ... 5493006O7NV2IXKS4288 ... 5493007715JF1TY3M614 ... 5493007HHN4G8PA5MS11 ... 5493007PWOC8DW5KJM17 ... 5493008EWHY43YYP8R93 ... 5493008VZPPOQ8Y63J10 ... 549300EF33KFNMISKX67 ... 549300EUCOJ6XD50YM58 ... 549300FR4NAW0G8UFI80 ... 549300FRSHK45MQIBL14 ... 549300GF102RMNYVKB19 ... 549300H45ZBEKCVW0U40 ... 549300IDQBTGQCXJ5239 ... 549300IWFWPPXW87ZE72 ... 549300J8EHPRYOKF3869 ... 549300JMX497I8GHDT24 ... 549300LHQ6XOM0JUW406 ... 549300M3SJFSFVXG6X69 ... 549300NV50SCQMF8OC75 ... 549300O2F2PCD1D7PZ95 ... 549300O7ZFXE3YT1GH43 ... 549300OIVSR86BGJGT75 ... 549300OM88E30DLQTD78 ... 549300PATTPXQ660N070 ... 549300PFL3HXXEEOHS50 ... 549300SILMFILZ8Y4427 ... 549300SOEQOO5LPOD659 ... 549300TZLPZOAIIMJF22 ... 549300UKFZ3BD7TNKI26 ... 549300V6KHTZPJ4YVC33 ... 549300V6LZG40THFO450 ... 549300V885B988S1LJ49 ... 549300WTO22HTNIA0Z19 ... 549300X8N7DWRL7VBF44 ... 549300XBRMGPGXSSB667 ... 549300YBGK6ESSY6G874 ... 549300YPYUJBJGNGQO81 ... 5967007LIEEXZX850W58 ... 6354004RBF2LINM9VH78 ... 635400ID2ZOCFWX3LH70 ... 635400TSTDEIQBVFXR91 ... 7245005BAK6R2JQ1LU94 ... 7245006M2FC6DPMC6427 ... 724500PVWFYKZIJQAN07 ... 815600065E4EA9D08446 ... 8156004572781E3F9023 ... 815600E6B00CF4DBB722 ... 815600FC0039E657C985 ... 815600FF404253C67598 ... 959800Q824KQDPCZPV58 ... 96950091S6OFL0N15G96 ... 969500BL7YE3PXKDYT35 ... 969500YLLNN3TK3JSF66 ... 969500ZAUC3Z50DNZV77 ... FIR47I6FEYKYNJBYW622 ... GU00WJXK6DH4VHHFXQ16 ... NMMFE09VSMAF2TU16C07 ... RCJ8N5WH4YK7SVJ4BO12 ... TGXITECVNFSIBV316765 ... WT03B8BB1IX8WI9ZGV02 ... XNIO7KHWR2WD0BP1F484 ... ... ''' >>> [x for x in numbers.splitlines() if x and not lei.is_valid(x)] [] python-stdnum-1.8.1/tests/test_ch_ssn.doctest0000644000000000000000000000226713156325253021371 0ustar rootroot00000000000000test_ch_ssn.doctest - more detailed doctests for stdnum.ch.ssn module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ch.ssn module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.ch import ssn Extra tests for length checking and corner cases: >>> ssn.validate('54165168') # valid EAN-8 but incorrect length Traceback (most recent call last): ... InvalidLength: ... python-stdnum-1.8.1/tests/test_cusip.doctest0000644000000000000000000001027213156325253021232 0ustar rootroot00000000000000test_cusip.doctest - more detailed doctests for the stdnum.cusip module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.cusip module. It tries to validate a number of numbers that have been found online. >>> from stdnum import cusip >>> from stdnum.exceptions import * Number should not use O (captial o) or I (capital 1) to avoid confusion with 0 and 1: >>> cusip.validate('0O141T575') Traceback (most recent call last): ... InvalidFormat: ... >>> cusip.validate('257I32103') Traceback (most recent call last): ... InvalidFormat: ... These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 00078H125 ... 00080Y348 ... 00141H409 ... 00141M572 ... 00141T577 ... 00141V267 ... 00142F832 ... 00142K500 ... 00170J862 ... 00170K109 ... 00170M873 ... 00758M261 ... 024524746 ... 024932808 ... 024934408 ... 025081704 ... 025081860 ... 02631C817 ... 068278704 ... 068278878 ... 06828M405 ... 101156602 ... 119804102 ... 12628J600 ... 140543828 ... 192476109 ... 19765J830 ... 19765N401 ... 19765Y852 ... 207267105 ... 23336W809 ... 23337G134 ... 23337R502 ... 23338F713 ... 245908660 ... 245917505 ... 24610B859 ... 25155T528 ... 25156A668 ... 25157M778 ... 25159K309 ... 25159L745 ... 25264S403 ... 254939424 ... 257132100 ... 258618701 ... 261967103 ... 261967822 ... 261986566 ... 265458513 ... 265458570 ... 269858817 ... 277902565 ... 277905436 ... 29372R208 ... 313923302 ... 314172743 ... 315792598 ... 315805325 ... 315807651 ... 315911875 ... 315920579 ... 316069103 ... 31607A208 ... 316146257 ... 316175850 ... 31638R204 ... 316390277 ... 316390335 ... 316390640 ... 316390681 ... 320600109 ... 320604606 ... 320917107 ... 353496854 ... 353535107 ... 354128704 ... 354723769 ... 36158T506 ... 409902624 ... 416649507 ... 416649606 ... 425888104 ... 42588P825 ... 42588P882 ... 44929K630 ... 461418691 ... 465898682 ... 469785109 ... 471023531 ... 47803M663 ... 4812A4427 ... 4812C0548 ... 52106N335 ... 52106N442 ... 52106N632 ... 52106N657 ... 543912604 ... 543913305 ... 552984601 ... 552986309 ... 552986853 ... 557492428 ... 56063J849 ... 56063U851 ... 56166Y438 ... 561709692 ... 561717661 ... 57056B ZW1 ... 575719109 ... 592905756 ... 61744J499 ... 640917209 ... 640917407 ... 64122M506 ... 643642200 ... 647108414 ... 648018828 ... 650914203 ... 66537Y165 ... 67065R408 ... 67065R812 ... 670678762 ... 670690767 ... 670700608 ... 670725738 ... 670729599 ... 670729730 ... 680029667 ... 68583W507 ... 704329101 ... 70472Q302 ... 70472Q880 ... 72200Q232 ... 72201F383 ... 72201F458 ... 72201M800 ... 72201T664 ... 72201U430 ... 741481105 ... 741486104 ... 74149P390 ... 74149P648 ... 74149P689 ... 74149P820 ... 742935521 ... 742935547 ... 74316P207 ... 743185373 ... 743185464 ... 74318Q864 ... 74683L508 ... 749255121 ... 74972H200 ... 74972H283 ... 74972H390 ... 74972H598 ... 74972K666 ... 76628T496 ... 77956H302 ... 783554470 ... 783554728 ... 784924458 ... 803431105 ... 803431410 ... 829334101 ... 82980D400 ... 884116872 ... 890085327 ... 890085871 ... 89354D874 ... 904504560 ... 904504586 ... 912810EQ7 ... 912828C24 ... 912828EG1 ... 912828HA1 ... 912828KD1 ... 912828UA6 ... 920461209 ... 92646A252 ... 92913K645 ... 92913K884 ... 92913L775 ... 92913R822 ... 92914A661 ... 93208V106 ... 936793306 ... 936793504 ... 94975P686 ... 94984B108 ... 94984B538 ... 949915177 ... 949915557 ... 957904584 ... 969251719 ... 969251834 ... 984281204 ... Y0488F100 ... Y27257149 ... Y44425117 ... ... ''' >>> [x for x in numbers.splitlines() if x and not cusip.is_valid(x)] [] python-stdnum-1.8.1/tests/test_rs_pib.doctest0000644000000000000000000000473213223166521021365 0ustar rootroot00000000000000test_rs_pib.doctest - more detailed doctests for the stdnum.rs.pib module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.rs.pib module. >>> from stdnum.rs import pib >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 100000303 ... 100081000 ... 100081235 ... 100081260 ... 100081341 ... 100081649 ... 100081882 ... 100081903 ... 100082658 ... 100084073 ... 100084354 ... 100085087 ... 100085118 ... 100085175 ... 100085386 ... 100086047 ... 100086549 ... 100086688 ... 100088399 ... 100088487 ... 100088518 ... 100089182 ... 100089199 ... 100089480 ... 100089990 ... 100090168 ... 100090301 ... 100090545 ... 100109782 ... 100109959 ... 100110287 ... 100110650 ... 100110756 ... 100110949 ... 100111525 ... 100112202 ... 100112995 ... 100113109 ... 100113117 ... 100113184 ... 100113561 ... 100125276 ... 100125305 ... 100125313 ... 100125799 ... 100126349 ... 100185801 ... 100185810 ... 100187083 ... 100187243 ... 100187392 ... 101230316 ... 101230611 ... 101230783 ... 101765372 ... 101827944 ... 101895156 ... 101895365 ... 101895638 ... 101895994 ... 101896698 ... 101896913 ... 101896972 ... 101897641 ... 101897692 ... 101897949 ... 101898689 ... 102056361 ... 102097064 ... 102194170 ... 102324017 ... 102372731 ... 102883324 ... 102890888 ... 102960137 ... 103054816 ... 103094132 ... 103180484 ... 103311203 ... 103323675 ... 103338275 ... 103421003 ... 103428256 ... 103465975 ... 103470618 ... 103521454 ... 103539751 ... 103622128 ... 103669676 ... 103728660 ... 103747316 ... 103809880 ... 103837987 ... 103853451 ... 103883410 ... 104007533 ... 104044942 ... 104064625 ... 104079900 ... 104111220 ... ... ''' >>> [x for x in numbers.splitlines() if x and not pib.is_valid(x)] [] python-stdnum-1.8.1/tests/test_ee_ik.doctest0000644000000000000000000000555213156325253021170 0ustar rootroot00000000000000test_ee_ik.doctest - test for estonian personal id Copyright (C) 2015 Tomas Karasek Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >>> from stdnum.ee import ik >>> import stdnum.exceptions >>> ik.validate('36805280109') '36805280109' >>> ik.is_valid('36805280109') True >>> ik.calc_check_digit('36805280109') '9' >>> ik.validate('06805280106') # invalid first digit Traceback (most recent call last): ... InvalidComponent: ... >>> ik.validate('36805280108') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> ik.validate('368052801099') Traceback (most recent call last): ... InvalidLength: ... >>> ik.get_birth_date('36805280109') datetime.date(1968, 5, 28) >>> ik.get_birth_date('16805280107') datetime.date(1868, 5, 28) >>> ik.get_birth_date('51205280105') datetime.date(2012, 5, 28) >>> ik.get_birth_date('81205280108') datetime.date(2112, 5, 28) >>> ik.get_birth_date('06805280106') # invalid first digit Traceback (most recent call last): ... InvalidComponent: ... >>> ik.get_birth_date('38102290106') # non-existing date Traceback (most recent call last): ... InvalidComponent: ... >>> ik.get_gender('36805280109') 'M' >>> ik.get_gender('46805280103') 'F' >>> ik.get_gender('98102290101') # invalid first digit Traceback (most recent call last): ... InvalidComponent: ... >>> numbers = """ ... 36205030034 ... 36606130166 ... 38002090113 ... 36703010079 ... 36412140053 ... 37105250048 ... 35806110178 ... 38411280151 ... 38004160054 ... 37406220030 ... 37207010076 ... 46104090101 ... 47306160017 ... 35712020095 ... 35512240278 ... 37111070056 ... 36003050128 ... 34508136020 ... 37112300117 ... 37205120111 ... 36708120106 ... 36204130100 ... 36805280109 ... 36404240119 ... 37609300174 ... 38407170099 ... 35903140121 ... 36912050058 ... 36706060097 ... 37909180161 ... 37210220129 ... 35803140053 ... 37709190107 ... 36306200109 ... 36208130099 ... 37611280079 ... 35806190146 ... 44909210102 ... 37104020141 ... 35907150159 ... 36412100145 ... 49105080018 ... 37406110083 ... 36304020091 ... 37106220087 ... 34706045216 ... 37503240119 ... 38310150127 ... 46708270050 ... """ >>> [x for x in numbers.splitlines() if x and not ik.is_valid(x)] [] python-stdnum-1.8.1/tests/test_de_wkn.doctest0000644000000000000000000000645213156325253021363 0ustar rootroot00000000000000test_de_wkn.doctest - more detailed doctests for the stdnum.de.wkn module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.de.wkn module. It tries to validate a number of numbers that have been found online. >>> from stdnum.de import wkn >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 934056 ... A0Q2A9 ... 978273 ... 989756 ... A0D85Q ... A0MUD3 ... A0F67A ... 622925 ... A0ESSP ... A0M82M ... 200435 ... 895705 ... A0MMMK ... 989226 ... 977858 ... A0DNG5 ... A0LGM2 ... 701932 ... A0H0UT ... 989127 ... A0JM7H ... 516810 ... 977023 ... 971043 ... 865742 ... A0MYFQ ... A1EWXW ... 591961 ... 980276 ... A0RNQ5 ... A0BMA4 ... 531713 ... A0F6EB ... A0MUHB ... 975694 ... A1J0ZD ... A0M11P ... A0MNX5 ... A0F5T6 ... A0MR7J ... 974839 ... 972001 ... A0M16T ... 592895 ... 977974 ... A0HGWD ... A0LHCL ... 691298 ... DBX0HY ... 986732 ... 974956 ... 973275 ... ETFL29 ... 857534 ... A0MVL0 ... A0CBA2 ... A0NGX0 ... A0M92M ... A0MSAG ... A0NFHK ... A0Q35X ... 513010 ... 921418 ... 531435 ... A0BL1D ... A0MKA9 ... 976169 ... 779374 ... 847519 ... A0HG5F ... 986868 ... 847347 ... 971929 ... A0DJ6U ... 847910 ... A0JMLN ... 701276 ... 580515 ... 986881 ... A0M2BY ... A0M93X ... 989427 ... A0LE9R ... 848390 ... 980457 ... DWS0UR ... 977187 ... 850667 ... 930920 ... 987906 ... A0MY8N ... 970047 ... A0M1NX ... 933368 ... DBX0F1 ... 848186 ... A0J3GM ... DBX0HC ... A0Q09X ... 988890 ... 589684 ... A0KE7P ... A0EAD3 ... DBX1F1 ... A1JJTG ... A0EQ91 ... A0KD2Q ... 971117 ... 973210 ... A0F6WG ... A0MLJK ... A0M46B ... A0HNPN ... 848066 ... A0LGQN ... DBX0G7 ... LYX0AB ... A0LGWU ... A0RDGC ... 848639 ... 589006 ... A0LEEE ... 552538 ... 977025 ... 531416 ... A0DJ49 ... A0REJL ... A0YE2R ... 251119 ... 693287 ... A0MJP7 ... 577345 ... 973228 ... 866953 ... A0MWAL ... 113596 ... 847426 ... 722538 ... DK0EBQ ... 603005 ... A1H6H7 ... 593396 ... 987972 ... 541779 ... 750437 ... 588798 ... A0Q60E ... A0NC6Z ... A0LGCU ... 532018 ... 257575 ... 629236 ... A1J0BH ... 515231 ... 851143 ... LYX0MG ... 801536 ... 888323 ... 976956 ... 853836 ... 723890 ... A0BL78 ... 971915 ... A0YCYF ... A0J3WX ... 847661 ... A0X970 ... 976375 ... A0J3W3 ... 989844 ... A0B5LC ... 620440 ... LYX0CB ... 795322 ... 848534 ... 677496 ... 727516 ... 973806 ... 971872 ... 859123 ... 970578 ... 675179 ... 976999 ... A0HF4G ... 871970 ... 978945 ... 691660 ... A0DPBF ... 930424 ... 978047 ... 847665 ... 971534 ... A0BMAJ ... A0NC87 ... A1JJP8 ... A0M2EB ... A0EQYQ ... 263233 ... ... ''' >>> [x for x in numbers.splitlines() if x and not wkn.is_valid(x)] [] python-stdnum-1.8.1/tests/test_es_referenciacatastral.doctest0000644000000000000000000002103713223166521024575 0ustar rootroot00000000000000test_es_referenciacatastral.doctest - more detailed doctests Copyright (C) 2016 David García Garzón Copyright (C) 2015-2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.es.referenciacatastral module. >>> from stdnum.es import referenciacatastral >>> from stdnum.exceptions import * The parcel digits are structured differently for urban, non-urban or special (infrastructure) cases: * Urban states * 7 digits: (numeric) block sequence within cartographic sheet, and parcel sequence within the block. * 7 digits: (alphanum) cartographic sheet where the block centroid is. * Non-urban states: * 2 digits: (numeric) Province or more exactly, ministerial delegation * 3 digits: (numeric) Municipality * 1 digits: (letter) Sector * 3 digits: (numeric) Polygon * 5 digits: (numeric) Parcel * Special states: * BICE code: (2 digits, a number and a letter) * Energy infrastructure * 1E: Thermal power plant * 1G: Regasification terminal * 1R: Oil refinery * 1N: Nuclear power plant * 1H: Hydro power plant * Hydro * 2P: Dam * Roads and highways * 3A: Tolled highway * 3C: Tolled road * 3T: Tolled tunnel * Ports and airports * 4A: Airports * 4P: Commercial ports * Province (major if many) (2 digits) * Municipality (3 digits) * Scope (1 letter) * E: National * A: Autonomous Community * P: Province * M: Municipality * Number of municipalities it extends (2 digits, numbers) * Abbreviated denomination (4 digits, letters) An online validator can be found at https://www1.sedecatastro.gob.es/CYCBienInmueble/OVCBusqueda.aspx This is a constructed example of a Referencia Catastral with an Ñ in it. It seems that unicode literals do not work so we are escaping Ñ. >>> referenciacatastral.calc_check_digits('9872023 ÑH5797S 0001') 'WP' >>> referenciacatastral.calc_check_digits(u'9872023 \xd1H5797S 0001') 'WP' >>> referenciacatastral.validate('9872023 ÑH5797S 0001 WP') == '9872023ÑH5797S0001WP' True >>> referenciacatastral.validate(u'9872023 \xd1H5797S 0001 WP') == u'9872023\xd1H5797S0001WP' True These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 000100100QE45D0001GA ... 000100100TH44D0001GX ... 000700100UJ13C0001XY ... 0014001QD4901S0001LP ... 001700100QC04D0001AF ... 002100100QD03C0001HH ... 0307813QD3100N0001LW ... 0376902QE3607N0001UM ... 0412501QD0301S0001BQ ... 0426012TJ3502N0001SQ ... 0474001QE5307C0033DW ... 0474001QE5307C0060IB ... 0474001QE5307C0067GR ... 0474001QE5307C0149YK ... 0553304TK9405S0001GR ... 06011A012002450000QE ... 06011A045000920000QX ... 06016A012090090000ZI ... 06051A005000200000ZJ ... 06060A040001360000XM ... 06063A002000200001SL ... 06063A015000110000AX ... 06074A005005560000BR ... 06079A002002810000JX ... 06080A504000390000II ... 06080A507000270000IK ... 06083A045001460000ZM ... 06083A136002390000UH ... 06084A508000290000QT ... 06084A511000950000QL ... 06085A009000130000YK ... 06086A023000710000PG ... 06092A010090070000XY ... 06105A014002400000QA ... 06127A011000890000LG ... 06150A022002960000YK ... 06151A008000450000PE ... 06153A002000420000KQ ... 06154A016090110000XD ... 06160A030009840000AJ ... 06162A009000770000LK ... 06900A228000090000EB ... 06900A228000110000EA ... 06900A230000050000EG ... 0736601QE2503N0002XI ... 0786418PD6508N0001GB ... 0791405PD6509S0001RX ... 0811056TJ8201S0001QF ... 0847501PE8504N0001EF ... 0895009TK5309N0001DA ... 0939216PD5603N0001BB ... 0989801QC2308N0001LY ... 10010A012005070000SA ... 10033A017000040000AH ... 10036A001002140000MU ... 10042A005090420000SX ... 10063A006000030000EW ... 10083A002030290000DX ... 10103A002002490000IE ... 10105A007004020000HQ ... 10118A004030320000PY ... 10122A032090100000FH ... 10134A009000010000RY ... 10149A011090100000YZ ... 10178A034090180000JE ... 1087910TK7118N0001FS ... 10900A044090170000MU ... 1099107TJ3419N0001RR ... 1344504PD5614S0001XE ... 1468103QC6316N0001PQ ... 1470436TJ5117S0001EP ... 15001A005004610000JK ... 15001A005004620000JR ... 15037A024005060000PX ... 1665311QC6316S0001OO ... 1811701QC3711S0001RM ... 1927510QD2812N0001GJ ... 2014801QC3721S0001IR ... 2019001QD2821N0001QR ... 2035116PD7423N0001WL ... 2070105TK4027A0001XW ... 2093020TK8129S0005RA ... 2106409QE0520N0001IO ... 2209001TK5620N0001LL ... 2217331QC3721N0001GL ... 2272003TJ5127S0001JF ... 2335208QC5823N0001YD ... 2372801QC0427S0001MO ... 2380105PC8328S0001PS ... 2409516TK5620N0001HL ... 2444001QD2724C0001EB ... 2595010TK8129N0001XX ... 2641303TK5424S0001WH ... 2667407TJ5126N0001RS ... 2735401PD7423N0001AL ... 2750203PC9625S0001BA ... 2787101TK8128N0001MT ... 2792003TK8129S0001QU ... 2792020TJ6029S0001IO ... 2911401TJ4521S0001BS ... 2951205TJ7025S0001RX ... 3012723TJ4531S0001DH ... 3065602TH8836N0001KA ... 3117006QC3731N0001KM ... 3135901PD7033E0001MF ... 3174922NH0737S0011QS ... 3174932NH0737S0001AT ... 3178101UJ2337N0001IB ... 3327002TJ6332N0001QH ... 3368022PE8136N0001LJ ... 3390803PC9439S0001XR ... 3456202TK7435N0001OU ... 3575302TJ6437N0001QF ... 3809537QC3230N0001JR ... 4028713TK8142N0001TE ... 4045111TK8444N0001KY ... 4443202PD7044C0068ZB ... 4471131PD7047A0001DR ... 4578201UJ0147N0001HD ... 4637801TK6843N0001WI ... 4878424TK6347N0001GT ... 4926002QE4142N0001UP ... 50210A003001510000LT ... 5034623PC6853S0001MO ... 5078102VK8957N0001TB ... 5172401PD7057A0001HI ... 5215006QC5751N0001EO ... 5238069TJ6253N0001PD ... 5335702QE3853N0001AI ... 5342201QC2854S0001WF ... 5347806UK9354N0001RU ... 5349709QC2854N0001FY ... 5410808QD5451S0001SJ ... 5417221QC5751N0001JO ... 5443405UK9354S0001BG ... 5468703QC3356N0001JR ... 5539105PC6853N0001KQ ... 5552401TK6255S0001YQ ... 5640007TJ6254S0001FG ... 5670823QC3357S0001AY ... 5867418QD1256N0001UD ... 5967307QC0256N0001GO ... 5972003QD1257S0001MG ... 6026813QD2762E0001WB ... 6043208PD9164C0001GI ... 6045303QE1564N0001UD ... 6050201PD7065A0001KQ ... 6061002QC2566S0001DF ... 6117611QC4261N0001UX ... 6229101QD2762G0001UG ... 6284203TH6368S0001UH ... 6320001QD2161N0001LI ... 6326404QD2762E0001MB ... 6380501UH0868S0001LT ... 6396405TJ8269N0001QT ... 6407102TJ8360N0001SK ... 6528901UJ0262N0001PP ... 6534011PC9763S0001YZ ... 6537302PD7063H0001WU ... 6595333QD0069N0001OM ... 6642023PD7064F0001SY ... 6684201VK8968S0002RR ... 6743701QD2764D0001IX ... 6795121QD0069N0008EU ... 6821105TK5662S0001QI ... 6822811QD2162S0001GP ... 6837203FT3063N0001YP ... 6893505QC5569S0001LO ... 6991224PD3869S0001FW ... 7076102TJ5177N0001ZE ... 7174002QD2077S0001XW ... 7244002PD7074C0001QY ... 7282901TJ5178S0001BT ... 7383502VK8978S0001PU ... 7384201TJ5178S0012WD ... 7384201TJ5178S0019OB ... 7384201TJ5178S0043QS ... 7479113QE2477N0001UY ... 7499524NH0179N0001RJ ... 7570012TJ4377S0001PO ... 7640222QE4374B0001FR ... 7682601TJ5178S0001XT ... 7749401PD7074H0001HT ... 7865002TJ4376N0001TU ... 7865004TJ4376N0001MU ... 7865006TJ4376N0001KU ... 7977802TJ5177N0001TE ... 8327413PE8482N0001HU ... 8344202PC6684S0001FT ... 8354003PD7085C0001RR ... 8384416TJ8688S0001IQ ... 8579507NH0387N0001QB ... 8645036TJ5984N0001TL ... 8670604TJ4587S0004BE ... 8679007TJ5187N0001LU ... 8696402TH7889N0001XQ ... 8696802TH7889N0001GQ ... 8701105PD7180B0001AU ... 8701110PD7180B0001YU ... 8788845QC2588H0001IJ ... 8796005QD2089N0001WO ... 8796022QD2089N0001OO ... 8827314QD5282N0001RT ... 8843501PC7484S0001KU ... 8910403QD3481S0001LT ... 8990307TH7889S0001OO ... 9013602QD2191S0001ET ... 9165501QE4396E0001YR ... 9201801QD2190S0001PA ... 9205301VL8090N0001PW ... 9265801QE4396E0001PR ... 9327401QE3592N0001JG ... 9655311TK9195N0001OJ ... 9712301QD2191S0001DT ... 9811901DS3191S0001QY ... 9811901TN8391S0001QM ... 9815402PD9391N0001PO ... 9854802PD7195D0001MX ... 9872023 VH5797S 0001 WX ... 9953001PD7195D0001GX ... 9988220VK8998N0001JU ... 9996812TJ9699N0001ZE ... ... ''' >>> [x for x in numbers.splitlines() if x and not referenciacatastral.is_valid(x)] [] python-stdnum-1.8.1/tests/test_meid.doctest0000644000000000000000000001330513156325253021025 0ustar rootroot00000000000000test_meid.doctest - more detailed doctests for stdnum.meid module Copyright (C) 2010, 2011, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.meid module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import meid IMEI numbers without the software version (but optionally with a check digit) should be valid numbers: >>> meid.validate('49-015420-323751') '49015420323751' >>> meid.validate('35-209900-176148-1') '35209900176148' >>> meid.validate('35-209900-176148-2') Traceback (most recent call last): ... InvalidChecksum: ... MEIDs can be represented as HEX strings (with and without check digit): >>> meid.validate('AF 01 23 45 0A BC DE') 'AF0123450ABCDE' >>> meid.validate('AF 01 23 45 0A BC DE C') 'AF0123450ABCDE' >>> meid.validate('AF 01 23 45 0A BC DE D') Traceback (most recent call last): ... InvalidChecksum: ... Also, MEIDs can be represented in decimal format (with and without check digit): >>> meid.validate('29360 87365 0070 3710') 'AF0123450ABCDE' >>> meid.validate('29360 87365 0070 3710 0') 'AF0123450ABCDE' >>> meid.validate('29360 87365 0070 3710 1') Traceback (most recent call last): ... InvalidChecksum: ... The validate() method should be fairly robust against invalid junk passed: >>> meid.validate('29360 ABCDE 0070 3710') Traceback (most recent call last): ... InvalidFormat: ... >>> meid.validate('GF 01 23 45 0A BC DE') Traceback (most recent call last): ... InvalidFormat: ... Decimal format MEIDs with manufacturer code exceeding 32-bits should fail. >>> meid.validate('99999 99999 0070 3710 4') Traceback (most recent call last): ... InvalidComponent: ... Decimal format MEIDs with serial number exceeding 24-bits should fail. >>> meid.validate('29360 87365 9999 9999 4') Traceback (most recent call last): ... InvalidComponent: ... The compact method should convert to HEX if needed and can optionally leave the check digit intact. >>> meid.compact('49-015420-323751') '49015420323751' >>> meid.compact('35-209900-176148-2') '35209900176148' >>> meid.compact('35-209900-176148-2', strip_check_digit=False) '352099001761482' >>> meid.compact('af 01 23 45 0a bc de') 'AF0123450ABCDE' >>> meid.compact('AF 01 23 45 0A BC DE C') 'AF0123450ABCDE' >>> meid.compact('AF 01 23 45 0A BC DE C', strip_check_digit=False) 'AF0123450ABCDEC' >>> meid.compact('29360 87365 0070 3710') 'AF0123450ABCDE' >>> meid.compact('29360 87365 0070 3710 0') 'AF0123450ABCDE' >>> meid.compact('29360 87365 0070 3710 0', strip_check_digit=False) 'AF0123450ABCDEC' The format() function can add the check digit if needed. It should leave alone existing check digits (even invalid ones). >>> meid.format('35-209900-176148-2') '35 20 99 00 17 61 48 2' >>> meid.format('35-209900-176148') '35 20 99 00 17 61 48' >>> meid.format('35-209900-176148', add_check_digit=True) '35 20 99 00 17 61 48 1' >>> meid.format('af0123450abcDE') 'AF 01 23 45 0A BC DE' >>> meid.format('af0123450abcDEC', add_check_digit=True) 'AF 01 23 45 0A BC DE C' The format() function can also convert to decimal, recalculating the check digit if needed (conversion will silently correct incorrect check digits): >>> meid.format('35-209900-176148', format='dec') '08913 28768 0153 2232' >>> meid.format('35-209900-176148', format='dec', add_check_digit=True) '08913 28768 0153 2232 3' >>> meid.format('35-209900-176148-9', format='dec') '08913 28768 0153 2232 3' >>> meid.format('af0123450abcDE', format='dec') '29360 87365 0070 3710' >>> meid.format('af0123450abcDE', format='dec', add_check_digit=True) '29360 87365 0070 3710 0' >>> meid.format('af0123450abcDEC', format='dec') '29360 87365 0070 3710 0' >>> meid.format('293608736500703710', format='dec') '29360 87365 0070 3710' >>> meid.format('293608736500703710', format='dec', add_check_digit=True) '29360 87365 0070 3710 0' >>> meid.format('2936087365007037106', format='dec') '29360 87365 0070 3710 6' The format() function can also convert to hex, recalculating the check digit if needed (conversion will silently correct incorrect check digits): >>> meid.format('35-209900-176148', format='hex') '35 20 99 00 17 61 48' >>> meid.format('35-209900-176148', format='hex', add_check_digit=True) '35 20 99 00 17 61 48 1' >>> meid.format('35-209900-176148-9', format='hex') '35 20 99 00 17 61 48 9' >>> meid.format('af0123450abcDE', format='hex') 'AF 01 23 45 0A BC DE' >>> meid.format('af0123450abcDE', format='hex', add_check_digit=True) 'AF 01 23 45 0A BC DE C' >>> meid.format('af0123450abcDEF', format='hex') 'AF 01 23 45 0A BC DE F' >>> meid.format('293608736500703710', format='hex') 'AF 01 23 45 0A BC DE' >>> meid.format('293608736500703710', format='hex', add_check_digit=True) 'AF 01 23 45 0A BC DE C' >>> meid.format('2936087365007037106', format='hex') 'AF 01 23 45 0A BC DE C' The conversion function should work regardless of the check digit and whether decimal or hex representation is used. >>> meid.to_pseudo_esn('AF 01 23 45 0A BC DE C') '8016B128' >>> meid.to_pseudo_esn('29360 87365 0070 3710') '8016B128' python-stdnum-1.8.1/tests/test_eu_eic.doctest0000644000000000000000000000555413223166521021343 0ustar rootroot00000000000000test_eu_eic.doctest - more detailed doctests for the stdnum.eu.eic module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.eu.eic module. It tries to validate a number of EIC numbers that have been found online. >>> from stdnum.eu import eic These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 10T-NO-SE-00005Q ... 10Y1001A1001B05V ... 10YAT-APG------L ... 10YCH-SWISSGRIDZ ... 10YDE-RWENET---I ... 10YDE-VE-------2 ... 11WD8JAEN1L---AD ... 11XE-WERK-STERNP ... 11XEMRHAENDLER-M ... 11XNATGAST00000G ... 11XNEW-ENERGIE-8 ... 11XWEMAG-------Q ... 13X-IKBAG-NV---3 ... 14X-VES--------8 ... 18X0000000002OOE ... 18X0000000003VQM ... 18XAIGVA-12345-G ... 18XALMAL-1234-12 ... 18XCEG-123456-1F ... 18XCEPSA-12345-6 ... 18XEACCO-12345-K ... 18XENERS-12345-Q ... 18XEPCSA-12345-S ... 18XERUYA-12345-5 ... 18XGEM3-12345--K ... 18XGESTN-12345-G ... 18XJEALS-12345-P ... 18XLURIA-12345-Y ... 18XMONTO-12345-C ... 18XUTZUB-1234-1M ... 19XENIONENERGIAM ... 21W000000000092T ... 21X0000000011845 ... 21X000000001297T ... 21YEA-EC-------9 ... 22X20160610----4 ... 23X----090406-1H ... 23X--150408-AS-5 ... 23XB4CARCAPMKT-H ... 25X-SHELLAUSTRIL ... 26X00000004851-Y ... 26X00000105742-Q ... 26X00000107862-1 ... 27XAPTPOWER-CZ-3 ... 27XG-ACTHERM-CV1 ... 27XG-RWE-STP-CZJ ... 27XMND---------8 ... 28XENS---------6 ... 37X000000000054S ... 59X000000000110J ... 59X0000000001515 ... 59X0000000002309 ... 59Z000000000216C ... 59Z000000000276V ... 59Z000000000368Q ... 59Z0000000004180 ... 59Z000000000673L ... 59Z000000000905Q ... 59Z000000001369J ... 59Z000000001534U ... 59Z0000000017952 ... 59Z000000001801X ... 59Z000000001934E ... 59Z0000000020518 ... 59Z0000000021522 ... 59Z000000002270X ... 59Z000000002349K ... 59Z000000002376H ... 59Z000000002475F ... 59Z0000000027818 ... 59Z000000003405V ... 59Z000000003499X ... 59Z000000003597X ... 59Z0000000036639 ... 59Z0000000038194 ... 59Z000000003867U ... 59Z000000004048O ... 59Z000000004192H ... 59Z000000004481A ... 59Z0000000045638 ... 59Z000000004595W ... 59Z000000004748X ... 59Z000000004764Z ... 59Z000000004787N ... ... ''' >>> [x for x in numbers.splitlines() if x and not eic.is_valid(x)] [] python-stdnum-1.8.1/tests/test_ismn.doctest0000644000000000000000000000515313223166521021053 0ustar rootroot00000000000000test_ismn.doctest - more detailed doctests for stdnum.ismn module Copyright (C) 2010-2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ismn module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import ismn These are normal variations that should just work. >>> ismn.validate('979-0-3217-6543-6') '9790321765436' >>> ismn.validate('979-0-3217-6544-3') '9790321765443' >>> ismn.validate('9790321765450') '9790321765450' >>> ismn.validate('M-3217-6546-7') 'M321765467' >>> ismn.validate('M321765474') 'M321765474' >>> ismn.validate('979-0-260000438') '9790260000438' Tests for mangling and incorrect check digits. >>> ismn.validate('979-0-3217-6543-x') Traceback (most recent call last): ... InvalidFormat: ... >>> ismn.validate('M-3217-6546-8') Traceback (most recent call last): ... InvalidChecksum: ... >>> ismn.validate('979M321765450') Traceback (most recent call last): ... InvalidComponent: ... >>> ismn.validate('Z-3217-6546-8') Traceback (most recent call last): ... InvalidFormat: ... See if 10 to 13 digit conversion works. >>> ismn.to_ismn13('979-0-32176544-3') # ismn13 should stay ismn13 '979-0-32176544-3' >>> ismn.to_ismn13('M-32176546-7') '979-0-32176546-7' >>> ismn.to_ismn13('M 3217 65504') '979 0 3217 65504' Test the ismn_type() function >>> ismn.ismn_type('M-3217-6546-7') 'ISMN10' >>> ismn.ismn_type('BAD') >>> ismn.ismn_type('9790321765450') 'ISMN13' Regrouping tests. >>> ismn.format('M-3217-6546-7') '979-0-3217-6546-7' >>> ismn.format('9790321765450') '979-0-3217-6545-0' While an EAN can also be less than 13 digits and ISMN should always be 13 digits (when not 10 digits) and start with 9790. >>> ismn.validate('979023456784') Traceback (most recent call last): ... InvalidLength: ... >>> ismn.validate('9781234567866') Traceback (most recent call last): ... InvalidComponent: ... python-stdnum-1.8.1/tests/test_ar_cbu.doctest0000644000000000000000000000504213223166521021335 0ustar rootroot00000000000000test_ar_cbu.doctest - more detailed doctests for the stdnum.ar.cbu module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ar.cbu module. It tries to validate a number of numbers that have been found online. >>> from stdnum.ar import cbu >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 0 0 7 0 9 9 9 0 2 0 0 0 0 0 6 5 7 0 6 0 8 0 ... 0 1 1 0 4 3 3 6 3 0 0 4 3 3 1 3 8 5 7 6 8 3 ... 0 1 4 0 3 3 9 6 0 1 6 3 0 2 0 1 3 8 1 2 7 6 ... 0 1400 236 – 01 5068 0262 5874 ... 0 4 4 0 0 6 4 – 6 – 4 0 0 0 0 1 4 2 9 4 1 0 9 – 2 ... 0 7 2 0 1 4 6 8 2 0 0 0 0 0 0 1 0 6 2 3 4 0 ... 0 7 2 0 1 6 8 0 2 0 0 0 0 0 0 1 1 8 3 2 3 6 ... 0 7 2 0 3 8 0 8 8 8 0 0 0 0 3 5 5 3 3 9 6 8 ... 0070090020000004146504 ... 0110097630009704213797 ... 0140339601630201381276 ... 0140351801684605023087 ... 0168888-1-0000827441015-8 ... 01703342 – 200 000 3036 7766 ... 0200915901000000274233 ... 03400562 00560007577005 ... 0720079388000035942322 ... 0940099324001313220028 ... 1 5 0 0 0 0 6 0 0 0 0 0 5 6 6 0 4 4 7 2 0 0 ... 1 5 0 0 0 8 7 9 - 0 0 0 5 1 3 3 2 0 7 5 1 9 - 6 ... 1 9 1 0 1 1 9 6 5 5 0 1 1 9 0 1 0 8 4 6 4 6 ... 2850590940090418135201 ... ... ''' >>> [x for x in numbers.splitlines() if x and not cbu.is_valid(x)] [] More detailed tests: >>> cbu.validate('285059094009041') Traceback (most recent call last): ... InvalidLength: ... >>> cbu.validate('A850590940090418135201') Traceback (most recent call last): ... InvalidFormat: ... >>> cbu.validate('0940099324001313220028') '0940099324001313220028' >>> cbu.validate('1940099324001313220028') # error in first part Traceback (most recent call last): ... InvalidChecksum: ... >>> cbu.validate('0940099324001313220038') # error in second part Traceback (most recent call last): ... InvalidChecksum: ... python-stdnum-1.8.1/tests/test_ec_ci.doctest0000644000000000000000000000362613156325253021156 0ustar rootroot00000000000000test_ec_ci.doctest - more detailed doctests for stdnum.ec.ci module Copyright (C) 2014 Jonathan Finlay Copyright (C) 2014 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ec.ci. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.ec import ci >>> from stdnum.exceptions import * Normal values that should just work. >>> ci.validate('1714307103') '1714307103' >>> ci.validate('171430710-3') '1714307103' >>> ci.validate('0602910945') '0602910945' >>> ci.validate('0926687856') '0926687856' >>> ci.validate('0910005917') '0910005917' Some invalid numbers. >>> ci.validate('1714307104') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> ci.validate('171430710') # digit missing Traceback (most recent call last): ... InvalidLength: ... >>> ci.validate('123A567890') # contains a letter Traceback (most recent call last): ... InvalidFormat: ... >>> ci.validate('1784307108') # third digit wrong Traceback (most recent call last): ... InvalidComponent: ... >>> ci.validate('8814307107') # invalid province code Traceback (most recent call last): ... InvalidComponent: ... python-stdnum-1.8.1/tests/test_my_nric.doctest0000644000000000000000000000620613156325253021551 0ustar rootroot00000000000000test_my_nric.doctest - more detailed doctests for stdnum.my.nric module Copyright (C) 2013, 2014 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.my.nric. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.my import nric >>> from stdnum.exceptions import * Normal values that should just work. >>> nric.validate('770305-02-1234') '770305021234' >>> nric.validate('890131-06-1224') '890131061224' >>> nric.validate('810909785542') '810909785542' >>> nric.validate('880229875542') '880229875542' Get the birth date: >>> nric.get_birth_date('770305-02-1234') datetime.date(1977, 3, 5) >>> nric.get_birth_date('890131-06-1224') datetime.date(1989, 1, 31) >>> nric.get_birth_date('810909785542') datetime.date(1981, 9, 9) >>> nric.get_birth_date('880229875542') datetime.date(1988, 2, 29) Get the birth place: >>> str(nric.get_birth_place('770305-02-1234')['state']) 'Kedah' >>> str(nric.get_birth_place('890131-06-1224')['state']) 'Pahang' >>> str(nric.get_birth_place('810909785542')['country']).upper() 'SRI LANKA' >>> str(nric.get_birth_place('880229875542')['countries']).upper() 'BRITAIN, GREAT BRITAIN, IRELAND' Formatting: >>> nric.format('770305-02-1234') '770305-02-1234' >>> nric.format('890131-06-1224') '890131-06-1224' >>> nric.format('810909785542') '810909-78-5542' >>> nric.format('880229875542') '880229-87-5542' Invalid date: >>> nric.validate('771305-02-1234') Traceback (most recent call last): ... InvalidComponent: ... >>> nric.validate('890132-06-1224') Traceback (most recent call last): ... InvalidComponent: ... >>> nric.validate('870229875542') Traceback (most recent call last): ... InvalidComponent: ... Invalid birth place: >>> nric.validate('770305-00-1234') Traceback (most recent call last): ... InvalidComponent: ... >>> nric.validate('890131-17-1224') Traceback (most recent call last): ... InvalidComponent: ... >>> nric.validate('810909805542') Traceback (most recent call last): ... InvalidComponent: ... >>> nric.validate('880229195542') Traceback (most recent call last): ... InvalidComponent: ... Just invalid numbers: >>> nric.validate('770305-00') Traceback (most recent call last): ... InvalidLength: ... >>> nric.validate('890A31-17-1224') Traceback (most recent call last): ... InvalidFormat: ... >>> nric.get_birth_place('8109098') Traceback (most recent call last): ... InvalidComponent: ... python-stdnum-1.8.1/tests/test_no_mva.doctest0000644000000000000000000000263613156325253021373 0ustar rootroot00000000000000test_no_mva.doctest - more detailed doctests for stdnum.no.mva module Copyright (C) 2015 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.no.mva module. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.no import mva These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 965 920 358 MVA ... 980 430 596 MVA ... 998 772 680 MVA ... NO 987 008 644 MVA ... NO 917 313 008 MVA ... NO 948007029 MVA ... NO 966 813 946 MVA ... NO 982 930 057 MVA ... NO 982 952 573 MVA ... NO 987 008 644 MVA ... NO 987 989 297 MVA ... ... ''' >>> [x for x in numbers.splitlines() if x and not mva.is_valid(x)] [] python-stdnum-1.8.1/tests/test_cn_ric.doctest0000644000000000000000000000435213156325253021346 0ustar rootroot00000000000000test_cn_ric.doctest - more detailed doctests for stdnum.cn.ric module Copyright (C) 2014 Jiangge Zhang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.cn.ric. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.cn import ric >>> from stdnum.exceptions import * # noqa Normal values that should just work. >>> ric.validate('360426199101010071') '360426199101010071' >>> ric.validate('44011320141005001x') '44011320141005001X' >>> ric.format('44011320141005001x') '44011320141005001X' Get the birth date: >>> ric.get_birth_date('360426199101010071') datetime.date(1991, 1, 1) >>> ric.get_birth_date('44011320141005001x') datetime.date(2014, 10, 5) Get the birth place: >>> c = ric.get_birth_place('360426199101010071')['county'] >>> c == u'\u5fb7\u5b89\u53bf' True >>> c = ric.get_birth_place('44011320141005001x')['county'] >>> c == u'\u756a\u79ba\u533a' True Invalid format: >>> ric.validate('36042619910101007V') Traceback (most recent call last): ... InvalidFormat: ... >>> ric.validate('T60426199101010078') Traceback (most recent call last): ... InvalidFormat: ... Invalid date: >>> ric.validate('360426199113010079') Traceback (most recent call last): ... InvalidComponent: ... Invalid checksum: >>> ric.validate('36042619910102009X') Traceback (most recent call last): ... InvalidChecksum: ... Invalid location: >>> ric.validate('990426199112010074') # unknown birth place code Traceback (most recent call last): ... InvalidComponent: ... python-stdnum-1.8.1/tests/test_do_rnc.py0000644000000000000000000000605613223166521020337 0ustar rootroot00000000000000# test_do_rnc.py - functions for testing the online RNC validation # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # This is a separate test file because it should not be run regularly # because it could negatively impact the online service. """Extra tests for the stdnum.do.rnc module.""" import os import unittest from stdnum.do import rnc from stdnum.exceptions import * @unittest.skipIf( not os.environ.get('ONLINE_TESTS'), 'Do not overload online services') class TestDGII(unittest.TestCase): """Test the web services provided by the the Dirección General de Impuestos Internos (DGII), the Dominican Republic tax department.""" def test_check_dgii(self): """Test stdnum.do.rnc.check_dgii()""" # Test a normal valid number result = rnc.check_dgii('131098193') self.assertTrue(all( key in result.keys() for key in ['rnc', 'name', 'commercial_name', 'category', 'status'])) self.assertEqual(result['rnc'], '131098193') # Test an invalid length number self.assertIsNone(rnc.check_dgii('123')) # Test a number with an invalid checksum self.assertIsNone(rnc.check_dgii('112031226')) # Valid number but unknown self.assertIsNone(rnc.check_dgii('814387152')) # Test a number on the whitelist result = rnc.check_dgii('501658167') self.assertEqual(result['rnc'], '501658167') def test_search_dgii(self): """Test stdnum.do.rnc.search_dgii()""" # Search for some existing companies results = rnc.search_dgii('EXPORT DE') self.assertGreaterEqual(len(results), 3) self.assertRegexpMatches(results[0]['rnc'], r'\d{9}') self.assertRegexpMatches(results[1]['rnc'], r'\d{9}') self.assertRegexpMatches(results[2]['rnc'], r'\d{9}') # Check maximum rows parameter two_results = rnc.search_dgii('EXPORT DE', end_at=2) self.assertEqual(len(two_results), 2) self.assertEqual(two_results, results[:2]) # Check the start_at parameter two_results = rnc.search_dgii('EXPORT DE', end_at=3, start_at=2) self.assertEqual(len(two_results), 2) self.assertEqual(two_results, results[1:3]) # Check non-existing company results = rnc.search_dgii('NON-EXISTING COMPANY') self.assertEqual(results, []) python-stdnum-1.8.1/tests/test_ean.doctest0000644000000000000000000000260013156325253020646 0ustar rootroot00000000000000test_ean.doctest - more detailed doctests for the stdnum.ean module Copyright (C) 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ean module. It tries to test more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum import ean These numbers have broken checksums or are mangled: >>> ean.validate('7501031311309') '7501031311309' >>> ean.validate('75010313113') Traceback (most recent call last): ... InvalidLength: ... >>> ean.validate('750103AAAA309') Traceback (most recent call last): ... InvalidFormat: ... >>> ean.validate('7501031311308') Traceback (most recent call last): ... InvalidChecksum: ... python-stdnum-1.8.1/tests/test_es_cups.doctest0000644000000000000000000000505513223166521021547 0ustar rootroot00000000000000test_my_nric.doctest - more detailed doctests for stdnum.es.cups module Copyright (C) 2016 David García Garzón Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.es.cups. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.es import cups >>> from stdnum.exceptions import * >>> cups.compact('ES 1234-123456789012-jy') 'ES1234123456789012JY' >>> cups.validate('ES 1234-123456789012-JY') 'ES1234123456789012JY' >>> cups.validate('GB 1234-123456789012-JY') Traceback (most recent call last): ... InvalidComponent: ... >>> cups.validate('ES 1234-12X456789012-JY') Traceback (most recent call last): ... InvalidFormat: ... >>> cups.validate('ES 1234-12345678901X-JY') Traceback (most recent call last): ... InvalidFormat: ... >>> cups.validate('ES 1234-12456789012-JY') Traceback (most recent call last): ... InvalidLength: ... >>> cups.validate('ES 1234-123456789012-JY 1F') 'ES1234123456789012JY1F' >>> cups.validate('ES 1234-123456789012-JY 1T') Traceback (most recent call last): ... InvalidFormat: ... >>> cups.validate('ES 1234-123456789012-JY XF') Traceback (most recent call last): ... InvalidFormat: ... >>> cups.validate('ES 1234-123456789012-XY 1F') Traceback (most recent call last): ... InvalidChecksum: ... >>> cups.is_valid('ES 1234-123456789012-JY 1F') True >>> cups.is_valid('ES 1234-123456789012-XY 1F') False >>> cups.format('ES1234123456789012JY') 'ES 1234 1234 5678 9012 JY' >>> cups.format('ES1234123456789012JY1F') 'ES 1234 1234 5678 9012 JY 1F' >>> cups.validate('ES 0987 5432 1098 7654 ZF') 'ES0987543210987654ZF' >>> cups.validate('ES 1234 1234 5678 9012 JY') 'ES1234123456789012JY' >>> cups.validate('ES 9750 2109 8765 4321 CQ') 'ES9750210987654321CQ' >>> cups.validate('ES 0999 1100 1234 5678 EK') 'ES0999110012345678EK' python-stdnum-1.8.1/tests/test_eu_banknote.doctest0000644000000000000000000000364513223166521022403 0ustar rootroot00000000000000test_eu_banknote.doctest - more detailed doctests for the stdnum.eu.banknote module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.eu.banknote module. It contains some corner case tests and tries to validate a serial numbers that have been found online. >>> from stdnum.eu import banknote >>> from stdnum.exceptions import * Some basic tests for invalid numbers. >>> banknote.validate('RABCDEFGHIJN') Traceback (most recent call last): ... InvalidFormat: ... >>> banknote.validate('Z123') Traceback (most recent call last): ... InvalidLength: ... >>> banknote.validate('A71220515713') Traceback (most recent call last): ... InvalidComponent: ... >>> banknote.validate('P36007033742') Traceback (most recent call last): ... InvalidChecksum: ... These should all be valid serial numbers. >>> numbers = ''' ... ... EA4100181598 ... F00172834112 ... P08392800367 ... P36007033744 ... S22227803764 ... SD9103468574 ... U36749787719 ... U71220515711 ... V37421817898 ... VA0436214792 ... X14234175767 ... X45370810262 ... X64709081183 ... X80420825306 ... Y12470649328 ... Z10708476264 ... Z34706855889 ... ... ''' >>> [x for x in numbers.splitlines() if x and not banknote.is_valid(x)] [] python-stdnum-1.8.1/tests/test_au_acn.doctest0000644000000000000000000000542113223166521021331 0ustar rootroot00000000000000test_au_acn.doctest - more detailed doctests for the stdnum.au.acn module Copyright (C) 2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.au.acn module. It tries to validate a number of numbers that have been found online. >>> from stdnum.au import acn, abn >>> from stdnum.exceptions import * These have been found online and should all be valid numbers. >>> numbers = ''' ... ... 000 024 733 ... 001 002 731 ... 001 976 272 ... 002 724 334 ... 002 955 722 ... 003 855 561 ... 004 071 854 ... 004 235 063 ... 004 394 763 ... 005 957 004 ... 007 433 623 ... 050 539 350 ... 055 980 204 ... 082 930 916 ... 088 952 023 ... 093 966 888  ... 099503456 ... 104 045 089 ... 104 128 001 ... 112 045 002 ... 116 306 453 ... 125 295 712  ... 135 427 075  ... 141 800 357 ... 143477632 ... ... 000 000 019 ... 000 250 000 ... 000 500 005 ... 000 750 005 ... 001 000 004 ... 001 250 004 ... 001 500 009 ... 001 749 999 ... 001 999 999 ... 002 249 998 ... 002 499 998 ... 002 749 993 ... 002 999 993 ... 003 249 992 ... 003 499 992 ... 003 749 988 ... 003 999 988 ... 004 249 987 ... 004 499 987 ... 004 749 982 ... 004 999 982 ... 005 249 981 ... 005 499 981 ... 005 749 986 ... 005 999 977 ... 006 249 976 ... 006 499 976 ... 006 749 980 ... 006 999 980 ... 007 249 989 ... 007 499 989 ... 007 749 975 ... 007 999 975 ... 008 249 974 ... 008 499 974 ... 008 749 979 ... 008 999 979 ... 009 249 969 ... 009 499 969 ... 009 749 964 ... 009 999 964 ... 010 249 966 ... 010 499 966 ... 010 749 961 ... ... ''' >>> [x for x in numbers.splitlines() if x and not acn.is_valid(x)] [] These numbers have been found in combination with an existing ABN. >>> numbers = ''' ... ... 000 024 733 / 79 000 024 733 ... 002 724 334 / 43002724334 ... 004 071 854 / 56 004 071 854 ... 004 235 063 / 63 004 235 063 ... 004 394 763 / 74 004 394 763 ... 055 980 204 / 31 055 980 204 ... 104 045 089 / 97 104 045 089 ... 112 045 002 / 19 112 045 002 ... 143477632 / 28143477632 ... ... ''' >>> lines = (l.split('/') for l in numbers.splitlines() if l) >>> [(x, y) for x, y in lines if acn.to_abn(x) != abn.compact(y)] [] python-stdnum-1.8.1/tests/test_gb_vat.doctest0000644000000000000000000000620613156325253021353 0ustar rootroot00000000000000test_gb_vat.doctest - more detailed doctests for stdnum.gb.vat module Copyright (C) 2012, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.gb.vat. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.gb import vat Normal values that should just work. >>> vat.validate('980780684') # standard number '980780684' >>> vat.validate('100190874') # standard number restarting '100190874' >>> vat.validate('242338087388') # branch trader '242338087388' >>> vat.validate('GD100') # government department 'GD100' >>> vat.validate('HA501') # health authority 'HA501' >>> vat.validate('GD888810003') # government department for EU 'GD888810003' >>> vat.validate('HA888856782') # health authority for EU 'HA888856782' Invalid long numbers: >>> vat.validate('802311781') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> vat.validate('9807806842') # too long for standard number Traceback (most recent call last): ... InvalidLength: ... >>> vat.validate('9807806B4') # invalid digit Traceback (most recent call last): ... InvalidFormat: ... >>> vat.validate('GD8888567B2') # invalid digit for EU health authority Traceback (most recent call last): ... InvalidFormat: ... >>> vat.validate('001234567') # invalid checksum Traceback (most recent call last): ... InvalidChecksum: ... Some variations on the short format: >>> vat.validate('ZZ100') # unknown code Traceback (most recent call last): ... InvalidComponent: ... >>> vat.validate('GD600') # government department with high number Traceback (most recent call last): ... InvalidComponent: ... >>> vat.validate('HA201') # health authority with low number Traceback (most recent call last): ... InvalidComponent: ... Some variations on the EU format: >>> vat.validate('GD888860018') # government department with high number Traceback (most recent call last): ... InvalidComponent: ... >>> vat.validate('HA888820107') # health authority with low number Traceback (most recent call last): ... InvalidComponent: ... >>> vat.validate('HA888856700') # health authority with invalid checksum Traceback (most recent call last): ... InvalidChecksum: ... Formatting tests: >>> vat.format('980780684') # standard number '980 7806 84' >>> vat.format('HA501') # health authority 'HA501' >>> vat.format('242338087388') # branch trader '242 3380 87 388' python-stdnum-1.8.1/tests/test_ee_registrikood.doctest0000644000000000000000000000537213223166521023266 0ustar rootroot00000000000000test_ee_registrikood.doctest - more detailed doctests for stdnum.ee.registrikood module Copyright (C) 2017 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA This file contains more detailed doctests for the stdnum.ee.registrikood. It tries to cover more corner cases and detailed functionality that is not really useful as module documentation. >>> from stdnum.ee import registrikood >>> from stdnum.exceptions import * Some simple tests for corner cases: >>> registrikood.validate('123456789') Traceback (most recent call last): ... InvalidLength: ... >>> registrikood.validate('1234567A') Traceback (most recent call last): ... InvalidFormat: ... These have been found online and should all be valid numbers. >>> numbers = """ ... ... 10000024 ... 10000030 ... 10000047 ... 10000171 ... 10254782 ... 10324169 ... 10491045 ... 10591640 ... 10722527 ... 10732046 ... 10953764 ... 11041309 ... 11104323 ... 11126796 ... 11129553 ... 11405303 ... 11426771 ... 11456861 ... 11521759 ... 11559868 ... 11664625 ... 11910691 ... 11984324 ... 12073932 ... 12111472 ... 12202654 ... 12493640 ... 70000823 ... 70002420 ... 70004264 ... 70005542 ... 75000561 ... 75000667 ... 75002287 ... 75002884 ... 75005334 ... 75005392 ... 75005618 ... 75006820 ... 75007267 ... 75008769 ... 75010476 ... 75012952 ... 75015580 ... 75016177 ... 75016993 ... 75017857 ... 75018325 ... 75018495 ... 75018822 ... 75020670 ... 75021043 ... 75021304 ... 75021617 ... 75024018 ... 75024509 ... 75024567 ... 75025153 ... 75025762 ... 75026968 ... 75027494 ... 75033069 ... 80026261 ... 80033947 ... 80040433 ... 80041421 ... 80046097 ... 80052459 ... 80078915 ... 80079820 ... 80093530 ... 80095629 ... 80107858 ... 80112196 ... 80132454 ... 80173430 ... 80186390 ... 80196158 ... 80213520 ... 80234120 ... 80287895 ... 80291371 ... 80293625 ... 80302784 ... 80309332 ... 80314929 ... 80319075 ... 80336642 ... 90004740 ... 90004817 ... 90006006 ... 90006549 ... 90006822 ... 90006845 ... 90007247 ... 90007796 ... 90008287 ... 90009370 ... 90010671 ... 90010887 ... ... """ >>> [x for x in numbers.splitlines() if x and not registrikood.is_valid(x)] [] python-stdnum-1.8.1/NEWS0000644000000000000000000003345113224171624015017 0ustar rootroot00000000000000changes from 1.8 to 1.8.1 ------------------------- * fix a packaging issue in the long description changes from 1.7 to 1.8 ----------------------- * add modules for the following number formats: - NCF (Números de Comprobante Fiscal, Dominican Republic receipt number) - Euro banknote serial numbers - CAS RN (Chemical Abstracts Service Registry Number) - Aadhaar (Indian digital resident personal identity number) (thanks Srikanth Lakshmanan) - PAN (Permanent Account Number, Indian income tax identifier) (thanks Srikanth Lakshmanan) * add functions for using the Dominican Republic DGII web service to validate and search for RNC and NCF numbers * add/update whitelists for Dominican Republic RNC and Cedula * support zeep as preferred SOAP library (suds and pysimplesoap are tried as fallback) * rename stdnum.iso9362 to stdnum.bic (iso9362 is deprecated but still available for compatibility) * add tests for web services (not normally run to avoid unnecessary load) * fixes and improvement to the sample online validation service Development of the NCF format validation and DGII web service validation was funded by iterativo | http://iterativo.do changes from 1.6 to 1.7 ----------------------- * add modules for the following number formats: - BN (Canadian Business Number) - SIN (Canadian Social Insurance Number) - IdNr (Steuerliche Identifikationsnummer, German personal tax number) (thanks Mohammed Salman of Holvi) - Registrikood (Estonian organisation registration code) (thanks Mohammed Salman of Holvi) - Veronumero (Finnish individual tax number) (thanks Mohammed Salman of Holvi) - UPN (English Unique Pupil Number) * fix a bug in the Czech DIČ check digit calculation * fix conversion of 9 digit ISBN to ISBN13 * fix a bug in the Damm is_valid() function * more validation of 13-digit ISBN values * more validation of ISMN values * various code and test improvements (100% branch coverage now) * documentation improvements changes from 1.5 to 1.6 ----------------------- * add modules for the following number formats: - CBU (Clave Bancaria Uniforme, Argentine bank account number) (thanks Luciano Rossi) - EIC (European Energy Identification Code) - NACE (classification for businesses in the European Union) - LEI (Legal Entity Identifier) - n° TVA (taxe sur la valeur ajoutée, Monacan VAT number) - PIB (Poreski Identifikacioni Broj, Serbian tax identification number) * add online check example that finds valid formats for a given number * fix support for Ñ in Spanish Referencia Catastral * updates to U.S. Employer Identification Number (thanks Greg Kuwaye) * various minor improvements changes from 1.4 to 1.5 ----------------------- * add modules for the following number formats: - ABN (Australian Business Number) - ACN (Australian Company Number) - TFN (Australian Tax File Number) - CCC (Código Cuenta Corriente, Spanish Bank Account Code) - CUPS (Código Unificado de Punto de Suministro, Supply Point Unified Code) - Spanish IBAN (International Bank Account Number) - Referencia Catastral (Spanish real estate property id) * the IBAN module now support validating the country-specific part * the Belgian VAT number is now also referenced as businessid * add a Tox configuration file changes from 1.3 to 1.4 ----------------------- * add modules for the following number formats: - NIF (Numéro d'Immatriculation Fiscale, French tax identification number) provided by Dimitri Papadopoulos - NIR (French personal identification number) provided by Dimitri Papadopoulos - SIRET (a French company establishment identification number) provided by Yoann Aubineau - NHS (United Kingdom National Health Service patient identifier) - T.C. Kimlik No. (Turkish personal identification number) * add an implementation of the Damm algorithm * ensure data files are properly closed * documentation improvements * extend test suite * a number of minor bug fixes and improvements changes from 1.2 to 1.3 ----------------------- * fix ISO 6346 check digit calculation (thanks Ronald Paloschi) * fix problem with check_vies_approx() (thanks Lionel Elie Mamane) * fix problem with SOAP client when using suds * include documentation that was previously on the Trac wiki changes from 1.1 to 1.2 ----------------------- * add modules for the following number formats: - Austrian Company Register Numbers - CNPJ (Cadastro Nacional da Pessoa Jurídica, Brazillian company identifier) - UID (Unternehmens-Identifikationsnummer, Swiss business identifier) - VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number) - CUSIP number (financial security identification number) - Wertpapierkennnummer (German securities identification code) - Isikukood (Estonian Personcal ID number) - Finnish Association Identifier - Y-tunnus (Finnish business identifier) - SEDOL number (Stock Exchange Daily Official List number) - IMO number (International Maritime Organization number) - ISIN (International Securities Identification Number) - RFC (Registro Federal de Contribuyentes, Mexican tax number) - PESEL (Polish national identification number) - REGON (Rejestr Gospodarki Narodowej, Polish register of economic units) - ИНН (Идентификационный номер налогоплательщика, Russian tax identifier) * add an alternate VIES check (check_vies_approx()) that includes a proof (certificate) that the check was performed * fall back to pysimplesoap if suds is unavailable * test and code quality improvements changes from 1.0 to 1.1 ----------------------- * add number formats based on the implementation in the vatnumber module: - NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT number) - CUIT (Código Único de Identificación Tributaria, Argentinian tax number) - RUT (Rol Único Tributario, Chilean national tax number) - NIT (Número De Identificación Tributaria, Colombian identity code) - COE (Codice operatore economico, San Marino national tax number) * add modules for the following number formats: - Cedula (Dominican Republic national identification number) - RNC (Registro Nacional del Contribuyente, Dominican Republic tax number) - Kennitala (Icelandic personal and organisation identity code, provided by Tuomas Toivonen) - VSK number (Virðisaukaskattsnúmer, Icelandic VAT number, provided by Tuomas Toivonen) - ISO 9362 (Business identifier codes, provided by Tony Bajan) - MVA (Merverdiavgift, Norwegian VAT number, provided by Tuomas Toivonen) - Orgnr (Organisasjonsnummer, Norwegian organisation number, provided by Tuomas Toivonen) - Orgnr (Organisationsnummer, Swedish company number, provided by Tomas Thor Jonsson) * add Croatia to list of EU VAT numbers * update getcnloc script * various small fixes and additional tests for existing modules changes from 0.9 to 1.0 ----------------------- * add modules for the following number formats: - Swiss social security number ("Sozialversicherungsnummer") - RIC No. (Chinese Resident Identity Card Number) - CI (Cédula de identidad, Ecuadorian personal identity code) - RUC (Registro Único de Contribuyentes, Ecuadorian company tax number) - SEPA Identifier of the Creditor (AT-02) - ISO 6346 (International standard for container identification) - Codice Fiscale (Italian tax code for individuals) - RTN (Routing transport number) * Add support for 2013 extension of Irish PPS Numbers * update getisbn script * update getmybp URLs for Malaysian code lists * various other minor improvements changes from 0.8.1 to 0.9 ------------------------- * add modules for the following number formats: - Brin number (Dutch number for schools) - Postcode (Dutch postal code) - ATIN (U.S. Adoption Taxpayer Identification Number) - EIN (U.S. Employer Identification Number) - ITIN (U.S. Individual Taxpayer Identification Number) - PTIN (U.S. Preparer Tax Identification Number) - TIN (U.S. Taxpayer Identification Number) * try to replace Unicode characters with similar-looking ASCII characters * update getimsi script (thanks eneq123) * update getiban script * add proxy support to the stdnum.eu.vat.check_vies() function (thanks Cédric Krier) * support newer United Kingdom VAT numbers changes from 0.8 to 0.8.1 ------------------------- * include some files that were missing from the source tarball changes from 0.7 to 0.8 ----------------------- * add modules for the following number formats: - NRIC No. (Malaysian National Registration Identity Card Number) * all modules now provide a validate() function that throws an exception that contains more information on the failure reason * documentation improvements * remove add_check_digit parameter from GRid's format() function * improvements to the tests * re-add Python3 support (now tested with Python 2.7, 3.2 and 3.3) changes from 0.6 to 0.7 ----------------------- * add modules for the following number formats: - Onderwijsnummer (Dutch school number) - BTW-nummer (Omzetbelastingnummer, the Dutch VAT number) - HETU (Finnish personal identity code) as provided by Jussi Judin (#5) - RČ (Rodné číslo, the Czech and Slovak birth numbers) - SIREN (a French company identification number) - FPA, ΦΠΑ (Foros Prostithemenis Aksias, the Greek VAT number) - Ust ID Nr. (Umsatzsteur Identifikationnummer, the German VAT number) - BTW, TVA, NWSt (Belgian VAT number) - DNI (Documento nacional de identidad, Spanish personal identity codes) - NIE (Número de Identificación de Extranjeros, Spanish foreigner number) - CIF (Certificado de Identificación Fiscal, Spanish company tax number) - NIF (Número de Identificación Fiscal, Spanish VAT number) - PVN (Pievienotās vērtības nodokļa, Latvian VAT number) - CVR (Momsregistreringsnummer, Danish VAT number) - TVA (taxe sur la valeur ajoutée, Luxembourgian VAT number) - CNP (Cod Numeric Personal, Romanian Numerical Personal Code) - CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number) - Partita IVA (Italian VAT number) - Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number) - UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number) - NIF (Número de identificação fiscal, Portuguese VAT number) - IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number) - ALV nro (Arvonlisäveronumero, Finnish VAT number) - DIČ (Daňové identifikační číslo, Czech VAT number) - ANUM (Közösségi adószám, Hungarian VAT number) - VAT (Irish VAT number) - KMKR (Käibemaksukohuslase, Estonian VAT number) - PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT number) - n° TVA (taxe sur la valeur ajoutée, French VAT number) - VAT (Maltese VAT number) - NIP (Numer Identyfikacji Podatkowej, Polish VAT number) - ID za DDV (Davčna številka, Slovenian VAT number) - VAT (Moms, Mervärdesskatt, Swedish VAT number) - VAT (United Kingdom (and Isle of Man) VAT registration number) - EGN (ЕГН, Единен граждански номер, Bulgarian personal identity codes) - PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner) - VAT (Идентификационен номер по ДДС, Bulgarian VAT number) - VAT (European Union VAT number) - OIB (Osobni identifikacijski broj, Croatian identification number) - PPS No (Personal Public Service Number, Irish personal number) - CPR (personnummer, the Danish citizen number) * additional tests for robustness and use introspection to test all modules * some code refactoring with the introduction of an internal utility module * improvements to the docstring documentation * generate API documentation using Sphinx changes from 0.5 to 0.6 ----------------------- * fix a problem with handling an ISBN13 with a valid check digit but with an unknown bookland prefix * add an IMSI (International Mobile Subscriber Identity) module * implement a conversion function from ISBN13 to ISBN10 * implement an ismn.ismn_type() function * implement an imei.split() function that splits the number into a TAC, serial number and checksum or software version * source code layout changes to better follow PEP8 changes from 0.4 to 0.5 ----------------------- * add modules for the following number formats: - EAN (International Article Number) * refactoring to use the EAN check digit code for ISBN and ISMN checks * implement a conversion function from ISSN to EAN * support Python3 with the same codebase * Python 2.5 compatibility improvement changes from 0.3 to 0.4 ----------------------- * add modules for the following number formats: - CPF (Cadastro de Pessoas Físicas, the Brazillian national identification number) - IBAN (International Bank Account Number) - ISIL (International Standard Identifier for Libraries and Related Organizations) - SSN (U.S. Social Security Number) * implement an internal module to store and handle hierarchically organised data structures efficiently * regional-specific numbers are now in ISO 3166 packages (the BSN module is now in stdnum.nl.bsn) * ISBN module functions now have a convert flag to convert to ISBN-13 on the fly changes from 0.2 to 0.3 ----------------------- * add modules for the following number formats: - ISMN (International Standard Music Number) - ISAN (International Standard Audiovisual Number) - IMEI (International Mobile Equipment Identity) - MEID (Mobile Equipment Identifier) - GRid (Global Release Identifier) * add modules for handling the following check digit algorithms: - the Verhoeff algorithm - the Luhn and Luhn mod N algorithms - some algorithms described in ISO/IEC 7064: Mod 11, 2, Mod 37, 2, Mod 97, 10, Mod 11, 10 and Mod 37, 36 * added more unit tests changes from 0.1 to 0.2 ----------------------- * rename validate() function to is_valid() for all modules * handle wrong types passed to is_valid() more gracefully * add more tests and fix some minor bugs python-stdnum-1.8.1/ChangeLog0000644000000000000000000033275513224171656016110 0ustar rootroot000000000000002018-01-06 Arthur de Jong * [820c233] README: Fix feedback section in README to be valid RST 2018-01-06 Arthur de Jong * [ab8a871] setup.py: Update long description in compatible way This ensures that the README is read correctly on all supported Python interpreters. Fixes 1304122 2018-01-05 5j9 <5j9@users.noreply.github.com> * [1304122] setup.py: setup.py: Open README with utf-8 encoding Fixes #59 2018-01-03 Arthur de Jong * [ae89e82] ChangeLog, MANIFEST.in, NEWS, README, docs/conf.py, docs/index.rst, docs/stdnum.casrn.rst, docs/stdnum.do.ncf.rst, docs/stdnum.eu.banknote.rst, docs/stdnum.in_.aadhaar.rst, docs/stdnum.in_.pan.rst, setup.cfg, stdnum/__init__.py, update/numlist.py: Get files ready for 1.8 release 2018-01-03 Arthur de Jong * [db9b278] tox.ini: Fix Sphinx dependency name 2018-01-03 Arthur de Jong * [fbb9d24] docs/index.rst, stdnum/__init__.py: Move get_cc_module() function to package for public use 2018-01-03 Arthur de Jong * [7bb0e5f] setup.py, stdnum/util.py: Try the non-caching zeep client on older versions This uses the "normal" Client class from zeep if CachingClient is not available (this is the case on older zeep versions). This also records (and documents) the dependencies for SOAP libraries in setup.py. 2018-01-01 Arthur de Jong * [6d7ba46] .travis.yml: Add a Travis configuration file 2018-01-01 Arthur de Jong * [db7be06] stdnum/do/ncf.py, stdnum/do/rnc.py, tox.ini: Fix Python 2.6 compatibility 2018-01-01 Arthur de Jong * [8107f08] stdnum/cn/loc.dat, stdnum/eu/nace.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/us/ein.dat: Update database files Note that the Swift IBAN Registry in txt format is currently unavailable so hasn't been updated. 2018-01-01 Arthur de Jong * [e781eee] MANIFEST.in, tox.ini, update/README, update/cn_loc.py, update/do_whitelists.py, update/eu_nace.py, update/iban.py, update/imsi.py, update/isbn.py, update/isil.py, update/my_bp.py, update/numlist.py, update/requirements.txt: Move update scripts to own directory This moves all the update scripts to their own directory so they don't clutter the toplevel directory. This also ensures that the scripts are passed through flake8 and makes some adjustments for that alongside a few other cleanups. 2017-12-01 srikanthlogic * [442aa82] stdnum/in_/pan.py, tests/test_in_pan.doctest: Add Indian PAN Closes https://github.com/arthurdejong/python-stdnum/pull/57 2017-12-31 Arthur de Jong * [8a34b4e] stdnum/util.py: Correctly quote regular expression Fixes a6ae1d0. 2017-12-31 Arthur de Jong * [271b9e4] docs/stdnum.is_.kennitala.rst, docs/stdnum.is_.vsk.rst, tox.ini: Add Sphinx documentation checks This also fixes an escaping issue in the automatically generated documentation for modules that end with an underscore. 2017-12-06 Arthur de Jong * [be094f8] README, docs/conf.py, docs/index.rst, getnumlist.py, setup.py, stdnum/__init__.py: Use README as package long description This also shortens the stdnum module docstring and updates the Sphinx configuration. 2017-12-01 srikanthlogic * [c576bc4] stdnum/in_/__init__.py, stdnum/in_/aadhaar.py: Add Indian Aadhaar Closes https://github.com/arthurdejong/python-stdnum/pull/56 2017-11-26 Arthur de Jong * [bafdb70] stdnum/casrn.py, tests/test_casrn.doctest: Add CAS Registry Number This adds validation of the Chemical Abstracts Service Registry Number. 2017-11-24 Arthur de Jong * [d5f97e9] online_check/check.js, online_check/stdnum.wsgi: Change output of online lookups This puts the number before the number name to make it a little clearer. 2017-11-24 Arthur de Jong * [f7b4615] online_check/check.js: Store online check numbers in history This updates the browser history with with the numbers that were checked so that you can easily go back and forth between checked number. 2017-11-24 Arthur de Jong * [7cb114b] online_check/stdnum.wsgi: Correctly escape number for use in attribute 2017-11-26 Arthur de Jong * [90067f7] tests/test_eu_banknote.doctest: Fix incorrect banknote test Also add a few verified correct numbers. Fixes b7b812c. 2017-11-22 Arthur de Jong * [b7b812c] stdnum/eu/banknote.py, tests/test_eu_banknote.doctest: Add Euro bank notes serial number This adds validation of serial numbers that appear on Euro bills. 2017-11-02 Arthur de Jong * [a6ae1d0] docs/index.rst, docs/stdnum.bic.rst, docs/stdnum.iso9362.rst, stdnum/bic.py, stdnum/iso9362.py, stdnum/util.py: Rename stdnum.iso9362 to stdnum.bic The new name is more descriptive and easier to remember. This makes stdnum.iso9362 a compatibility module that can be imported with the old name but provides a deprecation warning. 2017-10-22 Arthur de Jong * [6be1754] stdnum/util.py: Support zeep as preferred SOAP library This tries zeep, suds (suds-jurko) and falls back to using pysimplesoap for performing the SOAP requests. From those zeep seems to be the best supported implementation. 2017-10-22 Arthur de Jong * [9ab1d66] stdnum/eu/vat.py, tests/test_eu_vat.py: Add tests for the VIES VAT validation functions These tests are not normally run as part of the normal test suite and have to be explicitly enabled by setting the ONLINE_TESTS environment variable to avoid overloading these online services. 2017-10-18 Arthur de Jong * [ab21159] stdnum/do/ncf.py, tests/test_do_ncf.py: Add stdnum.do.ncf.check_dgii() This adds functions for querying the Dirección General de Impuestos Internos (DGII) API to check if the RNC and NCF combination provided is valid. 2017-10-18 Arthur de Jong * [6b09c5d] stdnum/do/rnc.py, tests/test_do_rnc.py, tox.ini: Add stdnum.do.rnc.check_dgii() and search_dgii() This adds functions for querying the Dirección General de Impuestos Internos (DGII) API to validate the RNC and search the register by keyword. 2017-10-16 Arthur de Jong * [665bf7a] stdnum/do/ncf.py, tests/test_do_ncf.doctest: Add Dominican Republic receipt number (NCF) This number does not have a check digit but uses a distinctive enough format that it should not be too great of a problem. 2017-10-14 Arthur de Jong * [4ab1e3b] stdnum/eu/vat.py, stdnum/tr/tckimlik.py, stdnum/util.py: Cache SOAP client in get_soap_client() This caches the instantiated SOAP client classes in the util module instead of doing the caching in every module that performs requests. 2017-10-18 Arthur de Jong * [cecd35c] getdowhitelists.py: Add a script for updating RNC and Cedula whitelists 2017-10-13 Arthur de Jong * [399321b] stdnum/do/rnc.py, tests/test_do_rnc.doctest: Also add a whitelist for Dominican Republic RNC Some RNCs are apparently valid while having an incorrect check digit (though most appear to be inactive). There also appear to be valid RNCs that do not have 9 digits. 2017-10-13 Arthur de Jong * [58511dc] stdnum/do/cedula.py, tests/test_do_cedula.doctest: Add a few new numbers to the Cedula whitelist These numbers were found to be valid but had an invalid check digit nonetheless (though most appear to be inactive). Also there appear to be a few valid Cedula that do not have 11 digits. 2017-10-13 David Arnold * [74c1721] stdnum/util.py, tests/test_util.doctest: Handle unicode arguments in get_cc_module() Closes https://github.com/arthurdejong/python-stdnum/issues/54 2017-09-15 Arthur de Jong * [12cd072] stdnum/eu/at_02.py: Fix spelling errors 2017-09-12 Arthur de Jong * [4496ffe] ChangeLog, NEWS, README, docs/index.rst, docs/stdnum.ca.bn.rst, docs/stdnum.ca.sin.rst, docs/stdnum.de.idnr.rst, docs/stdnum.ee.registrikood.rst, docs/stdnum.fi.veronumero.rst, docs/stdnum.gb.upn.rst, stdnum/__init__.py: Get files ready for 1.7 release 2017-09-12 Arthur de Jong * [28092b3] stdnum/damm.py: Add example with custom table to Damm 2017-09-11 Arthur de Jong * [24d4a76] stdnum/cn/loc.dat, stdnum/eu/nace.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update database files 2017-09-11 Arthur de Jong * [5071636] getisbn.py: Update getisbn to allow TLSv1 The www.isbn-international.org site uses TLSv1 which seems to be blocked by recent Python/OpenSSL combinations unless configured otherwise. 2017-09-11 Arthur de Jong * [edaad05] setup.cfg, tox.ini: Run flake8 from tox 2017-09-10 Arthur de Jong * [0ce5d0b] stdnum/bg/egn.py, stdnum/cz/dic.py, stdnum/dk/cpr.py, stdnum/es/cups.py, stdnum/es/referenciacatastral.py, stdnum/eu/nace.py, stdnum/fr/nir.py, stdnum/fr/siren.py, stdnum/iban.py, stdnum/it/codicefiscale.py, stdnum/lv/pvn.py, stdnum/numdb.py, stdnum/ro/cnp.py, stdnum/util.py: Minor code improvements (mostly PEP8) 2017-09-10 Arthur de Jong * [e468c1b] stdnum/ch/vat.py, stdnum/cn/ric.py, stdnum/do/cedula.py, stdnum/ee/ik.py, stdnum/ee/registrikood.py, stdnum/es/nif.py, stdnum/fi/__init__.py, stdnum/fi/hetu.py, stdnum/gb/nhs.py, stdnum/gb/upn.py, stdnum/gb/vat.py, stdnum/is_/kennitala.py, stdnum/it/codicefiscale.py, stdnum/nl/onderwijsnummer.py, stdnum/numdb.py, stdnum/rs/pib.py, stdnum/sk/rc.py, stdnum/us/tin.py: Make import ordering consistent 2017-09-10 Arthur de Jong * [1c27639] stdnum/al/nipt.py, stdnum/ar/cbu.py, stdnum/ar/cuit.py, stdnum/at/businessid.py, stdnum/at/uid.py, stdnum/au/abn.py, stdnum/au/acn.py, stdnum/au/tfn.py, stdnum/be/vat.py, stdnum/bg/egn.py, stdnum/bg/pnf.py, stdnum/bg/vat.py, stdnum/br/cnpj.py, stdnum/br/cpf.py, stdnum/ca/bn.py, stdnum/ca/sin.py, stdnum/ch/ssn.py, stdnum/ch/uid.py, stdnum/ch/vat.py, stdnum/cl/rut.py, stdnum/cn/ric.py, stdnum/co/nit.py, stdnum/cusip.py, stdnum/cy/vat.py, stdnum/cz/dic.py, stdnum/cz/rc.py, stdnum/damm.py, stdnum/de/idnr.py, stdnum/de/vat.py, stdnum/de/wkn.py, stdnum/dk/cpr.py, stdnum/dk/cvr.py, stdnum/do/cedula.py, stdnum/do/rnc.py, stdnum/ean.py, stdnum/ec/ci.py, stdnum/ec/ruc.py, stdnum/ee/ik.py, stdnum/ee/kmkr.py, stdnum/ee/registrikood.py, stdnum/es/ccc.py, stdnum/es/cif.py, stdnum/es/cups.py, stdnum/es/dni.py, stdnum/es/iban.py, stdnum/es/nie.py, stdnum/es/nif.py, stdnum/es/referenciacatastral.py, stdnum/eu/at_02.py, stdnum/eu/eic.py, stdnum/eu/nace.py, stdnum/eu/vat.py, stdnum/fi/alv.py, stdnum/fi/associationid.py, stdnum/fi/hetu.py, stdnum/fi/veronumero.py, stdnum/fi/ytunnus.py, stdnum/fr/nif.py, stdnum/fr/nir.py, stdnum/fr/siren.py, stdnum/fr/siret.py, stdnum/fr/tva.py, stdnum/gb/nhs.py, stdnum/gb/sedol.py, stdnum/gb/upn.py, stdnum/gb/vat.py, stdnum/gr/vat.py, stdnum/grid.py, stdnum/hr/oib.py, stdnum/hu/anum.py, stdnum/iban.py, stdnum/ie/pps.py, stdnum/ie/vat.py, stdnum/imei.py, stdnum/imo.py, stdnum/imsi.py, stdnum/is_/kennitala.py, stdnum/is_/vsk.py, stdnum/isan.py, stdnum/isbn.py, stdnum/isil.py, stdnum/isin.py, stdnum/ismn.py, stdnum/iso6346.py, stdnum/iso7064/mod_11_10.py, stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py, stdnum/iso9362.py, stdnum/issn.py, stdnum/it/codicefiscale.py, stdnum/it/iva.py, stdnum/lei.py, stdnum/lt/pvm.py, stdnum/lu/tva.py, stdnum/luhn.py, stdnum/lv/pvn.py, stdnum/mc/tva.py, stdnum/meid.py, stdnum/mt/vat.py, stdnum/mx/rfc.py, stdnum/my/nric.py, stdnum/nl/brin.py, stdnum/nl/bsn.py, stdnum/nl/btw.py, stdnum/nl/onderwijsnummer.py, stdnum/nl/postcode.py, stdnum/no/mva.py, stdnum/no/orgnr.py, stdnum/numdb.py, stdnum/pl/nip.py, stdnum/pl/pesel.py, stdnum/pl/regon.py, stdnum/pt/nif.py, stdnum/ro/cf.py, stdnum/ro/cnp.py, stdnum/rs/pib.py, stdnum/ru/inn.py, stdnum/se/orgnr.py, stdnum/se/vat.py, stdnum/si/ddv.py, stdnum/sk/dph.py, stdnum/sm/coe.py, stdnum/tr/__init__.py, stdnum/tr/tckimlik.py, stdnum/us/atin.py, stdnum/us/ein.py, stdnum/us/itin.py, stdnum/us/ptin.py, stdnum/us/rtn.py, stdnum/us/ssn.py, stdnum/us/tin.py, stdnum/verhoeff.py: Docstring improvements 2017-09-08 Arthur de Jong * [2cc39ea] stdnum/cz/dic.py, tests/test_eu_vat.doctest: Fix Czech DIČ check digit calculation This fixes a bug in the check digit calculation for the 9-digit numbers that start with a 6 for individuals without a RČ. This also adds a few tests for Czech VAT numbers. See https://github.com/arthurdejong/python-stdnum/issues/51 2017-09-04 Arthur de Jong * [d24a439] stdnum/ee/registrikood.py, tests/test_ee_registrikood.doctest: Add Estonian Registrikood This is based on what was done by Mohammed Salman of Holvi. This adds more tests and validates the check digit. This uses the check digit algorithm from Isikukood which seems to work with all tested numbers although there is no confirmation that this is the correct algorithm. 2017-08-25 Mohammed Salman * [53cc0dc] stdnum/de/idnr.py, tests/test_de_idnr.doctest: Add support for German tax id number 2017-08-30 Arthur de Jong * [a71a1ac] stdnum/isbn.py, tests/test_isbn.doctest: Check bookland code in ISBN This ensures that an InvalidComponent() exception is raised when an unknown EAN bookland code is found. It will also raise this exception when using to_isbn10() when not using the 978 code. 2017-08-28 Arthur de Jong * [8f6fa7d] setup.cfg, stdnum/iban.py, stdnum/ismn.py, stdnum/meid.py, stdnum/numdb.py, stdnum/util.py, tests/numdb-test.dat, tests/test_util.doctest: Ensure 100% branch coverage This ensures that the tests fail if 100% branch coverage is not achieved. It also adds some pragma statements for code that cannot be covered or is Python version dependent. Furthermore, the get_module_list() function was removed from stdnum.util and more tests were made from stdnum.util and stdnum.numdb. The functionality to call format() in a country-specific IBAN implementation was also dropped because it was not used. 2017-08-27 Arthur de Jong * [fbc92f8] stdnum/gb/upn.py: Add English Unique Pupil Number (UPN) 2017-08-26 Arthur de Jong * [b8389eb] stdnum/ca/bn.py, tests/test_ca_bn.doctest: Add Canadian Business Number (BN) 2017-08-26 Arthur de Jong * [efd2eb9] stdnum/ca/__init__.py, stdnum/ca/sin.py: Add Canadian Social Insurance Number (SIN) 2017-08-24 Arthur de Jong * [b8e12d6] setup.cfg: Ensure all Python files are in coverage report 2017-08-17 Mohammed Salman * [0c91b43] stdnum/fi/veronumero.py: Implement Finnish individual tax number validation 2017-07-11 Arthur de Jong * [bd0c7c7] online_check/check.js, online_check/stdnum.wsgi, online_check/template.html: Include search term in online form This also makes the Javascript regular expression used for highlighting links the same as the Python equivalent. 2017-06-02 Arthur de Jong * [81446fd] stdnum/iso7064/mod_97_10.py: Use slightly more compact code This changes the alphanumeric to numeric translation to be slightly more compact and slightly faster. 2017-04-16 Arthur de Jong * [ed9ac5b] tests/test_isbn.doctest: Add a few ISBNs found online This adds a number of ISBNs found online from various sources to the test suite. 2017-04-15 Arthur de Jong * [57c12d8] stdnum/ismn.py, tests/test_ismn.doctest: An ISMN can only be 10 or 13 digits This also adds the test that an ISMN should start with 9790. 2017-04-15 Arthur de Jong * [6fb2e89] stdnum/isbn.py, tests/test_isbn.doctest: Fix conversion of 9 digit ISBN to ISBN13 2017-04-13 Arthur de Jong * [5604d91] docs/index.rst, setup.py, stdnum/fr/nir.py, stdnum/fr/siren.py, stdnum/gb/nhs.py, stdnum/isil.py, stdnum/iso6346.py, stdnum/lv/pvn.py, stdnum/nl/brin.py, stdnum/us/ein.dat, tests/test_al_nipt.doctest: Switch to HTTPS URLs 2017-04-13 Arthur de Jong * [d14ea3b] online_check/README, online_check/check.js, online_check/stdnum.wsgi: Show possible conversions in online check This shows possible converted values. For example it will show ISBN13 conversions for ISBN10 values. 2017-04-13 Arthur de Jong * [6b588d1] stdnum/damm.py: Fix bug in damm.is_valid() function 2017-04-11 Arthur de Jong * [35542c1] ChangeLog, MANIFEST.in, NEWS, README, docs/index.rst, docs/stdnum.ar.cbu.rst, docs/stdnum.eu.eic.rst, docs/stdnum.eu.nace.rst, docs/stdnum.lei.rst, docs/stdnum.mc.tva.rst, docs/stdnum.rs.pib.rst, stdnum/__init__.py: Get files ready for 1.6 release 2017-04-10 Arthur de Jong * [93459d3] stdnum/cn/loc.dat, stdnum/eu/nace.dat, stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat: Update database files 2017-04-10 Arthur de Jong * [bb1712d] online_check/README, online_check/check.js, online_check/jquery-1.7.1.js, online_check/jquery-1.7.1.min.js, online_check/stdnum.wsgi, online_check/template.html: Add simple online check example This adds the code that is used to find formats for which a supplied number is valid. This is the code that is used on https://arthurdejong.org/python-stdnum/check/ 2017-04-10 Arthur de Jong * [5398247] stdnum/lei.py, tests/test_lei.doctest: Add Legal Entity Identifier 2017-04-10 Arthur de Jong * [e844b52] stdnum/iban.py, stdnum/iso7064/mod_97_10.py: Integrate base10 conversion into Mod 97, 10 This moves the conversion of an alphanumeric string to a numeric representation for modulo 97 calculation to the mod_97_10 module because this mechanism seems to be used by multiple formats. 2017-04-10 Arthur de Jong * [1b3d16e] stdnum/es/nie.py: Add missing export (__all__) 2017-04-10 Arthur de Jong * [72f5c6c] stdnum/rs/__init__.py, stdnum/rs/pib.py, tests/test_rs_pib.doctest: Add Serbian Poreski Identifikacioni Broj 2017-04-10 Arthur de Jong * [800205c] tox.ini: Print warnings during tox run 2017-04-07 Arthur de Jong * [7493eca] stdnum/cusip.py, stdnum/ean.py, stdnum/ec/ci.py, stdnum/isin.py, stdnum/tr/tckimlik.py: Use a slightly more readable weight alternation Switch to a slightly more readable syntax for alternating between two weights in checksums calculations. 2017-04-01 Arthur de Jong * [23b2150] stdnum/eu/eic.py, tests/test_eu_eic.doctest: Add European EIC (Energy Identification Code) 2017-03-26 Arthur de Jong * [194f025] stdnum/meid.py, tests/test_robustness.doctest: Add unicode robustness tests This tests a few unicode strings and fixes a bug in the MEID module. 2017-03-26 Arthur de Jong * [d43c394] stdnum/es/referenciacatastral.py, tests/test_es_referenciacatastral.doctest: Add test for Ñ in Referencia Catastral This supports the Referencia Catastral with an Ñ in it for both byte strings (Python 2) and unicode strings (Python 2 and 3). Support for literal unicode strings in Python 2 doctests is flaky so the test is a bit ugly. This also adds a few numbers that were found online. Sadly no real numbers with an Ñ in it have been found so the one in the test was constructed. 2017-03-26 Arthur de Jong * [61d73c1] getnace.py, stdnum/eu/nace.dat, stdnum/eu/nace.py, tests/test_robustness.doctest: Add European NACE classification This number is used to classify business. Validation is done based on a downloaded registry. 2017-03-26 Arthur de Jong * [649f073] stdnum/mc/tva.py: Remove unused import 2017-03-19 Arthur de Jong * [c957318] stdnum/fr/tva.py, stdnum/mc/__init__.py, stdnum/mc/tva.py, tests/test_eu_vat.doctest: Add support for Monaco VAT number The number uses the French TVA number but, unlike normal French VAT numbers, they are not valid French SIREN numbers. See https://github.com/arthurdejong/python-stdnum/issues/46 2016-12-11 Arthur de Jong * [5b43857] stdnum/au/tfn.py: Remove unused import 2016-12-01 Greg Kuwaye * [7d16ea5] stdnum/us/ein.dat: Add new 47 EIN prefix; fix duplicate 46; move 81 47 appears to be a new Internet campus code. Prefix 46 was listed twice, once under the Philadelphia campus and again under the Internet campus. This error may be seen on the IRS website itself. The Wikipedia article on EIN (https://en.wikipedia.org/wiki/Employer_Identification_Number) does not have 46 listed twice. 81 has moved from the Philadelphia campus to the Internet campus. 2016-11-14 Luciano Rossi * [dcde8f4] stdnum/ar/cbu.py, tests/test_ar_cbu.doctest: Implement CBU (unique bank code) of Argentina See https://github.com/arthurdejong/python-stdnum/issues/43 2016-11-14 Arthur de Jong * [da18e3b] setup.py, stdnum/fi/associationid.py, stdnum/meid.py, tests/test_mx_rfc.doctest, tox.ini: Add Python 2.6 support This also brings the list of Python versions in setup.py in line with tox.ini. 2016-11-13 Arthur de Jong * [62ebbce] ChangeLog, NEWS, README, docs/index.rst, docs/stdnum.au.abn.rst, docs/stdnum.au.acn.rst, docs/stdnum.au.tfn.rst, docs/stdnum.es.ccc.rst, docs/stdnum.es.cups.rst, docs/stdnum.es.iban.rst, docs/stdnum.es.referenciacatastral.rst, stdnum/__init__.py: Get files ready for 1.5 release 2016-11-13 Arthur de Jong * [c9beb00] stdnum/cn/loc.dat, stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat, tests/test_iban.doctest: Update database files This removes the Costa Rica IBAN test because the format of the IBAN seems to have been changed. The old length still seems to be in use so a more permanent solution is probably required. 2016-11-13 Arthur de Jong * [ac560a7] getisbn.py: Update getisbn to Python3 There were some SSL-related issues with the urllib module. This was the easiest solution. 2016-11-13 Arthur de Jong * [458c310] getiban.py: Update gettin IBAN registry The format of the registry file has changed. Before it was a straightforward CSV file with countries in rows but countries are now in columns. 2016-11-09 Sergi Almacellas Abellana * [45faa7c] .gitignore, tox.ini: Add tox.ini file 2016-11-08 Sergi Almacellas Abellana * [a9e5405] stdnum/eu/at_02.py: Implement calc_check_digits in SEPA Identifier of the Creditor (AT-02) 2016-10-14 Arthur de Jong * [8ea76ba] stdnum/au/tfn.py, tests/test_au_tfn.doctest: Add Australian Tax File Number Based on the implementation provided by Vincent Bastos See https://github.com/arthurdejong/python-stdnum/pull/40 2016-10-14 Arthur de Jong * [8028c3a] stdnum/au/acn.py, tests/test_au_acn.doctest: Add Australian Company Number Based on the implementation provided by Vincent Bastos See https://github.com/arthurdejong/python-stdnum/pull/40 2016-10-14 Arthur de Jong * [70b94ee] stdnum/au/__init__.py, stdnum/au/abn.py, tests/test_au_abn.doctest: Add Australian Business Number Based on the implementation provided by Vincent Bastos See https://github.com/arthurdejong/python-stdnum/pull/40 2016-10-14 Arthur de Jong * [d7cff5d] stdnum/be/__init__.py, stdnum/be/vat.py: Provide businessid as an alias The Belgian company number or enterprise number (ondernemingsnummer) is the new name for what was previously the VAT number. 2016-09-10 Arthur de Jong * [352aa8a] stdnum/es/referenciacatastral.py: Add reference to Referencia Catastral implementation 2016-09-03 Arthur de Jong * [49db553] tests/test_es_referenciacatastral.doctest: Add more tests for Referencia Catastral This adds a number of extra tests for the Spanish Referencia Catastral (stdnum.es.referenciacatastral) module, mostly based on numbers found online. This commit includes some of the documentation on the structure of Referencia Catastral that was in the original pull request. See https://github.com/arthurdejong/python-stdnum/pull/38 2016-08-31 David García Garzón * [2c557a0] stdnum/es/referenciacatastral.py: Add Spansih Referencia Catastral The control digit check algorithm is based on Javascript implementation by Vicente Sancho that can be found at http://trellat.es/validar-la-referencia-catastral-en-javascript/ See https://github.com/arthurdejong/python-stdnum/pull/38 2016-09-10 Arthur de Jong * [b128c8d] tests/test_iban.doctest: Test a few Spanish IBANs found online 2016-09-10 Arthur de Jong * [878e036] stdnum/numdb.py: Avoid leaving open file descriptor in test 2016-09-08 Arthur de Jong * [be24790] stdnum/es/iban.py, tests/test_iban.doctest: Add Spanish IBAN number module This validates the country-specific part of the IBAN. 2016-09-08 Arthur de Jong * [2510932] stdnum/iban.py: Validate country-specific part of IBAN This adds the possible of validating the country-specific part of the IBAN. If the country has an IBAN module, checking is also delegated to that module. 2016-09-06 Arthur de Jong * [d8cca82] stdnum/eu/vat.py, stdnum/util.py: Introduce get_cc_module() utility function This changes the get_vat_module() function to a more generic get_cc_module() function so that it can also be used for other things like IBAN checking. 2016-09-06 Arthur de Jong * [1622873] stdnum/es/ccc.py: Add to_iban() function to Spanish CCC 2016-09-08 Arthur de Jong * [7d969be] stdnum/iban.py: Implement calc_check_digits() in IBAN Introduce a function to calculate the two check digits of an IBAN. Since the check digits are the third and fourth characters in the number, placeholders need to be provided when calling this function. 2016-08-31 David García Garzón * [294f872] stdnum/es/ccc.py: Add Spanish Código Cuenta Corriente (CCC) 2016-08-28 David García Garzón * [466cec8] stdnum/es/cups.py, tests/test_es_cups.doctest: Add Spanish CUPS code 2016-08-28 Arthur de Jong * [d95382f] stdnum/exceptions.py: Properly print error message of exceptions This ensures that the message passed to the constructor is shown in the traceback while falling back to the class default. 2016-07-26 Arthur de Jong * [01a7f34] ChangeLog, NEWS, README, docs/index.rst, docs/stdnum.damm.rst, docs/stdnum.fr.nif.rst, docs/stdnum.fr.nir.rst, docs/stdnum.fr.siret.rst, docs/stdnum.gb.nhs.rst, docs/stdnum.tr.tckimlik.rst, stdnum/__init__.py: Get files ready for 1.4 release 2016-07-26 Arthur de Jong * [3e4e9e2] getmybp.py, stdnum/cn/loc.dat, stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update database files This also updates the getmybp script to support the new layout. 2016-07-26 Arthur de Jong * [3e344d1] stdnum/iso6346.py: Add formatting of ISO 6346 container codes 2016-07-26 Arthur de Jong * [aa1c298] getnumlist.py, stdnum/damm.py, tests/test_damm.doctest: Implement Damm algorithm This is a generic check digit algorithm. 2016-07-26 Arthur de Jong * [411d038] stdnum/fr/nif.py: Fix French NIF format test Fixes 2409ee9. 2016-07-26 Arthur de Jong * [06e4165] stdnum/ch/ssn.py: Improve validation to Swiss SSN number The EAN-13 number should start with 756. 2016-07-26 Arthur de Jong * [1907c67] stdnum/br/cpf.py: Add documentation to Brazillian CPF 2016-07-26 Arthur de Jong * [cf428ac] stdnum/iso6346.py: Add pointer to ISO 6346 information 2016-07-26 Arthur de Jong * [011c0f0] stdnum/gb/nhs.py: Fix copyright notice 2016-05-22 Dimitri Papadopoulos * [2409ee9] stdnum/fr/nif.py: Add NIF - French tax identification number Add module for NIF also known as SPI number. 2016-07-26 Arthur de Jong * [43b58d3] stdnum/fr/nir.py: Move NIR check digit calculation to function This also fixes a number of formatting issues, improves the module description and adds tests for the 2A and 2B departments. 2016-05-29 Dimitri Papadopoulos * [879f2d3] stdnum/fr/nir.py: Improve French NIR validation Please note that the 7th character of the NIR might be 'A' or 'B'. Other than that the NIR contains digits only. 2016-07-25 Arthur de Jong * [fd9f953] stdnum/fr/siren.py, stdnum/fr/siret.py, tests/test_fr_siren.doctest, tests/test_fr_siret.doctest: Add extra tests for SIREN and SIRET This adds tests for a few numbers that have been found online and allows the dot as a seprator because those numbers were found. It also ensures that the SIREN validation is also called for SIRET and adds a SIRET formatting function. 2016-05-27 Yoann Aubineau * [5ba3a87] stdnum/fr/siret.py: Add French SIRET number Add a SIRET (Système d'Identification du Répertoire des ETablissements, a French company etablishment identification number) module. 2016-05-29 Arthur de Jong * [dc708f0] stdnum/isil.py, tests/test_isil.doctest: Add more ISIL tests This moves a few of the tests from the module to a dedicated test file and adds tests for a number of ISIL numbers found online. 2016-05-29 Arthur de Jong * [4a57d84] stdnum/us/tin.py: Fix formatting of bulleted list 2016-05-28 Arthur de Jong * [9b74840] stdnum/ch/ssn.py, tests/test_ch_ssn.doctest: Fix bug in Swiss SSN validation The validation was delegated to the EAN module but the number is supposed to be an EAN-13 only and and EAN-8 was also accepted. This also reformats the docstring. 2016-05-28 Arthur de Jong * [f3c2491] stdnum/ie/vat.py, tests/test_ie_vat.doctest: Fix bug in Irish VAT number validation The last digits of the number that should be letters were not tested to be letters which could result in ValueError being raised for certain validations. This also clarifies the documentation and adds a convert() function to convert numbers from the old format (where the second character would be a letter or symbol) to the new format (7 digits followed by 1 or 2 letters). 2016-05-28 Arthur de Jong * [b5397ed] tests/test_robustness.doctest: Small improvements to tests This includes a formatting fix and removes an unused variable from a test. 2016-05-28 Arthur de Jong * [d85b27f] stdnum/util.py: Fix get_module_description() This fixes the initial implementation in 3f6d52a. 2016-05-22 Dimitri Papadopoulos * [a1afa76] stdnum/fr/nir.py: Add French NIR Add module for NIR also known as social security number. 2016-05-09 Arthur de Jong * [0a2f39e] stdnum/gb/nhs.py: Add United Kingdom NHS number Add module for United Kingdom National Health Service patient identifier. 2016-05-09 Arthur de Jong * [2126947] stdnum/numdb.py: Read numdb files in context manager This ensures that the file is explicitly closed in the function to avoid "unclosed file" warnings. See: https://github.com/arthurdejong/python-stdnum/issues/33 2016-04-11 Arthur de Jong * [e28b5e1] stdnum/ch/uid.py, stdnum/ch/vat.py, stdnum/cusip.py, stdnum/dk/cpr.py, stdnum/iban.py, stdnum/imei.py, stdnum/isbn.py, stdnum/isil.py, stdnum/isin.py, stdnum/issn.py, stdnum/mx/rfc.py, stdnum/nl/bsn.py, stdnum/nl/onderwijsnummer.py, stdnum/pl/regon.py, stdnum/tr/tckimlik.py, stdnum/us/ssn.py, stdnum/verhoeff.py: Make more information links consistent Also fix a docstring in stdnum.nl.bsn and add a pointer to stdnum.nl.onderwijsnummer. 2016-04-09 Arthur de Jong * [feab917] stdnum/eu/vat.py, stdnum/tr/tckimlik.py, stdnum/util.py: Implement online TC Kimlik check This refactors out the SOAP client function that was implemented for VIES to the stdnum.utils module. 2016-04-09 Arthur de Jong * [619b097] stdnum/tr/__init__.py, stdnum/tr/tckimlik.py, tests/test_tr_tckimlik.doctest: Add Turkish personal identification number 2016-04-01 Arthur de Jong * [095dcbb] stdnum/mx/rfc.py, tests/test_mx_rfc.doctest: Document accuracy of RFC check digit test There is an online service that allows validating RFC numbers. It seems there are a lot of numbers that do not match the check digit algorithm which confirms disabling the check digit test by default is a good idea. Also see https://github.com/arthurdejong/python-stdnum/issues/32 2016-03-05 Arthur de Jong * [41cecb5] ChangeLog, NEWS, getnumlist.py, setup.py, stdnum/__init__.py: Get files ready for 1.3 release 2016-03-03 Arthur de Jong * [6457734] getcnloc.py, getiban.py, stdnum/cn/loc.dat, stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update database files This also updates the getcnloc and getiban scripts to use new URLs. 2015-10-30 Arthur de Jong * [0061564] stdnum/dk/cpr.py, stdnum/iban.py, stdnum/imei.py, stdnum/isbn.py, stdnum/isil.py, stdnum/issn.py, stdnum/nl/bsn.py, stdnum/us/ssn.py, stdnum/verhoeff.py: Integrate information from the wiki This adds the information that was previously in the Trac wiki into the source docstrings because the Trac instance is being phased out. This also includes small updates to the ISIL module. 2015-10-28 Arthur de Jong * [96c8151] stdnum/eu/vat.py: Fix SOAP client re-use This fixes a bug when checking re-use of the global SOAP client object. The object could not be evaluated in boolean context so is no explicitly compared to None. For suds a MethodNotFound exception would be raised for __nonzero__() (which Python uses for boolean comparison). 2015-10-28 Lionel Elie Mamane * [2881b86] stdnum/eu/vat.py: Fix problem with check_vies_approx() 2015-10-15 Ronald Paloschi * [fb0efe0] stdnum/iso6346.py, tests/test_iso6346.doctest: Fix for when ISO 6346 checksum is 10 Bug fix for when the checksum is 10, it was compared to 0 and failed. New doctest exposing the bug that passes after the fix is applied. See: https://github.com/arthurdejong/python-stdnum/pull/30 2015-10-11 Arthur de Jong * [1361817] ChangeLog, MANIFEST.in, NEWS, README, docs/index.rst, docs/stdnum.at.businessid.rst, docs/stdnum.br.cnpj.rst, docs/stdnum.ch.uid.rst, docs/stdnum.ch.vat.rst, docs/stdnum.cusip.rst, docs/stdnum.de.wkn.rst, docs/stdnum.ee.ik.rst, docs/stdnum.fi.associationid.rst, docs/stdnum.fi.ytunnus.rst, docs/stdnum.gb.sedol.rst, docs/stdnum.imo.rst, docs/stdnum.isin.rst, docs/stdnum.mx.rfc.rst, docs/stdnum.pl.pesel.rst, docs/stdnum.pl.regon.rst, docs/stdnum.ru.inn.rst, setup.py, stdnum/__init__.py: Get files ready for 1.2 release 2015-10-11 Arthur de Jong * [1327045] getcnloc.py, stdnum/cn/loc.dat, stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update database files This also updates the script to download updated Chinese location names. 2015-10-11 Arthur de Jong * [a891c60] stdnum/al/nipt.py, stdnum/co/nit.py, stdnum/iban.py, stdnum/ie/pps.py, stdnum/imei.py, stdnum/isan.py, stdnum/iso6346.py, stdnum/it/codicefiscale.py, stdnum/meid.py, stdnum/nl/postcode.py, stdnum/numdb.py, stdnum/pt/nif.py, stdnum/us/atin.py, stdnum/us/ein.py, stdnum/us/itin.py, stdnum/us/ptin.py, stdnum/us/ssn.py, stdnum/util.py: Code style improvements Ensure that regular expressions are r'' strings, avoid too long lines and fix line wrapping. Also avoid catching toplevel Exception when possible and use binascii for hex to binary conversion which is available in both Python 2 and 3. 2015-10-11 Arthur de Jong * [3c7a302] stdnum/cusip.py, stdnum/de/wkn.py, stdnum/gb/sedol.py, stdnum/isin.py: Convert security ids to ISIN Allow conversion from national securities identifiers to the international ISIN. 2015-10-11 Arthur de Jong * [c565517] stdnum/de/wkn.py, tests/test_de_wkn.doctest: Add German Wertpapierkennnummer The format itself is pretty simple (no check digit) but this module is more for completeness sake. 2015-10-10 Arthur de Jong * [961815f] stdnum/gb/sedol.py, tests/test_gb_sedol.doctest: Add SEDOL number 2015-10-10 Arthur de Jong * [fb91775] stdnum/ru/__init__.py: Add information to Russian package 2015-10-10 Arthur de Jong * [ebb5c07] MANIFEST.in, stdnum/numdb.py, tests/numdb-test.dat: Move numdb test file This places the test database file in the tests directory. 2015-10-10 Arthur de Jong * [fa8099e] stdnum/imo.py: Add int. maritime org. number (IMO) This adds checks for the International Maritime Organization number used to identify ships. However, there seem to be a lot of ships with an IMO number that does not follow these rules (different check digits or even length). 2015-10-10 Arthur de Jong * [111b4fd] stdnum/isan.py, tests/test_isan.doctest: Fix handling of strip_check_digits in ISAN This fixes the compact() function to honor the strip_check_digits argument and does not validate the check digits if they are passed to validate together with strip_check_digits. 2015-10-10 Arthur de Jong * [9f9d13c] stdnum/isin.py, tests/test_isin.doctest: Add international securities id (ISIN) This adds support for handling ISINs (International Securities Identification Number). The can contain a CUSIP but performing this additional validation is currently not performed. 2015-10-09 Arthur de Jong * [522611c] stdnum/cusip.py, tests/test_cusip.doctest: Add CUSIP number 2015-10-08 Arthur de Jong * [320ecea] stdnum/ch/uid.py, stdnum/ch/vat.py, tests/test_ch_uid.doctest, tests/test_ch_vat.doctest: Add Swiss UID and VAT numbers The Swiss VAT number (MWST, TVA, IVA, TPV) is the UID (Unternehmens-Identifikationsnummer) followed by one of the VAT abbreviations. 2015-10-05 Arthur de Jong * [ec9bcb0] stdnum/mx/__init__.py, stdnum/mx/rfc.py, tests/test_mx_rfc.doctest: Add Mexican RFC number This adds support for the Mexican tax number RFC (Registro Federal de Contribuyentes). This module includes a number of checks on the number but the validation of the last check digit is disabled by default because a large number of numbers were found that were otherwise valid but had an invalid check digit. 2015-10-04 Arthur de Jong * [fd0cfd9] stdnum/eu/vat.py, stdnum/util.py: Move finding VAT module to util This moves the finding of a VAT module to the util module so that it can be more easily re-used for non-EU countries. 2015-10-04 Arthur de Jong * [38ed9c0] stdnum/co/nit.py, tests/test_co_nit.doctest: Update Colombian NIT checks This adds a number of tests for numbers found online. The length check has also been revisited because both shorter numbers and longer number have been found. This also updates the format() function to handle arbitrary length numbers. 2015-10-02 Arthur de Jong * [d413f95] stdnum/isbn.py: Fix comment 2015-10-02 Arthur de Jong * [3d1dbbb] stdnum/ar/cuit.py, stdnum/bg/egn.py, stdnum/bg/pnf.py, stdnum/bg/vat.py, stdnum/co/nit.py, stdnum/dk/cpr.py, stdnum/dk/cvr.py, stdnum/do/rnc.py, stdnum/ec/ruc.py, stdnum/ee/kmkr.py, stdnum/fi/alv.py, stdnum/gb/vat.py, stdnum/hu/anum.py, stdnum/is_/kennitala.py, stdnum/lv/pvn.py, stdnum/mt/vat.py, stdnum/no/orgnr.py, stdnum/pl/nip.py, stdnum/pl/pesel.py, stdnum/pl/regon.py, stdnum/ro/cf.py, stdnum/ro/cnp.py: Use zip() instead of enumerate() Makes the code slightly simpler and more compact. 2015-10-01 Sergio Isidoro * [222a87e] stdnum/fi/__init__.py: Add alias to hetu in for finnish personal id code 2015-09-27 Arthur de Jong * [e045c71] tests/test_eu_vat.doctest: Add more numbers found online 2015-09-07 Dariusz Choruzy * [36217ac] stdnum/pl/regon.py, tests/test_pl_regon.doctest: Add Polish REGON number 2015-09-06 Dariusz Choruzy * [a0cb61f] stdnum/pl/pesel.py: Add Polish PESEL number 2015-08-16 Arthur de Jong * [5ab8d24] stdnum/ru/__init__.py, stdnum/ru/inn.py, tests/test_ru_inn.doctest: Add Russioan ИНН (INN) tax ID This adds a basic implementation of the Russian Идентификационный номер налогоплательщика (tax identification number). This currently only checks the format, length and check digits but not whether each of the parts of the number are valid (e.g. valid region specified). 2015-08-16 Arthur de Jong * [714fa60] stdnum/br/cnpj.py, tests/test_br_cnpj.doctest: Add Brazillian CNPJ business identifier Add module for Cadastro Nacional da Pessoa Jurídica, the Brazillian company identifier. 2015-08-16 Arthur de Jong * [b939099] getiban.py, stdnum/iban.dat, tests/test_iban.doctest: Update IBAN tests This updates the iban.dat file from the IBAN registry, includes a fix for handling spaces in the BBAN and adds some more IBAN examples from the IBAN registry. 2015-08-16 Arthur de Jong * [7714db7] stdnum/iso9362.py: Make uppercase in compact() This changes the compact() function of the ISO 9362 module to make all the letters uppercase. 2015-08-16 Arthur de Jong * [6afa875] setup.cfg, stdnum/imei.py, stdnum/isbn.py, stdnum/isil.py, stdnum/ismn.py, stdnum/meid.py, stdnum/us/atin.py, stdnum/us/ein.py, stdnum/us/itin.py: Turn on and improve branch coverage 2015-08-16 Arthur de Jong * [e88ba0b] stdnum/dk/cpr.py, stdnum/is_/kennitala.py, stdnum/it/codicefiscale.py: Small typo and code style fixes 2015-08-03 Tomas Karasek * [243e50f] stdnum/ee/ik.py, tests/test_ee_ik.doctest: Add validation of Estonian personal ID 2015-06-12 Lari Haataja * [7f9c94f] stdnum/at/businessid.py: Add company register number validation for Austria 2015-07-12 Arthur de Jong * [0cbba6e] : Merge Finnish numbers provided by Holvi This merges the Finnish numbers provided by Holvi Payment Services Oy as found here: https://github.com/holvi/python-stdnum 2015-07-12 Arthur de Jong * [320326e] stdnum/fi/ytunnus.py: Split out format() function This uses the stdnum.fi.alv module more extensively and ensures that validate() returns a compact representation and a separate format() function is available. 2015-06-23 Lari Haataja * [37f7fa6] stdnum/fi/__init__.py, stdnum/fi/ytunnus.py: Add validation for Finnish y-tunnus (business identifier) 2015-07-12 Arthur de Jong * [db24746] stdnum/fi/associationid.py: Add a whitelist for short numbers and fix API This implements separate functions compact() and format() and fixes the doctests. This also implements a whitelist of registered short numbers to avoid accidentally validating just any number. 2015-06-16 Lari Haataja * [8d30992] stdnum/fi/associationid.py: Validation for Finnish association identifier 2015-07-12 Arthur de Jong * [e107457] : Merge changes to use CN Open Data 2015-07-12 Arthur de Jong * [a1a134e] stdnum/eu/vat.py: Fall back to pysimplesoap if suds is unavailable Initial testing seems to suggest that proxy-support is not complete with pysimplesoap (at least httplib2 and PySocks seem to be required). 2015-04-28 Lionel Elie Mamane * [8fe44f9] stdnum/eu/vat.py: Implement alternate VIES check Add a function to stdnum.eu.vat so that when one does a VIES VAT number check, one gets a proof (certificate) that one did the check, as defence against the VAT administration later putting this in doubt. This certificate is provided by the VIES service, if one provides one's own VAT number. 2015-06-08 Jiangge Zhang * [6308261] stdnum/cn/loc.dat: Download and generate latest Chinese location data. 2015-06-08 Jiangge Zhang * [12ba352] getcnloc.py: Download GB2260 data from github.com/cn. 2015-04-27 Arthur de Jong * [8925ae2] tests/test_iso6346.doctest: Fix copyright header 2015-04-27 Arthur de Jong * [58775d9] ChangeLog, NEWS, README, docs/index.rst, docs/stdnum.al.nipt.rst, docs/stdnum.ar.cuit.rst, docs/stdnum.cl.rut.rst, docs/stdnum.co.nit.rst, docs/stdnum.do.cedula.rst, docs/stdnum.do.rnc.rst, docs/stdnum.is_.kennitala.rst, docs/stdnum.is_.vsk.rst, docs/stdnum.iso9362.rst, docs/stdnum.no.mva.rst, docs/stdnum.no.orgnr.rst, docs/stdnum.se.orgnr.rst, docs/stdnum.sm.coe.rst, setup.py, stdnum/__init__.py: Get files ready for 1.1 release 2015-04-27 Arthur de Jong * [583b066] getcnloc.py, stdnum/cn/loc.dat, stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update database files This also updates the script to download updated Chinese location names. 2014-10-24 Tomas Thor Jonsson * [dd309e4] stdnum/se/orgnr.py, stdnum/se/vat.py: Add support for SE orgnr This also delegates some of the validation for the Swedish VAT module to the orgnr module. 2015-04-27 Arthur de Jong * [23882e2] tests/test_ec_ruc.doctest: Add extra tests for the stdnum.ec.ruc module These numbers were found in various online sources. 2015-04-25 Arthur de Jong * [eac4d63] stdnum/fr/tva.py: Add extra test for French TVA 2014-10-14 P. Christeas * [9934f76] stdnum/gr/vat.py: Change description of Greek FPA number In Greece, our VAT number is used as a generic "tax registration" num. Update the docstring to reflect that name. 2015-04-22 Arthur de Jong * [4d7163c] stdnum/ar/__init__.py, stdnum/ar/cuit.py, tests/test_ar_cuit.doctest: Add Argentinian CUIT (VAT) number Based partially on the implementation in the vatnumber module. 2015-04-18 Arthur de Jong * [ba894d7] stdnum/sm/__init__.py, stdnum/sm/coe.py: Add San Marino COE (VAT) number Based partially on the implementation in the vatnumber module. 2015-04-18 Arthur de Jong * [144e1a4] stdnum/co/__init__.py, stdnum/co/nit.py: Add Colombian NIT/RUT (VAT) code Based on the implementation in the vatnumber module. 2015-04-18 Arthur de Jong * [c69c8f0] stdnum/cl/__init__.py, stdnum/cl/rut.py, tests/test_cl_rut.doctest: Add Chilean national tax number (RUT) Based on the implementation in the vatnumber module. 2015-04-18 Arthur de Jong * [3db826c] stdnum/al/__init__.py, stdnum/al/nipt.py, tests/test_al_nipt.doctest: Add Albanian NIPT (VAT) number Partially based on the implementation in the vatnumber module. Some valid numbers appear to start with an L so those are allowed as well. 2015-04-23 Arthur de Jong * [88d1af3] stdnum/do/cedula.py: Extend the list of valid Cedula This is based on the list of Cedula found at http://prd.org.do/2013/07/30/lista-del-cen-del-prd-actualizada-y-registrada-en-la-junta-central-electoral/ (link provided by José Arturo García) 2015-04-17 Arthur de Jong * [49d1e69] stdnum/do/cedula.py, tests/test_do_cedula.doctest: Add Dominican Republic Cedula number The Cedule is a Dominican Republic national identification number for persons. The number uses the Luhn checksum but apparently there are a lof of valid numbers in use that do not match the checksum. For this a whitelist is used. 2015-04-17 Arthur de Jong * [d003ac3] stdnum/do/__init__.py, stdnum/do/rnc.py, tests/test_do_rnc.doctest: Add Dominican Republic RNC number The RNC (Registro Nacional del Contribuyente) is the Dominican Republic taxpayer registration number for companies. 2015-04-19 Arthur de Jong * [9e94ab8] tests/test_no_mva.doctest: Add more stdnum.no.mva tests 2015-04-18 Arthur de Jong * [c334bcf] stdnum/is_/kennitala.py, tests/test_is_kennitala.doctest: Add more tests for Kennitala 2015-04-11 Tuomas Toivonen * [84620f8] stdnum/is_/__init__.py, stdnum/is_/kennitala.py, stdnum/is_/vsk.py: Support Icelandic personal, organisation and VAT identifiers The package is named "is_" because "is" is a reserved word. 2015-04-11 Tuomas Toivonen * [699b340] stdnum/no/__init__.py, stdnum/no/mva.py, stdnum/no/orgnr.py: Add support for Norwegian organisation and VAT numbers This commit also includes changes from Tomas Thor Jonsson . 2015-02-09 Tony Bajan * [75bcef0] stdnum/iso9362.py: Add ISO 9362 (BIC) support 2015-04-17 Arthur de Jong * [2574f89] stdnum/imsi.py: Raise InvalidComponent for unregistered IMSI 2014-12-23 Emiliano Castro * [9883c72] stdnum/eu/vat.py, stdnum/hr/__init__.py: Adding HR (Croatia) to the list of available countries 2014-11-01 Arthur de Jong * [3a7c9f7] stdnum/bg/vat.py, stdnum/eu/at_02.py, stdnum/iban.py, stdnum/isan.py, stdnum/meid.py, stdnum/numdb.py: Fix common spelling mistake 2014-10-31 Matt McDonald * [6e332b1] stdnum/meid.py, tests/test_meid.doctest: Fix for invalidating MEIDs with invalid decimal bit length See: http://arthurdejong.org/trac/python-stdnum/ticket/10 2014-10-20 Arthur de Jong * [3fa795d] getnumlist.py: Restore section for on homepage 2014-10-19 Arthur de Jong * [147eeb1] ChangeLog, NEWS, README, docs/index.rst, docs/stdnum.ch.ssn.rst, docs/stdnum.cn.ric.rst, docs/stdnum.ec.ci.rst, docs/stdnum.ec.ruc.rst, docs/stdnum.eu.at_02.rst, docs/stdnum.iso6346.rst, docs/stdnum.it.codicefiscale.rst, docs/stdnum.us.rtn.rst, getnumlist.py, setup.py, stdnum/__init__.py: Get files ready for 1.0 release 2014-10-19 Arthur de Jong * [72c0ff1] stdnum/iso6346.py: Remove unused import 2014-10-19 Arthur de Jong * [e713cc7] stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update database files 2014-10-13 Denis Krienbühl * [256aa49] stdnum/ch/__init__.py, stdnum/ch/ssn.py: Adds the Swiss social security number Also known as "Sozialversicherungsnummer" / "Neue AHV Nummer". 2014-10-18 Arthur de Jong * [2cc50e2] stdnum/eu/at_02.py, stdnum/iban.py, stdnum/imei.py, stdnum/iso7064/mod_11_10.py, stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py, stdnum/luhn.py, stdnum/util.py, stdnum/verhoeff.py: Only catch Exception 2014-10-17 Arthur de Jong * [e2948bb] : Add Ecuadorian CI and RUC numbers Add modules for Ecuadorian Identification Card (CI - Cédula de identidad) and Fiscal Numbers (RUC - Registro Único de Contribuyentes) See: https://github.com/arthurdejong/python-stdnum/pull/12 2014-10-17 Arthur de Jong * [e5250be] stdnum/ec/ci.py, stdnum/ec/ruc.py, tests/test_ec_ci.doctest, tests/test_ec_ruc.doctest: Validate parts of numbers This raises exceptions when the provice or establishment number part of the number contains invalid values. 2014-10-17 Arthur de Jong * [10a044f] stdnum/ec/ci.py, stdnum/ec/ruc.py: Refactor checksum functions Use the CI checks from within the RUC module for natural RUC numbers (thereby eliminating a bug in the RUC checksum calculation) and simplify the checksum functions. 2014-10-17 Arthur de Jong * [f61b855] stdnum/ec/ci.py, stdnum/ec/ruc.py, tests/test_ec_ci.doctest, tests/test_ec_ruc.doctest: Use dedicated doctests This moves a number of the existing test cases to dedicated doctest files and extend the tests with more numbers and corner cases. This also fixes a few docstrings. 2014-10-12 Jonathan Finlay * [e8f1ca6] stdnum/ec/__init__.py, stdnum/ec/ci.py, stdnum/ec/ruc.py: Add Ecuadorian CI and RUC numbers Add modules for Ecuadorian Identification Card (CI - Cédula de identidad) and Fiscal Numbers (RUC - Registro Único de Contribuyentes) 2014-10-06 Arthur de Jong * [2700b7a] : Add Chinese Resident Identity Card Number 2014-10-06 Jiangge Zhang * [141d576] stdnum/cn/ric.py, tests/test_cn_ric.doctest: Support the Resident Identity Card Number of People's Republic China 2014-10-05 Jiangge Zhang * [10ae548] getcnloc.py, stdnum/cn/loc.dat: Download locations from the China (PRC) government site 2014-10-05 Jiangge Zhang * [e9eb546] stdnum/cn/__init__.py: Add stdnum.cn package for Chinese (PRC) numbers 2014-10-05 Arthur de Jong * [97ac94d] stdnum/my/nric.py, tests/test_my_nric.doctest: Update NRIC tests 2014-10-05 Arthur de Jong * [123e9cb] getmybp.py, stdnum/my/bp.dat: Update URLs for Malaysian code lists This updates the URLs for the state and country codes as published by the National Registration Department of Malaysia and changes the parsing to the new page layout. This also updates the data file. https://github.com/arthurdejong/python-stdnum/issues/14 2014-09-01 Tony Bajan * [86f60a2] stdnum/us/rtn.py: Add US bank routing transit numbers 2014-07-05 Arthur de Jong * [fbb0316] getisbn.py: Use ElementTree for simpler XML parsing 2014-07-05 Arthur de Jong * [03e4f97] getisbn.py, stdnum/isbn.dat: Fix getisbn script and update ISBN data file 2014-04-11 Arthur de Jong * [26517fe] getnumlist.py, stdnum/__init__.py: Improve package docstring formatting and show example 2014-03-18 Sharoon Thomas * [85dd6f2] stdnum/iso6346.py, tests/test_iso6346.doctest: Add support for ISO6346 Add validation and creation of check digit for ISO6346 codes. See: https://github.com/arthurdejong/python-stdnum/pull/9 2014-03-05 Jussi Räsänen * [2405c89] stdnum/eu/vat.py: Added a simple backwards compability check 2014-02-17 Arthur de Jong * [a4012f5] stdnum/ie/pps.py, stdnum/ie/vat.py, tests/test_eu_vat.doctest: Add support for 2013 extension of Irish PPS Numbers References: - https://www.welfare.ie/en/Pages/PPSN.aspx - http://www.citizensinformation.ie/en/social_welfare/irish_social_welfare_system/personal_public_service_number.html 2014-02-06 Arthur de Jong * [71d9837] stdnum/eu/at_02.py: Rename AT-02 module to stdnum.eu.at_02 2014-02-05 Sergi Almacellas Abellana * [099078e] stdnum/at_02.py: Add SEPA Creditor identifier (AT-02) 2014-02-02 Arthur de Jong * [1ac00a0] stdnum/it/codicefiscale.py, tests/test_it_codicefiscale.doctest: Add an Italian Codice Fiscale module This module validates 16 digit Italian tax codes for individuals. https://en.wikipedia.org/wiki/Italian_fiscal_code_card It is based on the pycodicefiscale module that can be found here: https://github.com/baxeico/pycodicefiscale Functions have been renamed to follow the stdnum naming scheme: isvalid() -> is_valid(), control_code -> calc_check_digit(), get_birthday() -> get_birth_date(), get_sex() -> get_gender(). The build() function for generating tax codes (based on name, birth place and date) has been left out because this number cannot be uniquely constructed with this information alone (numbers are issued by the Italian tax office with a mechanism handle duplicates). Addresses trac ticket #9. 2014-01-01 Arthur de Jong * [c3d669c] setup.py: Remove requirement on distribute This accidentally slipped into 907e410. 2013-12-31 Arthur de Jong * [d933aab] .gitignore, ChangeLog, NEWS, README, docs/index.rst, docs/stdnum.my.nric.rst, docs/stdnum.nl.brin.rst, docs/stdnum.nl.postcode.rst, docs/stdnum.us.atin.rst, docs/stdnum.us.ein.rst, docs/stdnum.us.itin.rst, docs/stdnum.us.ptin.rst, docs/stdnum.us.tin.rst, getiban.py, getimsi.py, stdnum/__init__.py: Get files ready for 0.9 release 2013-12-31 Arthur de Jong * [5c1765e] stdnum/iban.dat, stdnum/isbn.dat: Update database files 2013-12-31 Arthur de Jong * [4217c35] stdnum/isan.py, stdnum/meid.py, stdnum/util.py: Add pragma: no cover for Python 3 Some statements are not covered in Python 3 tests. 2013-12-31 Arthur de Jong * [6c49ca8] getiban.py: Update getiban script This switches to use the csv module to support multi-line column values. This also handles some problems in the BBAN structure column that would contain an IBAN structure. 2013-12-31 Arthur de Jong * [0ee74e5] ChangeLog: Generate Changelog with different formatter git log --date=short --name-only \ --format="%x0c%ad %aN <%aE>%n%n%x09* [%h]%x00%s%n%x00%+b%x00" | \ awk 'BEGIN { RS="\f"; FS="\0" } { if ($1) { gsub(/\n*$/, "", $4); gsub(/^\n*/, "", $4); gsub(/\n/, ", ", $4); gsub(/\ngit-svn-id.*/, "", $3); gsub(/\n/, "\n\t ", $3); print $1 " " $4 ": "; print "\t " $2 $3 }}' | \ fmt --width=78 -c > ChangeLog 2013-12-30 Cédric Krier * [a148835] stdnum/gb/vat.py, tests/test_gb_vat.doctest: Add some new VAT numbers for GB Add support for restarting from November 2009 using 9755. Add support for EU format of health authorities See: https://github.com/arthurdejong/python-stdnum/pull/4 2013-12-12 eneq123 * [4609a22] getimsi.py, stdnum/imsi.dat: Update parsing in getimsi script This updates the regexes and includes seom optimizations. See: https://github.com/arthurdejong/python-stdnum/issues/1 2013-12-30 Cédric Krier * [9ec3cb0] stdnum/eu/vat.py: Add support for proxy 2013-12-04 Arthur de Jong * [7f30979] getimsi.py, stdnum/imsi.dat: Update getimsi script This updates the script due to the Wikipedia article change and removes the code for getting the data from ITU for now. See: https://github.com/arthurdejong/python-stdnum/issues/1 2013-11-09 Arthur de Jong * [b0c47d5] stdnum/nl/__init__.py, stdnum/nl/postcode.py: Add a Dutch postal code module The Dutch postal code (postcode) consists of four digits followed by two characters and together with the house number should uniquely identify any address. Addresses trac ticket #7. 2013-11-09 Arthur de Jong * [73d05b0] stdnum/nl/brin.py: Add a Dutch Brin number module The Brin (Basis Registratie Instellingen) is a number to identify schools and related institutions. Addresses trac ticket #6. 2013-11-09 Arthur de Jong * [73330a1] stdnum/nl/onderwijsnummer.py: Clarify onderwijsnummer description 2013-11-09 Arthur de Jong * [188d3ea] : Add various United States Tax number modules This adds modules for the Individual Taxpayer Identification Number (ITIN), the Employer Identification Number (EIN), Adoption Taxpayer Identification Number (ATIN) and Preparer Tax Identification Number (PTIN) that together with the Social Security Number (SSN) are valid Taxpayer Identification Numbers (TIN) 2013-10-12 Arthur de Jong * [9530635] stdnum/us/tin.py: Add a United States TIN module The Taxpayer Identification Number is used used for tax purposes in the United States. This module uses the SSN, ITIN, EIN, PTIN and ATIN modules to determine validitiy of the TIN. 2013-10-11 Arthur de Jong * [316e3f2] stdnum/us/ptin.py: Add a United States PTIN module A Preparer Tax Identification Number (PTIN) is United States identification number for tax return preparers. It is an eight-digit number prefixed with a capital P. 2013-10-11 Arthur de Jong * [47ea6ea] stdnum/us/atin.py: Add a United States ATIN module An Adoption Taxpayer Identification Number (ATIN) is a temporary nine-digit number issued by the United States IRS for a child for whom the adopting parents cannot obtain a Social Security Number. 2013-10-11 Arthur de Jong * [b1c9ba5] stdnum/us/ein.dat, stdnum/us/ein.py: Add a United States EIN module The Employer Identification Number (EIN), also known as Federal Employer Identification Number (FEIN), is used to identify a business entity in the United States. It is issued to anyone that has to pay withholding taxes on employees. 2013-10-11 Arthur de Jong * [19039f7] stdnum/us/itin.py: Add a United States ITIN module The ITIN (Individual Taxpayer Identification Number) is issued by the United States IRS to individuals who are required to have a taxpayer identification number but who are not eligible to obtain a Social Security Number. 2013-10-11 Arthur de Jong * [70b974b] stdnum/meid.py: Remove unused import 2013-11-08 Arthur de Jong * [f122c88] stdnum/util.py: Try to replace Unicode characters with ASCII This changes the stdnum.util.clean() method that is used by all modules to replace alternative Unicode dashes, dots, etc. by their ASCII equivalent so the numbers will be automatically converted and validated. Inspiration for this change came from https://github.com/JNRowe/pyisbn/pull/6 2013-06-14 Arthur de Jong * [c042f02] ChangeLog, NEWS, stdnum/__init__.py: Get files ready for 0.8.1 release 2013-06-14 Arthur de Jong * [31e5e81] MANIFEST.in, setup.py: Ensure that all used files are included in the sdist 2013-06-09 Arthur de Jong * [7fa9822] ChangeLog, NEWS, README, docs/index.rst, getnumlist.py, setup.py, stdnum/__init__.py: Get files ready for 0.8 release 2013-06-09 Arthur de Jong * [9597010] stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update database files We manually tweak the Finland IBAN entry. We should probably change the parsing so that it uses the IBAN structure instead of the BBAN structure. 2013-06-09 Arthur de Jong * [19cbb3c] stdnum/my/nric.py: Fix NRIC module description 2013-06-08 Arthur de Jong * [46a7996] getmybp.py, stdnum/my/__init__.py, stdnum/my/bp.dat, stdnum/my/nric.py, tests/test_my_nric.doctest: Add a Malaysian NRIC No. module NRIC No. (National Registration Identity Card Number) is the unique identifier for issued to Malaysian citizens and permanent residents. 2013-06-08 Arthur de Jong * [999f2c3] : Provide a validate() function in all modules This provides an additional means of doing number validation that allows applications calling this library to get more information about why the validation failed and present more informative messages to the user. This introduces a collection of exceptions which will be raised by the validate() function in each module. All modules have been updated to provide this new function. 2013-05-22 Arthur de Jong * [cb69921] README, docs/index.rst, docs/stdnum.exceptions.rst: Document the validate() function and exceptions 2013-05-18 Arthur de Jong * [e00744c] stdnum/util.py: Use validate() in stdnum.util 2013-05-17 Arthur de Jong * [3d3a97d] stdnum/us/ssn.py: Implement validate() for U.S. Social Security Number 2013-05-17 Arthur de Jong * [4bfce3f] stdnum/eu/vat.py, tests/test_eu_vat.doctest: Implement validate() for European VAT numbers 2013-05-17 Arthur de Jong * [1aaf902] stdnum/sk/dph.py, stdnum/sk/rc.py: Implement validate() for Slovak numbers 2013-05-17 Arthur de Jong * [8982d1e] stdnum/si/ddv.py: Implement validate() for Slovenian VAT numbers 2013-05-17 Arthur de Jong * [522a599] stdnum/se/vat.py: Implement validate() for Swedish VAT numbers 2013-05-17 Arthur de Jong * [8e7d807] stdnum/pt/nif.py: Implement validate() for Portuguese VAT numbers 2013-05-17 Arthur de Jong * [7e865db] stdnum/pl/nip.py: Implement validate() for Polish numbers 2013-05-17 Arthur de Jong * [96c5080] stdnum/mt/vat.py: Implement validate() for Maltese numbers 2013-05-17 Arthur de Jong * [2ff4950] stdnum/lv/pvn.py: Implement validate() for Latvian numbers 2013-05-17 Arthur de Jong * [9845b0a] stdnum/lu/tva.py: Implement validate() for Luxembourgian numbers 2013-05-17 Arthur de Jong * [04cfb84] stdnum/lt/pvm.py: Implement validate() for Lithuanian numbers 2013-05-17 Arthur de Jong * [b1d5a72] stdnum/it/iva.py: Implement validate() for Italian numbers 2013-05-17 Arthur de Jong * [083993b] stdnum/ie/pps.py, stdnum/ie/vat.py: Implement validate() for Irish numbers 2013-05-17 Arthur de Jong * [301ba25] stdnum/hu/anum.py: Implement validate() for Hungarian numbers 2013-05-17 Arthur de Jong * [31f2684] stdnum/hr/oib.py: Implement validate() for Croatian numbers 2013-05-17 Arthur de Jong * [1932f69] stdnum/gr/vat.py: Implement validate() for Greek numbers 2013-05-17 Arthur de Jong * [10710dc] stdnum/gb/vat.py, tests/test_gb_vat.doctest: Implement validate() for United Kingdom numbers 2013-05-17 Arthur de Jong * [4753c09] stdnum/fi/alv.py, stdnum/fi/hetu.py, tests/test_fi_hetu.doctest: Implement validate() for Finnish numbers 2013-05-17 Arthur de Jong * [2259cbb] stdnum/es/cif.py, stdnum/es/dni.py, stdnum/es/nie.py, stdnum/es/nif.py: Implement validate() for Spanish numbers 2013-05-17 Arthur de Jong * [07c66e1] stdnum/ee/kmkr.py: Implement validate() for Estonian numbers 2013-05-17 Arthur de Jong * [8caecc5] stdnum/dk/cpr.py, stdnum/dk/cvr.py: Implement validate() for Danish numbers 2013-05-17 Arthur de Jong * [360480b] stdnum/de/vat.py: Implement validate() for German numbers 2013-05-17 Arthur de Jong * [fce6196] stdnum/cy/vat.py: Implement validate() for Cypriot numbers 2013-05-17 Arthur de Jong * [14e382f] stdnum/cz/dic.py, stdnum/cz/rc.py: Implement validate() for Czech numbers 2013-05-17 Arthur de Jong * [54ce2d7] stdnum/br/cpf.py: Implement validate() for Brazillian numbers 2013-05-17 Arthur de Jong * [6080907] stdnum/bg/egn.py, stdnum/bg/pnf.py, stdnum/bg/vat.py, tests/test_bg_vat.doctest: Implement validate() for Bulgarian numbers 2013-05-17 Arthur de Jong * [33ce4e9] stdnum/be/vat.py: Implement validate() for Belgian numbers 2013-05-17 Arthur de Jong * [66d6259] stdnum/at/uid.py: Implement validate() for Austrian numbers 2013-05-11 Arthur de Jong * [05547a4] stdnum/ro/cf.py, stdnum/ro/cnp.py: Implement validate() for Romanian numbers 2013-05-17 Arthur de Jong * [fc1432c] stdnum/fr/siren.py, stdnum/fr/tva.py: Implement validate() for French numbers 2013-05-05 Arthur de Jong * [62cafb4] stdnum/nl/bsn.py, stdnum/nl/btw.py, stdnum/nl/onderwijsnummer.py: Implement validate() for Dutch numbers 2013-05-04 Arthur de Jong * [cf88e23] stdnum/meid.py, tests/test_meid.doctest: Implement validate() for MEID 2013-05-04 Arthur de Jong * [c6f41f6] stdnum/issn.py: Implement validate() for ISSN 2013-05-04 Arthur de Jong * [21f07b3] stdnum/ismn.py, tests/test_ismn.doctest: Implement validate() for ISMN 2013-05-04 Arthur de Jong * [c07609f] stdnum/isil.py: Implement validate() for ISIL 2013-05-04 Arthur de Jong * [a18f1ac] stdnum/isan.py, tests/test_isan.doctest: Implement validate() for ISAN 2013-05-01 Arthur de Jong * [3ac8164] stdnum/iban.py: Implement validate() for IBAN 2013-05-03 Arthur de Jong * [12bd684] stdnum/grid.py: Implement validate() for GRid numbers 2013-05-04 Arthur de Jong * [9cee495] stdnum/imsi.py: Implement validate() for IMSI 2013-05-04 Arthur de Jong * [6e4bb71] stdnum/imei.py, tests/test_imei.doctest: Implement validate() for IMEI numbers 2013-05-04 Arthur de Jong * [efa2550] stdnum/iso7064/mod_11_10.py, stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py, tests/test_iso7064.doctest: Implement validate() for ISO 7064 algorithms 2013-05-03 Arthur de Jong * [5c9090b] stdnum/verhoeff.py, tests/test_verhoeff.doctest: Implement validate() for the Verhoeff checksum 2013-05-03 Arthur de Jong * [9ad5139] stdnum/luhn.py, tests/test_luhn.doctest: Implement validate() for the Luhn algorithms 2013-05-03 Arthur de Jong * [9580046] stdnum/isbn.py, tests/test_isbn.doctest: Implement validate() for ISBN 2013-05-03 Arthur de Jong * [fa1864f] stdnum/ean.py, tests/test_ean.doctest: Implement validate() for EAN 2013-06-07 Arthur de Jong * [8b9ef8f] stdnum/util.py: Raise a proper exception if cleaning fails 2013-06-07 Arthur de Jong * [1ac5437] setup.cfg, stdnum/exceptions.py: Provide a module with validation exceptions This introduces a new module for switching the validation scheme. Instead of using the is_valid() function that returns a boolean a validate() function either returns the sanitised number or raises an exception that should indicate the kind of validation failure. This should make it easier for applications calling this library to present more informative messages to the user. 2013-06-07 Arthur de Jong * [99586c9] stdnum/__init__.py, stdnum/de/vat.py, stdnum/nl/bsn.py, stdnum/util.py: Revert generating stdnum docstring dynamically Generating the docstring dynamically results in all stdnum modules being imported for every import from any stdnum module which is a performance hit. So we switch back to a manually generated list, using: from stdnum.util import get_module_list print '\n'.join(get_module_list()) This also shortens a few short descriptions to attempt to fit things on one line. 2013-06-07 Arthur de Jong * [a655e82] docs/conf.py, docs/index.rst: Documentation consistency improvements 2013-06-07 Arthur de Jong * [37a2afd] tests/test_iso7064.doctest: The robustness test were moved to the general tests 2013-06-07 Arthur de Jong * [90b7c4a] stdnum/numdb.py: Remove empty line 2013-06-07 Arthur de Jong * [bcb0a0b] stdnum/grid.py: GRid's format() function shouldn't have add_check_digit parameter 2013-04-26 Arthur de Jong * [2d956eb] stdnum/util.py: Use a cleaner way to get all stdnum modules This mechanism should work from Python 2.6 up to and including Python 3.3. 2013-04-26 Arthur de Jong * [30c832f] stdnum/numdb.py: Fix doctest to not be dependant on dict ordering 2013-04-26 Arthur de Jong * [51a55be] .gitignore: Add a .gitignore file 2012-09-22 Arthur de Jong * [3f6d52a] stdnum/__init__.py, stdnum/util.py: generate part of the stdnum docstring based on introspection of the modules 2012-06-16 Arthur de Jong * [af7e837] : set svn:ignore properly 2012-02-26 Arthur de Jong * [8f2e44c] stdnum/bg/egn.py, stdnum/cz/rc.py, stdnum/dk/cpr.py, stdnum/fi/hetu.py, stdnum/isan.py, stdnum/lv/pvn.py, stdnum/meid.py, stdnum/ro/cnp.py, tests/test_isan.doctest, tests/test_ismn.doctest, tests/test_robustness.doctest: re-add Python3 support 2012-02-26 Arthur de Jong * [3325052] ChangeLog, NEWS, stdnum/__init__.py: get files ready for 0.7 release 2012-02-26 Arthur de Jong * [a3ba206] stdnum/iban.dat, stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: update data files 2012-02-26 Arthur de Jong * [c240eff] getnumlist.py: also generate a list of modules for use in the Spinx documentation 2012-02-26 Arthur de Jong * [54b0f47] README, getnumlist.py, stdnum/__init__.py: use a script to generate the list of number formats in stdnum 2012-02-26 Arthur de Jong * [dada6a4] stdnum/eu/vat.py, stdnum/gb/vat.py, stdnum/gr/vat.py, stdnum/grid.py, stdnum/hr/oib.py, stdnum/hu/anum.py, stdnum/iban.py, stdnum/ie/pps.py, stdnum/ie/vat.py, stdnum/imei.py, stdnum/isan.py, stdnum/iso7064/__init__.py, stdnum/iso7064/mod_11_10.py, stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py, stdnum/lt/pvm.py, stdnum/luhn.py, stdnum/meid.py, stdnum/verhoeff.py: some more documentation improvements 2012-02-26 Arthur de Jong * [13218a0] setup.py: make script executable 2012-02-26 Arthur de Jong * [c2f0ea2] stdnum/fr/siren.py: add a to_vta() function to the stdnum.fr.siren module 2012-02-26 Arthur de Jong * [902a656] stdnum/__init__.py, stdnum/at/uid.py, stdnum/be/vat.py, stdnum/bg/egn.py, stdnum/bg/pnf.py, stdnum/bg/vat.py, stdnum/br/cpf.py, stdnum/cy/vat.py, stdnum/cz/dic.py, stdnum/cz/rc.py, stdnum/de/vat.py, stdnum/dk/cpr.py, stdnum/dk/cvr.py, stdnum/ean.py, stdnum/ee/kmkr.py, stdnum/es/cif.py, stdnum/es/dni.py, stdnum/es/nie.py, stdnum/es/nif.py, stdnum/eu/vat.py, stdnum/fi/alv.py, stdnum/fi/hetu.py, stdnum/fr/siren.py, stdnum/fr/tva.py, stdnum/gb/vat.py, stdnum/gr/vat.py, stdnum/grid.py, stdnum/hr/oib.py, stdnum/hu/anum.py, stdnum/iban.py, stdnum/ie/pps.py, stdnum/ie/vat.py, stdnum/imei.py, stdnum/imsi.py, stdnum/isan.py, stdnum/isbn.py, stdnum/isil.py, stdnum/ismn.py, stdnum/iso7064/__init__.py, stdnum/iso7064/mod_11_10.py, stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py, stdnum/issn.py, stdnum/it/iva.py, stdnum/lt/pvm.py, stdnum/lu/tva.py, stdnum/luhn.py, stdnum/lv/pvn.py, stdnum/meid.py, stdnum/mt/vat.py, stdnum/nl/bsn.py, stdnum/nl/btw.py, stdnum/nl/onderwijsnummer.py, stdnum/numdb.py, stdnum/pl/nip.py, stdnum/pt/nif.py, stdnum/ro/cf.py, stdnum/ro/cnp.py, stdnum/se/vat.py, stdnum/si/ddv.py, stdnum/sk/dph.py, stdnum/sk/rc.py, stdnum/us/ssn.py, stdnum/util.py, stdnum/verhoeff.py: ensure that the module docstrings are in a somewhat more usable format 2012-02-25 Arthur de Jong * [907e410] setup.py: add the optional dependency on suds for the stdnum.eu.vat.check_vies() function 2012-02-24 Arthur de Jong * [ae9268b] stdnum/cz/rc.py: make the get_birth_date() function publically available 2012-02-24 Arthur de Jong * [4dfc8d7] docs/_templates/autosummary/module.rst, docs/conf.py, docs/index.rst, docs/stdnum.at.uid.rst, docs/stdnum.be.vat.rst, docs/stdnum.bg.egn.rst, docs/stdnum.bg.pnf.rst, docs/stdnum.bg.vat.rst, docs/stdnum.br.cpf.rst, docs/stdnum.cy.vat.rst, docs/stdnum.cz.dic.rst, docs/stdnum.cz.rc.rst, docs/stdnum.de.vat.rst, docs/stdnum.dk.cpr.rst, docs/stdnum.dk.cvr.rst, docs/stdnum.ean.rst, docs/stdnum.ee.kmkr.rst, docs/stdnum.es.cif.rst, docs/stdnum.es.dni.rst, docs/stdnum.es.nie.rst, docs/stdnum.es.nif.rst, docs/stdnum.eu.vat.rst, docs/stdnum.fi.alv.rst, docs/stdnum.fi.hetu.rst, docs/stdnum.fr.siren.rst, docs/stdnum.fr.tva.rst, docs/stdnum.gb.vat.rst, docs/stdnum.gr.vat.rst, docs/stdnum.grid.rst, docs/stdnum.hr.oib.rst, docs/stdnum.hu.anum.rst, docs/stdnum.iban.rst, docs/stdnum.ie.pps.rst, docs/stdnum.ie.vat.rst, docs/stdnum.imei.rst, docs/stdnum.imsi.rst, docs/stdnum.isan.rst, docs/stdnum.isbn.rst, docs/stdnum.isil.rst, docs/stdnum.ismn.rst, docs/stdnum.iso7064.rst, docs/stdnum.issn.rst, docs/stdnum.it.iva.rst, docs/stdnum.lt.pvm.rst, docs/stdnum.lu.tva.rst, docs/stdnum.luhn.rst, docs/stdnum.lv.pvn.rst, docs/stdnum.meid.rst, docs/stdnum.mt.vat.rst, docs/stdnum.nl.bsn.rst, docs/stdnum.nl.btw.rst, docs/stdnum.nl.onderwijsnummer.rst, docs/stdnum.pl.nip.rst, docs/stdnum.pt.nif.rst, docs/stdnum.ro.cf.rst, docs/stdnum.ro.cnp.rst, docs/stdnum.se.vat.rst, docs/stdnum.si.ddv.rst, docs/stdnum.sk.dph.rst, docs/stdnum.sk.rc.rst, docs/stdnum.us.ssn.rst, docs/stdnum.verhoeff.rst, setup.cfg: generate documentation using Sphinx 2012-02-23 Arthur de Jong * [093b1a1] README, stdnum/__init__.py, stdnum/dk/cpr.py: add a CPR (personnummer, the Danish citizen number) module 2012-02-23 Arthur de Jong * [89e4d78] README, stdnum/__init__.py, stdnum/ie/pps.py: add a PPS No (Personal Public Service Number, Irish personal number) module 2012-02-22 Arthur de Jong * [3a9c407] README, stdnum/__init__.py, stdnum/hr/__init__.py, stdnum/hr/oib.py: add an OIB (Osobni identifikacijski broj, Croatian personal identification number) module 2012-02-20 Arthur de Jong * [680b7d1] numdb-test.dat, stdnum/numdb.py: rename numdb test file 2012-02-20 Arthur de Jong * [68f62bf] stdnum/eu/vat.py: add a stdnum.eu.vat.check_vies() function to do an on-line check of the VAT number 2012-02-19 Arthur de Jong * [e640e3b] stdnum/iban.py, stdnum/numdb.py: add "pragma: no cover" statements to code that isn't expected to be covered 2012-02-19 Arthur de Jong * [b561d59] README, stdnum/__init__.py, stdnum/eu/__init__.py, stdnum/eu/vat.py, tests/test_eu_vat.doctest: add a VAT (European Union VAT number) module 2012-02-19 Arthur de Jong * [61af19d] README, stdnum/__init__.py: make number description consistent 2012-02-19 Arthur de Jong * [eeb5c61] stdnum/at/__init__.py, stdnum/cz/__init__.py, stdnum/dk/__init__.py, stdnum/ee/__init__.py, stdnum/es/__init__.py, stdnum/fi/__init__.py, stdnum/fr/__init__.py, stdnum/hu/__init__.py, stdnum/it/__init__.py, stdnum/lt/__init__.py, stdnum/lu/__init__.py, stdnum/lv/__init__.py, stdnum/nl/__init__.py, stdnum/pl/__init__.py, stdnum/pt/__init__.py, stdnum/ro/__init__.py, stdnum/si/__init__.py, stdnum/sk/__init__.py: for all countries, provide vat as an alias for the local vat identifier 2012-02-19 Arthur de Jong * [6755b94] stdnum/at/__init__.py, stdnum/be/__init__.py, stdnum/bg/__init__.py, stdnum/br/__init__.py, stdnum/cy/__init__.py, stdnum/cz/__init__.py, stdnum/de/__init__.py, stdnum/dk/__init__.py, stdnum/ee/__init__.py, stdnum/es/__init__.py, stdnum/fi/__init__.py, stdnum/fr/__init__.py, stdnum/gb/__init__.py, stdnum/gr/__init__.py, stdnum/hu/__init__.py, stdnum/ie/__init__.py, stdnum/it/__init__.py, stdnum/lt/__init__.py, stdnum/lu/__init__.py, stdnum/lv/__init__.py, stdnum/mt/__init__.py, stdnum/nl/__init__.py, stdnum/pl/__init__.py, stdnum/pt/__init__.py, stdnum/ro/__init__.py, stdnum/se/__init__.py, stdnum/si/__init__.py, stdnum/sk/__init__.py, stdnum/us/__init__.py: give all packages a description 2012-02-19 Arthur de Jong * [6d74fe9] stdnum/nl/vat.py: remove stdnum.nl.vat alias module 2012-02-19 Arthur de Jong * [528901d] stdnum/util.py, tests/test_robustness.doctest: use introspection to find number modules and test them 2012-02-18 Arthur de Jong * [2d80a24] README, stdnum/__init__.py, stdnum/bg/vat.py, tests/test_bg_vat.doctest, tests/test_robustness.doctest: add a VAT (Идентификационен номер по ДДС, Bulgarian VAT numbers) module 2012-02-18 Arthur de Jong * [1384488] README, stdnum/__init__.py, stdnum/bg/pnf.py, tests/test_robustness.doctest: add a PNF (ЛНЧ, Личен номер на чужденец, Bulgarian personal number of a foreigner) module 2012-02-18 Arthur de Jong * [a24e98e] README, stdnum/__init__.py, stdnum/bg/__init__.py, stdnum/bg/egn.py, tests/test_robustness.doctest: add an EGN (ЕГН, Единен граждански номер, Bulgarian personal identity codes) module 2012-02-18 Arthur de Jong * [4ac3fe7] tests/test_robustness.doctest: explicitly test for False 2012-02-18 Arthur de Jong * [0c78d90] stdnum/lt/pvm.py: explicitly return False if no rule matches 2012-02-18 Arthur de Jong * [cddb5f9] README, stdnum/__init__.py, stdnum/gb/__init__.py, stdnum/gb/vat.py, tests/test_gb_vat.doctest, tests/test_robustness.doctest: add a VAT (United Kingdom (and Isle of Man) VAT registration number) module 2012-02-18 Arthur de Jong * [6c436ec] tests/test_fi_hetu.doctest: fix typo 2012-02-18 Arthur de Jong * [aa39c92] README, stdnum/__init__.py, stdnum/se/__init__.py, stdnum/se/vat.py, tests/test_robustness.doctest: add a VAT (Moms, Mervärdesskatt, Swedish VAT number) module 2012-02-18 Arthur de Jong * [3a7a91c] README, stdnum/__init__.py, stdnum/si/__init__.py, stdnum/si/ddv.py, tests/test_robustness.doctest: add a ID za DDV (Davčna številka, Slovenian VAT number) module 2012-02-18 Arthur de Jong * [ebbd1af] README, stdnum/__init__.py, stdnum/pl/__init__.py, stdnum/pl/nip.py, tests/test_robustness.doctest: add a NIP (Numer Identyfikacji Podatkowej, Polish VAT number) module 2012-02-18 Arthur de Jong * [c75f072] README, stdnum/__init__.py, stdnum/mt/__init__.py, stdnum/mt/vat.py, tests/test_robustness.doctest: add a VAT (Maltese VAT number) module 2012-02-17 Arthur de Jong * [0922f3c] stdnum/it/iva.py: strip a few more separators 2012-02-17 Arthur de Jong * [b708920] README, stdnum/__init__.py, stdnum/fr/tva.py, tests/test_robustness.doctest: add a TVA (Numéro d'identification à la taxe sur la valeur ajoutée, French VAT number) module 2012-02-17 Arthur de Jong * [dc8e9a3] README, stdnum/__init__.py, stdnum/lt/__init__.py, stdnum/lt/pvm.py, tests/test_robustness.doctest: add a PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT number) module 2012-02-17 Arthur de Jong * [20296ef] README, stdnum/__init__.py, stdnum/ee/__init__.py, stdnum/ee/kmkr.py, tests/test_robustness.doctest: add a KMKR (Käibemaksukohuslase, Estonian VAT number) module 2012-02-17 Arthur de Jong * [2100c28] README, stdnum/__init__.py, stdnum/ie/__init__.py, stdnum/ie/vat.py, tests/test_robustness.doctest: add a VAT (Irish VAT number) module 2012-02-17 Arthur de Jong * [d2f1348] README, stdnum/__init__.py, stdnum/hu/__init__.py, stdnum/hu/anum.py, tests/test_robustness.doctest: add an ANUM (Közösségi adószám, Hungarian VAT number) module 2012-02-17 Arthur de Jong * [d803443] README, stdnum/__init__.py, stdnum/cz/dic.py, tests/test_robustness.doctest: add a DIČ (Daňové identifikační číslo, Czech VAT number) module 2012-02-17 Arthur de Jong * [0d2e4cc] README, stdnum/__init__.py, stdnum/fi/alv.py, tests/test_robustness.doctest: add an ALV nro (Arvonlisäveronumero, Finnish VAT number) module 2012-02-17 Arthur de Jong * [03eccc4] README, stdnum/__init__.py, stdnum/sk/dph.py, tests/test_robustness.doctest: add IČ DPH (Identifikačné číslo pre daň z pridanej hodnoty, Slovak VAT number) module 2012-02-16 Arthur de Jong * [389c306] README, stdnum/__init__.py, stdnum/pt/__init__.py, stdnum/pt/nif.py, tests/test_robustness.doctest: add a NIF (Número de identificação fiscal, Portuguese VAT number) module 2012-02-13 Arthur de Jong * [cdc7f96] README, stdnum/__init__.py, stdnum/at/__init__.py, stdnum/at/uid.py, tests/test_robustness.doctest: add a UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number) module 2012-02-13 Arthur de Jong * [e0bb4e8] README, stdnum/__init__.py, stdnum/cy/__init__.py, stdnum/cy/vat.py, tests/test_robustness.doctest: add a Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number) module 2012-02-12 Arthur de Jong * [402a0d5] stdnum/es/cif.py, stdnum/it/iva.py, stdnum/util.py: use the luhn module where possible 2012-02-12 Arthur de Jong * [1c2b4c3] tests/test_robustness.doctest: fix typo in header 2012-02-12 Arthur de Jong * [09ef54d] README, stdnum/__init__.py, stdnum/it/__init__.py, stdnum/it/iva.py, tests/test_robustness.doctest: add a Partita IVA (Italian VAT number) module 2012-02-12 Arthur de Jong * [ffc824b] README, stdnum/__init__.py, stdnum/ro/cf.py, tests/test_robustness.doctest: add a CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number) module 2012-02-12 Arthur de Jong * [9d65f6a] README, stdnum/__init__.py, stdnum/ro/__init__.py, stdnum/ro/cnp.py, tests/test_robustness.doctest: add a CNP (Cod Numeric Personal, Romanian Numerical Personal Code) module 2012-02-12 Arthur de Jong * [60533cd] stdnum/gr/vat.py: also strip : as seen in some numbers 2012-02-11 Arthur de Jong * [74c4c71] README, stdnum/__init__.py, stdnum/lu/__init__.py, stdnum/lu/tva.py, tests/test_robustness.doctest: add a TVA (Numéro d'identification à la taxe sur la valeur ajoutée, Luxembourgian VAT number) module 2012-02-11 Arthur de Jong * [74f4e2a] README, stdnum/__init__.py, stdnum/dk/__init__.py, stdnum/dk/cvr.py, tests/test_robustness.doctest: add a CVR (Momsregistreringsnummer, Danish VAT number) module 2012-02-11 Arthur de Jong * [3c64f1e] stdnum/be/vat.py: add missing test 2012-02-11 Arthur de Jong * [b8c3ba6] stdnum/be/vat.py: clean up numbers starting with (0) 2012-02-11 Arthur de Jong * [8a10861] README, stdnum/__init__.py, stdnum/lv/__init__.py, stdnum/lv/pvn.py, tests/test_robustness.doctest: add a PVN (Pievienotās vērtības nodokļa, Latvian VAT number) module 2012-02-11 Arthur de Jong * [a3610a3] README, stdnum/__init__.py, stdnum/es/nif.py, tests/test_robustness.doctest: add a NIF (Número de Identificación Fiscal, Spanish VAT number) module 2012-02-11 Arthur de Jong * [aa90c4f] README, stdnum/__init__.py, stdnum/es/cif.py, tests/test_robustness.doctest: add a CIF (Certificado de Identificación Fiscal, Spanish tax identification number) module 2012-02-11 Arthur de Jong * [a574e6c] stdnum/util.py: implement a digitsum() function to find the sub of all digits in a number 2012-02-11 Arthur de Jong * [84d1ee7] stdnum/es/nie.py: fix description and remove unnecessary import 2012-02-10 Arthur de Jong * [fa2d398] README, stdnum/__init__.py, stdnum/es/nie.py, tests/test_robustness.doctest: add a NIE (Número de Identificación de Extranjeros, Spanish identification number for foreigners) module 2012-02-10 Arthur de Jong * [fe3210f] README, stdnum/__init__.py, stdnum/es/__init__.py, stdnum/es/dni.py, tests/test_robustness.doctest: add a DNI (Documento nacional de identidad, Spanish personal identity codes) module 2012-02-10 Arthur de Jong * [4439f47] README, stdnum/__init__.py, stdnum/be/__init__.py, stdnum/be/vat.py, tests/test_robustness.doctest: add a BTW, TVA, NWSt (Belgian VAT number) module 2012-02-10 Arthur de Jong * [1ab602c] README, stdnum/__init__.py, stdnum/sk/__init__.py, stdnum/sk/rc.py: also make the stdnum.cz.rc module available as stdnum.sk.rc 2012-02-10 Arthur de Jong * [e9e5861] stdnum/nl/vat.py: also make the stdnum.nl.btw module available as stdnum.nl.vat 2012-02-10 Arthur de Jong * [c795b3c] stdnum/nl/btw.py: fix number in test and ensure that number is not all zeroes 2012-02-10 Arthur de Jong * [2bb9231] stdnum/cz/rc.py: add some info to description 2012-02-10 Arthur de Jong * [1aeeaf4] README, stdnum/__init__.py, stdnum/de/__init__.py, stdnum/de/vat.py, tests/test_robustness.doctest: add an Ust ID Nr. (Umsatzsteur Identifikationnummer, the German VAT number) module 2012-02-10 Arthur de Jong * [473b3ca] README, stdnum/__init__.py, stdnum/gr/__init__.py, stdnum/gr/vat.py, tests/test_robustness.doctest: add a FPA, ΦΠΑ (Foros Prostithemenis Aksias, the Greek VAT number) module 2012-02-05 Arthur de Jong * [9f1d47b] README, stdnum/__init__.py, stdnum/fr/__init__.py, stdnum/fr/siren.py, tests/test_robustness.doctest: add a SIREN (Système d'Identification du Répertoire des Entreprises, a French company identification number) module 2012-02-05 Arthur de Jong * [575fc75] README, stdnum/__init__.py, stdnum/cz/__init__.py, stdnum/cz/rc.py, tests/test_robustness.doctest: add a RČ (Rodné číslo, the Czech birth numbers) module 2012-02-04 Arthur de Jong * [41dd815] stdnum/br/cpf.py, stdnum/ean.py, stdnum/grid.py, stdnum/iban.py, stdnum/imei.py, stdnum/imsi.py, stdnum/isan.py, stdnum/isbn.py, stdnum/ismn.py, stdnum/issn.py, stdnum/meid.py, stdnum/nl/bsn.py, stdnum/nl/btw.py, stdnum/nl/onderwijsnummer.py, stdnum/us/ssn.py, stdnum/util.py: implement a stdnum.util module for holding utility functions (for now clean()) 2012-02-04 Arthur de Jong * [54cc207] tests/test_robustness.doctest: some extra rubustness checks 2012-02-04 Arthur de Jong * [b43817c] stdnum/nl/bsn.py, stdnum/nl/onderwijsnummer.py: rename calc_checksum() to checksum() for consistency 2012-02-04 Arthur de Jong * [548f129] stdnum/iso7064/mod_37_36.py: use integer division 2012-02-02 Arthur de Jong * [9efde4f] README, stdnum/__init__.py, stdnum/nl/btw.py, tests/test_robustness.doctest: add a BTW (the Dutch VAT number) module 2012-02-02 Arthur de Jong * [086e509] README, stdnum/__init__.py, stdnum/nl/bsn.py, stdnum/nl/onderwijsnummer.py, tests/test_robustness.doctest: add an onderwijsnummer (Dutch school number) module 2011-12-31 Arthur de Jong * [587c538] setup.py: revert switching to distutils part of r93, keep restructuring part 2011-12-31 Arthur de Jong * [6756d79] setup.cfg, setup.py: switch to distutils 2011-11-07 Arthur de Jong * [e6020b9] README, stdnum/__init__.py, stdnum/fi/__init__.py, stdnum/fi/hetu.py, tests/test_fi_hetu.doctest, tests/test_robustness.doctest: add a HETU (Finnish personal identity code) module as provided by Jussi Judin (#5) 2011-09-30 Arthur de Jong * [77ac8d4] setup.py: fix version number use (fix r86) 2011-09-30 Arthur de Jong * [6cdfb6b] ChangeLog, NEWS, stdnum/__init__.py: get files ready for 0.6 release 2011-09-30 Arthur de Jong * [1451b47] stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: update data files 2011-09-30 Arthur de Jong * [6ec6c7e] setup.py, stdnum/__init__.py: move the version number definition to the stdnum package 2011-09-25 Arthur de Jong * [ae2013d] stdnum/ismn.py: implement an ismn_type() function 2011-09-23 Arthur de Jong * [14b97f9] : ignore __pycache__ directories 2011-09-23 Arthur de Jong * [cbd114e] README, getimsi.py, stdnum/__init__.py, stdnum/imsi.dat, stdnum/imsi.py, tests/test_robustness.doctest: add an IMSI (International Mobile Subscriber Identity) module 2011-09-23 Arthur de Jong * [68c98f0] stdnum/imei.py: implement an imei.split() function that splits the number into a TAC, serial number and checksum or software version 2011-09-23 Arthur de Jong * [e6cd768] getiban.py: remove unneeded import 2011-09-20 Arthur de Jong * [4e8d7e4] stdnum/isbn.py, tests/test_isbn.doctest: implement a conversion function from ISBN13 to ISBN10 2011-09-20 Arthur de Jong * [d6f9ba2] tests/test_imei.doctest, tests/test_isan.doctest, tests/test_isbn.doctest, tests/test_ismn.doctest: fix space before inline comments 2011-09-20 Arthur de Jong * [c4ad099] stdnum/isbn.py, tests/test_isbn.doctest: fix a problem with an ISBN13 with a valid check digit but with an unknown bookland prefix 2011-09-04 Arthur de Jong * [1c7c198] setup.py: fix homepage URL 2011-08-19 Arthur de Jong * [881e8a6] getiban.py, getisbn.py, getisil.py, setup.py, stdnum/br/cpf.py, stdnum/ean.py, stdnum/grid.py, stdnum/iban.py, stdnum/imei.py, stdnum/isan.py, stdnum/isbn.py, stdnum/isil.py, stdnum/ismn.py, stdnum/iso7064/mod_11_10.py, stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py, stdnum/issn.py, stdnum/luhn.py, stdnum/meid.py, stdnum/nl/bsn.py, stdnum/numdb.py, stdnum/us/ssn.py, stdnum/verhoeff.py: make source code layout follow PEP8 more 2011-07-09 Arthur de Jong * [8dbcedd] ChangeLog, NEWS, setup.py: get files ready for 0.5 release 2011-07-09 Arthur de Jong * [596c7a1] stdnum/iban.dat, stdnum/isbn.dat, stdnum/isil.dat: update data files 2011-06-20 Arthur de Jong * [63b2b0a] stdnum/issn.py: implement a conversion function from ISSN to EAN 2011-06-20 Arthur de Jong * [d101acf] stdnum/isbn.py, stdnum/ismn.py: use the ean module for calculating the check digit 2011-06-20 Arthur de Jong * [f5747bc] README, stdnum/__init__.py, stdnum/ean.py, tests/test_robustness.doctest: add an EAN (International Article Number) module 2011-03-06 Arthur de Jong * [1b904ba] setup.py, stdnum/numdb.py: also support Python3 with the same codebase (see #3) 2011-03-06 Arthur de Jong * [a45079f] setup.py: ensure that data files are always included 2011-03-02 Arthur de Jong * [c17920a] stdnum/verhoeff.py: Python 2.5 compatibility improvement 2011-02-06 Arthur de Jong * [e6ba399] ChangeLog, NEWS, setup.py: get files ready for 0.4 release 2011-02-06 Arthur de Jong * [060dfce] stdnum/isbn.dat: include an updated version 2011-02-06 Arthur de Jong * [8806d2a] README, stdnum/__init__.py, stdnum/us/__init__.py, stdnum/us/ssn.py, tests/test_robustness.doctest: add an SSN (U.S. Social Security Number) module 2011-02-05 Arthur de Jong * [c260626] README, stdnum/__init__.py: add ISIL to the documentation 2011-02-05 Arthur de Jong * [e517903] getisil.py, stdnum/isil.dat, stdnum/isil.py, tests/test_robustness.doctest: add an ISIL (International Standard Identifier for Libraries and Related Organizations) module 2011-02-05 Arthur de Jong * [96f4f7c] stdnum/numdb.py: allow most kind of characters in number ranges 2011-02-05 Arthur de Jong * [33611d1] stdnum/iban.py: move more validation into try/except (specifically the _convert() call) 2011-02-05 Arthur de Jong * [62aa496] tests/test_iban.doctest, tests/test_imei.doctest, tests/test_isan.doctest, tests/test_isbn.doctest, tests/test_ismn.doctest, tests/test_issn.doctest, tests/test_luhn.doctest, tests/test_meid.doctest, tests/test_nl_bsn.doctest, tests/test_robustness.doctest, tests/test_verhoeff.doctest: move all robustness tests into one test file 2011-02-05 Arthur de Jong * [9081e90] tests/test_iso7064.doctest: fix imports of iso7064.mod_*_* modules 2011-02-05 Arthur de Jong * [e5678ca] stdnum/isbn.py: fix typo in r53 2011-02-05 Arthur de Jong * [ea737ff] stdnum/__init__.py: add encoding header 2011-01-31 Arthur de Jong * [cc7a6d8] README, stdnum/__init__.py: get README and package docstring in sync 2011-01-21 Arthur de Jong * [6724e50] stdnum/isbn.py, tests/test_isbn.doctest: add a convert parameter to most isbn functions to automatically convert to ISBN-13 2011-01-17 Arthur de Jong * [411874e] README: add note about CPF and update copyright year 2011-01-16 Arthur de Jong * [db2238c] README, getiban.py, stdnum/iban.dat, stdnum/iban.py, tests/test_iban.doctest: add an IBAN (International Bank Account Number) module 2011-01-16 Arthur de Jong * [2b4aff6] setup.py, stdnum/numdb.py: revert r49 because it wasn't needed after all 2011-01-16 Arthur de Jong * [0bf31c9] setup.py, stdnum/numdb.py: introduce a full parameter that can be used to only return the part that is in the database 2011-01-16 Arthur de Jong * [4fe17ba] stdnum/grid.py, stdnum/isan.py: fix import of iso7064 modules 2011-01-16 Arthur de Jong * [c1f03c2] stdnum/numdb.py, test.dat: add test for partial match 2011-01-15 Arthur de Jong * [81a99d3] tests/test_nl_bsn.doctest: fix comments to refer to the new path of the module 2011-01-15 Arthur de Jong * [fda67ac] stdnum/br/__init__.py, stdnum/br/cpf.py, tests/test_br_cpf.doctest: add a CPF (Cadastro de Pessoas Físicas) module 2011-01-15 Arthur de Jong * [8d3a92c] stdnum/nl/__init__.py, stdnum/nl/bsn.py, tests/test_nl_bsn.doctest: move bsn module inside nl package 2010-11-26 Arthur de Jong * [6ed480c] setup.py, stdnum/__init__.py: move general description to package __init__.py file 2010-11-24 Arthur de Jong * [124c16d] getisbn.py, stdnum/isbn.dat, stdnum/isbn.py, stdnum/isbn/ranges.py, stdnum/numdb.py, test.dat, tests/test_isbn.doctest: implement a new numdb module to hold information on hierarchically organised numbers and switch the isbn module to use this format instead 2010-09-11 Arthur de Jong * [72a0b96] ChangeLog, NEWS, README, setup.py: get files ready for 0.3 release 2010-09-05 Arthur de Jong * [cd844b5] setup.py: have sdist target create a tarball with reasonable permissions 2010-08-29 Arthur de Jong * [2e64eb8] stdnum/bsn.py, stdnum/isan.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/meid.py, stdnum/verhoeff.py, tests/test_bsn.doctest, tests/test_ismn.doctest: spelling check 2010-08-28 Arthur de Jong * [2a7afff] README, stdnum/grid.py: add a GRid (Global Release Identifier) module 2010-08-27 Arthur de Jong * [9970652] README, stdnum/isan.py, tests/test_isan.doctest: add ISAN (International Standard Audiovisual Number) module 2010-08-27 Arthur de Jong * [fda9552] README, stdnum/iso7064/__init__.py, stdnum/iso7064/mod_11_10.py, stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py, stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py, tests/test_iso7064.doctest: implement some ISO/IEC 7064 check digit schemes 2010-08-26 Arthur de Jong * [4017d83] stdnum/isbn/__init__.py, stdnum/ismn.py, stdnum/issn.py, stdnum/verhoeff.py: switch to using enumerate() for looping over numbers where needed 2010-08-21 Arthur de Jong * [8bdb6ef] README, stdnum/ismn.py, tests/test_ismn.doctest: add an ISMN (International Standard Music Number) module 2010-08-21 Arthur de Jong * [97d5280] tests/test_isbn.doctest: simplify ranges tests a bit 2010-08-21 Arthur de Jong * [f3b025b] stdnum/isbn/ranges.py: update ranges from newly downloaded file 2010-08-20 Arthur de Jong * [8748830] README, stdnum/meid.py, tests/test_meid.doctest: add a MEID (Mobile Equipment Identifier) module 2010-08-20 Arthur de Jong * [f125f3e] setup.cfg, tests/test_isbn.doctest, tests/test_issn.doctest: write some more tests (some of which are a bit of a hack) to get coverage to 100% 2010-08-20 Arthur de Jong * [d622d92] stdnum/imei.py, tests/test_imei.doctest: add an add_check_digit option to the format() function to add a check digit if needed and possible 2010-08-20 Arthur de Jong * [a74a6f7] stdnum/luhn.py: make checksum calculation a little more readable 2010-08-20 Arthur de Jong * [6bb04af] README, stdnum/imei.py, tests/test_imei.doctest: add an IMEI (International Mobile Equipment Identity) module 2010-08-20 Arthur de Jong * [ca08995] README, stdnum/luhn.py, tests/test_luhn.doctest: add functions for handling the Luhn and Luhn mod N algorithms 2010-08-20 Arthur de Jong * [7e800c3] stdnum/issn.py: fix typo 2010-08-20 Arthur de Jong * [571dc83] README, stdnum/verhoeff.py, tests/test_verhoeff.doctest: add functions for handling the Verhoeff algorithm 2010-08-16 Arthur de Jong * [9ffa9fd] ChangeLog, NEWS, setup.py: get files ready for 0.2 release 2010-08-16 Arthur de Jong * [19b7d2d] debian/changelog, debian/compat, debian/control, debian/copyright, debian/docs, debian/rules, debian/source/format, debian/watch: debian package configuration is now available at http://svn.debian.org/viewsvn/python-modules/packages/python-stdnum/trunk/ 2010-08-14 Arthur de Jong * [85e9e3b] setup.cfg, tests/test_bsn.doctest, tests/test_isbn.doctest: add more doctests that are not part of the module documentation 2010-07-27 Arthur de Jong * [c536356] README, stdnum/bsn.py, stdnum/isbn/__init__.py, stdnum/issn.py: rename validate() function to is_valid() 2010-07-27 Arthur de Jong * [85a5fc8] stdnum/isbn/ranges.py: fix typo in output() function 2010-07-27 Arthur de Jong * [1071603] stdnum/isbn/ranges.py: fix range detection to handle lookup errors more gracefully 2010-07-27 Arthur de Jong * [a86c4cc] stdnum/bsn.py, stdnum/isbn/__init__.py, stdnum/issn.py: handle wrong types passed to validate() more gracefully 2010-07-26 Arthur de Jong * [9495116] debian/changelog, debian/source/format, debian/watch: make release 0.1-1 2010-07-25 Arthur de Jong * [55a97d4] ChangeLog: get files ready for 0.1 release 2010-07-25 Arthur de Jong * [1e02d5a] debian/changelog, debian/compat, debian/control, debian/copyright, debian/docs, debian/rules, debian/source/format: add Debian packaging 2010-07-25 Arthur de Jong * [14bd2fe] COPYING, ChangeLog, MANIFEST.in, NEWS: include some more files in the source distribution 2010-07-25 Arthur de Jong * [9940cf3] setup.cfg: use nose for testing and ignore generated files and directories 2010-07-25 Arthur de Jong * [967f2ae] setup.py: add a setup.py script for use of setuptools 2010-07-25 Arthur de Jong * [ca5f850] README: add documentation to the README 2010-07-25 Arthur de Jong * [40aff16] stdnum/bsn.py, stdnum/isbn/__init__.py, stdnum/isbn/ranges.py, stdnum/issn.py: spelling check an extra doctest and a simplification 2010-07-23 Arthur de Jong * [6eabbc3] stdnum/bsn.py: add BSN (Burgerservicenummer, the Ducth national identification number) module 2010-07-23 Arthur de Jong * [92e18aa] stdnum/issn.py: add an ISSN (International Standard Serial Number) module 2010-07-23 Arthur de Jong * [31ce783] stdnum/isbn/__init__.py: fix example and fix ISBN13 conversion 2010-07-23 Arthur de Jong * [4b8c10e] stdnum/isbn/__init__.py: get rid of remainders of old code that used exceptions 2010-07-23 Arthur de Jong * [7d2f15a] README, stdnum/__init__.py, stdnum/isbn/__init__.py, stdnum/isbn/ranges.py: make a initial repository layout with an implementation of the isbn module python-stdnum-1.8.1/tox.ini0000644000000000000000000000144113223220067015620 0ustar rootroot00000000000000[tox] envlist = py{26,27,34,35,36,py},flake8,docs skip_missing_interpreters = True [testenv] deps = nose coverage commands = nosetests setenv= PYTHONWARNINGS=all [testenv:py26] usedevelop = True commands = nosetests --ignore-file="test_.*.py" [testenv:flake8] skip_install = true deps = flake8 flake8-author flake8-blind-except py{35,36}: flake8-bugbear flake8-class-newline flake8-commas flake8-deprecated flake8-docstrings flake8-exact-pin flake8-import-order flake8-print flake8-quotes flake8-tidy-imports flake8-tuple pep8-naming commands = flake8 stdnum tests update *.py [testenv:docs] basepython = python deps = Sphinx commands = sphinx-build -N -b html docs {envtmpdir}/sphinx -W python-stdnum-1.8.1/update/0000755000000000000000000000000013224171744015577 5ustar rootroot00000000000000python-stdnum-1.8.1/update/numlist.py0000755000000000000000000000411013223221441017630 0ustar rootroot00000000000000#!/usr/bin/env python # update/numlist.py - script to get a list of number formats in stdnum # # Copyright (C) 2012-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script uses introspection to present a list of number formats suitable to be included in the README and stdnum package description.""" import os.path import pydoc import sys # Ensure that we use our local stdnum implementation is used sys.path.insert(0, os.path.normpath( os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))) from stdnum import util # noqa # these are excluded algortihms = ( 'stdnum.verhoeff', 'stdnum.luhn', 'stdnum.iso7064', 'stdnum.damm') def get_number_modules(): """Provide the number modules that are not algorithms.""" for module in util.get_number_modules(): if module.__name__ not in algortihms and \ not module.__name__.startswith('stdnum.iso7064'): yield module if __name__ == '__main__': print('For README:') print('') for module in get_number_modules(): print(' * %s' % util.get_module_name(module)) print('') print('For docs/index.rst:') print('') for module in get_number_modules(): print(' %s' % module.__name__.replace('stdnum.', '')) print('') print('For formats.xml:') print('') for module in get_number_modules(): print('
  • %s
  • ' % util.get_module_name(module)) python-stdnum-1.8.1/update/isil.py0000755000000000000000000000475613223166521017124 0ustar rootroot00000000000000#!/usr/bin/env python # update/isil.py - script to donwload ISIL agencies # # Copyright (C) 2011-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script downloads a web page from the ISIL Registration Authority and screen-scrapes the national and non-national ISIL agencies and code prefixes.""" import re import urllib import BeautifulSoup spaces_re = re.compile(r'\s+', re.UNICODE) # the web page that holds information on the ISIL authorities download_url = 'http://biblstandard.dk/isil/' def clean(s): """Clean up the string removing unneeded stuff from it.""" return spaces_re.sub(' ', s.replace(u'\u0096', '')).strip().encode('utf-8') def parse(f): """Parse the specified file.""" print('# generated from ISIL Registration Authority, downloaded from') print('# %s' % download_url) soup = BeautifulSoup.BeautifulSoup(f, convertEntities='html') # find all table rows for tr in soup.findAll('tr'): # find the rows with four columns of text tds = tr.findAll('td', attrs={'class': 'text'}, recursive=False) if len(tds) == 4: props = {} cc = clean(tds[0].string) if tds[1].string: props['country'] = clean(tds[1].contents[0]) ra_a = tds[2].find('a') if ra_a: props['ra'] = clean(ra_a.string) props['ra_url'] = clean(ra_a['href']) elif tds[2].string: props['ra'] = clean(tds[2].string) # we could also get the search urls from tds[3].findAll('a') print( '%s$ %s' % ( cc, ' '.join( ['%s="%s"' % (x, y) for x, y in props.iteritems()]))) if __name__ == '__main__': # f = open('isil.html', 'r') f = urllib.urlopen(download_url) parse(f) python-stdnum-1.8.1/update/iban.py0000755000000000000000000000573213223166521017070 0ustar rootroot00000000000000#!/usr/bin/env python # update/iban.py - script to donwload and parse data from the IBAN registry # # Copyright (C) 2011-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script downloads data from SWIFT (the Society for Worldwide Interbank Financial Telecommunication which is the official IBAN registrar) to get the data needed to correctly parse and validate IBANs.""" import csv import urllib from collections import defaultdict # The place where the current version of # swift_standards_infopaper_ibanregistry_1.txt can be downloaded. download_url = 'https://www.swift.com/node/11971' def get_country_codes(line): """Return the list of country codes this line has.""" # simplest case first if len(line['IBAN prefix country code (ISO 3166)']) == 2: return [line['IBAN prefix country code (ISO 3166)']] # fall back to parsing the IBAN structure return [x.strip()[:2] for x in line['iban structure'].split(',')] def parse(f): """Parse the specified file.""" print('# generated from swift_standards_infopaper_ibanregistry_1.txt,') print('# downloaded from %s' % download_url) values = defaultdict(dict) # the file is CSV but the data is in columns instead of rows for row in csv.reader(f, delimiter='\t', quotechar='"'): # skip first row if row[0] != 'Data element': # first column contains label for i, c in enumerate(row[1:]): values[i][row[0]] = c # output the collected data for i, data in values.items(): bban = data['BBAN structure'] if not(bban) or bban.lower() == 'n/a': bban = data['IBAN structure'] bban = bban.replace(' ', '') cc = data['IBAN prefix country code (ISO 3166)'][:2] cname = data['Name of country'] if bban.startswith(cc + '2!n'): bban = bban[5:] # print country line print('%s country="%s" bban="%s"' % (cc, cname, bban)) # TODO: some countries have a fixed check digit value # TODO: some countries have extra check digits # TODO: use "Bank identifier position within the BBAN" field # to add labels to the ranges (Bank identifier and Branch # Identifier) if __name__ == '__main__': f = urllib.urlopen(download_url) parse(f) python-stdnum-1.8.1/update/do_whitelists.py0000755000000000000000000000627213223166521021040 0ustar rootroot00000000000000#!/usr/bin/env python # coding: utf-8 # update/do_whitelists.py - script to update do.rnc and do.cedula whitelists # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script downloads a ZIP file from the Dirección General de Impuestos Internos (DGII) web site with lists of all RNC and Cedula values and outputs new whitelists for these modules.""" import os.path import shutil import sys import tempfile import textwrap import urllib import zipfile # Ensure that we use our local stdnum implementation is used sys.path.insert(0, os.path.normpath( os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))) from stdnum.do import cedula, rnc # noqa # The URL of the zip file with all valid numbers download_url = 'http://www.dgii.gov.do/app/WebApps/Consultas/rnc/DGII_RNC.zip' def handle_zipfile(f): """Parse the ZIP file and return a set of invalid RNC and Cedula.""" # collections of invalid numbers found invalidrnc = set() invalidcedula = set() # read the information from the ZIP file z = zipfile.ZipFile(f, 'r') for line in z.open('TMP/DGII_RNC.TXT'): number = line.split('|', 1)[0].strip() if len(number) <= 9: if not rnc.is_valid(number): invalidrnc.add(number) else: if not cedula.is_valid(number): invalidcedula.add(number) # return invalid numbers return invalidrnc, invalidcedula if __name__ == '__main__': # Download and read the ZIP file with valid data with tempfile.TemporaryFile() as tmp: # Download the zip file to a temporary file download = urllib.urlopen(download_url) print('%s: %s' % ( os.path.basename(download_url), download.info().get('Last-Modified'))) shutil.copyfileobj(download, tmp) # Open the temporary file as a zip file and read contents # (we cannot do this streaming because zipfile requires seek) invalidrnc, invalidcedula = handle_zipfile(tmp) # Output new RNC whitelist if changed if not invalidrnc: print('NO NEW WHITELISTED RNC') else: print('NEW RNC WHITELIST:') print('\n'.join(textwrap.wrap( ' '.join(sorted(rnc.whitelist | invalidrnc)), 77))) # Output new Cedula whitelist if changed if not invalidrnc: print('NO NEW WHITELISTED CEDULA') else: print('NEW CEDULA WHITELIST:') print('\n'.join(textwrap.wrap( ' '.join(sorted(cedula.whitelist | invalidcedula)), 77))) python-stdnum-1.8.1/update/my_bp.py0000755000000000000000000000617013223166521017262 0ustar rootroot00000000000000#!/usr/bin/env python # update/my_bp.py - script to download data from Malaysian government site # # Copyright (C) 2013-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script downloads the list of states and countries and their birthplace code from the National Registration Department of Malaysia.""" import re import urllib from collections import defaultdict import BeautifulSoup # URLs that are downloaded state_list_url = 'http://www.jpn.gov.my/informasi/kod-negeri/' country_list_url = 'http://www.jpn.gov.my/en/informasi/kod-negara/' spaces_re = re.compile(r'\s+', re.UNICODE) def clean(s): """Clean up the string removing unneeded stuff from it.""" return spaces_re.sub(' ', s.replace(u'\u0096', '')).strip().encode('utf-8') def parse(f): """Parse the specified file.""" soup = BeautifulSoup.BeautifulSoup(f, convertEntities='html') # find all table rows for tr in soup.find('div', {'class': 'box-content'}).findAll('tr'): # find the rows with four columns of text tds = [ clean(''.join(x.string for x in td.findAll(text=True))) for td in tr.findAll('td') ] if len(tds) >= 2 and tds[0] and tds[1]: yield tds[0], tds[1] if len(tds) >= 4 and tds[2] and tds[3]: yield tds[2], tds[3] if __name__ == '__main__': results = defaultdict(lambda: defaultdict(set)) # read the states # f = open('/tmp/states.html', 'r') f = urllib.urlopen(state_list_url) for state, bps in parse(f): for bp in bps.split(','): results[bp.strip()]['state'] = state results[bp.strip()]['countries'].add('Malaysia') # read the countries # f = open('/tmp/countries.html', 'r') f = urllib.urlopen(country_list_url) for country, bp in parse(f): results[bp]['countries'].add(country) # print the results print('# generated from National Registration Department of Malaysia, downloaded from') print('# %s' % state_list_url) print('# %s' % country_list_url) print('') for bp in sorted(results.iterkeys()): res = bp row = results[bp] if 'state' in row: res += ' state="%s"' % row['state'] countries = list(row['countries']) countries.sort() if len(countries) == 1: res += ' country="%s"' % countries[0] if len(countries) > 0: res += ' countries="%s"' % (', '.join(countries)) print(res) python-stdnum-1.8.1/update/README0000644000000000000000000000031113223166521016446 0ustar rootroot00000000000000This directory contains update scripts that typically update .dat files that are shipped along with python-stdnum. The dependencies of these scripts are recorded in requirements.txt in this directory. python-stdnum-1.8.1/update/cn_loc.py0000755000000000000000000000644113223166521017412 0ustar rootroot00000000000000#!/usr/bin/env python # update/cn_loc.py - script to fetch data from the CN Open Data community # # Copyright (C) 2014-2015 Jiangge Zhang # Copyright (C) 2015-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script downloads birth place codes from the CN Open Data community on Github.""" from __future__ import print_function, unicode_literals import codecs import sys from collections import OrderedDict from datetime import datetime import requests data_url = 'https://github.com/cn/GB2260' data_revisions = [ 'GB2260-2002', 'GB2260-2003', 'GB2260-200306', 'GB2260-2004', 'GB2260-200403', 'GB2260-200409', 'GB2260-2005', 'GB2260-200506', 'GB2260-2006', 'GB2260-2007', 'GB2260-2008', 'GB2260-2009', 'GB2260-2010', 'GB2260-2011', 'GB2260-2012', 'GB2260-2013', 'GB2260-2014', ] def fetch_data(): """Return the data from tab-separated revisions as one code/name dict.""" data_collection = OrderedDict() for revision in data_revisions: response = requests.get('%s/raw/release/%s.txt' % (data_url, revision)) if response.ok: print('%s is fetched' % revision, file=sys.stderr) else: print('%s is missing' % revision, file=sys.stderr) continue for line in response.text.strip().split('\n'): code, name = line.split('\t') data_collection[code.strip()] = name.strip() return data_collection def group_data(data_collection): """Filter the data and return codes with names.""" for code, name in sorted(data_collection.items()): if code.endswith('00'): continue # county only province_code = code[:2] + '0000' prefecture_code = code[:4] + '00' province_name = data_collection[province_code] prefecture_name = data_collection[prefecture_code] yield code, name, prefecture_name, province_name def print_data_file(file): """Output a data file in the right format.""" print("# generated from National Bureau of Statistics of the People's", file=file) print('# Republic of China, downloaded from %s' % data_url, file=file) print('# %s' % datetime.utcnow(), file=file) print('Downloading...', file=sys.stderr) data_collection = fetch_data() print('Generating...', file=sys.stderr) for data in group_data(data_collection): print('%s county="%s" prefecture="%s" province="%s"' % data, file=file) if __name__ == '__main__': if sys.stdout.isatty(): print_data_file(sys.stdout) else: print_data_file(codecs.getwriter('utf-8')(sys.stdout)) python-stdnum-1.8.1/update/isbn.py0000755000000000000000000000571713223166521017115 0ustar rootroot00000000000000#!/usr/bin/env python3 # update/isbn.py - script to get ISBN prefix data # # Copyright (C) 2010-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script downloads XML data from the International ISBN Agency website and provides a compact form of all group prefixes, and registrant ranges for those prefixes suitable for the numdb module. This data is needed to correctly split ISBNs into an EAN.UCC prefix, a group prefix, a registrant, an item number and a check-digit.""" import ssl import urllib.request from xml.etree import ElementTree # the location of the ISBN Ranges XML file download_url = 'https://www.isbn-international.org/export_rangemessage.xml' def ranges(group): """Provide the ranges for the group.""" for rule in group.find('Rules').findall('Rule'): length = int(rule.find('Length').text.strip()) if length: yield '-'.join( x[:length] for x in rule.find('Range').text.strip().split('-')) def wrap(text): """Rewrap the provided text into lines.""" while text: i = len(text) if i > 73: i = text.rindex(',', 20, 73) yield text[:i] text = text[i + 1:] if __name__ == '__main__': print('# generated from RangeMessage.xml, downloaded from') print('# %s' % download_url) ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) f = urllib.request.urlopen(download_url, context=ctx) # parse XML document msg = ElementTree.parse(f).getroot() # dump data from document print('# file serial %s' % msg.find('MessageSerialNumber').text.strip()) print('# file date %s' % msg.find('MessageDate').text.strip()) top_groups = dict( (x.find('Prefix').text.strip(), x) for x in msg.find('EAN.UCCPrefixes').findall('EAN.UCC')) prevtop = None for group in msg.find('RegistrationGroups').findall('Group'): top, prefix = group.find('Prefix').text.strip().split('-') agency = group.find('Agency').text.strip() if top != prevtop: print(top) for line in wrap(','.join(ranges(top_groups[top]))): print(' %s' % line) prevtop = top print(' %s agency="%s"' % (prefix, agency)) for line in wrap(','.join(ranges(group))): print(' %s' % line) python-stdnum-1.8.1/update/imsi.py0000755000000000000000000001753013223166521017117 0ustar rootroot00000000000000#!/usr/bin/env python # update/imsi.py - script to donwload from Wikipedia to build the database # # Copyright (C) 2011-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This extracts a IMSI country and operator code from Wikipedia.""" import re import urllib from collections import defaultdict # URLs that are downloaded mcc_list_url = 'https://en.wikipedia.org/w/index.php?title=Mobile_country_code&action=raw' cleanup_replacements = { 'Anguilla (United Kingdom)': 'Anguilla', 'Argentina|Argentine Republic': 'Argentina', 'Aruba (Kingdom of the Netherlands|Netherlands)': 'Aruba', 'Azerbaijan|Azerbaijani Republic': 'Azerbaijan', 'Bermuda (United Kingdom)': 'Bermuda', 'British Virgin Islands (United Kingdom)': 'British Virgin Islands', 'Brunei|Brunei Darussalam': 'Brunei', 'Cayman Islands': 'Cayman Islands (United Kingdom)', 'Cayman Islands (United Kingdom)': 'Cayman Islands (United Kingdom)', 'Czech Rep.': 'Czech Republic', 'Democratic People\'s Republic of Korea|Korea, North': 'North Korea', 'Denmark (Kingdom of Denmark)': 'Denmark', 'Faroe Islands (Kingdom of Denmark)': 'Faroe Islands (Denmark)', 'French Polynesia (France)': 'French Polynesia', 'Gabon|Gabonese Republic': 'Gabon', 'Georgia (country)|Georgia': 'Georgia', 'Gibraltar': 'Gibraltar (United Kingdom)', 'Gibraltar (United Kingdom)': 'Gibraltar (United Kingdom)', 'Greenland (Kingdom of Denmark)': 'Greenland (Denmark)', 'Guadeloupe': 'Guadeloupe (France)', 'Hong Kong (People\'s Republic of China|PRC)': 'Hong Kong (China)', 'Hong Kong (Special Administrative Region of People\'s Republic of China)': 'Hong Kong (China)', 'Korea (Rep. of)': 'South Korea', 'Kyrgyz Republic': 'Kyrgyzstan', 'Lao People\'s Democratic Republic|Laos': 'Laos', 'Macau (People\'s Republic of China)': 'Macau (China)', 'Macau (People\'s Republic of China|PRC)': 'Macau (China)', 'Martinique': 'Martinique (France)', 'Moldova (Republic of)': 'Moldova', 'Montenegro (Republic of)': 'Montenegro', 'Netherlands (Kingdom of the Netherlands)': 'Netherlands', 'Palestinian Authority': 'Palestinian territories', 'Palestinian territories|Palestine': 'Palestinian territories', 'People\'s Republic of China|China': 'China', 'Puerto Rico (United States)': 'Puerto Rico', 'Republic of Ireland|Ireland': 'Ireland', 'Republic of Korea|Korea, South': 'South Korea', 'Russian Federation': 'Russian Federation', 'Rwanda|Rwandese Republic': 'Rwanda', 'Serbia (Republic of)': 'Serbia', 'Somali Democratic Republic|Somalia': 'Somalia', 'Syrian Arab Republic': 'Syria', 'Syrian Arab Republic|Syria': 'Syria', 'Turks and Caicos Islands (United Kingdom)': 'Turks and Caicos Islands', 'United States': 'United States of America', 'United States Virgin Islands (United States)': 'United States Virgin Islands', 'Venezuela (Bolivarian Republic of)': 'Venezuela', 'Vietnam|Viet Nam': 'Vietnam', } remove_ref_re = re.compile(r'.*?') remove_comment_re = re.compile(r'{{.*?}}') quotes = u'\xab\xbb\u201c\u201d\u2018\u2019' remove_href_re = re.compile(r'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+' + r'[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|' + r'(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|' + r'(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>' + r'?' + quotes + ']))') def cleanup_value(val): """Remove unneeded markup from the value.""" # remove uninteresting things from value val = remove_comment_re.sub('', val) val = remove_ref_re.sub('', val) val = remove_href_re.sub('', val) val = val.replace('[', '').replace(']', '').replace('\'\'', '').strip() val = val.split('|')[-1] # replace value val = val.replace('Unknown', '') val = val.replace('United Kingdom|UK', 'United Kingdom') val = val.replace('United States|US', 'United States') val = val.replace('New Zealand|NZ', 'New Zealand').strip() return cleanup_replacements.get(val, val) def update_mncs(data, mcc, mnc, **kwargs): """Merge provided mnc information with the data that is already stored in mccs.""" data[mcc][mnc].update(dict((k, cleanup_value(v)) for k, v in kwargs.items() if v)) def get_mncs_from_wikipedia(data): """Update the collection of Mobile Country Codes from Wikipedia. This parses a Wikipedia page to extract the MCC and MNC, the first part of any IMSI, and stores the results.""" mnc_country_re = re.compile(r'^[=]{2,4}\s+(?P.*?)(\s+-\s+(?P[^\s]{2}))?\s+[=]{2,4}$') mnc_line_re = re.compile(r'^\|\s*(?P[0-9]+)' + r'\s*\\\\\s*(?P[0-9]+)' + r'(\s*\\\\\s*(?P[^\\]*)' + r'(\s*\\\\\s*(?P[^\\]*)' + r'(\s*\\\\\s*(?P[^\\]*)' + r'(\s*\\\\\s*(?P[^\\]*)' + r'(\s*\\\\\s*(?P[^\\]*)' + r')?)?)?)?)?') f = urllib.urlopen(mcc_list_url) country = cc = '' for line in f.readlines(): line = line.strip() match = mnc_country_re.match(line) if match: country = match.group('country') cc = (match.group('cc') or '').lower() if '||' not in line: continue line = line.replace('||', '\\\\') match = mnc_line_re.match(line) if match: for mnc in str2range(match.group('mnc')): update_mncs(data, match.group('mcc'), mnc, country=country, cc=cc, brand=match.group('brand'), operator=match.group('operator'), status=match.group('status'), bands=match.group('bands')) def str2range(x): """Convert the comma-separated list of ranges to a list of numbers.""" result = [] for part in x.split(','): if '-' in part: a, b = part.split('-') f = '%0' + str(len(b)) + 'd' a, b = int(a), int(b) for i in range(a, b + 1): result.append(f % (i)) else: result.append(part) return result if __name__ == '__main__': # download/parse the information data = defaultdict(lambda: defaultdict(dict)) get_mncs_from_wikipedia(data) # print header print('# generated from various sources') print('# %s' % mcc_list_url) # build an ordered list of mccs mcc_list = list(data.keys()) mcc_list.sort() # go over mccs for mcc in mcc_list: print('%s' % mcc) # build an ordered list of mncs mnc_list = data[mcc].keys() mnc_list.sort() for mnc in mnc_list: info = data[mcc][mnc] infokeys = info.keys() infokeys.sort() print(' %s%s' % (mnc, ''.join([' %s="%s"' % (k, info[k]) for k in infokeys]))) # try to get the length of mnc's try: length = len(mnc_list[0]) print(' %s-%s' % (length * '0', length * '9')) except IndexError: pass # ignore python-stdnum-1.8.1/update/eu_nace.py0000755000000000000000000000471713223166521017560 0ustar rootroot00000000000000#!/usr/bin/env python3 # update/eu_nace.py - script to get the NACE v2 catalogue # # Copyright (C) 2017-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """This script downloads XML data from the European commission RAMON Eurostat Metadata Server and extracts the information that is used for validating NACE codes.""" import cgi import urllib.request from xml.etree import ElementTree # the location of the ISBN Ranges XML file download_url = 'http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=ACT_OTH_CLS_DLD&StrNom=NACE_REV2&StrFormat=XML&StrLanguageCode=EN' if __name__ == '__main__': f = urllib.request.urlopen(download_url) _, params = cgi.parse_header(f.info().get('Content-Disposition', '')) filename = params.get('filename', '?') print('# generated from %s, downloaded from' % filename) print('# %s' % download_url) # parse XML document doc = ElementTree.parse(f).getroot() # output header print('# %s: %s' % ( doc.find('Classification').get('id'), doc.find('Classification/Label/LabelText[@language="EN"]').text)) for item in doc.findall('Classification/Item'): number = item.get('id') level = int(item.get('idLevel', 0)) label = item.find('Label/LabelText[@language="EN"]').text isic = item.find( 'Property[@genericName="ISIC4_REF"]/PropertyQualifier/' + 'PropertyText').text if level == 1: section = number print('%s label="%s" isic="%s"' % (number, label, isic)) elif level == 2: print('%s section="%s" label="%s" isic="%s"' % ( number, section, label, isic)) else: print('%s%s label="%s" isic="%s"' % ( ' ' * (level - 2), number[level], label, isic)) python-stdnum-1.8.1/update/requirements.txt0000644000000000000000000000002713223166521021056 0ustar rootroot00000000000000BeautifulSoup requests python-stdnum-1.8.1/README0000644000000000000000000002510413224171616015175 0ustar rootroot00000000000000python-stdnum ============= A Python module to parse, validate and reformat standard numbers and codes in different formats. It contains a large collection of number formats. Basically any number or code that has some validation mechanism available or some common formatting is eligible for inclusion in this library. https://arthurdejong.org/python-stdnum/ Available formats ----------------- Currently this package supports the following formats: * NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT number) * CBU (Clave Bancaria Uniforme, Argentine bank account number) * CUIT (Código Único de Identificación Tributaria, Argentinian tax number) * Austrian Company Register Numbers * UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number) * ABN (Australian Business Number) * ACN (Australian Company Number) * TFN (Australian Tax File Number) * BTW, TVA, NWSt, ondernemingsnummer (Belgian enterprise number) * EGN (ЕГН, Единен граждански номер, Bulgarian personal identity codes) * PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner) * VAT (Идентификационен номер по ДДС, Bulgarian VAT number) * BIC (ISO 9362 Business identifier codes) * CNPJ (Cadastro Nacional da Pessoa Jurídica, Brazillian company identifier) * CPF (Cadastro de Pessoas Físicas, Brazillian national identifier) * BN (Canadian Business Number) * SIN (Canadian Social Insurance Number) * CAS RN (Chemical Abstracts Service Registry Number) * Swiss social security number ("Sozialversicherungsnummer") * UID (Unternehmens-Identifikationsnummer, Swiss business identifier) * VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number) * RUT (Rol Único Tributario, Chilean national tax number) * RIC No. (Chinese Resident Identity Card Number) * NIT (Número De Identificación Tributaria, Colombian identity code) * CUSIP number (financial security identification number) * Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number) * DIČ (Daňové identifikační číslo, Czech VAT number) * RČ (Rodné číslo, the Czech birth number) * IdNr (Steuerliche Identifikationsnummer, German personal tax number) * Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number) * Wertpapierkennnummer (German securities identification code) * CPR (personnummer, the Danish citizen number) * CVR (Momsregistreringsnummer, Danish VAT number) * Cedula (Dominican Republic national identification number) * NCF (Números de Comprobante Fiscal, Dominican Republic receipt number) * RNC (Registro Nacional del Contribuyente, Dominican Republic tax number) * EAN (International Article Number) * CI (Cédula de identidad, Ecuadorian personal identity code) * RUC (Registro Único de Contribuyentes, Ecuadorian company tax number) * Isikukood (Estonian Personcal ID number) * KMKR (Käibemaksukohuslase, Estonian VAT number) * Registrikood (Estonian organisation registration code) * CCC (Código Cuenta Corriente, Spanish Bank Account Code) * CIF (Certificado de Identificación Fiscal, Spanish company tax number) * CUPS (Código Unificado de Punto de Suministro, Supply Point Unified Code) * DNI (Documento nacional de identidad, Spanish personal identity codes) * Spanish IBAN (International Bank Account Number) * NIE (Número de Identificación de Extranjeros, Spanish foreigner number) * NIF (Número de Identificación Fiscal, Spanish VAT number) * Referencia Catastral (Spanish real estate property id) * SEPA Identifier of the Creditor (AT-02) * Euro banknote serial numbers * EIC (European Energy Identification Code) * NACE (classification for businesses in the European Union) * VAT (European Union VAT number) * ALV nro (Arvonlisäveronumero, Finnish VAT number) * Finnish Association Identifier * HETU (Henkilötunnus, Finnish personal identity code) * Veronumero (Finnish individual tax number) * Y-tunnus (Finnish business identifier) * NIF (Numéro d'Immatriculation Fiscale, French tax identification number) * NIR (French personal identification number) * SIREN (a French company identification number) * SIRET (a French company establishment identification number) * n° TVA (taxe sur la valeur ajoutée, French VAT number) * NHS (United Kingdom National Health Service patient identifier) * SEDOL number (Stock Exchange Daily Official List number) * UPN (English Unique Pupil Number) * VAT (United Kingdom (and Isle of Man) VAT registration number) * FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number) * GRid (Global Release Identifier) * OIB (Osobni identifikacijski broj, Croatian identification number) * ANUM (Közösségi adószám, Hungarian VAT number) * IBAN (International Bank Account Number) * PPS No (Personal Public Service Number, Irish personal number) * VAT (Irish tax reference number) * IMEI (International Mobile Equipment Identity) * IMO number (International Maritime Organization number) * IMSI (International Mobile Subscriber Identity) * Aadhaar (Indian digital resident personal identity number) * PAN (Permanent Account Number, Indian income tax identifier) * Kennitala (Icelandic personal and organisation identity code) * VSK number (Virðisaukaskattsnúmer, Icelandic VAT number) * ISAN (International Standard Audiovisual Number) * ISBN (International Standard Book Number) * ISIL (International Standard Identifier for Libraries) * ISIN (International Securities Identification Number) * ISMN (International Standard Music Number) * ISO 6346 (International standard for container identification) * ISSN (International Standard Serial Number) * Codice Fiscale (Italian tax code for individuals) * Partita IVA (Italian VAT number) * LEI (Legal Entity Identifier) * PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT number) * TVA (taxe sur la valeur ajoutée, Luxembourgian VAT number) * PVN (Pievienotās vērtības nodokļa, Latvian VAT number) * n° TVA (taxe sur la valeur ajoutée, Monacan VAT number) * MEID (Mobile Equipment Identifier) * VAT (Maltese VAT number) * RFC (Registro Federal de Contribuyentes, Mexican tax number) * NRIC No. (Malaysian National Registration Identity Card Number) * Brin number (Dutch number for schools) * BSN (Burgerservicenummer, Dutch national identification number) * BTW-nummer (Omzetbelastingnummer, the Dutch VAT number) * Onderwijsnummer (Dutch student school number) * Postcode (Dutch postal code) * MVA (Merverdiavgift, Norwegian VAT number) * Orgnr (Organisasjonsnummer, Norwegian organisation number) * NIP (Numer Identyfikacji Podatkowej, Polish VAT number) * PESEL (Polish national identification number) * REGON (Rejestr Gospodarki Narodowej, Polish register of economic units) * NIF (Número de identificação fiscal, Portuguese VAT number) * CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number) * CNP (Cod Numeric Personal, Romanian Numerical Personal Code) * PIB (Poreski Identifikacioni Broj, Serbian tax identification number) * ИНН (Идентификационный номер налогоплательщика, Russian tax identifier) * Orgnr (Organisationsnummer, Swedish company number) * VAT (Moms, Mervärdesskatt, Swedish VAT number) * ID za DDV (Davčna številka, Slovenian VAT number) * IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number) * RČ (Rodné číslo, the Slovak birth number) * COE (Codice operatore economico, San Marino national tax number) * T.C. Kimlik No. (Turkish personal identification number) * ATIN (U.S. Adoption Taxpayer Identification Number) * EIN (U.S. Employer Identification Number) * ITIN (U.S. Individual Taxpayer Identification Number) * PTIN (U.S. Preparer Tax Identification Number) * RTN (Routing transport number) * SSN (U.S. Social Security Number) * TIN (U.S. Taxpayer Identification Number) Furthermore a number of generic check digit algorithms are available: * the Verhoeff algorithm * the Damm algorithm * the Luhn and Luhn mod N algorithms * some algorithms described in ISO/IEC 7064: Mod 11, 2, Mod 37, 2, Mod 97, 10, Mod 11, 10 and Mod 37, 36 Basically any number or code that has some validation mechanism available or some common formatting is eligible for inclusion into this library. These modules generally do not provide background information on the meaning and use of the specified numbers, only parsing and handling functions. Interface --------- All modules implement a common interface. For example for ISBN validation: >>> from stdnum import isbn >>> isbn.validate('978-9024538270') '9789024538270' >>> isbn.validate('978-9024538271') Traceback (most recent call last): ... InvalidChecksum: ... Most of these modules implement the following functions: * `validate()` validate the correctness of the passed number and return a compact representation of the number invalid numbers are rejected with one of the exceptions from the stdnum.exceptions module * `compact()` return a compact representation of the number or code this function generally does not do validation but may raise exceptions for wildly incorrect numbers * `format()` return a formatted version of the number in the preferred format this function generally expects to be passed a valid number or code Apart from the above, the module may add extra parsing, validation or conversion functions. Requirements ------------ The modules should not require any external Python modules and should be pure Python. The modules are developed and tested with Python 2.7 and 3.6 but may also work with older versions of Python. Copyright --------- Copyright (C) 2010-2018 Arthur de Jong and others This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Feedback and bug reports ------------------------ If you have any questions regarding python-stdnum, would like to report a bug or request addition of a format please send an email to Patches and code contributions are more than welcome. python-stdnum-1.8.1/MANIFEST.in0000644000000000000000000000033113223221441016035 0ustar rootroot00000000000000include README NEWS ChangeLog COPYING *.py tox.ini recursive-include tests *.doctest *.dat *.py recursive-include docs *.rst *.py recursive-include online_check * recursive-include update README requirements.txt *.py python-stdnum-1.8.1/PKG-INFO0000644000000000000000000003314613224171744015421 0ustar rootroot00000000000000Metadata-Version: 1.1 Name: python-stdnum Version: 1.8.1 Summary: Python module to handle standardized numbers and codes Home-page: https://arthurdejong.org/python-stdnum/ Author: Arthur de Jong Author-email: arthur@arthurdejong.org License: LGPL Description-Content-Type: UNKNOWN Description: python-stdnum ============= A Python module to parse, validate and reformat standard numbers and codes in different formats. It contains a large collection of number formats. Basically any number or code that has some validation mechanism available or some common formatting is eligible for inclusion in this library. https://arthurdejong.org/python-stdnum/ Available formats ----------------- Currently this package supports the following formats: * NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT number) * CBU (Clave Bancaria Uniforme, Argentine bank account number) * CUIT (Código Único de Identificación Tributaria, Argentinian tax number) * Austrian Company Register Numbers * UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number) * ABN (Australian Business Number) * ACN (Australian Company Number) * TFN (Australian Tax File Number) * BTW, TVA, NWSt, ondernemingsnummer (Belgian enterprise number) * EGN (ЕГН, Единен граждански номер, Bulgarian personal identity codes) * PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner) * VAT (Идентификационен номер по ДДС, Bulgarian VAT number) * BIC (ISO 9362 Business identifier codes) * CNPJ (Cadastro Nacional da Pessoa Jurídica, Brazillian company identifier) * CPF (Cadastro de Pessoas Físicas, Brazillian national identifier) * BN (Canadian Business Number) * SIN (Canadian Social Insurance Number) * CAS RN (Chemical Abstracts Service Registry Number) * Swiss social security number ("Sozialversicherungsnummer") * UID (Unternehmens-Identifikationsnummer, Swiss business identifier) * VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number) * RUT (Rol Único Tributario, Chilean national tax number) * RIC No. (Chinese Resident Identity Card Number) * NIT (Número De Identificación Tributaria, Colombian identity code) * CUSIP number (financial security identification number) * Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number) * DIČ (Daňové identifikační číslo, Czech VAT number) * RČ (Rodné číslo, the Czech birth number) * IdNr (Steuerliche Identifikationsnummer, German personal tax number) * Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number) * Wertpapierkennnummer (German securities identification code) * CPR (personnummer, the Danish citizen number) * CVR (Momsregistreringsnummer, Danish VAT number) * Cedula (Dominican Republic national identification number) * NCF (Números de Comprobante Fiscal, Dominican Republic receipt number) * RNC (Registro Nacional del Contribuyente, Dominican Republic tax number) * EAN (International Article Number) * CI (Cédula de identidad, Ecuadorian personal identity code) * RUC (Registro Único de Contribuyentes, Ecuadorian company tax number) * Isikukood (Estonian Personcal ID number) * KMKR (Käibemaksukohuslase, Estonian VAT number) * Registrikood (Estonian organisation registration code) * CCC (Código Cuenta Corriente, Spanish Bank Account Code) * CIF (Certificado de Identificación Fiscal, Spanish company tax number) * CUPS (Código Unificado de Punto de Suministro, Supply Point Unified Code) * DNI (Documento nacional de identidad, Spanish personal identity codes) * Spanish IBAN (International Bank Account Number) * NIE (Número de Identificación de Extranjeros, Spanish foreigner number) * NIF (Número de Identificación Fiscal, Spanish VAT number) * Referencia Catastral (Spanish real estate property id) * SEPA Identifier of the Creditor (AT-02) * Euro banknote serial numbers * EIC (European Energy Identification Code) * NACE (classification for businesses in the European Union) * VAT (European Union VAT number) * ALV nro (Arvonlisäveronumero, Finnish VAT number) * Finnish Association Identifier * HETU (Henkilötunnus, Finnish personal identity code) * Veronumero (Finnish individual tax number) * Y-tunnus (Finnish business identifier) * NIF (Numéro d'Immatriculation Fiscale, French tax identification number) * NIR (French personal identification number) * SIREN (a French company identification number) * SIRET (a French company establishment identification number) * n° TVA (taxe sur la valeur ajoutée, French VAT number) * NHS (United Kingdom National Health Service patient identifier) * SEDOL number (Stock Exchange Daily Official List number) * UPN (English Unique Pupil Number) * VAT (United Kingdom (and Isle of Man) VAT registration number) * FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number) * GRid (Global Release Identifier) * OIB (Osobni identifikacijski broj, Croatian identification number) * ANUM (Közösségi adószám, Hungarian VAT number) * IBAN (International Bank Account Number) * PPS No (Personal Public Service Number, Irish personal number) * VAT (Irish tax reference number) * IMEI (International Mobile Equipment Identity) * IMO number (International Maritime Organization number) * IMSI (International Mobile Subscriber Identity) * Aadhaar (Indian digital resident personal identity number) * PAN (Permanent Account Number, Indian income tax identifier) * Kennitala (Icelandic personal and organisation identity code) * VSK number (Virðisaukaskattsnúmer, Icelandic VAT number) * ISAN (International Standard Audiovisual Number) * ISBN (International Standard Book Number) * ISIL (International Standard Identifier for Libraries) * ISIN (International Securities Identification Number) * ISMN (International Standard Music Number) * ISO 6346 (International standard for container identification) * ISSN (International Standard Serial Number) * Codice Fiscale (Italian tax code for individuals) * Partita IVA (Italian VAT number) * LEI (Legal Entity Identifier) * PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT number) * TVA (taxe sur la valeur ajoutée, Luxembourgian VAT number) * PVN (Pievienotās vērtības nodokļa, Latvian VAT number) * n° TVA (taxe sur la valeur ajoutée, Monacan VAT number) * MEID (Mobile Equipment Identifier) * VAT (Maltese VAT number) * RFC (Registro Federal de Contribuyentes, Mexican tax number) * NRIC No. (Malaysian National Registration Identity Card Number) * Brin number (Dutch number for schools) * BSN (Burgerservicenummer, Dutch national identification number) * BTW-nummer (Omzetbelastingnummer, the Dutch VAT number) * Onderwijsnummer (Dutch student school number) * Postcode (Dutch postal code) * MVA (Merverdiavgift, Norwegian VAT number) * Orgnr (Organisasjonsnummer, Norwegian organisation number) * NIP (Numer Identyfikacji Podatkowej, Polish VAT number) * PESEL (Polish national identification number) * REGON (Rejestr Gospodarki Narodowej, Polish register of economic units) * NIF (Número de identificação fiscal, Portuguese VAT number) * CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number) * CNP (Cod Numeric Personal, Romanian Numerical Personal Code) * PIB (Poreski Identifikacioni Broj, Serbian tax identification number) * ИНН (Идентификационный номер налогоплательщика, Russian tax identifier) * Orgnr (Organisationsnummer, Swedish company number) * VAT (Moms, Mervärdesskatt, Swedish VAT number) * ID za DDV (Davčna številka, Slovenian VAT number) * IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number) * RČ (Rodné číslo, the Slovak birth number) * COE (Codice operatore economico, San Marino national tax number) * T.C. Kimlik No. (Turkish personal identification number) * ATIN (U.S. Adoption Taxpayer Identification Number) * EIN (U.S. Employer Identification Number) * ITIN (U.S. Individual Taxpayer Identification Number) * PTIN (U.S. Preparer Tax Identification Number) * RTN (Routing transport number) * SSN (U.S. Social Security Number) * TIN (U.S. Taxpayer Identification Number) Furthermore a number of generic check digit algorithms are available: * the Verhoeff algorithm * the Damm algorithm * the Luhn and Luhn mod N algorithms * some algorithms described in ISO/IEC 7064: Mod 11, 2, Mod 37, 2, Mod 97, 10, Mod 11, 10 and Mod 37, 36 Basically any number or code that has some validation mechanism available or some common formatting is eligible for inclusion into this library. These modules generally do not provide background information on the meaning and use of the specified numbers, only parsing and handling functions. Interface --------- All modules implement a common interface. For example for ISBN validation: >>> from stdnum import isbn >>> isbn.validate('978-9024538270') '9789024538270' >>> isbn.validate('978-9024538271') Traceback (most recent call last): ... InvalidChecksum: ... Most of these modules implement the following functions: * `validate()` validate the correctness of the passed number and return a compact representation of the number invalid numbers are rejected with one of the exceptions from the stdnum.exceptions module * `compact()` return a compact representation of the number or code this function generally does not do validation but may raise exceptions for wildly incorrect numbers * `format()` return a formatted version of the number in the preferred format this function generally expects to be passed a valid number or code Apart from the above, the module may add extra parsing, validation or conversion functions. Requirements ------------ The modules should not require any external Python modules and should be pure Python. The modules are developed and tested with Python 2.7 and 3.6 but may also work with older versions of Python. Copyright --------- Copyright (C) 2010-2018 Arthur de Jong and others This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Feedback and bug reports ------------------------ If you have any questions regarding python-stdnum, would like to report a bug or request addition of a format please send an email to Patches and code contributions are more than welcome. Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Financial and Insurance Industry Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: Telecommunications Industry Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Topic :: Office/Business :: Financial Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Processing :: General python-stdnum-1.8.1/docs/0000755000000000000000000000000013224171743015244 5ustar rootroot00000000000000python-stdnum-1.8.1/docs/stdnum.es.referenciacatastral.rst0000644000000000000000000000016713223166517023725 0ustar rootroot00000000000000stdnum.es.referenciacatastral ============================= .. automodule:: stdnum.es.referenciacatastral :members:python-stdnum-1.8.1/docs/stdnum.eu.vat.rst0000644000000000000000000000011013156325245020503 0ustar rootroot00000000000000stdnum.eu.vat ============= .. automodule:: stdnum.eu.vat :members: python-stdnum-1.8.1/docs/stdnum.fi.associationid.rst0000644000000000000000000000014513156325245022537 0ustar rootroot00000000000000stdnum.fi.associationid ======================= .. automodule:: stdnum.fi.associationid :members:python-stdnum-1.8.1/docs/stdnum.es.dni.rst0000644000000000000000000000011013156325245020461 0ustar rootroot00000000000000stdnum.es.dni ============= .. automodule:: stdnum.es.dni :members: python-stdnum-1.8.1/docs/stdnum.imo.rst0000644000000000000000000000007613156325245020100 0ustar rootroot00000000000000stdnum.imo ========== .. automodule:: stdnum.imo :members:python-stdnum-1.8.1/docs/stdnum.ee.registrikood.rst0000644000000000000000000000014213223166517022403 0ustar rootroot00000000000000stdnum.ee.registrikood ====================== .. automodule:: stdnum.ee.registrikood :members:python-stdnum-1.8.1/docs/stdnum.us.ptin.rst0000644000000000000000000000011313156325245020704 0ustar rootroot00000000000000stdnum.us.ptin ============== .. automodule:: stdnum.us.ptin :members: python-stdnum-1.8.1/docs/stdnum.eu.eic.rst0000644000000000000000000000010713223166517020457 0ustar rootroot00000000000000stdnum.eu.eic ============= .. automodule:: stdnum.eu.eic :members:python-stdnum-1.8.1/docs/stdnum.ie.pps.rst0000644000000000000000000000011013156325245020477 0ustar rootroot00000000000000stdnum.ie.pps ============= .. automodule:: stdnum.ie.pps :members: python-stdnum-1.8.1/docs/stdnum.isan.rst0000644000000000000000000000010213156325245020234 0ustar rootroot00000000000000stdnum.isan =========== .. automodule:: stdnum.isan :members: python-stdnum-1.8.1/docs/stdnum.meid.rst0000644000000000000000000000010213156325245020220 0ustar rootroot00000000000000stdnum.meid =========== .. automodule:: stdnum.meid :members: python-stdnum-1.8.1/docs/stdnum.lu.tva.rst0000644000000000000000000000011013156325245020512 0ustar rootroot00000000000000stdnum.lu.tva ============= .. automodule:: stdnum.lu.tva :members: python-stdnum-1.8.1/docs/stdnum.cusip.rst0000644000000000000000000000010413156325245020427 0ustar rootroot00000000000000stdnum.cusip ============ .. automodule:: stdnum.cusip :members:python-stdnum-1.8.1/docs/stdnum.eu.at_02.rst0000644000000000000000000000011613156325245020624 0ustar rootroot00000000000000stdnum.eu.at_02 =============== .. automodule:: stdnum.eu.at_02 :members: python-stdnum-1.8.1/docs/stdnum.mt.vat.rst0000644000000000000000000000011013156325245020512 0ustar rootroot00000000000000stdnum.mt.vat ============= .. automodule:: stdnum.mt.vat :members: python-stdnum-1.8.1/docs/stdnum.in_.pan.rst0000644000000000000000000000011413223221441020613 0ustar rootroot00000000000000stdnum.in\_.pan =============== .. automodule:: stdnum.in_.pan :members:python-stdnum-1.8.1/docs/stdnum.lei.rst0000644000000000000000000000007613223166517020065 0ustar rootroot00000000000000stdnum.lei ========== .. automodule:: stdnum.lei :members:python-stdnum-1.8.1/docs/stdnum.do.rnc.rst0000644000000000000000000000010713156325245020472 0ustar rootroot00000000000000stdnum.do.rnc ============= .. automodule:: stdnum.do.rnc :members:python-stdnum-1.8.1/docs/stdnum.ee.kmkr.rst0000644000000000000000000000011313156325245020640 0ustar rootroot00000000000000stdnum.ee.kmkr ============== .. automodule:: stdnum.ee.kmkr :members: python-stdnum-1.8.1/docs/stdnum.issn.rst0000644000000000000000000000010213156325245020256 0ustar rootroot00000000000000stdnum.issn =========== .. automodule:: stdnum.issn :members: python-stdnum-1.8.1/docs/stdnum.ar.cuit.rst0000644000000000000000000000011213156325245020650 0ustar rootroot00000000000000stdnum.ar.cuit ============== .. automodule:: stdnum.ar.cuit :members:python-stdnum-1.8.1/docs/stdnum.at.businessid.rst0000644000000000000000000000013413156325245022062 0ustar rootroot00000000000000stdnum.at.businessid ==================== .. automodule:: stdnum.at.businessid :members:python-stdnum-1.8.1/docs/stdnum.fr.tva.rst0000644000000000000000000000011013156325245020501 0ustar rootroot00000000000000stdnum.fr.tva ============= .. automodule:: stdnum.fr.tva :members: python-stdnum-1.8.1/docs/stdnum.sk.dph.rst0000644000000000000000000000011013156325245020470 0ustar rootroot00000000000000stdnum.sk.dph ============= .. automodule:: stdnum.sk.dph :members: python-stdnum-1.8.1/docs/stdnum.fi.hetu.rst0000644000000000000000000000011313156325245020646 0ustar rootroot00000000000000stdnum.fi.hetu ============== .. automodule:: stdnum.fi.hetu :members: python-stdnum-1.8.1/docs/stdnum.gb.upn.rst0000644000000000000000000000010713223166517020500 0ustar rootroot00000000000000stdnum.gb.upn ============= .. automodule:: stdnum.gb.upn :members:python-stdnum-1.8.1/docs/stdnum.cz.rc.rst0000644000000000000000000000010513156325245020324 0ustar rootroot00000000000000stdnum.cz.rc ============ .. automodule:: stdnum.cz.rc :members: python-stdnum-1.8.1/docs/stdnum.fr.nir.rst0000644000000000000000000000010713223166517020505 0ustar rootroot00000000000000stdnum.fr.nir ============= .. automodule:: stdnum.fr.nir :members:python-stdnum-1.8.1/docs/stdnum.ee.ik.rst0000644000000000000000000000010413156325245020277 0ustar rootroot00000000000000stdnum.ee.ik ============ .. automodule:: stdnum.ee.ik :members:python-stdnum-1.8.1/docs/stdnum.de.vat.rst0000644000000000000000000000011013156325245020462 0ustar rootroot00000000000000stdnum.de.vat ============= .. automodule:: stdnum.de.vat :members: python-stdnum-1.8.1/docs/stdnum.bic.rst0000644000000000000000000000007613223166517020051 0ustar rootroot00000000000000stdnum.bic ========== .. automodule:: stdnum.bic :members:python-stdnum-1.8.1/docs/stdnum.br.cnpj.rst0000644000000000000000000000011213156325245020637 0ustar rootroot00000000000000stdnum.br.cnpj ============== .. automodule:: stdnum.br.cnpj :members:python-stdnum-1.8.1/docs/stdnum.mc.tva.rst0000644000000000000000000000010713223166517020477 0ustar rootroot00000000000000stdnum.mc.tva ============= .. automodule:: stdnum.mc.tva :members:python-stdnum-1.8.1/docs/stdnum.gb.sedol.rst0000644000000000000000000000011513156325245021003 0ustar rootroot00000000000000stdnum.gb.sedol =============== .. automodule:: stdnum.gb.sedol :members:python-stdnum-1.8.1/docs/stdnum.gb.nhs.rst0000644000000000000000000000010713223166517020466 0ustar rootroot00000000000000stdnum.gb.nhs ============= .. automodule:: stdnum.gb.nhs :members:python-stdnum-1.8.1/docs/stdnum.al.nipt.rst0000644000000000000000000000011213156325245020650 0ustar rootroot00000000000000stdnum.al.nipt ============== .. automodule:: stdnum.al.nipt :members:python-stdnum-1.8.1/docs/stdnum.ch.uid.rst0000644000000000000000000000010713156325245020461 0ustar rootroot00000000000000stdnum.ch.uid ============= .. automodule:: stdnum.ch.uid :members:python-stdnum-1.8.1/docs/stdnum.lt.pvm.rst0000644000000000000000000000011013156325245020521 0ustar rootroot00000000000000stdnum.lt.pvm ============= .. automodule:: stdnum.lt.pvm :members: python-stdnum-1.8.1/docs/conf.py0000644000000000000000000001434513223221441016540 0ustar rootroot00000000000000# -*- coding: utf-8 -*- # # python-stdnum documentation build configuration file, created by # sphinx-quickstart # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os import stdnum # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.autosummary' ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information about the project. project = u'python-stdnum' copyright = u'2013-2018, Arthur de Jong' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = stdnum.__version__ # The full version, including alpha/beta/rc tags. release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_*', '.svn', '.git'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['stdnum.', ] # Automatically generate stub pages for autosummary entries. autosummary_generate = True # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%Y-%m-%d' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. html_show_sourcelink = False # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Suffix for generated links to HTML files. #html_link_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = 'python-stdnumdoc' # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'python-stdnum', u'python-stdnum Documentation', [u'Arthur de Jong'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} python-stdnum-1.8.1/docs/_templates/0000755000000000000000000000000013224171742017400 5ustar rootroot00000000000000python-stdnum-1.8.1/docs/_templates/autosummary/0000755000000000000000000000000013224171743021767 5ustar rootroot00000000000000python-stdnum-1.8.1/docs/_templates/autosummary/module.rst0000644000000000000000000000011413156325244024003 0ustar rootroot00000000000000{{ fullname }} {{ underline }} .. automodule:: {{ fullname }} :members: python-stdnum-1.8.1/docs/stdnum.pl.pesel.rst0000644000000000000000000000011513156325245021030 0ustar rootroot00000000000000stdnum.pl.pesel =============== .. automodule:: stdnum.pl.pesel :members:python-stdnum-1.8.1/docs/stdnum.us.tin.rst0000644000000000000000000000011013156325245020521 0ustar rootroot00000000000000stdnum.us.tin ============= .. automodule:: stdnum.us.tin :members: python-stdnum-1.8.1/docs/stdnum.eu.banknote.rst0000644000000000000000000000012613223221441021505 0ustar rootroot00000000000000stdnum.eu.banknote ================== .. automodule:: stdnum.eu.banknote :members:python-stdnum-1.8.1/docs/stdnum.ro.cnp.rst0000644000000000000000000000011013156325245020500 0ustar rootroot00000000000000stdnum.ro.cnp ============= .. automodule:: stdnum.ro.cnp :members: python-stdnum-1.8.1/docs/stdnum.ean.rst0000644000000000000000000000007713156325245020060 0ustar rootroot00000000000000stdnum.ean ========== .. automodule:: stdnum.ean :members: python-stdnum-1.8.1/docs/stdnum.cl.rut.rst0000644000000000000000000000010713156325245020516 0ustar rootroot00000000000000stdnum.cl.rut ============= .. automodule:: stdnum.cl.rut :members:python-stdnum-1.8.1/docs/stdnum.au.acn.rst0000644000000000000000000000010713223166517020454 0ustar rootroot00000000000000stdnum.au.acn ============= .. automodule:: stdnum.au.acn :members:python-stdnum-1.8.1/docs/stdnum.si.ddv.rst0000644000000000000000000000011013156325245020470 0ustar rootroot00000000000000stdnum.si.ddv ============= .. automodule:: stdnum.si.ddv :members: python-stdnum-1.8.1/docs/stdnum.sk.rc.rst0000644000000000000000000000010513156325245020325 0ustar rootroot00000000000000stdnum.sk.rc ============ .. automodule:: stdnum.sk.rc :members: python-stdnum-1.8.1/docs/stdnum.damm.rst0000644000000000000000000000010113223166517020217 0ustar rootroot00000000000000stdnum.damm =========== .. automodule:: stdnum.damm :members:python-stdnum-1.8.1/docs/stdnum.ru.inn.rst0000644000000000000000000000010713156325245020520 0ustar rootroot00000000000000stdnum.ru.inn ============= .. automodule:: stdnum.ru.inn :members:python-stdnum-1.8.1/docs/stdnum.imei.rst0000644000000000000000000000010213156325245020225 0ustar rootroot00000000000000stdnum.imei =========== .. automodule:: stdnum.imei :members: python-stdnum-1.8.1/docs/stdnum.exceptions.rst0000644000000000000000000000143213156325245021472 0ustar rootroot00000000000000stdnum.exceptions ================= .. automodule:: stdnum.exceptions :show-inheritance: :member-order: bysource :members: The exceptions are organised hierarchically in the following structure: :: ValidationError +-- InvalidFormat | +-- InvalidLength +-- InvalidChecksum +-- InvalidComponent It is possible to change the exception messages by setting the `message` class property. This allows localisation and application-specific error messages. >>> raise InvalidFormat() Traceback (most recent call last): ... InvalidChecksum: The number has an invalid format. >>> InvalidFormat.message = 'UNKNOWN' >>> raise InvalidFormat() Traceback (most recent call last): ... InvalidChecksum: UNKNOWN python-stdnum-1.8.1/docs/stdnum.dk.cvr.rst0000644000000000000000000000011013156325245020470 0ustar rootroot00000000000000stdnum.dk.cvr ============= .. automodule:: stdnum.dk.cvr :members: python-stdnum-1.8.1/docs/stdnum.ar.cbu.rst0000644000000000000000000000010713223166517020461 0ustar rootroot00000000000000stdnum.ar.cbu ============= .. automodule:: stdnum.ar.cbu :members:python-stdnum-1.8.1/docs/stdnum.es.cups.rst0000644000000000000000000000011213223166517020663 0ustar rootroot00000000000000stdnum.es.cups ============== .. automodule:: stdnum.es.cups :members:python-stdnum-1.8.1/docs/stdnum.it.iva.rst0000644000000000000000000000011013156325245020473 0ustar rootroot00000000000000stdnum.it.iva ============= .. automodule:: stdnum.it.iva :members: python-stdnum-1.8.1/docs/stdnum.ch.vat.rst0000644000000000000000000000010713156325245020472 0ustar rootroot00000000000000stdnum.ch.vat ============= .. automodule:: stdnum.ch.vat :members:python-stdnum-1.8.1/docs/stdnum.es.cif.rst0000644000000000000000000000011013156325245020450 0ustar rootroot00000000000000stdnum.es.cif ============= .. automodule:: stdnum.es.cif :members: python-stdnum-1.8.1/docs/stdnum.gb.vat.rst0000644000000000000000000000011013156325245020462 0ustar rootroot00000000000000stdnum.gb.vat ============= .. automodule:: stdnum.gb.vat :members: python-stdnum-1.8.1/docs/stdnum.isil.rst0000644000000000000000000000010213156325245020242 0ustar rootroot00000000000000stdnum.isil =========== .. automodule:: stdnum.isil :members: python-stdnum-1.8.1/docs/stdnum.cz.dic.rst0000644000000000000000000000011013156325245020453 0ustar rootroot00000000000000stdnum.cz.dic ============= .. automodule:: stdnum.cz.dic :members: python-stdnum-1.8.1/docs/stdnum.imsi.rst0000644000000000000000000000010213156325245020243 0ustar rootroot00000000000000stdnum.imsi =========== .. automodule:: stdnum.imsi :members: python-stdnum-1.8.1/docs/stdnum.se.orgnr.rst0000644000000000000000000000011513156325245021043 0ustar rootroot00000000000000stdnum.se.orgnr =============== .. automodule:: stdnum.se.orgnr :members:python-stdnum-1.8.1/docs/stdnum.is_.vsk.rst0000644000000000000000000000011413223166517020661 0ustar rootroot00000000000000stdnum.is\_.vsk =============== .. automodule:: stdnum.is_.vsk :members:python-stdnum-1.8.1/docs/stdnum.cn.ric.rst0000644000000000000000000000011013156325245020455 0ustar rootroot00000000000000stdnum.cn.ric ============= .. automodule:: stdnum.cn.ric :members: python-stdnum-1.8.1/docs/stdnum.us.atin.rst0000644000000000000000000000011313156325245020665 0ustar rootroot00000000000000stdnum.us.atin ============== .. automodule:: stdnum.us.atin :members: python-stdnum-1.8.1/docs/stdnum.de.wkn.rst0000644000000000000000000000010713156325245020475 0ustar rootroot00000000000000stdnum.de.wkn ============= .. automodule:: stdnum.de.wkn :members:python-stdnum-1.8.1/docs/stdnum.bg.egn.rst0000644000000000000000000000011013156325245020441 0ustar rootroot00000000000000stdnum.bg.egn ============= .. automodule:: stdnum.bg.egn :members: python-stdnum-1.8.1/docs/stdnum.iso6346.rst0000644000000000000000000000011313156325245020421 0ustar rootroot00000000000000stdnum.iso6346 ============== .. automodule:: stdnum.iso6346 :members: python-stdnum-1.8.1/docs/stdnum.no.orgnr.rst0000644000000000000000000000011513156325245021050 0ustar rootroot00000000000000stdnum.no.orgnr =============== .. automodule:: stdnum.no.orgnr :members:python-stdnum-1.8.1/docs/stdnum.grid.rst0000644000000000000000000000010213156325245020227 0ustar rootroot00000000000000stdnum.grid =========== .. automodule:: stdnum.grid :members: python-stdnum-1.8.1/docs/stdnum.fi.veronumero.rst0000644000000000000000000000013413223166517022105 0ustar rootroot00000000000000stdnum.fi.veronumero ==================== .. automodule:: stdnum.fi.veronumero :members:python-stdnum-1.8.1/docs/stdnum.dk.cpr.rst0000644000000000000000000000011013156325245020462 0ustar rootroot00000000000000stdnum.dk.cpr ============= .. automodule:: stdnum.dk.cpr :members: python-stdnum-1.8.1/docs/stdnum.es.iban.rst0000644000000000000000000000011213223166517020622 0ustar rootroot00000000000000stdnum.es.iban ============== .. automodule:: stdnum.es.iban :members:python-stdnum-1.8.1/docs/stdnum.br.cpf.rst0000644000000000000000000000011013156325245020453 0ustar rootroot00000000000000stdnum.br.cpf ============= .. automodule:: stdnum.br.cpf :members: python-stdnum-1.8.1/docs/stdnum.se.vat.rst0000644000000000000000000000011013156325245020501 0ustar rootroot00000000000000stdnum.se.vat ============= .. automodule:: stdnum.se.vat :members: python-stdnum-1.8.1/docs/stdnum.iban.rst0000644000000000000000000000010213156325245020213 0ustar rootroot00000000000000stdnum.iban =========== .. automodule:: stdnum.iban :members: python-stdnum-1.8.1/docs/stdnum.it.codicefiscale.rst0000644000000000000000000000014613156325245022502 0ustar rootroot00000000000000stdnum.it.codicefiscale ======================= .. automodule:: stdnum.it.codicefiscale :members: python-stdnum-1.8.1/docs/stdnum.in_.aadhaar.rst0000644000000000000000000000013013223221441021414 0ustar rootroot00000000000000stdnum.in\_.aadhaar =================== .. automodule:: stdnum.in_.aadhaar :members:python-stdnum-1.8.1/docs/index.rst0000644000000000000000000001000113223706005017067 0ustar rootroot00000000000000.. module:: stdnum .. include:: ../README :end-before: Available formats Common Interface ---------------- Most of the number format modules implement the following functions: .. function:: module.validate(number) Validate the number and return a compact, consistent representation of the number or code. If the validation fails, :mod:`an exception <.exceptions>` is raised that indicates the type of error. .. function:: module.is_valid(number) Return either ``True`` or ``False`` depending on whether the passed number is in any supported and valid form and passes all embedded checks of the number. This function should never raise an exception. .. function:: module.compact(number) Return a compact representation of the number or code. This function generally does not do validation but may raise exceptions for wildly invalid numbers. .. function:: module.format(number) Return a formatted version of the number in the preferred format. This function generally expects to be passed a valid number or code and may raise exceptions for invalid numbers. The check digit modules generally also provide the following functions: .. function:: module.checksum(number) Calculate the checksum over the provided number. This is generally a number that can be used to determine whether the provided number is valid. It depends on the algorithm which checksum is considered valid. .. function:: module.calc_check_digit(number) Calculate the check digit that should be added to the number to make it valid. Apart from the above, the modules may add extra parsing, validation or conversion functions. Helper functions and modules ---------------------------- .. autosummary:: :toctree: exceptions .. autofunction:: get_cc_module Searches the stdnum collection of modules for a number format for a particular country. `name` may be an aliased name. For example: >>> from stdnum import get_cc_module >>> get_cc_module('nl', 'vat') Will return ``None`` if no module could be found. The generic names that are currently in use: * ``'vat'`` for value added tax numbers * ``'businessid'`` for generic business identifiers (although some countries may have multiple) * ``'personalid'`` for generic personal identifiers (some countries may have multiple, especially for tax purposes) * ``'postcal_code'`` for address postal codes Generic check digit algorithms ------------------------------ .. autosummary:: :toctree: damm iso7064 luhn verhoeff Available formats ----------------- .. autosummary:: :toctree: al.nipt ar.cbu ar.cuit at.businessid at.uid au.abn au.acn au.tfn be.vat bg.egn bg.pnf bg.vat bic br.cnpj br.cpf ca.bn ca.sin casrn ch.ssn ch.uid ch.vat cl.rut cn.ric co.nit cusip cy.vat cz.dic cz.rc de.idnr de.vat de.wkn dk.cpr dk.cvr do.cedula do.ncf do.rnc ean ec.ci ec.ruc ee.ik ee.kmkr ee.registrikood es.ccc es.cif es.cups es.dni es.iban es.nie es.nif es.referenciacatastral eu.at_02 eu.banknote eu.eic eu.nace eu.vat fi.alv fi.associationid fi.hetu fi.veronumero fi.ytunnus fr.nif fr.nir fr.siren fr.siret fr.tva gb.nhs gb.sedol gb.upn gb.vat gr.vat grid hr.oib hu.anum iban ie.pps ie.vat imei imo imsi in_.aadhaar in_.pan is_.kennitala is_.vsk isan isbn isil isin ismn iso6346 issn it.codicefiscale it.iva lei lt.pvm lu.tva lv.pvn mc.tva meid mt.vat mx.rfc my.nric nl.brin nl.bsn nl.btw nl.onderwijsnummer nl.postcode no.mva no.orgnr pl.nip pl.pesel pl.regon pt.nif ro.cf ro.cnp rs.pib ru.inn se.orgnr se.vat si.ddv sk.dph sk.rc sm.coe tr.tckimlik us.atin us.ein us.itin us.ptin us.rtn us.ssn us.tin python-stdnum-1.8.1/docs/stdnum.ec.ruc.rst0000644000000000000000000000011013156325245020460 0ustar rootroot00000000000000stdnum.ec.ruc ============= .. automodule:: stdnum.ec.ruc :members: python-stdnum-1.8.1/docs/stdnum.ca.bn.rst0000644000000000000000000000010413223166517020265 0ustar rootroot00000000000000stdnum.ca.bn ============ .. automodule:: stdnum.ca.bn :members:python-stdnum-1.8.1/docs/stdnum.iso7064.rst0000644000000000000000000000123113156325245020421 0ustar rootroot00000000000000stdnum.iso7064 ============== .. automodule:: stdnum.iso7064 :members: Mod 11, 10 ---------- :mod:`stdnum.iso7064.mod_11_10` .. automodule:: stdnum.iso7064.mod_11_10 :members: Mod 11, 2 --------- :mod:`stdnum.iso7064.mod_11_2` .. automodule:: stdnum.iso7064.mod_11_2 :members: Mod 37, 2 (Mod x, 2) -------------------- :mod:`stdnum.iso7064.mod_37_2` .. automodule:: stdnum.iso7064.mod_37_2 :members: Mod 37, 36 (Mod x+1, x) ----------------------- :mod:`stdnum.iso7064.mod_37_36` .. automodule:: stdnum.iso7064.mod_37_36 :members: Mod 97, 10 ---------- :mod:`stdnum.iso7064.mod_97_10` .. automodule:: stdnum.iso7064.mod_97_10 :members: python-stdnum-1.8.1/docs/stdnum.au.abn.rst0000644000000000000000000000010713223166517020453 0ustar rootroot00000000000000stdnum.au.abn ============= .. automodule:: stdnum.au.abn :members:python-stdnum-1.8.1/docs/stdnum.my.nric.rst0000644000000000000000000000011313156325245020663 0ustar rootroot00000000000000stdnum.my.nric ============== .. automodule:: stdnum.my.nric :members: python-stdnum-1.8.1/docs/stdnum.mx.rfc.rst0000644000000000000000000000010713156325245020504 0ustar rootroot00000000000000stdnum.mx.rfc ============= .. automodule:: stdnum.mx.rfc :members:python-stdnum-1.8.1/docs/stdnum.rs.pib.rst0000644000000000000000000000010713223166517020504 0ustar rootroot00000000000000stdnum.rs.pib ============= .. automodule:: stdnum.rs.pib :members:python-stdnum-1.8.1/docs/stdnum.gr.vat.rst0000644000000000000000000000011013156325245020502 0ustar rootroot00000000000000stdnum.gr.vat ============= .. automodule:: stdnum.gr.vat :members: python-stdnum-1.8.1/docs/stdnum.fi.alv.rst0000644000000000000000000000011013156325245020460 0ustar rootroot00000000000000stdnum.fi.alv ============= .. automodule:: stdnum.fi.alv :members: python-stdnum-1.8.1/docs/stdnum.ch.ssn.rst0000644000000000000000000000011013156325245020475 0ustar rootroot00000000000000stdnum.ch.ssn ============= .. automodule:: stdnum.ch.ssn :members: python-stdnum-1.8.1/docs/stdnum.do.ncf.rst0000644000000000000000000000010713223221441020442 0ustar rootroot00000000000000stdnum.do.ncf ============= .. automodule:: stdnum.do.ncf :members:python-stdnum-1.8.1/docs/stdnum.bg.vat.rst0000644000000000000000000000011013156325245020462 0ustar rootroot00000000000000stdnum.bg.vat ============= .. automodule:: stdnum.bg.vat :members: python-stdnum-1.8.1/docs/stdnum.fi.ytunnus.rst0000644000000000000000000000012313156325245021427 0ustar rootroot00000000000000stdnum.fi.ytunnus ================= .. automodule:: stdnum.fi.ytunnus :members:python-stdnum-1.8.1/docs/stdnum.lv.pvn.rst0000644000000000000000000000011013156325245020524 0ustar rootroot00000000000000stdnum.lv.pvn ============= .. automodule:: stdnum.lv.pvn :members: python-stdnum-1.8.1/docs/stdnum.ca.sin.rst0000644000000000000000000000010713223166517020462 0ustar rootroot00000000000000stdnum.ca.sin ============= .. automodule:: stdnum.ca.sin :members:python-stdnum-1.8.1/docs/stdnum.pl.regon.rst0000644000000000000000000000011513156325245021032 0ustar rootroot00000000000000stdnum.pl.regon =============== .. automodule:: stdnum.pl.regon :members:python-stdnum-1.8.1/docs/stdnum.es.nie.rst0000644000000000000000000000011013156325245020462 0ustar rootroot00000000000000stdnum.es.nie ============= .. automodule:: stdnum.es.nie :members: python-stdnum-1.8.1/docs/stdnum.hu.anum.rst0000644000000000000000000000011313156325245020657 0ustar rootroot00000000000000stdnum.hu.anum ============== .. automodule:: stdnum.hu.anum :members: python-stdnum-1.8.1/docs/stdnum.fr.siret.rst0000644000000000000000000000011513223166517021042 0ustar rootroot00000000000000stdnum.fr.siret =============== .. automodule:: stdnum.fr.siret :members:python-stdnum-1.8.1/docs/stdnum.tr.tckimlik.rst0000644000000000000000000000012613223166517021543 0ustar rootroot00000000000000stdnum.tr.tckimlik ================== .. automodule:: stdnum.tr.tckimlik :members:python-stdnum-1.8.1/docs/stdnum.es.nif.rst0000644000000000000000000000011013156325245020463 0ustar rootroot00000000000000stdnum.es.nif ============= .. automodule:: stdnum.es.nif :members: python-stdnum-1.8.1/docs/stdnum.pl.nip.rst0000644000000000000000000000011013156325245020501 0ustar rootroot00000000000000stdnum.pl.nip ============= .. automodule:: stdnum.pl.nip :members: python-stdnum-1.8.1/docs/stdnum.cy.vat.rst0000644000000000000000000000011013156325245020505 0ustar rootroot00000000000000stdnum.cy.vat ============= .. automodule:: stdnum.cy.vat :members: python-stdnum-1.8.1/docs/stdnum.fr.nif.rst0000644000000000000000000000010713223166517020471 0ustar rootroot00000000000000stdnum.fr.nif ============= .. automodule:: stdnum.fr.nif :members:python-stdnum-1.8.1/docs/stdnum.nl.brin.rst0000644000000000000000000000011313156325245020646 0ustar rootroot00000000000000stdnum.nl.brin ============== .. automodule:: stdnum.nl.brin :members: python-stdnum-1.8.1/docs/stdnum.nl.btw.rst0000644000000000000000000000011013156325245020505 0ustar rootroot00000000000000stdnum.nl.btw ============= .. automodule:: stdnum.nl.btw :members: python-stdnum-1.8.1/docs/stdnum.us.ein.rst0000644000000000000000000000011013156325245020502 0ustar rootroot00000000000000stdnum.us.ein ============= .. automodule:: stdnum.us.ein :members: python-stdnum-1.8.1/docs/stdnum.casrn.rst0000644000000000000000000000010413223221441020376 0ustar rootroot00000000000000stdnum.casrn ============ .. automodule:: stdnum.casrn :members:python-stdnum-1.8.1/docs/stdnum.nl.postcode.rst0000644000000000000000000000012713156325245021541 0ustar rootroot00000000000000stdnum.nl.postcode ================== .. automodule:: stdnum.nl.postcode :members: python-stdnum-1.8.1/docs/stdnum.us.itin.rst0000644000000000000000000000011313156325245020675 0ustar rootroot00000000000000stdnum.us.itin ============== .. automodule:: stdnum.us.itin :members: python-stdnum-1.8.1/docs/stdnum.isbn.rst0000644000000000000000000000010213156325245020235 0ustar rootroot00000000000000stdnum.isbn =========== .. automodule:: stdnum.isbn :members: python-stdnum-1.8.1/docs/stdnum.isin.rst0000644000000000000000000000010113156325245020243 0ustar rootroot00000000000000stdnum.isin =========== .. automodule:: stdnum.isin :members:python-stdnum-1.8.1/docs/stdnum.no.mva.rst0000644000000000000000000000010713156325245020505 0ustar rootroot00000000000000stdnum.no.mva ============= .. automodule:: stdnum.no.mva :members:python-stdnum-1.8.1/docs/stdnum.us.ssn.rst0000644000000000000000000000011013156325245020532 0ustar rootroot00000000000000stdnum.us.ssn ============= .. automodule:: stdnum.us.ssn :members: python-stdnum-1.8.1/docs/stdnum.nl.onderwijsnummer.rst0000644000000000000000000000015413156325245023151 0ustar rootroot00000000000000stdnum.nl.onderwijsnummer ========================= .. automodule:: stdnum.nl.onderwijsnummer :members: python-stdnum-1.8.1/docs/stdnum.pt.nif.rst0000644000000000000000000000011013156325245020477 0ustar rootroot00000000000000stdnum.pt.nif ============= .. automodule:: stdnum.pt.nif :members: python-stdnum-1.8.1/docs/stdnum.ec.ci.rst0000644000000000000000000000010513156325245020266 0ustar rootroot00000000000000stdnum.ec.ci ============ .. automodule:: stdnum.ec.ci :members: python-stdnum-1.8.1/docs/stdnum.ro.cf.rst0000644000000000000000000000010513156325245020314 0ustar rootroot00000000000000stdnum.ro.cf ============ .. automodule:: stdnum.ro.cf :members: python-stdnum-1.8.1/docs/stdnum.eu.nace.rst0000644000000000000000000000011213223166517020621 0ustar rootroot00000000000000stdnum.eu.nace ============== .. automodule:: stdnum.eu.nace :members:python-stdnum-1.8.1/docs/stdnum.be.vat.rst0000644000000000000000000000011013156325245020460 0ustar rootroot00000000000000stdnum.be.vat ============= .. automodule:: stdnum.be.vat :members: python-stdnum-1.8.1/docs/stdnum.is_.kennitala.rst0000644000000000000000000000013613223166517022030 0ustar rootroot00000000000000stdnum.is\_.kennitala ===================== .. automodule:: stdnum.is_.kennitala :members:python-stdnum-1.8.1/docs/stdnum.fr.siren.rst0000644000000000000000000000011613156325245021035 0ustar rootroot00000000000000stdnum.fr.siren =============== .. automodule:: stdnum.fr.siren :members: python-stdnum-1.8.1/docs/stdnum.au.tfn.rst0000644000000000000000000000010713223166517020502 0ustar rootroot00000000000000stdnum.au.tfn ============= .. automodule:: stdnum.au.tfn :members:python-stdnum-1.8.1/docs/stdnum.ie.vat.rst0000644000000000000000000000011013156325245020467 0ustar rootroot00000000000000stdnum.ie.vat ============= .. automodule:: stdnum.ie.vat :members: python-stdnum-1.8.1/docs/stdnum.ismn.rst0000644000000000000000000000010213156325245020250 0ustar rootroot00000000000000stdnum.ismn =========== .. automodule:: stdnum.ismn :members: python-stdnum-1.8.1/docs/stdnum.bg.pnf.rst0000644000000000000000000000011013156325245020453 0ustar rootroot00000000000000stdnum.bg.pnf ============= .. automodule:: stdnum.bg.pnf :members: python-stdnum-1.8.1/docs/stdnum.us.rtn.rst0000644000000000000000000000011013156325245020532 0ustar rootroot00000000000000stdnum.us.rtn ============= .. automodule:: stdnum.us.rtn :members: python-stdnum-1.8.1/docs/stdnum.co.nit.rst0000644000000000000000000000010713156325245020501 0ustar rootroot00000000000000stdnum.co.nit ============= .. automodule:: stdnum.co.nit :members:python-stdnum-1.8.1/docs/stdnum.nl.bsn.rst0000644000000000000000000000011013156325245020473 0ustar rootroot00000000000000stdnum.nl.bsn ============= .. automodule:: stdnum.nl.bsn :members: python-stdnum-1.8.1/docs/stdnum.hr.oib.rst0000644000000000000000000000011013156325245020462 0ustar rootroot00000000000000stdnum.hr.oib ============= .. automodule:: stdnum.hr.oib :members: python-stdnum-1.8.1/docs/stdnum.do.cedula.rst0000644000000000000000000000012013156325245021140 0ustar rootroot00000000000000stdnum.do.cedula ================ .. automodule:: stdnum.do.cedula :members:python-stdnum-1.8.1/docs/stdnum.verhoeff.rst0000644000000000000000000000011613156325245021113 0ustar rootroot00000000000000stdnum.verhoeff =============== .. automodule:: stdnum.verhoeff :members: python-stdnum-1.8.1/docs/stdnum.es.ccc.rst0000644000000000000000000000010713223166517020445 0ustar rootroot00000000000000stdnum.es.ccc ============= .. automodule:: stdnum.es.ccc :members:python-stdnum-1.8.1/docs/stdnum.de.idnr.rst0000644000000000000000000000011213223166517020626 0ustar rootroot00000000000000stdnum.de.idnr ============== .. automodule:: stdnum.de.idnr :members:python-stdnum-1.8.1/docs/stdnum.at.uid.rst0000644000000000000000000000011013156325245020465 0ustar rootroot00000000000000stdnum.at.uid ============= .. automodule:: stdnum.at.uid :members: python-stdnum-1.8.1/docs/stdnum.sm.coe.rst0000644000000000000000000000010713156325245020473 0ustar rootroot00000000000000stdnum.sm.coe ============= .. automodule:: stdnum.sm.coe :members:python-stdnum-1.8.1/docs/stdnum.luhn.rst0000644000000000000000000000010213156325245020250 0ustar rootroot00000000000000stdnum.luhn =========== .. automodule:: stdnum.luhn :members: python-stdnum-1.8.1/setup.cfg0000644000000000000000000000103113224171744016131 0ustar rootroot00000000000000[metadata] license_file = COPYING [sdist] owner = root group = root [nosetests] with-doctest = true doctest-extension = doctest doctest-options = +IGNORE_EXCEPTION_DETAIL with-coverage = true cover-branches = true cover-package = stdnum cover-inclusive = true cover-erase = true cover-html = true cover-html-dir = coverage cover-min-percentage = 100 [build_sphinx] all_files = 1 [flake8] ignore = D105,D205,D209,D302,D400,E501,E731,F401,F403,F405,Q001 max-complexity = 15 max-line-length = 120 [egg_info] tag_build = tag_date = 0 python-stdnum-1.8.1/stdnum/0000755000000000000000000000000013224171743015626 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ro/0000755000000000000000000000000013224171744016247 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ro/__init__.py0000644000000000000000000000164113156325252020361 0ustar rootroot00000000000000# __init__.py - collection of Romanian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Romanian numbers.""" # provide vat as an alias from stdnum.ro import cf as vat python-stdnum-1.8.1/stdnum/ro/cf.py0000644000000000000000000000513213223166521017206 0ustar rootroot00000000000000# cf.py - functions for handling Romanian CF (VAT) numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number). The Romanian CF is used for VAT purposes and can be from 2 to 10 digits long. >>> validate('RO 185 472 90') '18547290' >>> validate('185 472 91') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('1630615123457') # personal code '1630615123457' """ from stdnum.exceptions import * from stdnum.ro import cnp from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('RO'): number = number[2:] return number def calc_check_digit(number): """Calculate the check digit for organisations. The number passed should not have the check digit included.""" weights = (7, 5, 3, 2, 1, 7, 5, 3, 2) number = (9 - len(number)) * '0' + number check = 10 * sum(w * int(n) for w, n in zip(weights, number)) return str(check % 11 % 10) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or number[0] == '0': raise InvalidFormat() if len(number) == 13: # apparently a CNP can also be used (however, not all sources agree) cnp.validate(number) elif 2 <= len(number) <= 10: if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() else: raise InvalidLength() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ro/cnp.py0000644000000000000000000000655613223166521017411 0ustar rootroot00000000000000# cnp.py - functions for handling Romanian CNP numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CNP (Cod Numeric Personal, Romanian Numerical Personal Code). The CNP is a 13 digit number that includes information on the person's gender, birth date and country zone. >>> validate('1630615123457') '1630615123457' >>> validate('8800101221144') # invalid first digit Traceback (most recent call last): ... InvalidFormat: ... >>> validate('1632215123457') # invalid date Traceback (most recent call last): ... InvalidComponent: ... >>> validate('1630615123458') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').upper().strip() def calc_check_digit(number): """Calculate the check digit for personal codes. The number passed should not have the check digit included.""" # note that this algorithm has not been confirmed by an independent source weights = (2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9) check = sum(w * int(n) for w, n in zip(weights, number)) % 11 return '1' if check == 10 else str(check) def get_birth_date(number): """Split the date parts from the number and return the birth date.""" centuries = { '1': 1900, '2': 1900, '3': 1800, '4': 1800, '5': 2000, '6': 2000, } # we assume 1900 for the others in order to try to construct a date year = int(number[1:3]) + centuries.get(number[0], 1900) month = int(number[3:5]) day = int(number[5:7]) try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) # first digit should be a known one (9=foreigner) if not number.isdigit() or number[0] not in '1234569': raise InvalidFormat() if len(number) != 13: raise InvalidLength() # check if birth date is valid get_birth_date(number) # TODO: check that the birth date is not in the future # number[7:9] is the county, we ignore it for now, just check last digit if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/luhn.py0000644000000000000000000000520513223166521017145 0ustar rootroot00000000000000# luhn.py - functions for performing the Luhn and Luhn mod N algorithms # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The Luhn and Luhn mod N algorithms. The Luhn algorithm is used to detect most accidental errors in various identification numbers. >>> validate('7894') Traceback (most recent call last): ... InvalidChecksum: ... >>> checksum('7894') 6 >>> calc_check_digit('7894') '9' >>> validate('78949') '78949' An alternative alphabet can be provided to use the Luhn mod N algorithm. The default alphabet is '0123456789'. >>> validate('1234', alphabet='0123456789abcdef') Traceback (most recent call last): ... InvalidChecksum: ... >>> checksum('1234', alphabet='0123456789abcdef') 14 """ from stdnum.exceptions import * def checksum(number, alphabet='0123456789'): """Calculate the Luhn checksum over the provided number. The checksum is returned as an int. Valid numbers should have a checksum of 0.""" n = len(alphabet) number = tuple(alphabet.index(i) for i in reversed(str(number))) return (sum(number[::2]) + sum(sum(divmod(i * 2, n)) for i in number[1::2])) % n def validate(number, alphabet='0123456789'): """Check if the number provided passes the Luhn checksum.""" if not bool(number): raise InvalidFormat() try: valid = checksum(number, alphabet) == 0 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number, alphabet='0123456789'): """Check if the number passes the Luhn checksum.""" try: return bool(validate(number, alphabet)) except ValidationError: return False def calc_check_digit(number, alphabet='0123456789'): """Calculate the extra digit that should be appended to the number to make it a valid number.""" ck = checksum(str(number) + alphabet[0], alphabet) return alphabet[-ck] python-stdnum-1.8.1/stdnum/dk/0000755000000000000000000000000013224171743016224 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/dk/cpr.py0000644000000000000000000000744613223166520017371 0ustar rootroot00000000000000# cpr.py - functions for handling Danish CPR numbers # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CPR (personnummer, the Danish citizen number). The CPR is the national number to identify Danish citizens and is stored in the Det Centrale Personregister (Civil Registration System). The number consists of 10 digits in the format DDMMYY-SSSS where the first part represents the birth date and the second a sequence number. The first digit of the sequence number indicates the century. The numbers used to validate using a checksum but since the sequence numbers ran out this was abandoned in 2007. It is also not possible to use the checksum only for numbers that have a birth date before that because the numbers are also assigned to immigrants. More information: * https://en.wikipedia.org/wiki/Personal_identification_number_(Denmark) * https://da.wikipedia.org/wiki/CPR-nummer * https://cpr.dk/ >>> validate('211062-5629') '2110625629' >>> checksum('2110625629') 0 >>> validate('511062-5629') # invalid date Traceback (most recent call last): ... InvalidComponent: ... >>> get_birth_date('2110620629') datetime.date(1962, 10, 21) >>> get_birth_date('2110525629') datetime.date(2052, 10, 21) >>> format('2110625629') '211062-5629' """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def checksum(number): """Calculate the checksum. Note that the checksum isn't actually used any more. Valid numbers used to have a checksum of 0.""" weights = (4, 3, 2, 7, 6, 5, 4, 3, 2, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def get_birth_date(number): """Split the date parts from the number and return the birth date.""" day = int(number[0:2]) month = int(number[2:4]) year = int(number[4:6]) if number[6] in '5678' and year >= 58: year += 1800 elif number[6] in '0123' or (number[6] in '49' and year >= 37): year += 1900 else: year += 2000 try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def validate(number): """Check if the number provided is a valid CPR number. This checks the length, formatting, embedded date and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() # check if birth date is valid get_birth_date(number) # TODO: check that the birth date is not in the future return number def is_valid(number): """Check if the number provided is a valid CPR number. This checks the length, formatting, embedded date and check digit.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return '-'.join((number[:6], number[6:])) python-stdnum-1.8.1/stdnum/dk/__init__.py0000644000000000000000000000163613156325246020346 0ustar rootroot00000000000000# __init__.py - collection of Danish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Danish numbers.""" # provide vat as an alias from stdnum.dk import cvr as vat python-stdnum-1.8.1/stdnum/dk/cvr.py0000644000000000000000000000433213223166520017366 0ustar rootroot00000000000000# cvr.py - functions for handling Danish CVR numbers # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CVR (Momsregistreringsnummer, Danish VAT number). The CVR (Momsregistreringsnummer, VAT) is an 8 digit number with a straightforward check mechanism. >>> validate('DK 13585628') '13585628' >>> validate('DK 13585627') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.,/:').upper().strip() if number.startswith('DK'): number = number[2:] return number def checksum(number): """Calculate the checksum.""" weights = (2, 7, 6, 5, 4, 3, 2, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def validate(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or number[0] == '0': raise InvalidFormat() if len(number) != 8: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/casrn.py0000644000000000000000000000454713223166520017314 0ustar rootroot00000000000000# casrn.py - functions for handling CAS Registry Numbers # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CAS RN (Chemical Abstracts Service Registry Number). The CAS Registry Number is a unique identifier assigned by the Chemical Abstracts Service (CAS) to a chemical substance. More information: * https://en.wikipedia.org/wiki/CAS_Registry_Number >>> validate('87-86-5') '87-86-5' >>> validate('87-86-6') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation.""" number = clean(number, ' ').strip() if '-' not in number: number = '-'.join((number[:-3], number[-3:-1], number[-1:])) return number def calc_check_digit(number): """Calculate the check digit for the number. The passed number should not have the check digit included.""" number = number.replace('-', '') return str( sum((i + 1) * int(n) for i, n in enumerate(reversed(number))) % 10) def validate(number): """Check if the number provided is a valid CAS RN.""" number = compact(number) if not 7 <= len(number) <= 12: raise InvalidLength() if not number[:-5].isdigit() or not number[-4:-2].isdigit(): raise InvalidFormat() if number[-2] != '-' or number[-5] != '-': raise InvalidFormat() if number[-1] != calc_check_digit(number[:-1]): raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid CAS RN.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/cz/0000755000000000000000000000000013224171743016242 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/cz/rc.py0000644000000000000000000000724413223166520017223 0ustar rootroot00000000000000# rc.py - functions for handling Czech birth numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """RČ (Rodné číslo, the Czech birth number). The birth number (RČ, Rodné číslo) is the Czech national identifier. The number can be 9 or 10 digits long. Numbers given out after January 1st 1954 should have 10 digits. The number includes the birth date of the person and their gender. This number is identical to the Slovak counterpart. >>> validate('710319/2745') '7103192745' >>> validate('991231123') '991231123' >>> validate('7103192746') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('1103492745') # invalid date Traceback (most recent call last): ... InvalidComponent: ... >>> validate('590312/123') # 9 digit number in 1959 Traceback (most recent call last): ... InvalidLength: ... >>> format('7103192745') '710319/2745' """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' /').upper().strip() def get_birth_date(number): """Split the date parts from the number and return the birth date.""" year = 1900 + int(number[0:2]) # females have 50 added to the month value, 20 is added when the serial # overflows (since 2004) month = int(number[2:4]) % 50 % 20 day = int(number[4:6]) # 9 digit numbers were used until January 1st 1954 if len(number) == 9: if year >= 1980: year -= 100 if year > 1953: raise InvalidLength('No 9 digit birth numbers after 1953.') elif year < 1954: year += 100 try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def validate(number): """Check if the number is a valid birth number. This checks the length, formatting, embedded date and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) not in (9, 10): raise InvalidLength() # check if birth date is valid birth_date = get_birth_date(number) # TODO: check that the birth date is not in the future # check the check digit (10 digit numbers only) if len(number) == 10: check = int(number[:-1]) % 11 # before 1985 the checksum could be 0 or 10 if birth_date < datetime.date(1985, 1, 1): check = check % 10 if number[-1] != str(check): raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid birth number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:6] + '/' + number[6:] python-stdnum-1.8.1/stdnum/cz/__init__.py0000644000000000000000000000163413156325246020362 0ustar rootroot00000000000000# __init__.py - collection of Czech numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Czech numbers.""" # provide vat as an alias from stdnum.cz import dic as vat python-stdnum-1.8.1/stdnum/cz/dic.py0000644000000000000000000000660613223166520017357 0ustar rootroot00000000000000# dic.py - functions for handling Czech VAT numbers # coding: utf-8 # # Copyright (C) 2012-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """DIČ (Daňové identifikační číslo, Czech VAT number). The number is an 8, 9 or 10 digit code that includes a check digit and is used to uniquely identify taxpayers for VAT (DPH in Czech). The number can refer to legal entities (8 digit numbers), individuals with a RČ (the 9 or 10 digit Czech birth number) or individuals without a RČ (9 digit numbers that begin with a 6). >>> compact('CZ 25123891') '25123891' >>> validate('25123891') # legal entity '25123891' >>> validate('25123890') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('7103192745') # RČ '7103192745' >>> validate('640903926') # special case '640903926' """ from stdnum.cz import rc from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' /').upper().strip() if number.startswith('CZ'): number = number[2:] return number def calc_check_digit_legal(number): """Calculate the check digit for 8 digit legal entities. The number passed should not have the check digit included.""" check = (11 - sum((8 - i) * int(n) for i, n in enumerate(number))) % 11 return str((check or 1) % 10) def calc_check_digit_special(number): """Calculate the check digit for special cases. The number passed should not have the first and last digits included.""" check = sum((8 - i) * int(n) for i, n in enumerate(number)) % 11 return str((8 - (10 - check) % 11) % 10) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) == 8: # legal entities if number.startswith('9'): raise InvalidComponent() if calc_check_digit_legal(number[:-1]) != number[-1]: raise InvalidChecksum() elif len(number) == 9 and number.startswith('6'): # special cases (skip first digit in calculation) if calc_check_digit_special(number[1:-1]) != number[-1]: raise InvalidChecksum() elif len(number) in (9, 10): # 9 or 10 digit individual rc.validate(number) else: raise InvalidLength() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/imsi.dat0000644000000000000000000112122513223166520017261 0ustar rootroot00000000000000# generated from various sources # https://en.wikipedia.org/w/index.php?title=Mobile_country_code&action=raw 001 01 bands="GSM 900" brand="TEST" country="Test networks" operator="Test Network" status="Operational" 00-99 202 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Cosmote" cc="gr" country="Greece" operator="COSMOTE - Mobile Telecommunications S.A." status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Cosmote" cc="gr" country="Greece" operator="COSMOTE - Mobile Telecommunications S.A." status="Operational" 03 bands="" cc="gr" country="Greece" operator="OTE" status="" 04 bands="GSM-R" cc="gr" country="Greece" operator="OSE" status="" 05 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Vodafone" cc="gr" country="Greece" operator="Vodafone Greece" status="Operational" 06 bands="" cc="gr" country="Greece" operator="Cosmoline" status="Not operational" 07 bands="" cc="gr" country="Greece" operator="AMD Telecom" status="" 09 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Wind" cc="gr" country="Greece" operator="Wind Hellas Telecommunications S.A." status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Wind" cc="gr" country="Greece" operator="Wind Hellas Telecommunications S.A." status="Operational" 11 bands="" cc="gr" country="Greece" operator="interConnect" status="" 12 bands="MVNO" cc="gr" country="Greece" operator="Yuboto" status="Operational" 13 bands="" cc="gr" country="Greece" operator="Compatel Limited" status="" 14 bands="MVNO" brand="Cyta Hellas" cc="gr" country="Greece" operator="CYTA" status="Operational" 15 bands="" cc="gr" country="Greece" operator="BWS" status="" 16 bands="MVNO" cc="gr" country="Greece" operator="Inter Telecom" status="Operational" 00-99 204 01 bands="" cc="nl" country="Netherlands" operator="RadioAccess Network Services" status="" 02 bands="LTE 800 / LTE 2600" brand="Tele2" cc="nl" country="Netherlands" operator="Tele2 Nederland B.V." status="Operational" 03 bands="MVNE / PrivateGSM 1800" brand="Voiceworks" cc="nl" country="Netherlands" operator="Voiceworks B.V." status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Vodafone" cc="nl" country="Netherlands" operator="Vodafone Libertel B.V." status="Operational" 05 bands="" cc="nl" country="Netherlands" operator="Elephant Talk Communications Premium Rate Services" status="" 06 bands="MVNO" brand="Vectone Mobile" cc="nl" country="Netherlands" operator="Mundio Mobile (Netherlands) Ltd" status="Operational" 07 bands="MVNE" cc="nl" country="Netherlands" operator="Teleena (MVNE)" status="Operational" 08 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="KPN" cc="nl" country="Netherlands" operator="KPN Mobile The Netherlands B.V." status="Operational" 09 bands="MVNO" brand="Lycamobile" cc="nl" country="Netherlands" operator="Lycamobile Netherlands Limited" status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="KPN" cc="nl" country="Netherlands" operator="KPN B.V." status="Operational" 11 bands="" cc="nl" country="Netherlands" operator="VoipIT B.V." status="" 12 brand="Telfort" cc="nl" country="Netherlands" operator="KPN Mobile The Netherlands B.V." status="Operational" 13 bands="" cc="nl" country="Netherlands" operator="Unica Installatietechniek B.V." status="" 14 cc="nl" country="Netherlands" operator="6GMOBILE B.V." status="Reserved" 15 bands="LTE 2600" brand="Ziggo" cc="nl" country="Netherlands" operator="Ziggo B.V." status="Operational" 16 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2100 / LTE 2600" brand="T-Mobile (BEN)" cc="nl" country="Netherlands" operator="T-Mobile Netherlands B.V" status="Operational" 17 bands="MVNE" brand="Intercity Zakelijk" cc="nl" country="Netherlands" operator="Intercity Mobile Communications B.V." status="Operational" 18 bands="MVNO" brand="upc" cc="nl" country="Netherlands" operator="UPC Nederland B.V." status="Operational" 19 bands="" cc="nl" country="Netherlands" operator="Mixe Communication Solutions B.V." status="" 20 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2100 / LTE 2600" brand="T-Mobile" cc="nl" country="Netherlands" operator="T-Mobile Netherlands B.V" status="Operational" 21 bands="GSM-R 900" cc="nl" country="Netherlands" operator="ProRail B.V." status="Operational" 22 bands="" cc="nl" country="Netherlands" operator="Ministerie van Defensie" status="" 23 bands="MVNE" cc="nl" country="Netherlands" operator="Wyless Nederland B.V." status="Operational" 24 bands="" cc="nl" country="Netherlands" operator="Private Mobility Nederland B.V." status="" 25 bands="PrivateGSM 1800" cc="nl" country="Netherlands" operator="CapX B.V." status="Operational" 26 bands="" cc="nl" country="Netherlands" operator="SpeakUp B.V." status="" 27 bands="" cc="nl" country="Netherlands" operator="Breezz Nederland B.V." status="" 28 bands="" cc="nl" country="Netherlands" operator="Lancelot B.V." status="" 29 bands="" cc="nl" country="Netherlands" operator="Private Mobile Ltd" status="" 60 bands="" cc="nl" country="Netherlands" operator="Nextgen Mobile Ltd" status="" 61 bands="MVNO" cc="nl" country="Netherlands" operator="BodyTrace Netherlands B.V." status="Operational" 62 bands="MVNO" brand="Voxbone" cc="nl" country="Netherlands" operator="Voxbone mobile" status="Operational" 64 bands="" cc="nl" country="Netherlands" operator="Zetacom B.V." status="" 65 bands="" cc="nl" country="Netherlands" operator="AGMS Netherlands B.V." status="" 66 bands="CDMA 450" cc="nl" country="Netherlands" operator="Utility Connect B.V." status="Operational" 67 bands="PrivateGSM 1800" cc="nl" country="Netherlands" operator="Koning en Hartman B.V." status="Operational" 68 bands="" cc="nl" country="Netherlands" operator="Roamware (Netherlands) B.V." status="" 69 cc="nl" country="Netherlands" operator="KPN Mobile The Netherlands B.V." status="" 00-99 206 00 bands="" brand="Proximus" cc="be" country="Belgium" operator="Belgacom Mobile" status="" 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Proximus" cc="be" country="Belgium" operator="Belgacom Mobile" status="Operational" 02 bands="GSM-R" cc="be" country="Belgium" operator="N.M.B.S." status="Operational" 05 bands="MVNO" brand="Telenet" cc="be" country="Belgium" operator="Telenet" status="Operational" 06 bands="MVNO" brand="Lycamobile" cc="be" country="Belgium" operator="Lycamobile sprl" status="Operational" 07 bands="MVNO" brand="Vectone Mobile" cc="be" country="Belgium" operator="Mundio Mobile Belgium nv" status="Reserved" 09 bands="MVNO" brand="Voxbone" cc="be" country="Belgium" operator="Voxbone mobile" status="Not operational" 10 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Orange" cc="be" country="Belgium" operator="Orange S.A." status="Operational" 15 bands="" cc="be" country="Belgium" operator="Elephant Talk Communications Schweiz GmbH" status="Not operational" 16 bands="" cc="be" country="Belgium" operator="NextGen Mobile Ltd." status="" 20 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="BASE" cc="be" country="Belgium" operator="Telenet" status="Operational" 25 bands="" cc="be" country="Belgium" operator="Voyacom SPRL" status="" 40 bands="MVNO" brand="JOIN" cc="be" country="Belgium" operator="JOIN Experience (Belgium)" status="Operational" 00-99 208 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 2600" brand="Orange" cc="fr" country="France" operator="Orange S.A." status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="Orange" cc="fr" country="France" operator="Orange S.A." status="Operational" 03 bands="MVNO" brand="MobiquiThings" cc="fr" country="France" operator="MobiquiThings" status="Operational" 04 bands="MVNO" brand="Sisteer" cc="fr" country="France" operator="Societe d'ingenierie systeme telecom et reseaux" status="Operational" 05 bands="Satellite" cc="fr" country="France" operator="Globalstar Europe" status="Operational" 06 bands="Satellite" cc="fr" country="France" operator="Globalstar Europe" status="Operational" 07 bands="Satellite" cc="fr" country="France" operator="Globalstar Europe" status="Operational" 08 bands="MVNO" brand="Completel Mobile" cc="fr" country="France" operator="Completel" status="Operational" 09 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="SFR" cc="fr" country="France" operator="Altice" status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 LTE 2600" brand="SFR" cc="fr" country="France" operator="Altice" status="Operational" 11 bands="UMTS 2100" brand="SFR" cc="fr" country="France" operator="Altice" status="Operational" 12 bands="" cc="fr" country="France" operator="Hewlett-Packard France" status="" 13 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="SFR" cc="fr" country="France" operator="Altice" status="Operational" 14 bands="GSM-R" brand="SNCF Réseau" cc="fr" country="France" operator="SNCF Réseau" status="Operational" 15 bands="UMTS 900 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="Free Mobile" cc="fr" country="France" operator="Iliad" status="Operational" 16 bands="UMTS 900 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="Free Mobile" cc="fr" country="France" operator="Iliad" status="Operational" 17 bands="" brand="LEGOS" cc="fr" country="France" operator="Local Exchange Global Operation Services" status="" 18 bands="MVNO" brand="Voxbone" cc="fr" country="France" operator="Voxbone mobile" status="Not operational" 19 bands="" cc="fr" country="France" operator="Altitude Infrastructure" status="" 20 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 700 / LTE 800 / LTE 1800 / LTE 2600" brand="Bouygues" cc="fr" country="France" operator="Bouygues Telecom" status="Operational" 21 bands="GSM 900 / GSM 1800 / UMTS 2100 / UMTS 900" brand="Bouygues" cc="fr" country="France" operator="Bouygues Telecom" status="" 22 bands="" brand="Transatel Mobile" cc="fr" country="France" operator="Transatel" status="" 23 bands="MVNO" cc="fr" country="France" operator="Omea Telecom" status="Operational" 24 bands="MVNO" brand="MobiquiThings" cc="fr" country="France" operator="MobiquiThings" status="Operational" 25 bands="MVNO" brand="LycaMobile" cc="fr" country="France" operator="LycaMobile" status="Operational" 26 bands="MVNO" brand="NRJ Mobile" cc="fr" country="France" operator="Euro-Information Telecom SAS" status="Operational" 27 bands="MVNO" cc="fr" country="France" operator="Coriolis Telecom" status="Operational" 28 bands="" cc="fr" country="France" operator="Airbus Defence and Space SAS" status="" 29 bands="" cc="fr" country="France" operator="Société International Mobile Communication" status="Not operational" 30 bands="MVNO" cc="fr" country="France" operator="Syma Mobile" status="Operational" 31 bands="MVNO" brand="Vectone Mobile" cc="fr" country="France" operator="Mundio Mobile" status="Operational" 88 bands="GSM 900 / GSM 1800" brand="Bouygues" cc="fr" country="France" operator="Bouygues Telecom" status="Operational" 89 bands="" cc="fr" country="France" operator="Fondation b-com" status="" 90 bands="" cc="fr" country="France" operator="Images & Réseaux" status="" 91 bands="" cc="fr" country="France" operator="Orange S.A." status="" 92 bands="TD-LTE 2300 / LTE 2600" brand="Com4Innov" cc="fr" country="France" operator="Association Plate-forme Télécom" status="Not operational" 93 bands="" cc="fr" country="France" operator="Thales Communications & Security SAS" status="" 94 bands="" cc="fr" country="France" operator="Halys" status="" 95 bands="" cc="fr" country="France" operator="Orange S.A." status="" 96 bands="" cc="fr" country="France" operator="Axione" status="" 97 bands="" cc="fr" country="France" operator="Thales Communications & Security SAS" status="" 98 bands="" cc="fr" country="France" operator="Société Air France" status="" 00-99 212 10 bands="GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Office des Telephones" cc="mc" country="Monaco" operator="Monaco Telecom" status="Operational" 00-99 213 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="Mobiland" cc="ad" country="Andorra" operator="Servei De Tele. DAndorra" status="Operational" 00-99 214 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600 / TD-LTE 2600" brand="Vodafone" cc="es" country="Spain" operator="Vodafone Spain" status="Operational" 02 bands="TD-LTE 2600" brand="Altecom/Fibracat" cc="es" country="Spain" operator="Alta Tecnologia en Comunicacions SL" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Orange" cc="es" country="Spain" operator="France Telecom España SA" status="Operational" 04 bands="GSM 1800 / UMTS 2100 / LTE 1800" brand="Yoigo" cc="es" country="Spain" operator="Xfera Moviles SA" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Movistar" cc="es" country="Spain" operator="Telefónica Móviles España" status="Operational" 06 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Vodafone" cc="es" country="Spain" operator="Vodafone Spain" status="Operational" 07 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Movistar" cc="es" country="Spain" operator="Telefónica Móviles España" status="Operational" 08 bands="MVNO" brand="Euskaltel" cc="es" country="Spain" status="Operational" 09 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Orange" cc="es" country="Spain" operator="France Telecom España SA" status="Operational" 10 bands="" cc="es" country="Spain" operator="ZINNIA TELECOMUNICACIONES, S.L.U." status="" 11 bands="" cc="es" country="Spain" operator="TELECOM CASTILLA-LA MANCHA, S.A." status="" 12 bands="" cc="es" country="Spain" operator="Contacta Servicios Avanzados de Telecomunicaciones SL" status="Not operational" 13 bands="" cc="es" country="Spain" operator="Incotel Ingeniera y Consultaria SL" status="Not operational" 14 bands="" cc="es" country="Spain" operator="Incotel Servicioz Avanzados SL" status="Not operational" 15 bands="MVNO" brand="BT" cc="es" country="Spain" operator="BT Group España Compañia de Servicios Globales de Telecomunicaciones S.A.U." status="Not operational" 16 bands="MVNO" brand="TeleCable" cc="es" country="Spain" operator="Telecable de Asturias S.A.U." status="Operational" 17 bands="MVNO" brand="Móbil R" cc="es" country="Spain" operator="R Cable y Telecomunicaciones Galicia S.A." status="Operational" 18 bands="MVNO" brand="ONO" cc="es" country="Spain" operator="Cableuropa S.A.U." status="Not operational" 19 bands="MVNO" brand="Simyo" cc="es" country="Spain" operator="E-PLUS Moviles Virtuales España S.L.U." status="Operational" 20 bands="MVNO" brand="Fonyou" cc="es" country="Spain" operator="Fonyou Telecom S.L." status="Not operational" 21 bands="MVNO" brand="Jazztel" cc="es" country="Spain" operator="Orange S.A." status="Operational" 22 bands="MVNO" brand="DigiMobil" cc="es" country="Spain" operator="Best Spain Telecom" status="Operational" 23 bands="MVNO" brand="Barablu" cc="es" country="Spain" operator="Barablu Móvil España" status="" 24 bands="MVNO" brand="Eroski" cc="es" country="Spain" operator="Eroski Móvil España" status="Operational" 25 bands="MVNO" brand="Lycamobile" cc="es" country="Spain" operator="LycaMobile S.L." status="Operational" 26 bands="" cc="es" country="Spain" operator="Lleida Networks Serveis Telemátics, SL" status="" 27 bands="MVNO" brand="Truphone" cc="es" country="Spain" operator="SCN Truphone, S.L." status="Operational" 28 bands="TD-LTE 2600" brand="Murcia4G" cc="es" country="Spain" operator="Consorcio de Telecomunicaciones Avanzadas, S.A." status="Operational" 29 bands="TD-LTE 3500" cc="es" country="Spain" operator="NEO-SKY 2002, S.A." status="Operational" 30 bands="" cc="es" country="Spain" operator="Compatel Limited" status="" 31 bands="" cc="es" country="Spain" operator="Red Digital De Telecomunicaciones de las Islas Baleares, S.L." status="" 32 bands="MVNO" brand="Tuenti" cc="es" country="Spain" operator="Telefónica Móviles España" status="Operational" 33 bands="WiMAX" cc="es" country="Spain" operator="EURONA WIRELESS TELECOM, S.A." status="Operational" 34 bands="LTE 2600" cc="es" country="Spain" operator="Aire Networks del Mediterráneo, S.L.U." status="Operational" 35 bands="MVNO" cc="es" country="Spain" operator="INGENIUM OUTSOURCING SERVICES, S.L." status="" 36 bands="" cc="es" country="Spain" operator="OPEN CABLE TELECOMUNICACIONES, S.L." status="" 51 bands="GSM-R" brand="ADIF" cc="es" country="Spain" operator="Administrador de Infraestructuras Ferroviarias" status="Operational" 00-99 216 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Telenor Hungary" cc="hu" country="Hungary" operator="Telenor Magyarország Zrt." status="Operational" 02 bands="LTE 450" cc="hu" country="Hungary" operator="MVM Net Ltd." status="Operational" 03 bands="LTE 1800" brand="DIGI" cc="hu" country="Hungary" operator="DIGI Telecommunication Ltd." status="Not operational" 04 bands="" cc="hu" country="Hungary" operator="Invitech Solutions" status="" 30 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="T-Mobile" cc="hu" country="Hungary" operator="Magyar Telekom Plc" status="Operational" 70 bands="GSM 900 / GSM 1800 / UMTS 2100 / UMTS 900 / LTE 800 / LTE 1800 / LTE 2600" brand="Vodafone" cc="hu" country="Hungary" operator="Vodafone Magyarország Zrt." status="Operational" 71 bands="MVNO" brand="upc" cc="hu" country="Hungary" operator="UPC Hungary Ltd." status="Operational" 99 bands="GSM-R 900" brand="MAV GSM-R" cc="hu" country="Hungary" operator="Magyar Államvasutak" status="Planned" 00-99 218 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="HT-ERONET" cc="ba" country="Bosnia and Herzegovina" operator="Public Enterprise Croatian Telecom Ltd." status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="m:tel" cc="ba" country="Bosnia and Herzegovina" operator="RS Telecommunications JSC Banja Luka" status="Operational" 90 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="BH Mobile" cc="ba" country="Bosnia and Herzegovina" operator="BH Telecom" status="Operational" 00-99 219 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="T-Mobile" cc="hr" country="Croatia" operator="T-Hrvatski Telekom" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800" brand="Tele2" cc="hr" country="Croatia" operator="Tele2" status="Operational" 10 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Vip" cc="hr" country="Croatia" operator="Vipnet" status="Operational" 12 bands="MVNO" cc="hr" country="Croatia" operator="TELE FOCUS d.o.o." status="" 00-99 220 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Telenor" cc="rs" country="Serbia" operator="Telenor Serbia" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Telenor" cc="rs" country="Serbia" operator="Telenor Montenegro" status="Not operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="mt:s" cc="rs" country="Serbia" operator="Telekom Srbija" status="Operational" 04 bands="GSM" brand="T-Mobile" cc="rs" country="Serbia" operator="T-Mobile Montenegro LLC" status="Not operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="VIP" cc="rs" country="Serbia" operator="VIP Mobile" status="Operational" 07 bands="CDMA 450" cc="rs" country="Serbia" operator="Orion Telekom" status="Operational" 09 bands="MVNO" brand="Vectone Mobile" cc="rs" country="Serbia" operator="MUNDIO MOBILE d.o.o." status="Operational" 11 bands="MVNO" cc="rs" country="Serbia" operator="GLOBALTEL d.o.o." status="Operational" 00-99 221 01 bands="GSM 900 / LTE 1800" brand="Vala" cc="xk" country="Kosovo" operator="Telecom of Kosovo J.S.C." status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="IPKO" cc="xk" country="Kosovo" operator="IPKO" status="Operational" 06 bands="MVNO" brand="Z Mobile" cc="xk" country="Kosovo" operator="Dardaphone.Net LLC" status="Operational" 00-99 222 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1500 / LTE 1800 / LTE 2600" brand="TIM" cc="it" country="Italy" operator="Telecom Italia S.p.A" status="Operational" 02 bands="Satellite (Globalstar)" brand="Elsacom" cc="it" country="Italy" status="Not operational" 04 bands="" brand="Intermatica" cc="it" country="Italy" status="" 05 bands="" brand="Telespazio" cc="it" country="Italy" status="" 06 bands="" brand="Vodafone" cc="it" country="Italy" operator="Vodafone Italia S.p.A." status="" 07 bands="MVNO" brand="Nòverca" cc="it" country="Italy" operator="Nòverca Italia" status="Not operational" 08 bands="MVNO" brand="Fastweb" cc="it" country="Italy" operator="Fastweb S.p.A." status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1500 / LTE 1800 / LTE 2600" brand="Vodafone" cc="it" country="Italy" operator="Vodafone Italia S.p.A." status="Operational" 30 bands="GSM-R 900" brand="RFI" cc="it" country="Italy" operator="Rete Ferroviaria Italiana" status="Operational" 33 bands="MVNO" brand="Poste Mobile" cc="it" country="Italy" operator="Poste Mobile S.p.A." status="Operational" 34 bands="MVNO" brand="BT Italia" cc="it" country="Italy" operator="British Telecom Italia" status="Reserved" 35 bands="MVNO" brand="Lycamobile" cc="it" country="Italy" operator="Lycamobile" status="Operational" 36 bands="" brand="Digi Mobil" cc="it" country="Italy" operator="Digi Italy S.r.l." status="" 37 bands="" brand="3 Italia" cc="it" country="Italy" operator="H3G S.p.A." status="" 38 bands="TD-LTE 3500" brand="LINKEM" cc="it" country="Italy" operator="Linkem S.p.A." status="Operational" 39 bands="" brand="SMS Italia" cc="it" country="Italy" operator="SMS Italia S.r.l." status="" 43 bands="" brand="TIM" cc="it" country="Italy" operator="Telecom Italia S.p.A." status="" 48 bands="" brand="TIM" cc="it" country="Italy" operator="Telecom Italia S.p.A." status="" 50 bands="900 / 1800 / 2100 / 2600" brand="Ho" cc="it" country="Italy" operator="Iliad Italia" status="Not operational" 77 bands="UMTS 2100" brand="IPSE 2000" cc="it" country="Italy" status="Not operational" 88 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800" brand="Wind" cc="it" country="Italy" operator="Wind Telecomunicazioni S.p.A." status="Operational" 98 bands="GSM 900" brand="BLU" cc="it" country="Italy" operator="BLU S.p.A." status="Not operational" 99 bands="UMTS 900 / UMTS 2100 / LTE 1800" brand="3 Italia" cc="it" country="Italy" operator="H3G S.p.A." status="Operational" 00-99 226 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / TD-LTE 2600" brand="Vodafone" cc="ro" country="Romania" operator="Vodafone România" status="Operational" 02 bands="CDMA 420" brand="Clicknet Mobile" cc="ro" country="Romania" operator="Telekom Romania" status="Not operational" 03 bands="GSM 900 / GSM 1800 / LTE 800 / LTE 1800 / LTE 2600" brand="Telekom" cc="ro" country="Romania" operator="Telekom Romania" status="Operational" 04 bands="CDMA 450" brand="Cosmote/Zapp" cc="ro" country="Romania" operator="Telekom Romania" status="Not operational" 05 bands="UMTS 900 / UMTS 2100 / LTE 2100 / TD-LTE 2600" brand="Digi.Mobil" cc="ro" country="Romania" operator="RCS&RDS" status="Operational" 06 bands="UMTS 900 / UMTS 2100" brand="Telekom/Zapp" cc="ro" country="Romania" operator="Telekom Romania" status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Orange" cc="ro" country="Romania" operator="Orange România" status="Operational" 11 bands="MVNO" cc="ro" country="Romania" operator="Enigma-System" status="" 15 bands="WiMAX / TD-LTE 2600" brand="Idilis" cc="ro" country="Romania" operator="Idilis" status="Operational" 16 bands="MVNO" brand="Lycamobile" cc="ro" country="Romania" operator="Lycamobile Romania" status="Operational" 00-99 228 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2100 / LTE 2600" brand="Swisscom" cc="ch" country="Switzerland" operator="Swisscom Ltd" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Sunrise" cc="ch" country="Switzerland" operator="Sunrise Communications AG" status="Operational" 03 bands="GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Salt" cc="ch" country="Switzerland" operator="Salt Mobile SA" status="Operational" 05 bands="" cc="ch" country="Switzerland" operator="Comfone AG" status="Not operational" 06 bands="GSM-R 900" brand="SBB-CFF-FFS" cc="ch" country="Switzerland" operator="SBB AG" status="Operational" 07 bands="GSM 1800" brand="IN&Phone" cc="ch" country="Switzerland" operator="IN&Phone SA" status="Not operational" 08 bands="GSM 1800" brand="Tele4u" cc="ch" country="Switzerland" operator="TelCommunication Services AG" status="Operational" 09 bands="" cc="ch" country="Switzerland" operator="Comfone AG" status="" 12 brand="Sunrise" cc="ch" country="Switzerland" operator="Sunrise Communications AG" status="Not operational" 50 bands="UMTS 2100" cc="ch" country="Switzerland" operator="3G Mobile AG" status="Not operational" 51 bands="MVNO" cc="ch" country="Switzerland" operator="BebbiCell AG" status="Operational" 52 brand="Barablu" cc="ch" country="Switzerland" operator="Barablu" status="Not operational" 53 bands="MVNO" brand="upc cablecom" cc="ch" country="Switzerland" operator="UPC Cablecom GmbH" status="Operational" 54 bands="MVNO" brand="Lycamobile" cc="ch" country="Switzerland" operator="Lycamobile AG" status="Operational" 55 cc="ch" country="Switzerland" operator="WeMobile SA" status="" 56 bands="" cc="ch" country="Switzerland" operator="SMSRelay AG" status="Not operational" 57 cc="ch" country="Switzerland" operator="Mitto AG" status="" 58 bands="MVNO" brand="beeone" cc="ch" country="Switzerland" operator="Beeone Communications SA" status="Operational" 59 bands="MVNO" brand="Vectone" cc="ch" country="Switzerland" operator="Mundio Mobile Limited" status="" 60 bands="" brand="Sunrise" cc="ch" country="Switzerland" operator="Sunrise Communications AG" status="Not operational" 61 cc="ch" country="Switzerland" operator="Compatel Ltd." status="" 99 cc="ch" country="Switzerland" operator="Swisscom" status="" 00-99 230 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2100 / LTE 2600" brand="T-Mobile" cc="cz" country="Czech Republic" operator="T-Mobile Czech Republic" status="Operational" 02 bands="CDMA 450 / GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="O2" cc="cz" country="Czech Republic" operator="O2 Czech Republic" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 900 / LTE 1800 / LTE 2100" brand="Vodafone" cc="cz" country="Czech Republic" operator="Vodafone Czech Republic" status="Operational" 04 bands="MVNO" cc="cz" country="Czech Republic" operator="Nordic Telecom s.r.o." status="Operational" 05 bands="TD-LTE 3700" cc="cz" country="Czech Republic" operator="PODA a.s." status="" 06 bands="" cc="cz" country="Czech Republic" operator="OSNO TELECOMUNICATION, s.r.o." status="Not operational" 07 bands="MVNO" cc="cz" country="Czech Republic" operator="ASTELNET, s.r.o." status="Not operational" 08 bands="" cc="cz" country="Czech Republic" operator="Compatel s.r.o." status="" 09 bands="MVNO" brand="Vectone Mobile" cc="cz" country="Czech Republic" operator="Mundio Distribution Czech Republic s.r.o." status="" 98 bands="GSM-R 900" cc="cz" country="Czech Republic" operator="Správa železniční dopravní cesty, s.o." status="Operational" 99 bands="GSM 1800" brand="Vodafone" cc="cz" country="Czech Republic" operator="Vodafone Czech Republic" status="Operational" 00-99 231 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 2600" brand="Orange" cc="sk" country="Slovakia" operator="Orange Slovensko" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Telekom" cc="sk" country="Slovakia" operator="Slovak Telekom" status="Operational" 03 bands="LTE 1800 / TD-LTE 3700" brand="Swan" cc="sk" country="Slovakia" operator="Unient Communications" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Telekom" cc="sk" country="Slovakia" operator="Slovak Telekom" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="Orange" cc="sk" country="Slovakia" operator="Orange Slovensko" status="Operational" 06 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="O2" cc="sk" country="Slovakia" operator="Telefónica O2 Slovakia" status="Operational" 99 bands="GSM-R" brand="ŽSR" cc="sk" country="Slovakia" operator="Železnice Slovenskej Republiky" status="Operational" 00-99 232 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 2600" brand="A1.net" cc="at" country="Austria" operator="A1 Telekom Austria" status="Operational" 02 cc="at" country="Austria" operator="A1 Telekom Austria" status="Reserved" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2600" brand="T-Mobile AT" cc="at" country="Austria" operator="T-Mobile Austria" status="Operational" 04 bands="" brand="T-Mobile AT" cc="at" country="Austria" operator="T-Mobile Austria Gmbh" status="" 05 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="3" cc="at" country="Austria" operator="Hutchison Drei Austria" status="Operational" 06 bands="" brand="Orange AT" cc="at" country="Austria" operator="Orange Austria GmbH" status="Not operational" 07 bands="MVNO" brand="tele.ring" cc="at" country="Austria" operator="T-Mobile Austria" status="Operational" 08 bands="MVNO" brand="Lycamobile" cc="at" country="Austria" operator="Lycamobile Austria" status="Operational" 09 bands="MVNO" brand="Tele2Mobil" cc="at" country="Austria" operator="A1 Telekom Austria" status="Operational" 10 bands="UMTS 2100 / LTE 900 / LTE 1800 / LTE 2600" brand="3" cc="at" country="Austria" operator="Hutchison Drei Austria" status="Operational" 11 bands="MVNO" brand="bob" cc="at" country="Austria" operator="A1 Telekom Austria" status="Operational" 12 bands="MVNO" brand="yesss!" cc="at" country="Austria" operator="A1 Telekom Austria" status="Operational" 13 bands="MVNO" brand="upc" cc="at" country="Austria" operator="UPC Austria" status="Operational" 14 bands="" cc="at" country="Austria" operator="Hutchison Drei Austria" status="Reserved" 15 bands="MVNO" brand="Vectone Mobile" cc="at" country="Austria" operator="Mundio Mobile Austria" status="Operational" 16 bands="" cc="at" country="Austria" operator="Hutchison Drei Austria" status="Reserved" 17 bands="" cc="at" country="Austria" operator="MASS Response Service GmbH" status="" 18 bands="MVNO" cc="at" country="Austria" operator="smartspace GmbH" status="" 19 bands="" cc="at" country="Austria" operator="Tele2 Telecommunication GmbH" status="" 20 bands="MVNO" brand="m:tel" cc="at" country="Austria" operator="MTEL Austrija GmbH" status="Operational" 21 bands="" cc="at" country="Austria" operator="Salzburg AG für Energie, Verkehr und Telekommunikation" status="" 22 bands="MVNO" cc="at" country="Austria" operator="Plintron Austria Limited" status="" 91 bands="GSM-R" brand="GSM-R A" cc="at" country="Austria" operator="ÖBB" status="Operational" 92 bands="CDMA 450" brand="ArgoNET" cc="at" country="Austria" operator="ArgoNET GmbH" status="Operational" 00-99 234 00 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="BT" cc="gb" country="United Kingdom" operator="BT Group" status="Operational" 01 bands="MVNO" brand="Vectone Mobile" cc="gb" country="United Kingdom" operator="Mundio Mobile Limited" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800" brand="O2 (UK)" cc="gb" country="United Kingdom" operator="Telefónica Europe" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE" brand="Airtel-Vodafone" cc="gb" country="United Kingdom" operator="Jersey Airtel Ltd" status="Operational" 04 bands="GSM 1800" brand="FMS Solutions Ltd" cc="gb" country="United Kingdom" operator="FMS Solutions Ltd" status="Reserved" 05 cc="gb" country="United Kingdom" operator="COLT Mobile Telecommunications Limited" status="Not operational" 06 cc="gb" country="United Kingdom" operator="Internet Computer Bureau Limited" status="" 07 bands="GSM 1800" cc="gb" country="United Kingdom" operator="Vodafone" status="Not operational" 08 cc="gb" country="United Kingdom" operator="BT OnePhone (UK) Ltd" status="" 09 cc="gb" country="United Kingdom" operator="Tismi BV" status="" 10 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800" brand="O2 (UK)" cc="gb" country="United Kingdom" operator="Telefónica Europe" status="Operational" 11 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800" brand="O2 (UK)" cc="gb" country="United Kingdom" operator="Telefónica Europe" status="Operational" 12 bands="GSM-R" brand="Railtrack" cc="gb" country="United Kingdom" operator="Network Rail Infrastructure Ltd" status="Operational" 13 bands="GSM-R" brand="Railtrack" cc="gb" country="United Kingdom" operator="Network Rail Infrastructure Ltd" status="Operational" 14 bands="GSM 1800" brand="Hay Systems Ltd" cc="gb" country="United Kingdom" operator="Hay Systems Ltd" status="Operational" 15 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800" brand="Vodafone UK" cc="gb" country="United Kingdom" operator="Vodafone" status="Operational" 16 bands="MVNO" brand="Talk Talk" cc="gb" country="United Kingdom" operator="TalkTalk Communications Limited" status="Operational" 17 cc="gb" country="United Kingdom" operator="FleXtel Limited" status="" 18 bands="MVNO" brand="Cloud9" cc="gb" country="United Kingdom" operator="Cloud9" status="Operational" 19 bands="GSM 1800" brand="Private Mobile Networks PMN" cc="gb" country="United Kingdom" operator="Teleware plc" status="Operational" 20 bands="UMTS 2100 / LTE 800 / LTE 1800" brand="3" cc="gb" country="United Kingdom" operator="Hutchison 3G UK Ltd" status="Operational" 21 bands="" cc="gb" country="United Kingdom" operator="LogicStar Ltd" status="Not operational" 22 bands="" cc="gb" country="United Kingdom" operator="Telesign Mobile Limited" status="" 23 bands="" cc="gb" country="United Kingdom" operator="Icron Network Limited" status="" 24 bands="MVNO" brand="Greenfone" cc="gb" country="United Kingdom" operator="Stour Marine Limited" status="Operational" 25 bands="MVNO" brand="Truphone" cc="gb" country="United Kingdom" operator="Truphone" status="Operational" 26 bands="MVNO" brand="Lycamobile" cc="gb" country="United Kingdom" operator="Lycamobile UK Limited" status="Operational" 27 bands="MVNE" cc="gb" country="United Kingdom" operator="Teleena UK Limited" status="Operational" 28 bands="MVNO" cc="gb" country="United Kingdom" operator="Marathon Telecom Limited" status="Operational" 29 bands="" brand="aql" cc="gb" country="United Kingdom" operator="(aq) Limited" status="" 30 bands="GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="T-Mobile UK" cc="gb" country="United Kingdom" operator="EE" status="Operational" 31 bands="GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="T-Mobile UK" cc="gb" country="United Kingdom" operator="EE" status="Allocated" 32 bands="GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="T-Mobile UK" cc="gb" country="United Kingdom" operator="EE" status="Allocated" 33 bands="GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Orange" cc="gb" country="United Kingdom" operator="EE" status="Operational" 34 bands="GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Orange" cc="gb" country="United Kingdom" operator="EE" status="Operational" 35 bands="" cc="gb" country="United Kingdom" operator="JSC Ingenium (UK) Limited" status="Not operational" 36 bands="GSM 900 / GSM 1800 / LTE" brand="Sure Mobile" cc="gb" country="United Kingdom" operator="Sure Isle of Man Ltd." status="Operational" 37 bands="" cc="gb" country="United Kingdom" operator="Synectiv Ltd" status="" 38 bands="" brand="Virgin Mobile" cc="gb" country="United Kingdom" operator="Virgin Media" status="" 39 bands="" cc="gb" country="United Kingdom" operator="Gamma Telecom Holdings Ltd." status="" 50 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="JT" cc="gb" country="United Kingdom" operator="JT Group Limited" status="Operational" 51 bands="TD-LTE 3500 / TD-LTE 3700" brand="Relish" cc="gb" country="United Kingdom" operator="UK Broadband Limited" status="Operational" 52 bands="" cc="gb" country="United Kingdom" operator="Shyam Telecom UK Ltd" status="" 53 bands="MVNO" cc="gb" country="United Kingdom" operator="Limitless Mobile Ltd" status="Operational" 54 bands="MVNO" brand="iD Mobile" cc="gb" country="United Kingdom" operator="The Carphone Warehouse Limited" status="Operational" 55 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Sure Mobile" cc="gb" country="United Kingdom" operator="Sure (Guernsey) Limited" status="Operational" 56 bands="" cc="gb" country="United Kingdom" operator="CESG" status="" 57 bands="" cc="gb" country="United Kingdom" operator="Sky UK Limited" status="" 58 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Pronto GSM" cc="gb" country="United Kingdom" operator="Manx Telecom" status="Operational" 59 bands="MVNO" cc="gb" country="United Kingdom" operator="Limitless Mobile Ltd" status="Operational" 70 bands="" cc="gb" country="United Kingdom" operator="AMSUK Ltd." status="" 71 bands="" cc="gb" country="United Kingdom" operator="Home Office" status="" 72 bands="MVNO" cc="gb" country="United Kingdom" operator="Hanhaa Limited" status="Operational" 76 bands="GSM 900 / GSM 1800" brand="BT" cc="gb" country="United Kingdom" operator="BT Group" status="Operational" 78 bands="TETRA" brand="Airwave" cc="gb" country="United Kingdom" operator="Airwave Solutions Ltd" status="Operational" 86 bands="" cc="gb" country="United Kingdom" operator="EE" status="" 00-99 235 00 brand="Vectone Mobile" cc="gb" country="United Kingdom" operator="Mundio Mobile Limited" status="" 01 bands="" cc="gb" country="United Kingdom" operator="EE" status="" 02 bands="" cc="gb" country="United Kingdom" operator="EE" status="" 03 bands="" brand="Relish" cc="gb" country="United Kingdom" operator="UK Broadband Limited" status="" 77 brand="BT" cc="gb" country="United Kingdom" operator="BT Group" status="" 91 cc="gb" country="United Kingdom" operator="Vodafone United Kingdom" status="" 92 cc="gb" country="United Kingdom" operator="Vodafone United Kingdom" status="Not operational" 94 cc="gb" country="United Kingdom" operator="Hutchison 3G UK Ltd" status="" 95 bands="GSM-R" cc="gb" country="United Kingdom" operator="Network Rail Infrastructure Limited" status="Test Network" 00-99 238 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="TDC" cc="dk" country="Denmark" operator="TDC A/S" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Telenor" cc="dk" country="Denmark" operator="Telenor Denmark" status="Operational" 03 bands="" cc="dk" country="Denmark" operator="Syniverse Technologies" status="" 04 bands="" cc="dk" country="Denmark" operator="NextGen Mobile Ltd T/A CardBoardFish" status="" 05 bands="TETRA" brand="TetraNet" cc="dk" country="Denmark" operator="Dansk Beredskabskommunikation A/S" status="Operational" 06 bands="UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="3" cc="dk" country="Denmark" operator="Hi3G Denmark ApS" status="Operational" 07 bands="MVNO" brand="Vectone Mobile" cc="dk" country="Denmark" operator="Mundio Mobile (Denmark) Limited" status="Operational" 08 bands="MVNO" brand="Voxbone" cc="dk" country="Denmark" operator="Voxbone mobile" status="Operational" 09 bands="TETRA" brand="SINE" cc="dk" country="Denmark" operator="Dansk Beredskabskommunikation A/S" status="Operational" 10 bands="" brand="TDC" cc="dk" country="Denmark" operator="TDC A/S" status="Operational" 11 bands="TETRA" brand="SINE" cc="dk" country="Denmark" operator="Dansk Beredskabskommunikation A/S" status="Operational" 12 bands="MVNO" brand="Lycamobile" cc="dk" country="Denmark" operator="Lycamobile Denmark Ltd" status="Operational" 13 bands="" cc="dk" country="Denmark" operator="Compatel Limited" status="" 14 bands="" cc="dk" country="Denmark" operator="Monty UK Global Limited" status="" 15 bands="" cc="dk" country="Denmark" operator="Ice Danmark ApS" status="" 16 bands="" cc="dk" country="Denmark" operator="Tismi B.V." status="" 17 bands="MVNO" cc="dk" country="Denmark" operator="Naka AG" status="" 18 bands="" cc="dk" country="Denmark" operator="Cubic Telecom" status="" 20 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Telia" cc="dk" country="Denmark" operator="Telia" status="Operational" 23 bands="GSM-R" brand="GSM-R DK" cc="dk" country="Denmark" operator="Banedanmark" status="Operational" 25 bands="MVNO" brand="Viahub" cc="dk" country="Denmark" operator="SMS Provider Corp." status="" 28 bands="" cc="dk" country="Denmark" operator="LINK Mobile A/S" status="" 30 bands="" cc="dk" country="Denmark" operator="Interactive digital media GmbH" status="" 40 bands="" cc="dk" country="Denmark" operator="Ericsson Danmark A/S" status="Not operational" 42 bands="" cc="dk" country="Denmark" operator="Tel42 ApS" status="" 43 bands="" cc="dk" country="Denmark" operator="MobiWeb Limited" status="Not operational" 66 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" cc="dk" country="Denmark" operator="TT-Netværket P/S" status="Operational" 73 bands="" cc="dk" country="Denmark" operator="Onomondo ApS" status="" 77 bands="GSM 900 / GSM 1800" brand="Telenor" cc="dk" country="Denmark" operator="Telenor Denmark" status="Operational" 00-99 240 01 bands="GSM 900 / GSM 1800 / UMTS 900 / LTE 800 / LTE 1800 / LTE 2600" brand="Telia" cc="se" country="Sweden" operator="TeliaSonera Sverige AB" status="Operational" 02 bands="UMTS 900 / UMTS 2100 / LTE 800 / LTE 2600 / TD-LTE 2600" brand="3" cc="se" country="Sweden" operator="HI3G Access AB" status="Operational" 03 bands="LTE 450" brand="Net 1" cc="se" country="Sweden" operator="Netett Sverige AB" status="Operational" 04 bands="UMTS 2100" brand="SWEDEN" cc="se" country="Sweden" operator="3G Infrastructure Services AB" status="Operational" 05 bands="UMTS 2100" brand="Sweden 3G" cc="se" country="Sweden" operator="Svenska UMTS-Nät AB" status="Operational" 06 bands="UMTS 2100" brand="Telenor" cc="se" country="Sweden" operator="Telenor Sverige AB" status="Operational" 07 bands="UMTS 2100 / LTE 800 / LTE 900 / LTE 1800 / LTE 2600" brand="Tele2" cc="se" country="Sweden" operator="Tele2 Sverige AB" status="Operational" 08 bands="GSM 900 / GSM 1800" brand="Telenor" cc="se" country="Sweden" operator="Telenor Sverige AB" status="Not operational" 09 bands="" brand="Com4" cc="se" country="Sweden" operator="Communication for Devices in Sweden AB" status="" 10 brand="Spring Mobil" cc="se" country="Sweden" operator="Tele2 Sverige AB" status="Operational" 11 bands="" cc="se" country="Sweden" operator="ComHem AB" status="" 12 bands="MVNO" brand="Lycamobile" cc="se" country="Sweden" operator="Lycamobile Sweden Limited" status="Operational" 13 bands="" cc="se" country="Sweden" operator="Alltele Företag Sverige AB" status="" 14 bands="" cc="se" country="Sweden" operator="Tele2 Business AB" status="" 15 bands="GSM 900 / GSM 1800 / UMTS 2100" cc="se" country="Sweden" operator="Wireless Maingate Nordic AB" status="Operational" 16 bands="GSM" cc="se" country="Sweden" operator="42 Telecom AB" status="Operational" 17 bands="MVNO" brand="Gotanet" cc="se" country="Sweden" operator="Götalandsnätet AB" status="Operational" 18 bands="" cc="se" country="Sweden" operator="Generic Mobile Systems Sweden AB" status="" 19 bands="MVNO" brand="Vectone Mobile" cc="se" country="Sweden" operator="Mundio Mobile (Sweden) Limited" status="Operational" 20 bands="GSM" cc="se" country="Sweden" operator="Wireless Maingate Messaging Services AB" status="Operational" 21 bands="GSM-R 900" brand="MobiSir" cc="se" country="Sweden" operator="Trafikverket ICT" status="Operational" 22 bands="" cc="se" country="Sweden" operator="EuTel AB" status="" 23 bands="" cc="se" country="Sweden" operator="Infobip Limited (UK)" status="Not operational" 24 bands="GSM 900 / LTE 800 / LTE 900 / LTE 1800 / LTE 2600" brand="Sweden 2G" cc="se" country="Sweden" operator="Net4Mobility HB" status="Operational" 25 bands="" cc="se" country="Sweden" operator="Monty UK Global Ltd" status="" 26 bands="" cc="se" country="Sweden" operator="Twilio Sweden AB" status="" 27 bands="MVNO" cc="se" country="Sweden" operator="GlobeTouch AB" status="Operational" 28 bands="" cc="se" country="Sweden" operator="LINK Mobile A/S" status="" 29 bands="" cc="se" country="Sweden" operator="Mercury International Carrier Services" status="" 30 bands="" cc="se" country="Sweden" operator="NextGen Mobile Ltd." status="" 31 bands="" cc="se" country="Sweden" operator="RebTel Network AB" status="" 32 bands="" cc="se" country="Sweden" operator="Compatel Limited" status="" 33 bands="" cc="se" country="Sweden" operator="Mobile Arts AB" status="" 34 bands="" cc="se" country="Sweden" operator="Pro Net Telecommunications Services Ltd." status="Not operational" 35 bands="" cc="se" country="Sweden" operator="42 Telecom LTD" status="" 36 bands="" cc="se" country="Sweden" operator="interactive digital media GmbH" status="" 37 bands="" cc="se" country="Sweden" operator="CLX Networks AB" status="Operational" 38 bands="MVNO" brand="Voxbone" cc="se" country="Sweden" operator="Voxbone mobile" status="Operational" 39 bands="" cc="se" country="Sweden" operator="Borderlight AB" status="" 40 bands="" cc="se" country="Sweden" operator="North net connect AB" status="" 41 bands="" cc="se" country="Sweden" operator="Shyam Telecom UK Ltd." status="" 42 bands="" cc="se" country="Sweden" operator="Telenor Connexion AB" status="" 43 bands="" cc="se" country="Sweden" operator="MobiWeb Ltd." status="" 44 bands="" cc="se" country="Sweden" operator="Telenabler AB" status="" 45 bands="" cc="se" country="Sweden" operator="Spirius AB" status="" 46 bands="MVNO" brand="Viahub" cc="se" country="Sweden" operator="SMS Provider Corp." status="" 47 bands="" cc="se" country="Sweden" operator="Viatel Sweden AB" status="" 60 bands="" cc="se" country="Sweden" operator="Telefonaktiebolaget LM Ericsson" status="" 61 bands="" cc="se" country="Sweden" operator="MessageBird B.V." status="" 00-99 242 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Telenor" cc="no" country="Norway" operator="Telenor Norge AS" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Telia" cc="no" country="Norway" operator="TeliaSonera Norge AS" status="Operational" 03 bands="" cc="no" country="Norway" operator="Televerket AS" status="" 04 bands="MVNO" brand="Tele2" cc="no" country="Norway" operator="Tele2 (Mobile Norway AS)" status="Not operational" 05 bands="GSM 900 / UMTS 900 / UMTS 2100" brand="Telia" cc="no" country="Norway" operator="TeliaSonera Norge AS" status="Not operational" 06 bands="LTE 450" brand="ICE" cc="no" country="Norway" operator="ICE Norge AS" status="Operational" 07 bands="MVNO" brand="Phonero" cc="no" country="Norway" operator="Phonero AS" status="Operational" 08 bands="MVNO" brand="TDC" cc="no" country="Norway" operator="TDC Mobil AS" status="Operational" 09 bands="MVNO" brand="Com4" cc="no" country="Norway" operator="Com4 AS" status="Operational" 10 bands="" cc="no" country="Norway" operator="Norwegian Communications Authority" status="" 11 bands="Test" brand="SystemNet" cc="no" country="Norway" operator="SystemNet AS" status="" 12 bands="" brand="Telenor" cc="no" country="Norway" operator="Telenor Norge AS" status="" 14 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="ICE" cc="no" country="Norway" operator="ICE Communication Norge AS" status="Operational" 20 bands="GSM-R 900" cc="no" country="Norway" operator="Jernbaneverket AS" status="Operational" 21 bands="GSM-R 900" cc="no" country="Norway" operator="Jernbaneverket AS" status="Operational" 22 bands="" cc="no" country="Norway" operator="Network Norway AS" status="Not operational" 23 bands="MVNO" brand="Lycamobile" cc="no" country="Norway" operator="Lyca Mobile Ltd" status="Operational" 24 bands="" cc="no" country="Norway" operator="Mobile Norway AS" status="Not operational" 25 bands="" cc="no" country="Norway" operator="Forsvarets kompetansesenter KKIS" status="" 99 bands="LTE" cc="no" country="Norway" operator="TampNet AS" status="Operational" 00-99 244 03 bands="GSM 1800" brand="DNA" cc="fi" country="Finland" operator="DNA Oy" status="Operational" 04 bands="" brand="DNA" cc="fi" country="Finland" operator="DNA Oy" status="" 05 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Elisa" cc="fi" country="Finland" operator="Elisa Oyj" status="Operational" 06 bands="" brand="Elisa" cc="fi" country="Finland" operator="Elisa Oyj" status="Not operational" 07 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2600 / TD-LTE 2600" brand="Nokia" cc="fi" country="Finland" operator="Nokia Solutions and Networks Oy" status="Operational" 08 bands="GSM 1800 / UMTS 2100" brand="Nokia" cc="fi" country="Finland" operator="Nokia Solutions and Networks Oy" status="" 09 bands="GSM 900" cc="fi" country="Finland" operator="Nokia Solutions and Networks Oy" status="" 10 bands="" cc="fi" country="Finland" operator="Viestintävirasto" status="" 11 bands="" cc="fi" country="Finland" operator="Viestintävirasto" status="" 12 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="DNA" cc="fi" country="Finland" operator="DNA Oy" status="Operational" 13 bands="GSM 900 / GSM 1800" brand="DNA" cc="fi" country="Finland" operator="DNA Oy" status="Not operational" 14 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Ålcom" cc="fi" country="Finland" operator="Ålands Telekommunikation Ab" status="Operational" 15 bands="GSM 1800" brand="SAMK" cc="fi" country="Finland" operator="Satakunnan ammattikorkeakoulu Oy" status="Not operational" 16 bands="MVNO" brand="Tele2" cc="fi" country="Finland" operator="Oy Finland Tele2 AB" status="Not operational" 17 bands="GSM-R" cc="fi" country="Finland" operator="Liikennevirasto" status="Operational" 21 bands="MVNO" brand="Elisa- Saunalahti" cc="fi" country="Finland" operator="Elisa Oyj" status="Operational" 22 bands="" cc="fi" country="Finland" operator="EXFO Oy" status="Not operational" 23 bands="" cc="fi" country="Finland" operator="EXFO Oy" status="Not operational" 24 bands="" cc="fi" country="Finland" operator="TTY-säätiö" status="Not operational" 25 bands="CDMA" brand="Datame" cc="fi" country="Finland" operator="Datame Oy" status="Not operational" 26 bands="MVNO" brand="Compatel" cc="fi" country="Finland" operator="Compatel Ltd" status="Operational" 27 bands="" cc="fi" country="Finland" operator="Teknologian tutkimuskeskus VTT Oy" status="" 28 bands="" cc="fi" country="Finland" operator="Teknologian tutkimuskeskus VTT Oy" status="" 29 bands="MVNO" cc="fi" country="Finland" operator="SCNL Truphone" status="Not operational" 30 bands="MVNO" brand="Vectone Mobile" cc="fi" country="Finland" operator="Mundio Mobile Oy" status="Not operational" 31 bands="MVNO" brand="Kuiri" cc="fi" country="Finland" operator="Ukko Mobile Oy" status="Operational" 32 bands="MVNO" brand="Voxbone" cc="fi" country="Finland" operator="Voxbone SA" status="Operational" 33 bands="TETRA" brand="VIRVE" cc="fi" country="Finland" operator="Virve Tuotteet ja Palvelut Oy" status="Operational" 34 bands="MVNO" brand="Bittium Wireless" cc="fi" country="Finland" operator="Bittium Wireless Oy" status="Operational" 35 bands="LTE 450 / TD-LTE 2600" brand="Ukko Mobile" cc="fi" country="Finland" operator="Ukkoverkot Oy" status="Operational" 36 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Sonera / DNA" cc="fi" country="Finland" operator="TeliaSonera Finland Oyj / Suomen Yhteisverkko Oy" status="Operational" 37 bands="MVNO" brand="Tismi" cc="fi" country="Finland" operator="Tismi BV" status="Operational" 38 bands="" cc="fi" country="Finland" operator="Nokia Solutions and Networks Oy" status="Test Network" 39 bands="" cc="fi" country="Finland" operator="Nokia Solutions and Networks Oy" status="Test Network" 40 bands="" cc="fi" country="Finland" operator="Nokia Solutions and Networks Oy" status="Test Network" 41 bands="" cc="fi" country="Finland" operator="Nokia Solutions and Networks Oy" status="Test Network" 42 bands="" cc="fi" country="Finland" operator="SMS Provider Corp." status="" 91 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 700 / LTE 800 / LTE 1800 / LTE 2600" brand="Sonera" cc="fi" country="Finland" operator="TeliaSonera Finland Oyj" status="Operational" 92 bands="" brand="Sonera" cc="fi" country="Finland" operator="TeliaSonera Finland Oyj" status="" 00-99 246 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Telia" cc="lt" country="Lithuania" operator="Telia Lietuva" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="BITĖ" cc="lt" country="Lithuania" operator="UAB Bitė Lietuva" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Tele2" cc="lt" country="Lithuania" operator="UAB Tele2 (Tele2 AB, Sweden)" status="Operational" 04 bands="" cc="lt" country="Lithuania" operator="Ministry of the Interior)" status="" 05 bands="GSM-R 900" brand="LitRail" cc="lt" country="Lithuania" operator="Lietuvos geležinkeliai (Lithuanian Railways)" status="Operational" 06 bands="" brand="Mediafon" cc="lt" country="Lithuania" operator="UAB Mediafon" status="Operational" 07 bands="" cc="lt" country="Lithuania" operator="Compatel Ltd." status="" 08 bands="WiMAX 3500 / TD-LTE 2300" brand="MEZON" cc="lt" country="Lithuania" operator="Lietuvos radijo ir televizijos centras" status="Operational" 09 bands="" cc="lt" country="Lithuania" operator="Interactive Digital Media GmbH" status="" 00-99 247 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="LMT" cc="lv" country="Latvia" operator="Latvian Mobile Telephone" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Tele2" cc="lv" country="Latvia" operator="Tele2" status="Operational" 03 bands="CDMA 450" brand="TRIATEL" cc="lv" country="Latvia" operator="Telekom Baltija" status="Operational" 04 bands="" cc="lv" country="Latvia" operator="Beta Telecom" status="" 05 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Bite" cc="lv" country="Latvia" operator="Bite Latvija" status="Operational" 06 bands="" cc="lv" country="Latvia" operator="Rigatta" status="Not operational" 07 bands="MVNO" brand="MTS" cc="lv" country="Latvia" operator="Master Telecom" status="Operational" 08 bands="MVNO" brand="IZZI" cc="lv" country="Latvia" operator="IZZI" status="Operational" 09 bands="MVNO" brand="Xomobile" cc="lv" country="Latvia" operator="Camel Mobile" status="Operational" 00-99 248 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Telia" cc="ee" country="Estonia" operator="Estonian Mobile Telecom" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Elisa" cc="ee" country="Estonia" operator="Elisa Eesti" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2100 / LTE 2600" brand="Tele2" cc="ee" country="Estonia" operator="Tele2 Eesti" status="Operational" 04 bands="MVNO" brand="Top Connect" cc="ee" country="Estonia" operator="OY Top Connect" status="Operational" 05 bands="" cc="ee" country="Estonia" operator="AS Bravocom Mobiil" status="Not operational" 06 bands="UMTS 2100" cc="ee" country="Estonia" operator="Progroup Holding" status="Not operational" 07 bands="CDMA2000 450" brand="Kou" cc="ee" country="Estonia" operator="Televõrgu AS" status="Not operational" 08 bands="MVNO" brand="VIVEX" cc="ee" country="Estonia" operator="VIVEX OU" status="Not operational" 09 bands="" cc="ee" country="Estonia" operator="Bravo Telecom" status="Not operational" 10 bands="" cc="ee" country="Estonia" operator="Telcotrade OÜ" status="Not operational" 71 bands="" cc="ee" country="Estonia" operator="Siseministeerium (Ministry of Interior)" status="" 00-99 250 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600 / TD-LTE 2600" brand="MTS" cc="ru" country="Russian Federation" operator="Mobile TeleSystems" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="MegaFon" cc="ru" country="Russian Federation" operator="MegaFon PJSC" status="Operational" 03 bands="GSM 900 / GSM 1800" brand="NCC" cc="ru" country="Russian Federation" operator="Nizhegorodskaya Cellular Communications" status="Operational" 04 bands="GSM 900" brand="Sibchallenge" cc="ru" country="Russian Federation" operator="Sibchallenge" status="Not operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100 / CDMA2000 450" brand="ETK" cc="ru" country="Russian Federation" operator="Yeniseytelecom" status="Operational" 06 bands="CDMA2000 450" brand="Skylink" cc="ru" country="Russian Federation" operator="CJSC Saratov System of Cellular Communications" status="Operational" 07 bands="GSM 900 / GSM 1800" brand="SMARTS" cc="ru" country="Russian Federation" operator="Zao SMARTS" status="Operational" 08 bands="GSM 900 / GSM 1800 / LTE 2300" brand="Vainah Telecom" cc="ru" country="Russian Federation" operator="CS "VainahTelecom"" status="Operational" 09 bands="CDMA2000 450" brand="Skylink" cc="ru" country="Russian Federation" operator="Khabarovsky Cellular Phone" status="Operational" 10 bands="GSM 900" brand="DTC" cc="ru" country="Russian Federation" operator="Dontelekom" status="Not operational" 11 bands="MVNO" brand="Yota" cc="ru" country="Russian Federation" operator="Scartel" status="Operational" 12 bands="GSM 1800" brand="Akos" cc="ru" country="Russian Federation" operator="Baykal Westcom / New Telephone Company / Far Eastern Cellular" status="Operational" 13 bands="GSM 900 / GSM 1800" brand="KUGSM" cc="ru" country="Russian Federation" operator="Kuban GSM" status="Not operational" 14 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / TD-LTE 2600" brand="MegaFon" cc="ru" country="Russian Federation" operator="MegaFon OJSC" status="Not operational" 15 bands="GSM 1800" brand="SMARTS" cc="ru" country="Russian Federation" operator="SMARTS Ufa, SMARTS Uljanovsk" status="Operational" 16 bands="GSM 900 / GSM 1800" brand="NTC" cc="ru" country="Russian Federation" operator="New Telephone Company" status="Operational" 17 bands="GSM 900 / GSM 1800" brand="Utel" cc="ru" country="Russian Federation" operator="JSC Uralsvyazinform" status="Operational" 18 bands="TD-LTE 2300" brand="Osnova Telecom" cc="ru" country="Russian Federation" status="Not operational" 19 bands="GSM 1800" brand="INDIGO" cc="ru" country="Russian Federation" operator="INDIGO" status="Not operational" 20 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 450 / LTE 1800 / LTE 2600" brand="Tele2" cc="ru" country="Russian Federation" operator="Tele2" status="Operational" 22 bands="TD-LTE 2300" cc="ru" country="Russian Federation" operator="Vainakh Telecom" status="Operational" 23 bands="Satellite MVNO" brand="Thuraya" cc="ru" country="Russian Federation" operator="GTNT" status="Operational" 28 bands="GSM 900" brand="Beeline" cc="ru" country="Russian Federation" operator="Beeline" status="Not operational" 29 bands="Satellite MVNO" brand="Iridium" cc="ru" country="Russian Federation" operator="Iridium Communications" status="Operational" 32 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Win Mobile" cc="ru" country="Russian Federation" operator="K-Telecom" status="Operational" 33 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Sevmobile" cc="ru" country="Russian Federation" operator="Sevtelekom" status="Operational" 34 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Krymtelekom" cc="ru" country="Russian Federation" operator="Krymtelekom" status="Operational" 35 bands="GSM 1800 / LTE 1800" brand="MOTIV" cc="ru" country="Russian Federation" operator="EKATERINBURG-2000" status="Operational" 38 bands="GSM 900 / GSM 1800" brand="Tambov GSM" cc="ru" country="Russian Federation" operator="Central Telecommunication Company" status="Operational" 39 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / TD-LTE 2300 / LTE 2600" brand="Rostelecom" cc="ru" country="Russian Federation" operator="ROSTELECOM" status="Not operational" 44 bands="" cc="ru" country="Russian Federation" operator="Stavtelesot / North Caucasian GSM" status="Not operational" 50 bands="MVNO" brand="MTS" cc="ru" country="Russian Federation" operator="Bezlimitno.ru" status="Operational" 54 bands="LTE 1800" brand="TTK" cc="ru" country="Russian Federation" operator="Tattelecom" status="Operational" 60 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Volna mobile" cc="ru" country="Russian Federation" operator="KTK Telecom" status="Operational" 811 bands="AMPS / DAMPS / GSM 1800" cc="ru" country="Russian Federation" operator="Votek Mobile" status="Not operational" 91 bands="GSM 1800" brand="Sonic Duo" cc="ru" country="Russian Federation" operator="Sonic Duo CJSC" status="Not operational" 92 bands="" cc="ru" country="Russian Federation" operator="Primtelefon" status="Not operational" 93 bands="" cc="ru" country="Russian Federation" operator="Telecom XXI" status="Not operational" 99 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Beeline" cc="ru" country="Russian Federation" operator="OJSC Vimpel-Communications" status="Operational" 00-99 255 01 bands="GSM 900 / GSM 1800 / CDMA 450 / UMTS 2100" brand="Vodafone" cc="ua" country="Ukraine" operator="PRJSC VF Ukraine" status="Operational" 02 bands="GSM 900 / GSM 1800" brand="Beeline" cc="ua" country="Ukraine" operator="Kyivstar GSM JSC" status="Not operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Kyivstar" cc="ua" country="Ukraine" operator="Kyivstar JSC" status="Operational" 04 bands="CDMA 800" brand="IT" cc="ua" country="Ukraine" operator="Intertelecom LLC" status="Operational" 05 bands="GSM 1800" brand="Golden Telecom" cc="ua" country="Ukraine" operator="Kyivstar GSM JSC" status="Not operational" 06 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="lifecell" cc="ua" country="Ukraine" operator="Turkcell" status="Operational" 07 bands="UMTS 2100" brand="3Mob" cc="ua" country="Ukraine" operator="Trymob LLC" status="Operational" 21 bands="CDMA 800" brand="PEOPLEnet" cc="ua" country="Ukraine" operator="Telesystems of Ukraine" status="Operational" 23 bands="CDMA 800" brand="CDMA Ukraine" cc="ua" country="Ukraine" operator="Intertelecom" status="Not operational" 25 bands="CDMA 800" brand="NEWTONE" cc="ua" country="Ukraine" operator="CST Invest" status="Operational" 00-99 257 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="velcom" cc="by" country="Belarus" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="MTS" cc="by" country="Belarus" operator="Mobile TeleSystems" status="Operational" 03 bands="CDMA 450" brand="DIALLOG" cc="by" country="Belarus" operator="BelCel" status="Not operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="life:)" cc="by" country="Belarus" operator="Belarusian Telecommunications Network" status="Operational" 05 bands="WiMAX 3500" brand="byfly" cc="by" country="Belarus" operator="Beltelecom" status="Not operational" 06 bands="LTE 1800" brand="beCloud" cc="by" country="Belarus" operator="Belorussian Cloud Technologies" status="Operational" 00-99 259 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Orange" cc="md" country="Moldova" operator="Orange Moldova" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Moldcell" cc="md" country="Moldova" status="Operational" 03 bands="CDMA 450" brand="Unité" cc="md" country="Moldova" operator="Moldtelecom" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="Eventis" cc="md" country="Moldova" operator="Eventis Telecom" status="Not operational" 05 bands="UMTS 900 / UMTS 2100 / LTE 1800" brand="Unité" cc="md" country="Moldova" operator="Moldtelecom" status="Operational" 15 bands="LTE 800" brand="IDC" cc="md" country="Moldova" operator="Interdnestrcom" status="Operational" 99 bands="UMTS 2100" brand="Unité" cc="md" country="Moldova" operator="Moldtelecom" status="Operational" 00-99 260 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Plus" cc="pl" country="Poland" operator="Polkomtel Sp. z o.o." status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="T-Mobile" cc="pl" country="Poland" operator="T-Mobile Polska S.A." status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Orange" cc="pl" country="Poland" operator="Polska Telefonia Komórkowa Centertel Sp. z o.o." status="Operational" 04 bands="" brand="Aero2" cc="pl" country="Poland" operator="Aero 2 Sp. z o.o." status="Not operational" 05 bands="UMTS 2100" brand="Orange" cc="pl" country="Poland" operator="Polska Telefonia Komórkowa Centertel Sp. z o.o." status="Not operational" 06 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2100 / LTE 2600" brand="Play" cc="pl" country="Poland" operator="P4 Sp. z o.o." status="Operational" 07 bands="MVNO" brand="Netia" cc="pl" country="Poland" operator="Netia S.A." status="Operational" 08 bands="" cc="pl" country="Poland" operator="E-Telko Sp. z o.o." status="Not operational" 09 bands="MVNO" brand="Lycamobile" cc="pl" country="Poland" operator="Lycamobile Sp. z o.o." status="Operational" 10 bands="CDMA 800" brand="Sferia" cc="pl" country="Poland" operator="Sferia S.A." status="Not operational" 11 bands="CDMA2000 420" brand="Nordisk Polska" cc="pl" country="Poland" operator="Nordisk Polska Sp. z o.o." status="Operational" 12 bands="MVNO" brand="Cyfrowy Polsat" cc="pl" country="Poland" operator="Cyfrowy Polsat S.A." status="Operational" 13 brand="Sferia" cc="pl" country="Poland" operator="Sferia S.A." status="Not operational" 14 brand="Sferia" cc="pl" country="Poland" operator="Sferia S.A." status="Not operational" 15 bands="LTE 1800" brand="Aero2" cc="pl" country="Poland" operator="Aero 2 Sp. z o.o." status="Operational" 16 bands="LTE 1800" brand="Aero2" cc="pl" country="Poland" operator="Aero 2 Sp. z o.o." status="Operational" 17 bands="UMTS 900 / LTE 800 / TD-LTE 2600" brand="Aero2" cc="pl" country="Poland" operator="Aero 2 Sp. z o.o." status="Operational" 18 bands="" brand="AMD Telecom" cc="pl" country="Poland" operator="AMD Telecom S.A." status="" 19 bands="" brand="Teleena" cc="pl" country="Poland" operator="Teleena Holding BV" status="Not operational" 20 bands="" brand="Mobile.Net" cc="pl" country="Poland" operator="Mobile.Net Sp. z o.o." status="" 21 bands="" brand="Exteri" cc="pl" country="Poland" operator="Exteri Sp. z o.o." status="Not operational" 22 bands="" brand="Arcomm" cc="pl" country="Poland" operator="Arcomm Sp. z o.o." status="" 23 bands="" brand="Amicomm" cc="pl" country="Poland" operator="Amicomm Sp. z o.o." status="Not operational" 24 bands="" cc="pl" country="Poland" operator="IT Partners Telco Sp. z o.o." status="" 25 bands="" cc="pl" country="Poland" operator="Polskie Sieci Radiowe Sp. z o.o. Sp. k.a." status="" 26 bands="" brand="ATE" cc="pl" country="Poland" operator="Advanced Technology & Experience Sp. z o.o." status="Not operational" 27 bands="" brand="Intertelcom" cc="pl" country="Poland" operator="Intertelcom Sp. z o.o." status="Not operational" 28 bands="" brand="PhoneNet" cc="pl" country="Poland" operator="PhoneNet Sp. z o.o." status="Not operational" 29 bands="" brand="Interfonica" cc="pl" country="Poland" operator="Interfonica Sp. z o.o." status="Not operational" 30 bands="" brand="GrandTel" cc="pl" country="Poland" operator="GrandTel Sp. z o.o." status="Not operational" 31 bands="" brand="Phone IT" cc="pl" country="Poland" operator="Phone IT Sp. z o.o." status="" 32 bands="" cc="pl" country="Poland" operator="Compatel Limited" status="" 33 bands="MVNO" brand="Truphone" cc="pl" country="Poland" operator="Truphone Poland Sp. z o.o." status="Operational" 34 bands="UMTS 900 / LTE 800 / LTE 1800 / LTE 2600" brand="NetWorkS!" cc="pl" country="Poland" operator="T-Mobile Polska S.A." status="Operational" 35 bands="GSM-R" cc="pl" country="Poland" operator="PKP Polskie Linie Kolejowe S.A." status="Operational" 36 bands="MVNO" brand="Vectone Mobile" cc="pl" country="Poland" operator="Mundio Mobile" status="Not operational" 37 bands="" cc="pl" country="Poland" operator="NEXTGEN MOBILE LTD" status="" 38 bands="" cc="pl" country="Poland" operator="CALLFREEDOM Sp. z o.o." status="" 39 bands="MVNO" brand="Voxbone" cc="pl" country="Poland" operator="VOXBONE SA" status="Operational" 40 bands="" cc="pl" country="Poland" operator="Interactive Digital Media GmbH" status="" 41 bands="" cc="pl" country="Poland" operator="EZ PHONE MOBILE Sp. z o.o." status="" 42 bands="" cc="pl" country="Poland" operator="MobiWeb Telecom Limited" status="" 43 bands="" cc="pl" country="Poland" operator="Smart Idea International Sp. z o.o." status="" 44 bands="" cc="pl" country="Poland" operator="Rebtel Poland Sp. z o.o." status="" 45 bands="MVNO" cc="pl" country="Poland" operator="Virgin Mobile Polska Sp. z o.o." status="Operational" 46 bands="" cc="pl" country="Poland" operator="Terra Telekom Sp. z o.o." status="" 47 bands="" cc="pl" country="Poland" operator="SMShighway Limited" status="" 48 bands="" cc="pl" country="Poland" operator="AGILE TELECOM S.P.A." status="" 49 bands="" cc="pl" country="Poland" operator="Messagebird B.V." status="" 98 bands="LTE 1800" brand="Play" cc="pl" country="Poland" operator="P4 Sp. z o.o." status="Not operational" 00-99 262 01 bands="GSM 900 / GSM 1800/ / UMTS 2100 / LTE 800 / LTE 900 / LTE 1800 / LTE 2600" brand="Telekom" cc="de" country="Germany" operator="Telekom Deutschland GmbH" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Vodafone" cc="de" country="Germany" operator="Vodafone D2 GmbH" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="O2" cc="de" country="Germany" operator="Telefónica Germany GmbH & Co. oHG" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Vodafone" cc="de" country="Germany" operator="Vodafone D2 GmbH" status="Reserved" 05 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="O2" cc="de" country="Germany" operator="Telefónica Germany GmbH & Co. oHG" status="Reserved" 06 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 900 / LTE 1800 / LTE 2600" brand="Telekom" cc="de" country="Germany" operator="Telekom Deutschland GmbH" status="Reserved" 07 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="O2" cc="de" country="Germany" operator="Telefónica Germany GmbH & Co. oHG" status="Not operational" 08 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="O2" cc="de" country="Germany" operator="Telefónica Germany GmbH & Co. oHG" status="Reserved" 09 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="Vodafone" cc="de" country="Germany" operator="Vodafone D2 GmbH" status="Operational" 10 bands="GSM-R" cc="de" country="Germany" operator="DB Netz AG" status="Operational" 11 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="O2" cc="de" country="Germany" operator="Telefónica Germany GmbH & Co. oHG" status="Reserved" 12 bands="MVNO" brand="Dolphin Telecom" cc="de" country="Germany" operator="sipgate GmbH" status="Operational" 13 bands="UMTS 2100" cc="de" country="Germany" operator="Mobilcom Multimedia" status="Not operational" 14 bands="UMTS 2100" cc="de" country="Germany" operator="Group 3G UMTS" status="Not operational" 15 bands="TD-SCDMA" brand="Airdata" cc="de" country="Germany" status="Operational" 16 bands="MVNO" cc="de" country="Germany" operator="Telogic Germany GmbH" status="Not operational" 17 bands="" brand="O2" cc="de" country="Germany" operator="Telefónica Germany GmbH & Co. oHG" status="" 18 bands="MVNO" cc="de" country="Germany" operator="NetCologne" status="Operational" 19 bands="CDMA 450" cc="de" country="Germany" operator="Inquam Deutschland" status="" 20 bands="MVNE" brand="Voiceworks" cc="de" country="Germany" operator="Voiceworks GmbH" status="Operational" 21 bands="" cc="de" country="Germany" operator="Multiconnect GmbH" status="" 22 bands="MVNO" cc="de" country="Germany" operator="sipgate Wireless GmbH" status="" 23 bands="MVNO" cc="de" country="Germany" operator="Drillisch Online AG" status="Operational" 33 bands="MVNO" brand="simquadrat" cc="de" country="Germany" operator="sipgate GmbH" status="Operational" 41 bands="" cc="de" country="Germany" operator="First Telecom GmbH" status="Not operational" 42 bands="GSM 1800" brand="CCC Event" cc="de" country="Germany" operator="Chaos Computer Club" status="Temporary operational" 43 bands="MVNO" brand="Lycamobile" cc="de" country="Germany" operator="Lycamobile" status="Operational" 60 bands="GSM-R 900" cc="de" country="Germany" operator="DB Telematik" status="Operational" 72 bands="" cc="de" country="Germany" operator="Ericsson GmbH" status="" 73 bands="" cc="de" country="Germany" operator="Xantaro Deutschland GmbH" status="" 74 bands="" cc="de" country="Germany" operator="Qualcomm CDMA Technologies GmbH" status="" 75 cc="de" country="Germany" operator="Core Network Dynamics GmbH" status="Not operational" 76 bands="GSM 900" cc="de" country="Germany" operator="Siemens AG" status="Not operational" 77 bands="GSM 900" brand="O2" cc="de" country="Germany" operator="Telefónica Germany GmbH & Co. oHG" status="" 78 bands="" brand="Telekom" cc="de" country="Germany" operator="Telekom Deutschland GmbH" status="" 79 bands="" cc="de" country="Germany" operator="ng4T GmbH" status="Not operational" 92 bands="GSM 1800 / UMTS 2100" cc="de" country="Germany" operator="Nash Technologies" status="Operational" 00-99 266 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 2600" brand="GibTel" cc="gi" country="Gibraltar (United Kingdom)" operator="Gibtelecom" status="Operational" 06 bands="UMTS 2100" brand="CTS Mobile" cc="gi" country="Gibraltar (United Kingdom)" operator="CTS Gibraltar" status="Not operational" 09 bands="GSM 1800 / UMTS 2100" brand="Shine" cc="gi" country="Gibraltar (United Kingdom)" operator="Eazitelecom" status="Operational" 00-99 268 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Vodafone" cc="pt" country="Portugal" operator="Vodafone Portugal" status="Operational" 02 bands="" brand="MEO" cc="pt" country="Portugal" operator="Telecomunicações Móveis Nacionais" status="" 03 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="NOS" cc="pt" country="Portugal" operator="NOS Comunicações" status="Operational" 04 bands="MVNO" brand="LycaMobile" cc="pt" country="Portugal" operator="LycaMobile" status="Operational" 05 bands="UMTS 2100" cc="pt" country="Portugal" operator="Oniway - Inforcomunicaçôes, S.A." status="Not operational" 06 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="MEO" cc="pt" country="Portugal" operator="Telecomunicações Móveis Nacionais" status="Operational" 07 bands="MVNO" brand="Vectone Mobile" cc="pt" country="Portugal" operator="Mundio Mobile (Portugal) Limited" status="Operational" 11 bands="" cc="pt" country="Portugal" operator="Compatel, Limited" status="" 12 bands="GSM-R" cc="pt" country="Portugal" operator="IP Telecom - Serviços de Telecomunicações, S.A." status="Operational" 13 bands="" cc="pt" country="Portugal" operator="G9Telecom, S.A." status="" 21 bands="CDMA2000 450" brand="Zapp" cc="pt" country="Portugal" operator="Zapp Portugal" status="Not operational" 80 bands="" brand="MEO" cc="pt" country="Portugal" operator="Telecomunicações Móveis Nacionais" status="" 00-99 270 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="POST" cc="lu" country="Luxembourg" operator="POST Luxembourg" status="Operational" 02 bands="" cc="lu" country="Luxembourg" operator="MTX Connect S.a.r.l." status="" 07 bands="" cc="lu" country="Luxembourg" operator="Bouygues Telecom S.A." status="" 10 bands="" cc="lu" country="Luxembourg" operator="Blue Communications" status="" 77 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Tango" cc="lu" country="Luxembourg" operator="Tango SA" status="Operational" 78 bands="" cc="lu" country="Luxembourg" operator="Interactive digital media GmbH" status="" 79 bands="" cc="lu" country="Luxembourg" operator="Mitto A.G." status="" 80 bands="" cc="lu" country="Luxembourg" operator="Syniverse Technologies S.à r.l." status="" 81 bands="" cc="lu" country="Luxembourg" operator="E-Lux Mobile Telecommunication S.A." status="" 99 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Orange" cc="lu" country="Luxembourg" operator="Orange S.A." status="Operational" 00-99 272 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Vodafone" cc="ie" country="Ireland" operator="Vodafone Ireland" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="3" cc="ie" country="Ireland" operator="Hutchison 3G Ireland limited" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Eir" cc="ie" country="Ireland" operator="Eir Group plc" status="Operational" 04 bands="" cc="ie" country="Ireland" operator="Access Telecom" status="" 05 bands="UMTS 2100 / LTE 800 / LTE 1800" brand="3" cc="ie" country="Ireland" operator="Hutchison 3G Ireland limited" status="Operational" 07 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Eir" cc="ie" country="Ireland" operator="Eir Group plc" status="Operational" 08 bands="" brand="Eir" cc="ie" country="Ireland" operator="Eir Group plc" status="" 09 bands="" cc="ie" country="Ireland" operator="Clever Communications Ltd." status="Not operational" 11 bands="MVNO" brand="Tesco Mobile" cc="ie" country="Ireland" operator="Liffey Telecom" status="Operational" 13 bands="MVNO" brand="Lycamobile" cc="ie" country="Ireland" operator="Lycamobile" status="Operational" 15 bands="MVNO" brand="Virgin Mobile" cc="ie" country="Ireland" operator="UPC" status="Operational" 16 bands="MVNO" brand="Carphone Warehouse" cc="ie" country="Ireland" operator="Carphone Warehouse" status="Operational" 17 bands="" brand="3" cc="ie" country="Ireland" operator="Hutchison 3G Ireland limited" status="" 00-99 274 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800" brand="Síminn" cc="is" country="Iceland" operator="Iceland Telecom" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Vodafone" cc="is" country="Iceland" operator="Og fjarskipti hf" status="Operational" 03 bands="" brand="Vodafone" cc="is" country="Iceland" operator="Og fjarskipti hf" status="Operational" 04 bands="GSM 1800" brand="Viking" cc="is" country="Iceland" operator="IMC Island ehf" status="Operational" 05 bands="GSM 1800" cc="is" country="Iceland" operator="Halló Frjáls fjarskipti hf." status="Not operational" 06 bands="" cc="is" country="Iceland" operator="Núll níu ehf" status="Not operational" 07 bands="GSM 1800" brand="IceCell" cc="is" country="Iceland" operator="IceCell ehf" status="Not operational" 08 bands="GSM 900 / GSM 1800" brand="On-waves" cc="is" country="Iceland" operator="Iceland Telecom" status="Operational" 11 bands="UMTS 2100 / LTE 1800" brand="Nova" cc="is" country="Iceland" operator="Nova ehf" status="Operational" 12 bands="MVNO" brand="Tal" cc="is" country="Iceland" operator="IP fjarskipti" status="Operational" 16 bands="" cc="is" country="Iceland" operator="Tismi BV" status="" 22 bands="" cc="is" country="Iceland" operator="Landhelgisgæslan (Icelandic Coast Guard)" status="" 31 bands="" brand="Síminn" cc="is" country="Iceland" operator="Iceland Telecom" status="" 00-99 276 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Telekom.al" cc="al" country="Albania" operator="Telekom Albania" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Vodafone" cc="al" country="Albania" operator="Vodafone Albania" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Eagle Mobile" cc="al" country="Albania" operator="Albtelecom" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="Plus Communication" cc="al" country="Albania" operator="Plus Communication" status="Operational" 00-99 278 01 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Vodafone" cc="mt" country="Malta" operator="Vodafone Malta" status="Operational" 11 bands="MVNO" cc="mt" country="Malta" operator="YOM Ltd." status="Operational" 21 bands="GSM 1800 / UMTS 2100 / LTE 1800" brand="GO" cc="mt" country="Malta" operator="Mobile Communications Limited" status="Operational" 30 bands="" brand="GO" cc="mt" country="Malta" operator="Mobile Communications Limited" status="" 77 bands="UMTS 2100" brand="Melita" cc="mt" country="Malta" operator="Melita" status="Operational" 00-99 280 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Cytamobile-Vodafone" cc="cy" country="Cyprus" operator="Cyprus Telecommunications Authority" status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="MTN" cc="cy" country="Cyprus" operator="MTN Group" status="Operational" 20 bands="LTE 1800" brand="PrimeTel" cc="cy" country="Cyprus" operator="PrimeTel PLC" status="Operational" 22 bands="MVNO" brand="lemontel" cc="cy" country="Cyprus" operator="Lemontel Ltd" status="Operational" 23 bands="MVNO" brand="Vectone Mobile" cc="cy" country="Cyprus" operator="Mundio Mobile Cyprus Ltd." status="" 00-99 282 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Geocell" cc="ge" country="Georgia" operator="Geocell Limited" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="MagtiCom" cc="ge" country="Georgia" operator="Magticom GSM" status="Operational" 03 bands="CDMA 450" brand="MagtiCom" cc="ge" country="Georgia" operator="Magtifix" status="Operational" 04 bands="GSM 1800 / UMTS 2100 / LTE 800" brand="Beeline" cc="ge" country="Georgia" operator="Mobitel LLC" status="Operational" 05 bands="CDMA 800" brand="Silknet" cc="ge" country="Georgia" operator="JSC Silknet" status="Operational" 06 bands="" cc="ge" country="Georgia" operator="JSC Compatel" status="" 07 bands="MVNO" brand="GlobalCell" cc="ge" country="Georgia" operator="GlobalCell Ltd" status="Operational" 08 bands="TD-LTE 2300" brand="Silk LTE" cc="ge" country="Georgia" operator="JSC Silknet" status="Operational" 09 bands="" cc="ge" country="Georgia" operator="Gmobile Ltd" status="" 00-99 283 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 450 / LTE 1800" brand="Beeline" cc="am" country="Armenia" operator="ArmenTel" status="Operational" 04 bands="GSM 900 / UMTS 900" brand="Karabakh Telecom" cc="am" country="Armenia" operator="Karabakh Telecom" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="VivaCell-MTS" cc="am" country="Armenia" operator="K Telecom CJSC" status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Ucom" cc="am" country="Armenia" operator="Ucom LLC" status="Operational" 00-99 284 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2100" brand="M-Tel" cc="bg" country="Bulgaria" operator="Mobiltel" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800" brand="Vivacom" cc="bg" country="Bulgaria" operator="BTC" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800" brand="Telenor" cc="bg" country="Bulgaria" operator="Telenor (Bulgaria)" status="Operational" 07 bands="GSM-R" brand="НКЖИ" cc="bg" country="Bulgaria" operator="НАЦИОНАЛНА КОМПАНИЯ ЖЕЛЕЗОПЪТНА ИНФРАСТРУКТУРА" status="Operational" 09 bands="" cc="bg" country="Bulgaria" operator="COMPATEL LIMITED" status="Not operational" 11 bands="LTE 1800" cc="bg" country="Bulgaria" operator="Bulsatcom" status="Operational" 13 bands="LTE 1800" brand="MAX" cc="bg" country="Bulgaria" operator="Max Telecom LTD" status="Operational" 00-99 286 01 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 900 / LTE 1800 / LTE 2100 / LTE 2600" brand="Turkcell" cc="tr" country="Turkey" operator="Turkcell Iletisim Hizmetleri A.S." status="Operational" 02 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 900 / LTE 1800 / LTE 2600" brand="Vodafone" cc="tr" country="Turkey" operator="Vodafone Turkey" status="Operational" 03 bands="GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Türk Telekom" cc="tr" country="Turkey" operator="Türk Telekom" status="Operational" 04 bands="GSM 1800" brand="Aycell" cc="tr" country="Turkey" operator="Aycell" status="Not operational" 00-99 288 01 bands="GSM 900 / UMTS 900 / UMTS 2100" brand="Faroese Telecom" cc="fo" country="Faroe Islands (Denmark)" operator="Faroese Telecom" status="Operational" 02 bands="GSM 900 / UMTS 2100" brand="Vodafone" cc="fo" country="Faroe Islands (Denmark)" operator="Vodafone Faroe Islands" status="Operational" 03 bands="GSM 1800" cc="fo" country="Faroe Islands (Denmark)" operator="Edge Mobile Sp/F" status="Not operational" 00-99 289 67 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="Aquafon" country="Abkhazia - GE-AB" operator="Aquafon JSC" status="Operational" 88 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="A-Mobile" country="Abkhazia - GE-AB" operator="A-Mobile LLSC" status="Operational" 00-99 290 01 bands="GSM 900 / UMTS 900 / LTE 800" cc="gl" country="Greenland (Denmark)" operator="TELE Greenland A/S" status="Operational" 02 bands="TD-LTE 2500" brand="Nuuk TV" cc="gl" country="Greenland (Denmark)" operator="inu:it a/s" status="Operational" 00-99 292 01 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="PRIMA" cc="sm" country="San Marino" operator="San Marino Telecom" status="Operational" 00-99 293 10 bands="GSM-R" cc="si" country="Slovenia" operator="SŽ - Infrastruktura, d.o.o." status="Operational" 20 bands="" cc="si" country="Slovenia" operator="COMPATEL Ltd" status="Not operational" 40 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="A1" cc="si" country="Slovenia" operator="A1 Slovenija" status="Operational" 41 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 900 / LTE 1800 / LTE 2100 / LTE 2600" brand="Mobitel" cc="si" country="Slovenia" operator="Telekom Slovenije" status="Operational" 64 bands="UMTS 2100" brand="T-2" cc="si" country="Slovenia" operator="T-2 d.o.o." status="Operational" 70 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Telemach" cc="si" country="Slovenia" operator="Tušmobil d.o.o." status="Operational" 00-99 294 01 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Telekom.mk" cc="mk" country="Macedonia" operator="Makedonski Telekom" status="Operational" 02 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="vip" cc="mk" country="Macedonia" operator="ONE.VIP DOO" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="vip" cc="mk" country="Macedonia" operator="ONE.VIP DOO" status="Operational" 04 bands="MVNO" brand="Lycamobile" cc="mk" country="Macedonia" operator="Lycamobile LLC" status="Operational" 10 bands="" cc="mk" country="Macedonia" operator="WTI Macedonia" status="Not operational" 11 bands="" cc="mk" country="Macedonia" operator="MOBIK TELEKOMUNIKACII DOOEL Skopje" status="" 00-99 295 01 bands="GSM 900 / GSM 1800 / LTE 1800" brand="Swisscom" cc="li" country="Liechtenstein" operator="Swisscom Schweiz AG" status="Operational" 02 bands="GSM 1800 / UMTS 2100 / LTE 1800" brand="7acht" cc="li" country="Liechtenstein" operator="Salt Liechtenstein AG" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="FL1" cc="li" country="Liechtenstein" operator="Telecom Liechtenstein AG" status="Operational" 06 bands="MVNO" brand="Cubic Telecom" cc="li" country="Liechtenstein" operator="Cubic Telecom AG" status="Operational" 07 bands="MVNO" cc="li" country="Liechtenstein" operator="First Mobile AG" status="" 09 bands="MVNO" cc="li" country="Liechtenstein" operator="EMnify GmbH" status="" 10 bands="MVNO" cc="li" country="Liechtenstein" operator="Soracom LI Ltd." status="" 77 bands="GSM 900" brand="Alpmobil" cc="li" country="Liechtenstein" operator="Alpcom AG" status="Not operational" 00-99 297 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Telenor" cc="me" country="Montenegro" operator="Telenor Montenegro" status="Operational" 02 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="T-Mobile" cc="me" country="Montenegro" operator="T-Mobile Montenegro LLC" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="m:tel CG" cc="me" country="Montenegro" operator="MTEL CG" status="Operational" 00-99 302 130 bands="TD-LTE 3500 / WiMAX" brand="Xplornet" cc="ca" country="Canada" operator="Xplornet Communications" status="Operational" 131 bands="TD-LTE 3500 / WiMAX" brand="Xplornet" cc="ca" country="Canada" operator="Xplornet Communications" status="Operational" 220 bands="UMTS 850 / UMTS 1900 / LTE 1700 / LTE 2600" brand="Telus Mobility, Koodo Mobile, Public Mobile" cc="ca" country="Canada" operator="Telus Mobility" status="Operational" 221 bands="" brand="Telus" cc="ca" country="Canada" operator="Telus Mobility" status="" 222 bands="" brand="Telus" cc="ca" country="Canada" operator="Telus Mobility" status="" 250 bands="" brand="ALO" cc="ca" country="Canada" operator="ALO Mobile Inc." status="" 270 bands="UMTS 1700 / LTE 1700" brand="EastLink" cc="ca" country="Canada" operator="Bragg Communications" status="Operational" 290 bands="iDEN 900" brand="Airtel Wireless" cc="ca" country="Canada" operator="Airtel Wireless" status="Operational" 300 bands="" cc="ca" country="Canada" operator="ECOTEL Inc." status="" 320 bands="UMTS 1700" brand="Rogers Wireless" cc="ca" country="Canada" operator="Rogers Communications" status="Operational" 340 bands="MVNO" brand="Execulink" cc="ca" country="Canada" operator="Execulink" status="Operational" 350 bands="GSM 850" brand="FIRST" cc="ca" country="Canada" operator="FIRST Networks Operations" status="Not operational" 360 bands="iDEN 800" brand="MiKe" cc="ca" country="Canada" operator="Telus Mobility" status="Not operational" 361 bands="CDMA 800 / CDMA 1900" brand="Telus" cc="ca" country="Canada" operator="Telus Mobility" status="Not operational" 370 bands="MVNO" brand="Fido" cc="ca" country="Canada" operator="Fido Solutions (Rogers Wireless)" status="Operational" 380 bands="UMTS 850 / UMTS 1900" brand="Keewaytinook Mobile" cc="ca" country="Canada" operator="Keewaytinook Okimakanak Mobile" status="Operational" 390 bands="" brand="DMTS" cc="ca" country="Canada" operator="Dryden Mobility" status="Not operational" 480 bands="" brand="SSi Connexions" cc="ca" country="Canada" operator="SSi Connexions" status="" 490 bands="UMTS 1700 / LTE 1700" brand="Freedom Mobile" cc="ca" country="Canada" operator="Shaw Communications" status="Operational" 500 bands="UMTS 1700 / LTE 1700" brand="Videotron" cc="ca" country="Canada" operator="Videotron" status="Operational" 510 bands="UMTS 1700 / LTE 1700" brand="Videotron" cc="ca" country="Canada" operator="Videotron" status="Operational" 520 bands="" brand="Videotron" cc="ca" country="Canada" operator="Videotron" status="" 530 bands="GSM" brand="Keewaytinook Mobile" cc="ca" country="Canada" operator="Keewaytinook Okimakanak Mobile" status="Operational" 540 bands="" cc="ca" country="Canada" operator="Rovvr Communications Inc." status="" 560 bands="CDMA / GSM" brand="Lynx Mobility" cc="ca" country="Canada" operator="Lynx Mobility" status="Operational" 570 bands="" brand="LightSquared" cc="ca" country="Canada" operator="LightSquared" status="" 590 bands="" brand="Quadro Mobility" cc="ca" country="Canada" operator="Quadro Communications Co-op" status="Operational" 610 bands="UMTS 850 / UMTS 1900 / LTE 700 / LTE 1700 / LTE 1900 / LTE 2600" brand="Bell Mobility, Virgin Mobile Canada" cc="ca" country="Canada" operator="Bell Mobility" status="Operational" 620 bands="UMTS 850 / GSM 1900" brand="ICE Wireless" cc="ca" country="Canada" operator="ICE Wireless" status="Operational" 630 bands="" brand="Aliant Mobility" cc="ca" country="Canada" operator="Bell Aliant" status="" 640 bands="CDMA 800 / CDMA 1900" brand="Bell" cc="ca" country="Canada" operator="Bell Mobility" status="Operational" 650 bands="UMTS 850 / UMTS 1900 / LTE 2600" brand="TBaytel" cc="ca" country="Canada" operator="Thunder Bay Telephone" status="Operational" 652 bands="CDMA2000" cc="ca" country="Canada" operator="BC Tel Mobility (Telus)" status="Not operational" 653 bands="CDMA 800 / CDMA 1900" brand="Telus" cc="ca" country="Canada" operator="Telus Mobility" status="Not operational" 655 bands="CDMA 800 / CDMA 1900" brand="MTS" cc="ca" country="Canada" operator="MTS Mobility" status="Operational" 656 bands="CDMA" brand="TBay" cc="ca" country="Canada" operator="Thunder Bay Telephone Mobility" status="Not operational" 657 bands="CDMA 800 / CDMA 1900" brand="Telus" cc="ca" country="Canada" operator="Telus Mobility" status="Not operational" 660 bands="UMTS 850 / UMTS 1900 / LTE 1700" brand="MTS" cc="ca" country="Canada" operator="Bell MTS" status="Operational" 670 bands="" brand="CityTel Mobility" cc="ca" country="Canada" operator="CityWest" status="" 680 bands="TD-LTE 2600" brand="SaskTel" cc="ca" country="Canada" operator="SaskTel Mobility" status="Operational" 690 bands="UMTS 850 / UMTS 1900" brand="Bell" cc="ca" country="Canada" operator="Bell Mobility" status="Operational" 701 bands="CDMA2000" cc="ca" country="Canada" operator="MB Tel Mobility" status="Operational" 702 bands="CDMA2000" cc="ca" country="Canada" operator="MT&T Mobility (Aliant)" status="Operational" 703 bands="CDMA2000" cc="ca" country="Canada" operator="New Tel Mobility (Aliant)" status="Operational" 710 bands="Satellite CDMA" brand="Globalstar" cc="ca" country="Canada" status="Operational" 720 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 700 / LTE 1700 / LTE 2600" brand="Rogers Wireless" cc="ca" country="Canada" operator="Rogers Communications" status="Operational" 730 bands="" brand="TerreStar Solutions" cc="ca" country="Canada" operator="TerreStar Networks" status="" 740 bands="" brand="Shaw Telecom" cc="ca" country="Canada" operator="Shaw Communications" status="Not operational" 750 bands="" brand="SaskTel" cc="ca" country="Canada" operator="SaskTel Mobility" status="" 760 bands="MVNO" brand="Public Mobile" cc="ca" country="Canada" operator="Telus Mobility" status="Operational" 770 bands="UMTS 850" brand="TNW Wireless" cc="ca" country="Canada" operator="TNW Wireless Inc." status="Operational" 780 bands="UMTS 850 / UMTS 1900 / LTE 1700" brand="SaskTel" cc="ca" country="Canada" operator="SaskTel Mobility" status="Operational" 790 bands="WiMAX / TD-LTE 3500" cc="ca" country="Canada" operator="NetSet Communications" status="Operational" 820 bands="" brand="Rogers Wireless" cc="ca" country="Canada" operator="Rogers Communications" status="" 860 bands="" brand="Telus" cc="ca" country="Canada" operator="Telus Mobility" status="" 880 bands="UMTS 850 / UMTS 1900" brand="Bell / Telus / SaskTel" cc="ca" country="Canada" operator="Shared Telus, Bell, and SaskTel" status="Operational" 920 bands="" brand="Rogers Wireless" cc="ca" country="Canada" operator="Rogers Communications" status="Not operational" 940 bands="UMTS 850 / UMTS 1900" brand="Wightman Mobility" cc="ca" country="Canada" operator="Wightman Telecom" status="Operational" 990 bands="" cc="ca" country="Canada" status="" 000-999 308 01 bands="GSM 900" brand="Ameris" cc="pm" country="Saint Pierre and Miquelon (France)" operator="St. Pierre-et-Miquelon Télécom" status="Operational" 02 bands="GSM 900" brand="GLOBALTEL" cc="pm" country="Saint Pierre and Miquelon (France)" operator="GLOBALTEL" status="Operational" 00-99 310 004 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Operational" 005 bands="CDMA2000 850 / CDMA2000 1900" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Operational" 006 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Operational" 010 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 012 bands="LTE 700 / LTE 1700 / LTE 1900" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Operational" 013 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 014 bands="" cc="us" country="United States of America" status="" 015 bands="iDEN" brand="Southern LINC" cc="us" country="United States of America" operator="Southern Communications" status="" 016 bands="CDMA2000 1900 / CDMA2000 1700" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Not operational" 017 bands="iDEN" brand="ProxTel" cc="us" country="United States of America" operator="North Sight Communications Inc." status="Not operational" 020 bands="GSM 850 / GSM 1900 / UMTS" brand="Union Wireless" cc="us" country="United States of America" operator="Union Telephone Company" status="Operational" 030 bands="GSM 850" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 032 bands="CDMA 1900 / GSM 1900 / LTE 700" brand="IT&E Wireless" cc="us" country="United States of America" operator="IT&E Overseas, Inc" status="Operational" 033 bands="" cc="us" country="United States of America" operator="Guam Telephone Authority" status="" 034 bands="iDEN" brand="Airpeak" cc="us" country="United States of America" operator="Airpeak" status="Operational" 035 bands="" brand="ETEX Wireless" cc="us" country="United States of America" operator="ETEX Communications, LP" status="" 040 bands="CDMA" brand="MTA" cc="us" country="United States of America" operator="Matanuska Telephone Association, Inc." status="Operational" 050 bands="CDMA" brand="GCI" cc="us" country="United States of America" operator="Alaska Communications" status="Operational" 053 bands="MVNO" brand="Virgin Mobile" cc="us" country="United States of America" operator="Sprint" status="Operational" 054 bands="" cc="us" country="United States of America" operator="Alltel US" status="Operational" 060 bands="1900" cc="us" country="United States of America" operator="Consolidated Telcom" status="" 066 bands="GSM / CDMA" brand="U.S. Cellular" cc="us" country="United States of America" operator="U.S. Cellular" status="Operational" 070 bands="GSM 850" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 080 bands="GSM 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 090 bands="GSM 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 100 bands="GSM 850 / UMTS 850 / UMTS 1700" brand="Plateau Wireless" cc="us" country="United States of America" operator="New Mexico RSA 4 East LP" status="Operational" 110 bands="CDMA / GSM 850 / LTE 700" brand="IT&E Wireless" cc="us" country="United States of America" operator="PTI Pacifica Inc." status="Operational" 120 bands="CDMA2000 1900 / LTE 850 / LTE 1900" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="Operational" 130 bands="CDMA2000 1900" brand="Carolina West Wireless" cc="us" country="United States of America" operator="Carolina West Wireless" status="Operational" 140 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 1700" brand="GTA Wireless" cc="us" country="United States of America" operator="Teleguam Holdings, LLC" status="Operational" 150 bands="GSM 850 / UMTS 850 / UMTS 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 160 bands="GSM 1900" brand="T-Mobile" cc="us" country="United States of America" operator="T-Mobile US" status="Operational" 170 bands="GSM 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 180 bands="GSM 850 / UMTS 850 / UMTS 1900" brand="West Central" cc="us" country="United States of America" operator="West Central Wireless" status="Operational" 190 bands="GSM 850" brand="GCI" cc="us" country="United States of America" operator="Alaska Wireless Communications, LLC" status="Operational" 200 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 210 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 220 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 230 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 240 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 250 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 260 bands="GSM 1900 / UMTS 1900 / UMTS 1700 / LTE 850 / LTE 700 / LTE 1900 / LTE 1700" brand="T-Mobile" cc="us" country="United States of America" operator="T-Mobile USA" status="Operational" 270 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 280 bands="GSM 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Not operational" 290 bands="GSM 1900" brand="nep" cc="us" country="United States of America" operator="NEP Cellcorp Inc." status="Not operational" 300 bands="GSM 1900" brand="Big Sky Mobile" cc="us" country="United States of America" operator="iSmart Mobile, LLC" status="Operational" 310 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 311 bands="GSM 1900" cc="us" country="United States of America" operator="Farmers Wireless" status="Not operational" 320 bands="GSM 850 / GSM 1900 / UMTS" brand="Cellular One" cc="us" country="United States of America" operator="Smith Bagley, Inc." status="Operational" 330 bands="CDMA" brand="Alltel" cc="us" country="United States of America" operator="Allied Wireless Communications Corporation (AWCC)" status="Not operational" 340 bands="GSM 1900" brand="Westlink Communications" cc="us" country="United States of America" operator="High Plains Midwest LLC" status="Not operational" 350 bands="CDMA" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 360 bands="CDMA" brand="Pioneer Cellular" cc="us" country="United States of America" operator="Cellular Network Partnership" status="Operational" 370 bands="GSM 1900 / UMTS 850 / LTE 700" brand="Docomo" cc="us" country="United States of America" operator="NTT Docomo Pacific" status="Operational" 380 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Not operational" 390 bands="GSM 850 / LTE 700 / CDMA" brand="Cellular One of East Texas" cc="us" country="United States of America" operator="TX-11 Acquisition, LLC" status="Operational" 400 bands="GSM 1900 / UMTS 1900 / LTE 700" brand="iConnect" cc="us" country="United States of America" operator="Wave Runner LLC" status="Operational" 410 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 420 bands="GSM 1900 / UMTS 1700" brand="Cincinnati Bell" cc="us" country="United States of America" operator="Cincinnati Bell Wireless" status="Not operational" 430 bands="GSM 1900 / UMTS 1900" brand="GCI" cc="us" country="United States of America" operator="GCI Communications Corp." status="Operational" 440 bands="MVNO" cc="us" country="United States of America" operator="Numerex" status="Operational" 450 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900" brand="Viaero" cc="us" country="United States of America" operator="Viaero Wireless" status="Operational" 460 bands="GSM 1900" brand="NewCore" cc="us" country="United States of America" operator="NewCore Wireless LLC" status="Operational" 470 bands="CDMA2000 1900" brand="Shentel" cc="us" country="United States of America" operator="Shenandoah Telecommunications Company" status="Operational" 480 bands="iDEN" brand="Instant Connect" cc="us" country="United States of America" operator="Wave Runner LLC" status="Operational" 490 bands="GSM 850 / GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Operational" 500 bands="CDMA2000 850 / CDMA2000 1900" brand="Alltel" cc="us" country="United States of America" operator="Public Service Cellular Inc." status="Operational" 510 bands="" brand="Cellcom" cc="us" country="United States of America" operator="Nsighttel Wireless LLC" status="" 520 bands="" brand="TNS" cc="us" country="United States of America" operator="Transaction Network Services" status="" 530 bands="" brand="iWireless" cc="us" country="United States of America" operator="Iowa Wireless Services LLC" status="" 540 bands="GSM 850 / GSM 1900" brand="Phoenix" cc="us" country="United States of America" operator="Oklahoma Western Telephone Company" status="Operational" 550 bands="" cc="us" country="United States of America" operator="Syniverse Technologies" status="" 560 bands="GSM 850" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Not operational" 570 bands="GSM 850 / LTE 700" brand="Cellular One" cc="us" country="United States of America" operator="TX-10, LLC and Central Louisiana Cellular, LLC (MTPCS)" status="Operational" 580 bands="CDMA2000" cc="us" country="United States of America" operator="Inland Cellular Telephone Company" status="Operational" 59 bands="CDMA" brand="Cellular One" cc="bm" country="Bermuda" status="Operational" 590 bands="GSM 850 / GSM 1900" cc="us" country="United States of America" operator="Verizon Wireless" status="" 600 bands="CDMA2000 850 / CDMA2000 1900" brand="Cellcom" cc="us" country="United States of America" operator="New-Cell Inc." status="Operational" 610 bands="GSM 1900" brand="Epic PCS" cc="us" country="United States of America" operator="Elkhart Telephone Co." status="Not operational" 620 bands="" brand="Cellcom" cc="us" country="United States of America" operator="Nsighttel Wireless LLC" status="" 630 bands="LTE 700" brand="miSpot" cc="us" country="United States of America" operator="Agri-Valley Communications" status="Not operational" 640 bands="MVNO" cc="us" country="United States of America" operator="Numerex" status="Operational" 650 bands="MVNO" brand="Jasper" cc="us" country="United States of America" operator="Jasper Technologies" status="Operational" 660 bands="GSM 1900" brand="T-Mobile" cc="us" country="United States of America" status="Not operational" 670 bands="" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="" 680 bands="GSM 850 / GSM 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 690 bands="GSM 1900 / LTE 1900" brand="Limitless Mobile" cc="us" country="United States of America" operator="Limitless Mobile, LLC" status="Not operational" 700 bands="GSM" brand="Bigfoot Cellular" cc="us" country="United States of America" operator="Cross Valiant Cellular Partnership" status="" 710 bands="GSM 850" brand="ASTAC" cc="us" country="United States of America" operator="Arctic Slope Telephone Association Cooperative" status="Operational" 720 bands="" cc="us" country="United States of America" operator="Syniverse Technologies" status="" 730 bands="" brand="U.S. Cellular" cc="us" country="United States of America" operator="U.S. Cellular" status="" 740 bands="LTE 700 / LTE 1700 / LTE 1900" brand="Viaero" cc="us" country="United States of America" operator="Viaero Wireless" status="Operational" 750 bands="CDMA2000 850 / CDMA2000 1900" brand="Appalachian Wireless" cc="us" country="United States of America" operator="East Kentucky Network, LLC" status="Operational" 760 bands="" cc="us" country="United States of America" operator="Lynch 3G Communications Corporation" status="Not operational" 770 bands="GSM 1900 / UMTS 1700 / LTE 1700 / LTE 1900" brand="iWireless" cc="us" country="United States of America" operator="Iowa Wireless Services" status="Operational" 780 bands="iDEN" brand="Dispatch Direct" cc="us" country="United States of America" operator="D. D. Inc." status="Operational" 790 bands="GSM 1900 / UMTS / LTE" brand="BLAZE" cc="us" country="United States of America" operator="PinPoint Communications Inc." status="Operational" 800 bands="GSM 1900" cc="us" country="United States of America" operator="T-Mobile" status="Not operational" 810 bands="1900" cc="us" country="United States of America" operator="LCFR LLC" status="Not operational" 820 bands="" cc="us" country="United States of America" operator="Verizon Wireless" status="" 830 bands="WiMAX" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="Not operational" 840 bands="MVNO" brand="telna Mobile" cc="us" country="United States of America" operator="Telecom North America Mobile, Inc." status="Operational" 850 bands="MVNO" brand="Aeris" cc="us" country="United States of America" operator="Aeris Communications, Inc." status="Operational" 860 bands="CDMA" brand="Five Star Wireless" cc="us" country="United States of America" operator="TX RSA 15B2, LP" status="Operational" 870 bands="GSM 850" brand="PACE" cc="us" country="United States of America" operator="Kaplan Telephone Company" status="Not operational" 880 bands="GSM 850" brand="DTC Wireless" cc="us" country="United States of America" operator="Advantage Cellular Systems, Inc." status="Operational" 890 bands="GSM 850 / GSM 1900" cc="us" country="United States of America" operator="Verizon Wireless" status="" 900 bands="CDMA2000 850 / CDMA2000 1900" brand="Mid-Rivers Wireless" cc="us" country="United States of America" operator="Cable & Communications Corporation" status="Operational" 910 bands="GSM 850" cc="us" country="United States of America" operator="Verizon Wireless" status="" 920 bands="CDMA" cc="us" country="United States of America" operator="James Valley Wireless, LLC" status="Operational" 930 bands="CDMA" cc="us" country="United States of America" operator="Copper Valley Wireless" status="Operational" 940 bands="MVNO" cc="us" country="United States of America" operator="Iris Wireless LLC" status="" 950 bands="GSM 850" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 960 bands="CDMA" brand="STRATA" cc="us" country="United States of America" operator="UBET Wireless" status="Operational" 970 bands="Satellite" cc="us" country="United States of America" operator="Globalstar" status="Operational" 980 bands="CDMA / LTE 700" brand="Peoples Telephone" cc="us" country="United States of America" operator="Texas RSA 7B3" status="Not operational" 990 bands="LTE 700" brand="Evolve Broadband" cc="us" country="United States of America" operator="Worldcall Interconnect Inc." status="Operational" 000-999 311 000 bands="CDMA2000 850 / CDMA2000 1900" brand="West Central Wireless" cc="us" country="United States of America" operator="Mid-Tex Cellular Ltd." status="Operational" 010 bands="CDMA2000 850 / CDMA2000 1900" brand="Chariton Valley" cc="us" country="United States of America" operator="Chariton Valley Communications" status="Operational" 012 bands="CDMA2000 850 / CDMA2000 1900" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Operational" 020 bands="GSM 850" brand="Chariton Valley" cc="us" country="United States of America" operator="Missouri RSA 5 Partnership" status="Operational" 030 bands="GSM 850 / GSM 1900 / UMTS 850" brand="Indigo Wireless" cc="us" country="United States of America" operator="Americell PA 3 Partnership" status="Operational" 040 bands="GSM 850 / GSM 1900 / CDMA 2000 / UMTS" brand="Choice Wireless" cc="us" country="United States of America" operator="Commnet Wireless" status="Operational" 050 bands="CDMA2000 850" cc="us" country="United States of America" operator="Thumb Cellular LP" status="Operational" 060 bands="" cc="us" country="United States of America" operator="Space Data Corporation" status="Operational" 070 bands="GSM 850" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 080 bands="GSM 850 / LTE" brand="Pine Cellular" cc="us" country="United States of America" operator="Pine Telephone Company" status="Operational" 090 bands="GSM 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Operational" 100 bands="CDMA2000" cc="us" country="United States of America" operator="Nex-Tech Wireless" status="Operational" 110 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 120 bands="" brand="iConnect" cc="us" country="United States of America" operator="Wave Runner LLC" status="Operational" 130 bands="LTE" cc="us" country="United States of America" operator="Lightsquared L.P." status="Not operational" 140 bands="CDMA" brand="Bravado Wireless" cc="us" country="United States of America" operator="Cross Telephone Company" status="Operational" 150 bands="GSM 850" cc="us" country="United States of America" operator="Wilkes Cellular" status="Operational" 160 bands="LTE" cc="us" country="United States of America" operator="Lightsquared L.P." status="Not operational" 170 bands="GSM 850" cc="us" country="United States of America" operator="Broadpoint Inc." status="Operational" 180 bands="GSM 850 / UMTS 850 / UMTS 1900" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="Not operational" 190 bands="" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="" 200 bands="" cc="us" country="United States of America" operator="ARINC" status="" 210 bands="GSM 1900" cc="us" country="United States of America" operator="Emery Telcom Wireless" status="Not operational" 220 bands="CDMA" brand="U.S. Cellular" cc="us" country="United States of America" operator="U.S. Cellular" status="Operational" 230 bands="CDMA 850 / CDMA 1900 / LTE 700 / LTE 850 / LTE 1700 / LTE 1900 / TD-LTE 2500" brand="C Spire Wireless" cc="us" country="United States of America" operator="Cellular South Inc." status="Operational" 240 bands="GSM / UMTS 850 / WiMAX" cc="us" country="United States of America" operator="Cordova Wireless" status="Operational" 250 bands="" brand="iConnect" cc="us" country="United States of America" operator="Wave Runner LLC" status="Operational" 260 bands="WiMAX" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="Not operational" 270 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 271 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 272 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 273 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 274 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 275 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 276 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 277 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 278 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 279 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 280 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 281 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 282 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 283 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 284 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 285 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 286 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 287 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 288 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 289 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 290 bands="GSM 1900 / UMTS / LTE" brand="BLAZE" cc="us" country="United States of America" operator="PinPoint Communications Inc." status="Operational" 300 bands="" cc="us" country="United States of America" operator="Nexus Communications, Inc." status="" 310 bands="CDMA2000" brand="NMobile" cc="us" country="United States of America" operator="Leaco Rural Telephone Company Inc." status="Operational" 320 bands="GSM 850 / GSM 1900 / CDMA 2000 / UMTS" brand="Choice Wireless" cc="us" country="United States of America" operator="Commnet Wireless" status="Operational" 330 bands="GSM 1900 / LTE 1700 / WiMAX 3700" brand="Bug Tussel Wireless" cc="us" country="United States of America" operator="Bug Tussel Wireless LLC" status="Operational" 340 bands="CDMA2000 / LTE 850" cc="us" country="United States of America" operator="Illinois Valley Cellular" status="Operational" 350 bands="CDMA2000" brand="Nemont" cc="us" country="United States of America" operator="Sagebrush Cellular, Inc." status="Operational" 360 bands="UMTS 1700" cc="us" country="United States of America" operator="Stelera Wireless" status="Not operational" 370 bands="LTE 1700" brand="GCI Wireless" cc="us" country="United States of America" operator="General Communication Inc." status="Operational" 380 bands="MVNO" cc="us" country="United States of America" operator="New Dimension Wireless Ltd." status="Operational" 390 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 400 bands="" cc="us" country="United States of America" status="" 410 bands="CDMA" brand="Chat Mobility" cc="us" country="United States of America" operator="Iowa RSA No. 2 LP" status="Operational" 420 bands="CDMA" brand="NorthwestCell" cc="us" country="United States of America" operator="Northwest Missouri Cellular LP" status="Operational" 430 bands="CDMA" brand="Chat Mobility" cc="us" country="United States of America" operator="RSA 1 LP" status="" 440 bands="CDMA" cc="us" country="United States of America" operator="Bluegrass Cellular LLC" status="Operational" 450 bands="GSM 1900 / LTE 700" brand="PTCI" cc="us" country="United States of America" operator="Panhandle Telecommunication Systems Inc." status="Operational" 460 bands="DMR" cc="us" country="United States of America" operator="Fisher Wireless Services Inc." status="Not operational" 470 bands="GSM 850 / GSM 1900 / TD-LTE 2500" brand="Viya" cc="us" country="United States of America" operator="Vitelcom Cellular Inc." status="Operational" 480 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Operational" 481 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 482 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 483 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 484 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 485 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 486 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 487 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 488 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 489 bands="LTE 700" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="Not operational" 490 bands="LTE 850 / LTE 1900 / TD-LTE 2500" brand="Sprint Corporation" cc="us" country="United States of America" operator="Sprint" status="Operational" 500 bands="UMTS / LTE 700 / LTE 1700" cc="us" country="United States of America" operator="Mosaic Telecom" status="Not operational" 510 bands="LTE" cc="us" country="United States of America" operator="Lightsquared L.P." status="Not operational" 520 bands="LTE" cc="us" country="United States of America" operator="Lightsquared L.P." status="Not operational" 530 bands="LTE 1900" brand="NewCore" cc="us" country="United States of America" operator="NewCore Wireless LLC" status="Operational" 540 bands="GSM 850" cc="us" country="United States of America" operator="Proximiti Mobility Inc." status="Not operational" 550 bands="GSM 850 / GSM 1900 / CDMA 2000 / UMTS" brand="Choice Wireless" cc="us" country="United States of America" operator="Commnet Midwest LLC" status="Operational" 560 bands="GSM 850" brand="OTZ Cellular" cc="us" country="United States of America" operator="OTZ Communications, Inc." status="Operational" 570 bands="UMTS 1700 / LTE 1700" brand="BendBroadband" cc="us" country="United States of America" operator="Bend Cable Communications LLC" status="Not operational" 580 bands="LTE 700 / LTE 850" brand="U.S. Cellular" cc="us" country="United States of America" operator="U.S. Cellular" status="Operational" 590 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 600 bands="CDMA" brand="Cox Wireless" cc="us" country="United States of America" operator="Cox TMI Wireless LLC" status="Not operational" 610 bands="CDMA" brand="SRT Communications" cc="us" country="United States of America" operator="North Dakota Network Co." status="Not operational" 620 bands="Satellite" cc="us" country="United States of America" operator="TerreStar Networks, Inc." status="Not operational" 630 bands="" brand="C Spire Wireless" cc="us" country="United States of America" operator="Cellular South Inc." status="" 640 bands="LTE 700" brand="Rock Wireless" cc="us" country="United States of America" operator="Standing Rock Telecommunications" status="Operational" 650 bands="CDMA / LTE 700 / WiMAX 3700" brand="United Wireless" cc="us" country="United States of America" operator="United Wireless" status="Operational" 660 bands="MVNO" brand="metroPCS" cc="us" country="United States of America" operator="MetroPCS Wireless Inc." status="Operational" 670 bands="CDMA" brand="Pine Belt Wireless" cc="us" country="United States of America" operator="Pine Belt Cellular Inc." status="Operational" 680 bands="GSM 1900" cc="us" country="United States of America" operator="GreenFly LLC" status="" 690 bands="paging" cc="us" country="United States of America" operator="TeleBEEPER of New Mexico" status="Operational" 700 bands="MVNO" cc="us" country="United States of America" operator="Aspenta International, Inc." status="Operational" 710 bands="" cc="us" country="United States of America" operator="Northeast Wireless Networks LLC" status="" 720 bands="GSM 1900" cc="us" country="United States of America" operator="MainePCS LLC" status="Not operational" 730 bands="GSM 850" cc="us" country="United States of America" operator="Proximiti Mobility Inc." status="" 740 bands="GSM 850" cc="us" country="United States of America" operator="Telalaska Cellular" status="Operational" 750 bands="" brand="ClearTalk" cc="us" country="United States of America" operator="Flat Wireless LLC" status="" 760 bands="" cc="us" country="United States of America" operator="Edigen Inc." status="Not operational" 770 bands="" cc="us" country="United States of America" operator="Altiostar Networks, Inc." status="" 780 bands="" brand="Pioneer Cellular" cc="us" country="United States of America" operator="Cellular Network Partnership" status="Not operational" 790 bands="" cc="us" country="United States of America" operator="Coleman County Telephone Cooperative, Inc." status="" 800 bands="LTE 700" cc="us" country="United States of America" operator="Bluegrass Cellular LLC" status="Operational" 810 bands="LTE 700" cc="us" country="United States of America" operator="Bluegrass Cellular LLC" status="Operational" 820 bands="" cc="us" country="United States of America" operator="Sonus Networks" status="" 830 bands="LTE 700" cc="us" country="United States of America" operator="Thumb Cellular LP" status="Operational" 840 bands="LTE 700" brand="Cellcom" cc="us" country="United States of America" operator="Nsight Spectrum LLC" status="Operational" 850 bands="LTE 700" brand="Cellcom" cc="us" country="United States of America" operator="Nsight Spectrum LLC" status="Operational" 860 bands="LTE 700" brand="STRATA" cc="us" country="United States of America" operator="Uintah Basin Electronic Telecommunications" status="Operational" 870 bands="MVNO" brand="Boost Mobile" cc="us" country="United States of America" operator="Sprint Corporation" status="Operational" 880 bands="" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="" 890 bands="" cc="us" country="United States of America" operator="Globecomm Network Services Corporation" status="" 900 bands="MVNO" cc="us" country="United States of America" operator="GigSky" status="Operational" 910 bands="CDMA / LTE" brand="MobileNation" cc="us" country="United States of America" operator="SI Wireless LLC" status="Operational" 920 bands="" brand="Chariton Valley" cc="us" country="United States of America" operator="Missouri RSA 5 Partnership" status="" 930 bands="LTE 700" cc="us" country="United States of America" operator="Syringa Wireless" status="Not operational" 940 bands="WiMAX" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="Not operational" 950 bands="CDMA / LTE 700" brand="ETC" cc="us" country="United States of America" operator="Enhanced Telecommmunications Corp." status="Operational" 960 bands="MVNO" brand="Lycamobile" cc="us" country="United States of America" operator="Lycamobile USA Inc." status="Operational" 970 bands="LTE 1700" brand="Big River Broadband" cc="us" country="United States of America" operator="Big River Broadband, LLC" status="Operational" 980 bands="" cc="us" country="United States of America" operator="LigTel Communications" status="" 990 bands="LTE 700 / LTE 1700" cc="us" country="United States of America" operator="VTel Wireless" status="Operational" 000-999 312 010 bands="" brand="Chariton Valley" cc="us" country="United States of America" operator="Chariton Valley Communication Corporation, Inc" status="" 020 bands="LTE 700" cc="us" country="United States of America" operator="Infrastructure Networks, LLC" status="Operational" 030 bands="LTE 700" brand="Bravado Wireless" cc="us" country="United States of America" operator="Cross Wireless" status="Operational" 040 bands="LTE 700" cc="us" country="United States of America" operator="Custer Telephone Co-op (CTCI)" status="Operational" 050 bands="LTE 700" cc="us" country="United States of America" operator="Fuego Wireless" status="Not operational" 060 bands="CDMA / GSM" cc="us" country="United States of America" operator="CoverageCo" status="" 070 bands="LTE 700" cc="us" country="United States of America" operator="Adams Networks Inc" status="Operational" 080 bands="UMTS-TDD 700" brand="SyncSouth" cc="us" country="United States of America" operator="South Georgia Regional Information Technology Authority" status="Operational" 090 bands="" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="" 100 bands="" cc="us" country="United States of America" operator="ClearSky Technologies, Inc." status="" 110 bands="LTE" cc="us" country="United States of America" operator="Texas Energy Network LLC" status="Not operational" 120 bands="LTE 700" brand="Appalachian Wireless" cc="us" country="United States of America" operator="East Kentucky Network, LLC" status="Operational" 130 bands="LTE 700" brand="Appalachian Wireless" cc="us" country="United States of America" operator="East Kentucky Network, LLC" status="Operational" 140 bands="CDMA" brand="Revol Wireless" cc="us" country="United States of America" operator="Cleveland Unlimited, Inc." status="Not operational" 150 bands="LTE 700" brand="NorthwestCell" cc="us" country="United States of America" operator="Northwest Missouri Cellular LP" status="Operational" 160 bands="LTE 700" brand="Chat Mobility" cc="us" country="United States of America" operator="RSA1 Limited Partnership" status="Operational" 170 bands="LTE 700" brand="Chat Mobility" cc="us" country="United States of America" operator="Iowa RSA No. 2 LP" status="Operational" 180 bands="" cc="us" country="United States of America" operator="Limiteless Mobile LLC" status="" 190 bands="" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="" 200 bands="MVNO" cc="us" country="United States of America" operator="Voyager Mobility LLC" status="Not operational" 210 bands="MVNO" cc="us" country="United States of America" operator="Aspenta International, Inc." status="Operational" 220 bands="LTE 700" brand="Chariton Valley" cc="us" country="United States of America" operator="Chariton Valley Communication Corporation, Inc." status="Operational" 230 bands="" brand="SRT Communications" cc="us" country="United States of America" operator="North Dakota Network Co." status="Not operational" 240 bands="" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="" 250 bands="" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="" 260 bands="LTE 1900" brand="NewCore" cc="us" country="United States of America" operator="Central LTE Holdings" status="Operational" 270 bands="LTE 700" brand="Pioneer Cellular" cc="us" country="United States of America" operator="Cellular Network Partnership" status="Operational" 280 bands="LTE 700" brand="Pioneer Cellular" cc="us" country="United States of America" operator="Cellular Network Partnership" status="Operational" 290 bands="" brand="STRATA" cc="us" country="United States of America" operator="Uintah Basin Electronic Telecommunications" status="" 300 bands="MVNO" brand="telna Mobile" cc="us" country="United States of America" operator="Telecom North America Mobile, Inc." status="Operational" 310 bands="LTE 700" cc="us" country="United States of America" operator="Clear Stream Communications, LLC" status="Operational" 320 bands="LTE 700" cc="us" country="United States of America" operator="S and R Communications LLC" status="Operational" 330 bands="LTE 700" brand="Nemont" cc="us" country="United States of America" operator="Nemont Communications, Inc." status="Operational" 340 bands="LTE 700" brand="MTA" cc="us" country="United States of America" operator="Matanuska Telephone Association, Inc." status="Operational" 350 bands="LTE 700" cc="us" country="United States of America" operator="Triangle Communication System Inc." status="Operational" 360 bands="" cc="us" country="United States of America" operator="Wes-Tex Telecommunications, Ltd." status="" 370 bands="LTE" brand="Choice Wireless" cc="us" country="United States of America" operator="Commnet Wireless" status="Operational" 380 bands="LTE 700" cc="us" country="United States of America" operator="Copper Valley Wireless" status="Operational" 390 bands="UMTS / LTE" brand="FTC Wireless" cc="us" country="United States of America" operator="FTC Communications LLC" status="Operational" 400 bands="LTE 700" brand="Mid-Rivers Wireless" cc="us" country="United States of America" operator="Mid-Rivers Telephone Cooperative" status="Operational" 410 bands="" cc="us" country="United States of America" operator="Eltopia Communications, LLC" status="" 420 bands="LTE 700" cc="us" country="United States of America" operator="Nex-Tech Wireless" status="Operational" 430 bands="CDMA / LTE 700" cc="us" country="United States of America" operator="Silver Star Communications" status="Operational" 440 bands="2500" cc="us" country="United States of America" operator="Consolidated Telcom" status="" 450 bands="" cc="us" country="United States of America" operator="Cable & Communications Corporation" status="" 460 bands="LTE 700" cc="us" country="United States of America" operator="Ketchikan Public Utilities (KPU)" status="Operational" 470 bands="LTE 700" brand="Carolina West Wireless" cc="us" country="United States of America" operator="Carolina West Wireless" status="Operational" 480 bands="" brand="Nemont" cc="us" country="United States of America" operator="Sagebrush Cellular, Inc." status="" 490 bands="Satellite" cc="us" country="United States of America" operator="TrustComm, Inc." status="" 500 bands="LTE 700" cc="us" country="United States of America" operator="AB Spectrum LLC" status="Not operational" 510 bands="CDMA / LTE" cc="us" country="United States of America" operator="WUE Inc." status="" 520 bands="" cc="us" country="United States of America" operator="ANIN" status="Not operational" 530 bands="" brand="Sprint" cc="us" country="United States of America" operator="Sprint Corporation" status="Operational" 540 bands="" cc="us" country="United States of America" operator="Broadband In Hand LLC" status="Not operational" 550 bands="" cc="us" country="United States of America" operator="Great Plains Communications, Inc." status="" 560 bands="MVNO" cc="us" country="United States of America" operator="NHLT Inc." status="Not operational" 570 bands="CDMA / LTE" brand="Blue Wireless" cc="us" country="United States of America" operator="Buffalo-Lake Erie Wireless Systems Co., LLC" status="Operational" 580 bands="" cc="us" country="United States of America" operator="Morgan, Lewis & Bockius LLP" status="" 590 bands="LTE 2600" brand="NMU" cc="us" country="United States of America" operator="Northern Michigan University" status="Operational" 600 bands="" brand="Nemont" cc="us" country="United States of America" operator="Sagebrush Cellular, Inc." status="" 610 bands="LTE 1900" brand="nTelos" cc="us" country="United States of America" operator="nTelos Licenses, Inc." status="Not operational" 620 bands="MVNO" cc="us" country="United States of America" operator="GlobeTouch Inc." status="Operational" 630 bands="" cc="us" country="United States of America" operator="NetGenuity, Inc." status="" 640 bands="" brand="Nemont" cc="us" country="United States of America" operator="Sagebrush Cellular, Inc." status="Not operational" 650 bands="" cc="us" country="United States of America" operator="365 Wireless LLC" status="" 660 bands="LTE 1900" brand="nTelos" cc="us" country="United States of America" operator="nTelos Wireless" status="Not operational" 670 bands="" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="" 680 bands="" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="" 690 bands="MVNO/MVNE" cc="us" country="United States of America" operator="TGS, LLC" status="Operational" 700 bands="LTE 700" cc="us" country="United States of America" operator="Wireless Partners, LLC" status="Operational" 710 bands="LTE" cc="us" country="United States of America" operator="Great North Woods Wireless LLC" status="Operational" 720 bands="LTE" brand="Southern LINC" cc="us" country="United States of America" operator="Southern Communications Services" status="" 730 bands="CDMA" cc="us" country="United States of America" operator="Triangle Communication System Inc." status="Operational" 740 bands="MVNO" brand="Locus Telecommunications" cc="us" country="United States of America" operator="KDDI America, Inc." status="Operational" 750 bands="" cc="us" country="United States of America" operator="Artemis Networks LLC" status="" 760 bands="" brand="ASTAC" cc="us" country="United States of America" operator="Arctic Slope Telephone Association Cooperative" status="" 770 bands="" brand="Verizon" cc="us" country="United States of America" operator="Verizon Wireless" status="" 780 bands="TD-LTE 2500" cc="us" country="United States of America" operator="Redzone Wireless" status="Operational" 790 bands="" cc="us" country="United States of America" operator="Gila Electronics" status="" 800 bands="MVNO" cc="us" country="United States of America" operator="Cirrus Core Networks" status="" 810 bands="CDMA" brand="BBCP" cc="us" country="United States of America" operator="Bristol Bay Telephone Cooperative" status="Operational" 820 bands="" cc="us" country="United States of America" operator="Santel Communications Cooperative, Inc." status="" 830 bands="WiMAX" cc="us" country="United States of America" operator="Kings County Office of Education" status="Operational" 840 bands="" cc="us" country="United States of America" operator="South Georgia Regional Information Technology Authority" status="" 850 bands="MVNO" cc="us" country="United States of America" operator="Onvoy Spectrum, LLC" status="" 860 bands="CDMA / LTE 1900 / LTE 1700" brand="ClearTalk" cc="us" country="United States of America" operator="Flat Wireless, LLC" status="Operational" 870 bands="MVNO" cc="us" country="United States of America" operator="GigSky Mobile, LLC" status="Operational" 880 bands="" cc="us" country="United States of America" operator="Albemarle County Public Schools" status="" 890 bands="" cc="us" country="United States of America" operator="Circle Gx" status="" 900 bands="CDMA / LTE 1900 / LTE 1700" brand="ClearTalk" cc="us" country="United States of America" operator="Flat West Wireless, LLC" status="Operational" 910 bands="" brand="Appalachian Wireless" cc="us" country="United States of America" operator="East Kentucky Network, LLC" status="" 920 bands="" cc="us" country="United States of America" operator="Northeast Wireless Networks LLC" status="" 930 bands="" cc="us" country="United States of America" operator="Hewlett-Packard Communication Services, LLC" status="" 940 bands="" cc="us" country="United States of America" operator="Webformix" status="Operational" 950 bands="CDMA" cc="us" country="United States of America" operator="Custer Telephone Co-op (CTCI)" status="Operational" 960 bands="" cc="us" country="United States of America" operator="M&A Technology, Inc." status="" 970 bands="" cc="us" country="United States of America" operator="IOSAZ Intellectual Property LLC" status="" 980 bands="" cc="us" country="United States of America" operator="Mark Twain Communications Company" status="" 990 bands="" brand="Premier Broadband" cc="us" country="United States of America" operator="Premier Holdings LLC" status="" 000-999 313 000 bands="" cc="us" country="United States of America" operator="Tennessee Wireless" status="Operational" 010 bands="" brand="Bravado Wireless" cc="us" country="United States of America" operator="Cross Wireless LLC" status="" 020 bands="CDMA" brand="CTC Wireless" cc="us" country="United States of America" operator="Cambridge Telephone Company Inc." status="Operational" 030 bands="CDMA" brand="Snake River PCS" cc="us" country="United States of America" operator="Eagle Telephone System Inc." status="Operational" 040 bands="CDMA" brand="NNTC Wireless" cc="us" country="United States of America" operator="Nucla-Naturita Telephone Company" status="Operational" 050 bands="CDMA" brand="Breakaway Wireless" cc="us" country="United States of America" operator="Manti Tele Communications Company, Inc." status="Operational" 060 bands="" cc="us" country="United States of America" operator="Country Wireless" status="Operational" 070 bands="" cc="us" country="United States of America" operator="Midwest Network Solutions Hub LLC" status="" 080 bands="" cc="us" country="United States of America" operator="Speedwavz LLP" status="Operational" 090 bands="" cc="us" country="United States of America" operator="Vivint Wireless, Inc." status="Operational" 100 bands="LTE 700" brand="FirstNet" cc="us" country="United States of America" operator="700 MHz Public Safety Broadband" status="" 110 cc="us" country="United States of America" 200 bands="" cc="us" country="United States of America" operator="Mercury Network Corporation" status="Operational" 210 bands="" brand="AT&T" cc="us" country="United States of America" operator="AT&T Mobility" status="" 000-999 316 010 bands="iDEN 800" brand="Nextel" cc="us" country="United States of America" operator="Nextel Communications" status="Not operational" 011 bands="iDEN 800" brand="Southern LINC" cc="us" country="United States of America" operator="Southern Communications Services" status="Operational" 000-999 330 000 bands="CDMA 1900" brand="Open Mobile" cc="pr" country="Puerto Rico" operator="PR Wireless" status="Operational" 110 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 700 / LTE 1700" brand="Claro Puerto Rico" cc="pr" country="Puerto Rico" operator="América Móvil" status="Operational" 120 bands="LTE 700" brand="Open Mobile" cc="pr" country="Puerto Rico" operator="PR Wireless" status="Operational" 000-999 334 001 bands="" cc="mx" country="Mexico" operator="Comunicaciones Digitales Del Norte, S.A. de C.V." status="" 010 bands="iDEN 800" brand="AT&T" cc="mx" country="Mexico" operator="AT&T Mexico" status="Operational" 020 bands="TDMA 850 / GSM 1900 / UMTS 850 / LTE 1700" brand="Telcel" cc="mx" country="Mexico" operator="América Móvil" status="Operational" 030 bands="CDMA2000 800 / CDMA2000 1900 / GSM 1900 / UMTS 850 / LTE 1700" brand="movistar" cc="mx" country="Mexico" operator="Movistar - Telefónica Moviles" status="Operational" 040 bands="CDMA2000 800 / CDMA2000 1900" brand="Unefon" cc="mx" country="Mexico" operator="AT&T Mexico" status="Operational" 050 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900" brand="AT&T" cc="mx" country="Mexico" operator="AT&T Mexico" status="Operational" 060 bands="" cc="mx" country="Mexico" operator="Servicios de Acceso Inalambrico, S.A. de C.V." status="" 066 bands="" cc="mx" country="Mexico" operator="Telefonos de México, S.A.B. de C.V." status="" 070 bands="" cc="mx" country="Mexico" operator="Unefon" status="" 080 bands="" cc="mx" country="Mexico" operator="Unefon" status="" 090 bands="UMTS 1700 / LTE 1700" brand="AT&T" cc="mx" country="Mexico" operator="AT&T Mexico" status="Operational" 000-999 338 020 bands="" brand="FLOW" cc="jm" country="Jamaica" operator="LIME (Cable & Wireless)" status="Not operational" 040 bands="LTE" brand="Caricel" cc="jm" country="Jamaica" operator="Symbiote Investment Limited" status="" 050 bands="GSM 900 / GSM 1800 / GSM 1900 / LTE 700" brand="Digicel" cc="tc" country="Turks and Caicos Islands" operator="Digicel (Turks & Caicos) Limited" status="Operational" 070 bands="GSM / UMTS / CDMA" brand="Claro" cc="jm" country="Jamaica" operator="Oceanic Digital Jamaica Limited" status="Not operational" 110 bands="" brand="FLOW" cc="jm" country="Jamaica" operator="Cable & Wireless Communications" status="Operational" 180 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 1700" brand="FLOW" cc="jm" country="Jamaica" operator="Cable & Wireless Communications" status="Operational" 000-999 340 01 bands="GSM 900 / UMTS 2100 / LTE 1800 / LTE 2100" brand="Orange" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="Orange Caraïbe Mobiles" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS / LTE" brand="SFR Caraïbe" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="Outremer Telecom" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS / LTE 1800" brand="Chippie" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="UTS Caraïbe" status="Operational" 08 bands="GSM 900 / GSM 1800 / UMTS" brand="Dauphin" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="Dauphin Telecom" status="Operational" 10 bands="" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="Guadeloupe Téléphone Mobile" status="Not operational" 11 bands="" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="Guyane Téléphone Mobile" status="Not operational" 12 bands="" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="Martinique Téléphone Mobile" status="Not operational" 20 bands="GSM 900 / UMTS 2100" brand="Digicel" country="French Antilles (France) - BL/GF/GP/MF/MQ" operator="DIGICEL Antilles Française Guyane" status="Operational" 00-99 342 600 bands="GSM 1900 / UMTS 850 / LTE 850 / LTE 1900" brand="FLOW" cc="bb" country="Barbados" operator="LIME (formerly known as Cable & Wireless)" status="Operational" 750 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 700 / LTE 1900" brand="Digicel" cc="bb" country="Barbados" operator="Digicel (Barbados) Limited" status="Operational" 820 bands="" cc="bb" country="Barbados" operator="Sunbeach Communications" status="Not operational" 000-999 344 030 bands="GSM 1900" brand="APUA" cc="ag" country="Antigua and Barbuda" operator="Antigua Public Utilities Authority" status="Operational" 050 bands="GSM 900 / GSM 1900 / UMTS 850 / LTE 700" brand="Digicel" cc="ag" country="Antigua and Barbuda" operator="Antigua Wireless Ventures Limited" status="Operational" 920 bands="GSM 850 / GSM 1800 / GSM 1900 / UMTS / LTE 1700" brand="FLOW" cc="ag" country="Antigua and Barbuda" operator="Cable & Wireless Caribbean Cellular (Antigua) Limited" status="Operational" 930 bands="" cc="ag" country="Antigua and Barbuda" operator="AT&T Wireless" status="" 000-999 346 050 bands="GSM 900 / GSM 1800 / UMTS / LTE 1800" brand="Digicel" cc="ky" country="Cayman Islands (United Kingdom)" operator="Digicel Cayman Ltd." status="Operational" 140 bands="GSM 850 / GSM 1900 / UMTS / LTE 700 / LTE 1900" brand="FLOW" cc="ky" country="Cayman Islands (United Kingdom)" operator="Cable & Wireless (Cayman Islands) Limited" status="Operational" 000-999 348 170 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 700 / LTE 1900" brand="FLOW" cc="vg" country="British Virgin Islands" operator="Cable & Wireless" status="Operational" 370 bands="" cc="vg" country="British Virgin Islands" operator="BVI Cable TV Ltd" status="" 570 bands="GSM 900 / GSM 1900 / LTE" brand="CCT Boatphone" cc="vg" country="British Virgin Islands" operator="Caribbean Cellular Telephone" status="Operational" 770 bands="GSM 1800 / GSM 1900 / UMTS / LTE 700" brand="Digicel" cc="vg" country="British Virgin Islands" operator="Digicel (BVI) Limited" status="Operational" 000-999 350 00 bands="GSM 1900 / UMTS 850 / LTE 850" brand="CellOne" cc="bm" country="Bermuda" operator="Bermuda Digital Communications Ltd." status="Operational" 01 bands="GSM 1900" brand="Digicel Bermuda" cc="bm" country="Bermuda" operator="Telecommunications (Bermuda & West Indies) Ltd" status="Reserved" 02 bands="GSM 1900 / UMTS" brand="Mobility" cc="bm" country="Bermuda" operator="M3 Wireless" status="Operational" 05 bands="" cc="bm" country="Bermuda" operator="Telecom Networks" status="" 11 bands="" cc="bm" country="Bermuda" operator="Deltronics" status="" 00-99 352 030 bands="GSM 900 / GSM 1800" brand="Digicel" cc="gd" country="Grenada" operator="Digicel Grenada Ltd." status="Operational" 110 bands="GSM 850" brand="FLOW" cc="gd" country="Grenada" operator="Cable & Wireless Grenada Ltd." status="Operational" 000-999 354 860 bands="GSM 850" brand="FLOW" cc="ms" country="Montserrat (United Kingdom)" operator="Cable & Wireless" status="Operational" 000-999 356 050 bands="GSM 900 / GSM 1800" brand="Digicel" cc="kn" country="Saint Kitts and Nevis" operator="Wireless Ventures (St Kitts-Nevis) Limited" status="Operational" 070 brand="Chippie" cc="kn" country="Saint Kitts and Nevis" operator="UTS" status="Operational" 110 bands="GSM 850 / GSM 1900 / LTE 700" brand="FLOW" cc="kn" country="Saint Kitts and Nevis" operator="Cable & Wireless St. Kitts & Nevis Ltd" status="Operational" 000-999 358 110 bands="GSM 850 / LTE 700" brand="FLOW" cc="lc" country="Saint Lucia" operator="Cable & Wireless" status="Operational" 000-999 360 050 bands="GSM 900 / GSM 1800 / GSM 1900" brand="Digicel" cc="vc" country="Saint Vincent and the Grenadines" operator="Digicel (St. Vincent and the Grenadines) Limited" status="Operational" 100 bands="GSM 850" brand="Cingular Wireless" cc="vc" country="Saint Vincent and the Grenadines" status="" 110 bands="GSM 850" brand="FLOW" cc="vc" country="Saint Vincent and the Grenadines" operator="Cable & Wireless (St. Vincent & the Grenadines) Ltd" status="Operational" 000-999 362 31 bands="GSM" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="Eutel N.V." status="" 33 bands="GSM" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="WICC N.V." status="" 51 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Telcell" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="Telcell N.V." status="Operational" 54 bands="GSM 900 / GSM 1800" brand="ECC" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="East Caribbean Cellular" status="Operational" 59 bands="GSM 900 / GSM 1800" brand="Chippie" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="United Telecommunication Service N.V. (UTS)" status="Operational" 60 bands="UMTS 2100 / LTE 1800" brand="Chippie" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="United Telecommunication Service N.V. (UTS)" status="Operational" 63 bands="" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="CSC N.V." status="" 68 bands="UMTS 2100 / LTE 1800" brand="Digicel" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="Curaçao Telecom N.V." status="Operational" 69 bands="GSM 900 / GSM 1800" brand="Digicel" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="Curaçao Telecom N.V." status="Operational" 74 bands="" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="PCS N.V." status="" 76 bands="GSM 900 / UMTS" brand="Digicel" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="Antiliano Por N.V." status="Operational" 78 bands="UMTS 900 / LTE 1800" brand="Telbo" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="Telefonia Bonairiano N.V." status="Operational" 91 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 1800" brand="Chippie" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="United Telecommunication Service N.V. (UTS)" status="Operational" 94 bands="TDMA PCS" brand="Bayòs" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="Bòbò Frus N.V." status="Operational" 95 bands="CDMA2000 850" brand="MIO" country="Former Netherlands Antilles (Kingdom of the Netherlands) - BQ/CW/SX" operator="E.O.C.G. Wireless" status="Not operational" 00-99 363 01 bands="GSM 900 / GSM 1800 / GSM 1900 / UMTS 2100 / LTE 1800 / TDMA 800" brand="SETAR" cc="aw" country="Aruba (Kingdom of the Netherlands)" operator="Servicio di Telecomunicacion di Aruba" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Digicel" cc="aw" country="Aruba (Kingdom of the Netherlands)" operator="Digicel Aruba" status="Operational" 00-99 364 39 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 700" brand="BTC" cc="bs" country="Bahamas" operator="The Bahamas Telecommunications Company Ltd (BaTelCo)" status="Operational" 49 bands="LTE 700 / LTE AWS" brand="Aliv" cc="bs" country="Bahamas" operator="Cable Bahamas Ltd" status="Operational" 00-99 365 010 bands="" cc="ai" country="Anguilla" operator="Weblinks Limited" status="Operational" 840 bands="GSM 850 / UMTS / LTE 700" brand="FLOW" cc="ai" country="Anguilla" operator="Cable & Wireless" status="Operational" 000-999 366 020 bands="GSM 900 / GSM 1900 / UMTS" brand="Digicel" cc="dm" country="Dominica" operator="Digicel Group Limited" status="Operational" 110 bands="GSM 850 / UMTS / LTE 700" brand="FLOW" cc="dm" country="Dominica" operator="Cable & Wireless" status="Operational" 000-999 368 01 bands="GSM 900 / GSM 850 / UMTS 900" brand="CUBACEL" cc="cu" country="Cuba" operator="Empresa de Telecomunicaciones de Cuba, SA" status="Operational" 00-99 370 01 bands="GSM 900 / GSM 1800 / GSM 1900 / UMTS 900 / LTE 1800" brand="Altice" cc="do" country="Dominican Republic" operator="Altice Group" status="Operational" 02 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 1700" brand="Claro" cc="do" country="Dominican Republic" operator="Compañía Dominicana de Teléfonos" status="Operational" 03 bands="AMPS / CDMA 850" brand="Altice" cc="do" country="Dominican Republic" operator="Altice Group" status="Operational" 04 bands="CDMA 1900 / GSM 1900" brand="Viva" cc="do" country="Dominican Republic" operator="Trilogy Dominicana, S.A." status="Operational" 05 bands="TD-LTE 2600" brand="Wind" cc="do" country="Dominican Republic" operator="WIND Telecom, S.A" status="Operational" 00-99 372 01 bands="GSM 850" brand="Voila" cc="ht" country="Haiti" operator="Communication Cellulaire d'Haiti S.A." status="Not operational" 02 bands="GSM 1800" brand="Digicel" cc="ht" country="Haiti" operator="Unigestion Holding S.A." status="Operational" 03 bands="GSM 900 / GSM 1800 / UTMS 2100" brand="Natcom" cc="ht" country="Haiti" operator="NATCOM S.A." status="Operational" 00-99 374 12 bands="GSM 850 / GSM 1900 / UMTS 1900 / LTE 1900 / TD-LTE 2600" brand="bmobile" cc="tt" country="Trinidad and Tobago" operator="TSTT" status="Operational" 130 bands="GSM 850 / GSM 1900 / UMTS 1900" brand="Digicel" cc="tt" country="Trinidad and Tobago" operator="Digicel (Trinidad & Tobago) Limited" status="Operational" 140 bands="CDMA" cc="tt" country="Trinidad and Tobago" operator="LaqTel Ltd." status="Not operational" 00-99 376 350 bands="GSM 850 / LTE 700" brand="FLOW" cc="tc" country="Turks and Caicos Islands" operator="Cable & Wireless West Indies Ltd (Turks & Caicos)" status="Operational" 352 bands="UMTS 850" brand="FLOW" cc="tc" country="Turks and Caicos Islands" operator="Cable & Wireless West Indies Ltd (Turks & Caicos)" status="Operational" 360 bands="" brand="FLOW" cc="tc" country="Turks and Caicos Islands" operator="Cable & Wireless West Indies Ltd (Turks & Caicos)" status="" 000-999 400 01 bands="GSM 900 / GSM 1800/ UMTS 2100 / LTE 1800" brand="Azercell" cc="az" country="Azerbaijan" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Bakcell" cc="az" country="Azerbaijan" status="Operational" 03 bands="CDMA 450" brand="FONEX" cc="az" country="Azerbaijan" operator="CATEL" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Nar Mobile" cc="az" country="Azerbaijan" operator="Azerfon" status="Operational" 05 bands="TETRA?" cc="az" country="Azerbaijan" operator="Special State Protection Service of the Republic of Azerbaijan" status="" 06 bands="CDMA 800" brand="Naxtel" cc="az" country="Azerbaijan" operator="Nakhtel LLC" status="Operational" 00-99 401 01 bands="GSM 900 / GSM 1800 / LTE 800 / LTE 1800 / LTE 2100" brand="Beeline" cc="kz" country="Kazakhstan" operator="KaR-Tel LLP" status="Operational" 02 bands="GSM 900 / GSM 1800 / LTE 800 / LTE 1800" brand="Kcell" cc="kz" country="Kazakhstan" operator="Kcell JSC" status="Operational" 07 bands="UMTS 850 / GSM 1800 / LTE 1800" brand="Altel" cc="kz" country="Kazakhstan" operator="Altel" status="Operational" 08 bands="CDMA2000 800 / CDMA2000 450" brand="Kazakhtelecom" cc="kz" country="Kazakhstan" status="Operational" 77 bands="GSM 900 / GSM 1800 / UMTS 900" brand="Tele2.kz" cc="kz" country="Kazakhstan" operator="MTS" status="Operational" 00-99 402 11 bands="GSM 900 / UMTS 850 / UMTS 2100 / LTE 1800" brand="B-Mobile" cc="bt" country="Bhutan" operator="B-Mobile / Bhutan Telecom Ltd." status="Operational" 77 bands="GSM 900 / GSM 1800 / UMTS / LTE 700" brand="TashiCell" cc="bt" country="Bhutan" operator="Tashi InfoComm Limited" status="Operational" 00-99 404 01 bands="GSM 900" brand="Vodafone India" cc="in" country="India" operator="Haryana" status="Operational" 02 bands="GSM 900" brand="AirTel" cc="in" country="India" operator="Punjab" status="Operational" 03 bands="GSM 900" brand="AirTel" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 04 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Delhi & NCR" status="Operational" 05 bands="GSM 900" brand="Vodafone India" cc="in" country="India" operator="Gujarat" status="Operational" 07 bands="GSM 900" brand="IDEA" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 09 bands="GSM 900" brand="Reliance" cc="in" country="India" operator="Assam" status="Operational" 10 bands="GSM 900" brand="AirTel" cc="in" country="India" operator="Delhi & NCR" status="Operational" 11 bands="GSM 900 / GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Delhi & NCR" status="Operational" 12 bands="GSM 900" brand="IDEA" cc="in" country="India" operator="Haryana" status="Operational" 13 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 14 bands="GSM 900 / GSM 1800" brand="IDEA" cc="in" country="India" operator="Punjab" status="Operational" 15 bands="GSM 900" brand="Vodafone India" cc="in" country="India" operator="Uttar Pradesh (East)" status="Operational" 16 bands="GSM 900" brand="Airtel" cc="in" country="India" operator="North East" status="Operational" 17 bands="GSM 900 / GSM 1800" brand="AIRCEL" cc="in" country="India" operator="West Bengal" status="Operational" 18 bands="GSM 900" brand="Reliance" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 19 bands="GSM 900 / GSM 1800" brand="IDEA" cc="in" country="India" operator="Kerala" status="Operational" 20 bands="GSM 900 / UMTS 2100" brand="Vodafone India" cc="in" country="India" operator="Mumbai" status="Operational" 21 bands="GSM 900" brand="Loop Mobile" cc="in" country="India" operator="Mumbai" status="Operational" 22 bands="GSM 900" brand="IDEA" cc="in" country="India" operator="Maharashtra & Goa" status="Operational" 24 bands="GSM 900" brand="IDEA" cc="in" country="India" operator="Gujarat" status="Operational" 25 bands="GSM 900 / GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Bihar" status="Operational" 27 bands="GSM 900" brand="Vodafone India" cc="in" country="India" operator="Maharashtra & Goa" status="Operational" 28 bands="GSM 900" brand="AIRCEL" cc="in" country="India" operator="Orissa" status="Operational" 29 bands="GSM 900" brand="AIRCEL" cc="in" country="India" operator="Assam" status="Operational" 30 bands="GSM 900 / GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Kolkata" status="Operational" 31 bands="GSM 900" brand="AirTel" cc="in" country="India" operator="Kolkata" status="Operational" 34 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Haryana" status="Operational" 36 bands="GSM 900" brand="Reliance" cc="in" country="India" operator="Bihar & Jharkhand" status="Operational" 37 bands="GSM 900 / UMTS 2100" brand="Aircel" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 38 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Assam" status="Operational" 40 bands="" brand="AirTel" cc="in" country="India" operator="Chennai" status="Operational" 41 bands="GSM 900" brand="Aircel" cc="in" country="India" operator="Chennai" status="Operational" 42 bands="GSM 900" brand="Aircel" cc="in" country="India" operator="Tamil Nadu" status="Operational" 43 bands="GSM 900" brand="Vodafone India" cc="in" country="India" operator="Tamil Nadu" status="Operational" 44 bands="GSM 900 / LTE 1800" brand="IDEA" cc="in" country="India" operator="Karnataka" status="Operational" 45 bands="GSM / TD-LTE 2300" brand="Airtel" cc="in" country="India" operator="Karnataka" status="Operational" 46 bands="GSM 900" brand="Vodafone India" cc="in" country="India" operator="Kerala" status="Operational" 48 bands="GSM 900" brand="Dishnet Wireless" cc="in" country="India" operator="" status="Operational" 49 bands="GSM 900" brand="Airtel" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 50 bands="GSM 900" brand="Reliance" cc="in" country="India" operator="North East" status="Operational" 51 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 52 bands="GSM 900" brand="Reliance" cc="in" country="India" operator="Orissa" status="Operational" 53 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Punjab" status="Operational" 54 bands="GSM 900 / UTMS 2100" brand="cellone" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 55 bands="GSM 900 / UTMS 2100" brand="cellone" cc="in" country="India" operator="Uttar Pradesh (East)" status="Operational" 56 bands="GSM 900" brand="IDEA" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 57 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Gujarat" status="Operational" 58 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Madhya Pradesh & Chhattisgarh" status="Operational" 59 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Rajasthan" status="Operational" 60 bands="GSM 900" brand="Vodafone India" cc="in" country="India" operator="Rajasthan" status="Operational" 62 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 64 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Chennai" status="Operational" 66 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Maharashtra & Goa" status="Operational" 67 bands="GSM 900 / UMTS 2100" brand="Reliance" cc="in" country="India" operator="Madhya Pradesh & Chhattisgarh" status="Operational" 68 bands="GSM 900 / UMTS 2100" brand="DOLPHIN" cc="in" country="India" operator="Delhi & NCR" status="Operational" 69 bands="GSM 900 / UMTS 2100" brand="DOLPHIN" cc="in" country="India" operator="Mumbai" status="Operational" 70 bands="" brand="AirTel" cc="in" country="India" operator="Rajasthan" status="Operational" 71 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Karnataka (Bangalore)" status="Operational" 72 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Kerala" status="Operational" 73 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 74 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="West Bengal" status="Operational" 75 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Bihar" status="Operational" 76 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Orissa" status="Operational" 77 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="North East" status="Operational" 78 bands="GSM 900 / UMTS 2100" brand="IDEA" cc="in" country="India" operator="Madhya Pradesh & Chattishgarh" status="Operational" 79 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Andaman Nicobar" status="Operational" 80 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Tamil Nadu" status="Operational" 81 bands="GSM 900 / UMTS 2100" brand="cellone" cc="in" country="India" operator="Kolkata" status="Operational" 82 bands="" brand="IDEA" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 83 bands="GSM 1800" brand="Reliance" cc="in" country="India" operator="Kolkata" status="Operational" 84 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Chennai" status="Operational" 85 bands="GSM 1800" brand="Reliance" cc="in" country="India" operator="West Bengal" status="Operational" 86 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Vodafone India" cc="in" country="India" operator="Karnataka" status="Operational" 87 bands="" brand="IDEA" cc="in" country="India" operator="Rajasthan" status="Operational" 88 bands="" brand="Vodafone India" cc="in" country="India" operator="Vodafone Punjab" status="Operational" 89 bands="" brand="IDEA" cc="in" country="India" operator="Uttar Pradesh (East)" status="Operational" 90 bands="GSM 1800" brand="AirTel" cc="in" country="India" operator="Maharashtra" status="Operational" 91 bands="GSM 900" brand="AIRCEL" cc="in" country="India" operator="Kolkata" status="Operational" 92 bands="GSM 1800 / UMTS 2100" brand="AirTel" cc="in" country="India" operator="Mumbai" status="Operational" 93 bands="GSM 1800" brand="AirTel" cc="in" country="India" operator="Madhya Pradesh" status="Operational" 94 bands="" brand="AirTel" cc="in" country="India" operator="Tamil Nadu" status="Operational" 95 bands="GSM 1800" brand="AirTel" cc="in" country="India" operator="Kerala" status="Operational" 96 bands="GSM 1800" brand="AirTel" cc="in" country="India" operator="Haryana" status="Operational" 97 bands="" brand="AirTel" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 98 bands="" brand="AirTel" cc="in" country="India" operator="Gujarat" status="Operational" 00-99 405 01 bands="GSM 1800" brand="Reliance" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 025 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 026 bands="CDMA 2000" brand="TATA DOCOMO" cc="in" country="India" operator="Assam" status="Operational" 027 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="Bihar/Jharkhand" status="Operational" 028 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="Chennai" status="Operational" 029 bands="CDMA 2000" brand="TATA DOCOMO" cc="in" country="India" operator="Delhi" status="Operational" 03 bands="GSM 1800" brand="Reliance" cc="in" country="India" operator="Bihar" status="Operational" 030 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Gujarat" status="Operational" 031 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Haryana" status="Operational" 032 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 033 bands="CDMA 2000" brand="TATA DOCOMO" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 034 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Karnataka" status="Operational" 035 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Kerala" status="Operational" 036 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="Kolkata" status="Operational" 037 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Maharashtra & Goa" status="Operational" 038 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Madhya Pradesh" status="Operational" 039 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="Mumbai" status="Operational" 04 bands="GSM 1800" brand="Reliance" cc="in" country="India" operator="Chennai" status="Operational" 041 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="Orissa" status="Operational" 042 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Punjab" status="Operational" 043 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Rajasthan" status="Operational" 044 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="Tamil Nadu including Chennai" status="Operational" 045 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="Uttar Pradesh (E)" status="Operational" 046 bands="CDMA 2000 / GSM 1800 / UMTS 2100" brand="TATA DOCOMO" cc="in" country="India" operator="Uttar Pradesh (W) & Uttarakhand" status="Operational" 047 bands="CDMA 2000 / GSM 1800" brand="TATA DOCOMO" cc="in" country="India" operator="West Bengal" status="Operational" 05 bands="GSM 1800" brand="Reliance" cc="in" country="India" operator="Delhi & NCR" status="Operational" 06 bands="GSM 1800" brand="Reliance" cc="in" country="India" operator="Gujarat" status="Operational" 07 bands="GSM" brand="Reliance" cc="in" country="India" operator="Haryana" status="Operational" 08 bands="GSM" brand="Reliance" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 09 bands="GSM 1800 / UMTS 2100" brand="Reliance" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 10 bands="GSM" brand="Reliance" cc="in" country="India" operator="Karnataka" status="Operational" 11 bands="GSM" brand="Reliance" cc="in" country="India" operator="Kerala" status="Operational" 12 bands="GSM" brand="Reliance" cc="in" country="India" operator="Kolkata" status="Operational" 13 bands="GSM" brand="Reliance" cc="in" country="India" operator="Maharashtra & Goa" status="Operational" 14 bands="GSM" brand="Reliance" cc="in" country="India" operator="Madhya Pradesh" status="Operational" 15 bands="GSM 1800 / UMTS 2100" brand="Reliance" cc="in" country="India" operator="Mumbai" status="Operational" 17 bands="GSM" brand="Reliance" cc="in" country="India" operator="Orissa" status="Operational" 18 bands="GSM" brand="Reliance" cc="in" country="India" operator="Punjab" status="Operational" 19 bands="GSM" brand="Reliance" cc="in" country="India" operator="Rajasthan" status="Operational" 20 bands="GSM" brand="Reliance" cc="in" country="India" operator="Tamil Nadu" status="Operational" 21 bands="GSM" brand="Reliance" cc="in" country="India" operator="Uttar Pradesh (East)" status="Operational" 22 bands="GSM" brand="Reliance" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 23 bands="GSM" brand="Reliance" cc="in" country="India" operator="West Bengal" status="Operational" 51 bands="GSM 900" brand="AirTel" cc="in" country="India" operator="West Bengal" status="Operational" 52 bands="GSM 900" brand="AirTel" cc="in" country="India" operator="Bihar & Jharkhand" status="Operational" 53 bands="GSM" brand="AirTel" cc="in" country="India" operator="Orissa" status="Operational" 54 bands="GSM 900" brand="AirTel" cc="in" country="India" operator="Uttar Pradesh (East)" status="Operational" 55 bands="GSM 900 / UTMS 2100" brand="Airtel" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 56 bands="GSM 900 / GSM 1800" brand="AirTel" cc="in" country="India" operator="Assam" status="Operational" 66 bands="GSM 900 / GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 67 bands="" brand="Vodafone India" cc="in" country="India" operator="West Bengal" status="Operational" 70 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Bihar & Jharkhand" status="Operational" 750 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 751 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Assam" status="Operational" 752 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Bihar & Jharkhand" status="Operational" 753 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Orissa" status="Operational" 754 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 755 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="North East" status="Operational" 756 bands="GSM 1800" brand="Vodafone India" cc="in" country="India" operator="Madhya Pradesh & Chhattisgarh" status="Operational" 799 bands="GSM 900 / GSM 1800" brand="IDEA" cc="in" country="India" operator="Mumbai" status="Operational" 800 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Delhi & NCR" status="Operational" 801 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 802 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Gujarat" status="Not operational" 803 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Karnataka" status="Operational" 804 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Maharashtra & Goa" status="Operational" 805 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Mumbai" status="Operational" 806 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Rajasthan" status="Operational" 807 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Haryana" status="Not operational" 808 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Madhya Pradesh" status="Not operational" 809 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Kerala" status="Operational" 810 bands="GSM 1800" brand="AIRCEL" cc="in" country="India" operator="Uttar Pradesh (East)" status="Operational" 811 bands="GSM" brand="AIRCEL" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 812 bands="GSM" brand="AIRCEL" cc="in" country="India" operator="Punjab" status="Not operational" 818 bands="GSM" brand="Uninor" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 819 bands="GSM" brand="Uninor" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 820 bands="GSM 1800" brand="Uninor" cc="in" country="India" operator="Karnataka" status="Operational" 821 bands="GSM 1800" brand="Uninor" cc="in" country="India" operator="Kerala" status="Operational" 822 bands="GSM" brand="Uninor" cc="in" country="India" operator="Kolkata" status="Operational" 824 bands="GSM 1800" brand="Videocon Datacom" cc="in" country="India" operator="Assam" status="Reserved" 827 bands="GSM 1800" brand="Videocon Datacom" cc="in" country="India" operator="Gujarat" status="Operational" 834 bands="GSM 1800" brand="Videocon Datacom" cc="in" country="India" operator="Madhya Pradesh" status="Reserved" 840 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="West Bengal" status="Operational" 844 bands="GSM" brand="Uninor" cc="in" country="India" operator="Delhi & NCR" status="Not operational" 845 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Assam" status="Operational" 846 bands="GSM 1800 / UTMS 2100" brand="IDEA" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 847 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Karnataka" status="Operational" 848 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Kolkata" status="Operational" 849 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="North East" status="Operational" 850 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Orissa" status="Operational" 851 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Punjab" status="Operational" 852 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Tamil Nadu" status="Operational" 853 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="West Bengal" status="Operational" 854 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Andhra Pradesh" status="Operational" 855 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Assam" status="Operational" 856 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Bihar" status="Operational" 857 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Gujarat" status="Operational" 858 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Haryana" status="Operational" 859 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Himachal Pradesh" status="Operational" 860 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Jammu & Kashmir" status="Operational" 861 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Karnataka" status="Operational" 862 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Kerala" status="Operational" 863 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Madhya Pradesh" status="Operational" 864 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Maharashtra" status="Operational" 865 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="North East" status="Operational" 866 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Orissa" status="Operational" 867 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Punjab" status="Operational" 868 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Rajasthan" status="Operational" 869 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Tamil Nadu (incl. Chennai)" status="Operational" 870 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Uttar Pradesh (West)" status="Operational" 871 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Uttar Pradesh (East)" status="Operational" 872 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Delhi" status="Operational" 873 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Kolkata" status="Operational" 874 bands="LTE 850 / LTE 1800 / TD-LTE 2300" brand="Jio" cc="in" country="India" operator="Mumbai" status="Operational" 875 bands="GSM 1800" brand="Uninor" cc="in" country="India" operator="Assam" status="Reserved" 880 bands="GSM 1800" brand="Uninor" cc="in" country="India" operator="West Bengal" status="Operational" 881 bands="GSM 1800" brand="S Tel" cc="in" country="India" operator="Assam" status="Reserved" 908 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Operational" 909 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Delhi" status="Operational" 910 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Haryana" status="Operational" 911 bands="GSM 1800" brand="IDEA" cc="in" country="India" operator="Maharashtra" status="Operational" 912 bands="GSM 1800" brand="Etisalat DB(cheers)" cc="in" country="India" operator="Andhra Pradesh and Telangana" status="Not operational" 913 bands="GSM 1800" brand="Etisalat DB(cheers)" cc="in" country="India" operator="Delhi & NCR" status="Not operational" 914 bands="GSM 1800" brand="Etisalat DB(cheers)" cc="in" country="India" operator="Gujarat" status="Not operational" 917 bands="GSM 1800" brand="Etisalat DB(cheers)" cc="in" country="India" operator="Kerala" status="Not operational" 927 bands="" brand="Uninor" cc="in" country="India" operator="Gujarat" status="Operational" 929 bands="GSM 1800" brand="Uninor" cc="in" country="India" operator="Maharashtra" status="Operational" 00-99 410 01 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Jazz" cc="pk" country="Pakistan" operator="Mobilink-PMCL" status="Operational" 02 bands="CDMA2000 1900" brand="PTCL" cc="pk" country="Pakistan" operator="PTCL" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="Ufone" cc="pk" country="Pakistan" operator="Pakistan Telecommunication Mobile Ltd" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Zong" cc="pk" country="Pakistan" operator="China Mobile" status="Operational" 05 bands="GSM 900 / GSM 1800" brand="SCO Mobile" cc="pk" country="Pakistan" operator="SCO Mobile Ltd" status="Operational" 06 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 850" brand="Telenor" cc="pk" country="Pakistan" operator="Telenor Pakistan" status="Operational" 07 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Jazz" cc="pk" country="Pakistan" operator="WaridTel" status="Operational" 08 bands="GSM 900 / GSM 1800" brand="SCO Mobile" cc="pk" country="Pakistan" operator="SCO Mobile Ltd" status="Operational" 00-99 412 01 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="AWCC" cc="af" country="Afghanistan" operator="Afghan Wireless Communication Company" status="Operational" 20 bands="GSM 900 / UMTS" brand="Roshan" cc="af" country="Afghanistan" operator="Telecom Development Company Afghanistan Ltd." status="Operational" 40 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="MTN" cc="af" country="Afghanistan" operator="MTN Group Afghanistan" status="Operational" 50 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Etisalat" cc="af" country="Afghanistan" operator="Etisalat Afghanistan" status="Operational" 55 bands="CDMA 800" brand="WASEL" cc="af" country="Afghanistan" operator="WASEL Afghanistan" status="Operational" 80 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Salaam" cc="af" country="Afghanistan" operator="Afghan Telecom" status="Operational" 88 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Salaam" cc="af" country="Afghanistan" operator="Afghan Telecom" status="Operational" 00-99 413 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 900 / LTE 1800" brand="Mobitel" cc="lk" country="Sri Lanka" operator="Mobitel (Pvt) Ltd" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Dialog" cc="lk" country="Sri Lanka" operator="Dialog Axiata PLC" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Etisalat" cc="lk" country="Sri Lanka" operator="Etisalat Lanka (Pvt) Ltd" status="Operational" 04 bands="CDMA / WiMAX / TD-LTE 2300" brand="Lanka Bell" cc="lk" country="Sri Lanka" operator="Lanka Bell Ltd" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Airtel" cc="lk" country="Sri Lanka" operator="Bharti Airtel Lanka (Pvt) Ltd" status="Operational" 08 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Hutch" cc="lk" country="Sri Lanka" operator="Hutchison Telecommunications Lanka (Pvt) Ltd" status="Operational" 11 bands="CDMA / WiMAX / TD-LTE 2300" brand="Dialog" cc="lk" country="Sri Lanka" operator="Dialog Broadband Networks (Pvt) Ltd" status="Operational" 12 bands="CDMA / TD-LTE 2600" brand="SLT" cc="lk" country="Sri Lanka" operator="Sri Lanka Telecom" status="Operational" 13 bands="TD-LTE 2300" brand="Lanka Bell" cc="lk" country="Sri Lanka" operator="Lanka Bell Ltd" status="Operational" 00-99 414 00 bands="" brand="MPT" cc="mm" country="Myanmar" operator="Myanmar Posts and Telecommunications" status="" 01 bands="GSM 900 / UMTS 2100 / LTE 1800 / LTE 2100" brand="MPT" cc="mm" country="Myanmar" operator="Myanmar Posts and Telecommunications" status="Operational" 02 bands="" brand="MPT" cc="mm" country="Myanmar" operator="Myanmar Posts and Telecommunications" status="" 03 bands="CDMA 800" brand="CDMA800" cc="mm" country="Myanmar" operator="Myanmar Economic Corporation" status="Operational" 04 bands="" brand="MPT" cc="mm" country="Myanmar" operator="Myanmar Posts and Telecommunications" status="" 05 bands="UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2100" brand="Ooredoo" cc="mm" country="Myanmar" operator="Ooredoo Myanmar" status="Operational" 06 bands="GSM 900 / UMTS 2100 / LTE 1800 / LTE 2100" brand="Telenor" cc="mm" country="Myanmar" operator="Telenor Myanmar" status="Operational" 09 bands="" brand="MNTC" cc="mm" country="Myanmar" operator="Myanmar National Tele & Communication Co., Ltd" status="" 00-99 415 01 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Alfa" cc="lb" country="Lebanon" operator="MIC 1" status="Operational" 03 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="Touch" cc="lb" country="Lebanon" operator="MIC 2" status="Operational" 05 bands="GSM 900" brand="Ogero Mobile" cc="lb" country="Lebanon" operator="Ogero Telecom" status="Operational" 00-99 416 01 bands="GSM 900 / LTE 1800" brand="zain JO" cc="jo" country="Jordan" operator="Jordan Mobile Telephone Services" status="Operational" 02 bands="iDEN 800" brand="XPress Telecom" cc="jo" country="Jordan" operator="XPress Telecom" status="Not operational" 03 bands="GSM 1800 / LTE 1800 / LTE 3500" brand="Umniah" cc="jo" country="Jordan" operator="Umniah Mobile Company" status="Operational" 77 bands="GSM 900 / LTE 1800" brand="Orange" cc="jo" country="Jordan" operator="Petra Jordanian Mobile Telecommunications Company (MobileCom)" status="Operational" 00-99 417 01 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Syriatel" cc="sy" country="Syria" operator="Syriatel Mobile Telecom" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="MTN" cc="sy" country="Syria" operator="MTN Syria" status="Operational" 09 bands="" cc="sy" country="Syria" operator="Syrian Telecom" status="" 00-99 418 00 bands="GSM 900" brand="Asia Cell" cc="iq" country="Iraq" operator="Asia Cell Telecommunications Company" status="Operational" 05 bands="GSM 900" brand="Asia Cell" cc="iq" country="Iraq" operator="Asia Cell Telecommunications Company" status="Operational" 08 bands="GSM 900" brand="SanaTel" cc="iq" country="Iraq" status="Operational" 20 bands="GSM 900 / GSM 1800" brand="Zain" cc="iq" country="Iraq" operator="Zain Iraq" status="Operational" 30 bands="GSM 900" brand="Zain" cc="iq" country="Iraq" operator="Zain Iraq" status="Operational" 40 bands="GSM 900" brand="Korek" cc="iq" country="Iraq" operator="Telecom Ltd" status="Operational" 45 bands="UMTS" brand="Mobitel" cc="iq" country="Iraq" operator="Mobitel Co. Ltd." status="Operational" 62 bands="CDMA 800 / CDMA 1900" brand="Itisaluna" cc="iq" country="Iraq" operator="Itisaluna Wireless CO." status="Operational" 92 bands="CDMA" brand="Omnnea" cc="iq" country="Iraq" operator="Omnnea Wireless" status="Operational" 00-99 419 02 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="zain KW" cc="kw" country="Kuwait" operator="Zain Kuwait" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="K.S.C Ooredoo" cc="kw" country="Kuwait" operator="National Mobile Telecommunications" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Viva" cc="kw" country="Kuwait" operator="Kuwait Telecommunication Company" status="Operational" 00-99 420 01 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 1800 / TD-LTE 2300" brand="Al Jawal (STC )" cc="sa" country="Saudi Arabia" operator="Saudi Telecom Company" status="Operational" 03 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 1800 / TD-LTE 2600" brand="Mobily" cc="sa" country="Saudi Arabia" operator="Etihad Etisalat Company" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2100" brand="Zain SA" cc="sa" country="Saudi Arabia" operator="Zain Saudi Arabia" status="Operational" 05 bands="MVNO" brand="Virgin Mobile" cc="sa" country="Saudi Arabia" operator="Virgin Mobile Saudi Arabia" status="Operational" 21 bands="GSM-R 900" brand="RGSM" cc="sa" country="Saudi Arabia" operator="Saudi Railways GSM" status="Operational" 00-99 421 01 bands="GSM 900" brand="SabaFon" cc="ye" country="Yemen" status="Operational" 02 bands="GSM 900" brand="MTN" cc="ye" country="Yemen" operator="Spacetel Yemen" status="Operational" 03 bands="CDMA2000 800" brand="Yemen Mobile" cc="ye" country="Yemen" operator="Yemen Mobile" status="Operational" 04 bands="GSM 900" brand="HiTS-UNITEL" cc="ye" country="Yemen" operator="Y" status="Operational" 00-99 422 02 bands="GSM 900 / GSM 1800 / UMTS 900 / LTE 1800 / TD-LTE 2300" brand="Omantel" cc="om" country="Oman" operator="Oman Telecommunications Company" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / LTE 800 / LTE 1800 / TD-LTE 2300" brand="ooredoo" cc="om" country="Oman" operator="Omani Qatari Telecommunications Company SAOC" status="Operational" 04 bands="" brand="Omantel" cc="om" country="Oman" operator="Oman Telecommunications Company" status="" 00-99 424 02 bands="GSM 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Etisalat" cc="ae" country="United Arab Emirates" operator="Emirates Telecom Corp" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="du" cc="ae" country="United Arab Emirates" operator="Emirates Integrated Telecommunications Company" status="Operational" 00-99 425 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800" brand="Partner" cc="il" country="Israel" operator="Partner Communications Company Ltd." status="Operational" 02 bands="GSM 1800 / UMTS 850 / UMTS 2100 / LTE 1800" brand="Cellcom" cc="il" country="Israel" operator="Cellcom Israel Ltd." status="Operational" 03 bands="UMTS 850 / UMTS 2100 / LTE 1800" brand="Pelephone" cc="il" country="Israel" operator="Pelephone Communications Ltd." status="Operational" 04 bands="" cc="il" country="Israel" operator="Globalsim Ltd" status="" 05 bands="GSM 900" brand="Jawwal" cc="ps" country="Palestine" operator="Palestine Cellular Communications, Ltd." status="Operational" 06 bands="GSM 900 / GSM 1800" brand="Wataniya" cc="ps" country="Palestine" operator="Wataniya Palestine Mobile Telecommunications Company" status="Operational" 07 bands="iDEN 800 / UMTS 2100" brand="Hot Mobile" cc="il" country="Israel" operator="Hot Mobile Ltd." status="Operational" 08 bands="UMTS 2100 / LTE 1800" brand="Golan Telecom" cc="il" country="Israel" operator="Golan Telecom Ltd" status="Operational" 09 bands="" brand="018 Xphone" cc="il" country="Israel" operator="Marathon 018 Xphone Ltd." status="" 11 bands="MVNO" cc="il" country="Israel" operator="365 Telecom" status="" 12 bands="MVNO" cc="il" country="Israel" operator="Free Telecom" status="" 13 bands="" cc="il" country="Israel" operator="Ituran Cellular Communications" status="" 14 bands="MVNO" brand="Youphone" cc="il" country="Israel" operator="Alon Cellular Ltd." status="Operational" 15 bands="MVNO" brand="Home Cellular" cc="il" country="Israel" operator="Home Cellular" status="Operational" 16 bands="MVNO" brand="Rami Levy" cc="il" country="Israel" operator="Rami Levy Communications Ltd." status="Operational" 17 bands="MVNO" brand="Sipme" cc="il" country="Israel" operator="Gale Phone" status="" 18 bands="MVNO" brand="Cellact Communications" cc="il" country="Israel" operator="Cellact Communications Ltd." status="Operational" 19 bands="MVNO" brand="Telzar 019" cc="il" country="Israel" operator="Azi Communications Ltd." status="Operational" 20 bands="" brand="Bezeq" cc="il" country="Israel" operator="Bezeq The Israeli Telecommunication Corp Ltd." status="" 21 bands="" brand="Bezeq International" cc="il" country="Israel" operator="B.I.P. Communications Ltd." status="" 23 bands="" cc="il" country="Israel" operator="Beezz Communication Solutions Ltd." status="" 24 bands="MVNO" brand="012 Telecom" cc="il" country="Israel" operator="Partner Communications Company Ltd." status="Operational" 25 bands="LTE" brand="IMOD" cc="il" country="Israel" operator="Israel Ministry of Defense" status="Not operational" 26 bands="MVNO" cc="il" country="Israel" operator="LB Annatel Ltd." status="Operational" 28 bands="LTE 1800" cc="il" country="Israel" operator="PHI Networks" status="" 00-99 426 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Batelco" cc="bh" country="Bahrain" operator="Bahrain Telecommunications Company" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="zain BH" cc="bh" country="Bahrain" operator="Zain Bahrain" status="Operational" 03 bands="" cc="bh" country="Bahrain" operator="Civil Aviation Authority" status="" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="VIVA Bahrain" cc="bh" country="Bahrain" operator="Viva Bahrain" status="Operational" 05 bands="GSM 900 / GSM 1800" brand="Batelco" cc="bh" country="Bahrain" operator="Bahrain Telecommunications Company" status="Operational" 00-99 427 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="ooredoo" cc="qa" country="Qatar" operator="ooredoo" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600" brand="Vodafone" cc="qa" country="Qatar" operator="Vodafone Qatar" status="Operational" 05 bands="TETRA 380" brand="Ministry of Interior" cc="qa" country="Qatar" operator="Ministry of Interior" status="Operational" 06 bands="LTE" brand="Ministry of Interior" cc="qa" country="Qatar" operator="Ministry of Interior" status="Operational" 00-99 428 88 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Unitel" cc="mn" country="Mongolia" operator="Unitel LLC" status="Operational" 91 bands="CDMA2000 800 / UMTS 2100" brand="Skytel" cc="mn" country="Mongolia" operator="Skytel LLC" status="Operational" 98 bands="CDMA2000 450 / UMTS 2100" brand="G-Mobile" cc="mn" country="Mongolia" operator="G-Mobile LLC" status="Operational" 99 bands="GSM 900 / UMTS 2100 / LTE 1800 / LTE 2100" brand="Mobicom" cc="mn" country="Mongolia" operator="Mobicom Corporation" status="Operational" 00-99 429 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / CDMA / WiMAX" brand="Namaste / NT Mobile / Sky Phone" cc="np" country="Nepal" operator="Nepal Telecom (NDCL)" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Ncell" cc="np" country="Nepal" operator="Ncell Pvt. Ltd." status="Operational" 03 bands="CDMA2000 800" brand="UTL" cc="np" country="Nepal" operator="United Telecom Limited" status="Operational" 04 bands="GSM 900 / LTE 1800" brand="SmartCell" cc="np" country="Nepal" operator="Smart Telecom Pvt. Ltd. (STPL)" status="Operational" 00-99 432 11 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="IR-MCI (Hamrah-e-Avval)" cc="ir" country="Iran" operator="Mobile Communications Company of Iran" status="Operational" 12 bands="LTE 800" brand="Avacell" cc="ir" country="Iran" operator="Dadeh Dostar asr Novin p.j.s. co & Information Technology Company of Iran" status="Operational" 14 bands="GSM 900" brand="TKC" cc="ir" country="Iran" operator="Telecommunication Kish Company" status="Operational" 19 bands="GSM 900" brand="MTCE (Espadan)" cc="ir" country="Iran" operator="Mobile Telecommunications Company of Esfahan" status="Operational" 20 bands="UMTS 900 / UMTS 2100 / LTE 1800" brand="Rightel" cc="ir" country="Iran" operator="Social Security Investment Co." status="Operational" 32 bands="GSM 900 / GSM 1800" brand="Taliya" cc="ir" country="Iran" operator="TCI of Iran and Iran Mobin" status="Not Operational" 35 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600 / TD-LTE 3500" brand="MTN Irancell" cc="ir" country="Iran" operator="MTN Irancell Telecommunications Services Company" status="Operational" 70 bands="GSM 900" brand="TCI" cc="ir" country="Iran" operator="Telephone Communications Company of Iran" status="Operational" 93 bands="GSM 1800" brand="Iraphone" cc="ir" country="Iran" operator="Iraphone" status="Operational" 00-99 434 01 bands="GSM 900 / GSM 1800" cc="uz" country="Uzbekistan" operator="Buztel" status="Not operational" 02 bands="GSM 900 / GSM 1800" cc="uz" country="Uzbekistan" operator="Uzmacom" status="Not operational" 03 bands="CDMA2000 450" brand="UzMobile" cc="uz" country="Uzbekistan" operator="Uzbektelekom" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="Beeline" cc="uz" country="Uzbekistan" operator="Unitel LLC" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="Ucell" cc="uz" country="Uzbekistan" operator="Coscom" status="Operational" 06 bands="CDMA2000 800" brand="Perfectum Mobile" cc="uz" country="Uzbekistan" operator="RUBICON WIRELESS COMMUNICATION" status="Operational" 07 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="UMS" cc="uz" country="Uzbekistan" operator="Universal Mobile Systems" status="Operational" 08 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="UzMobile" cc="uz" country="Uzbekistan" operator="Uzbektelekom" status="Operational" 00-99 436 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="Tcell" cc="tj" country="Tajikistan" operator="JV Somoncom" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="Tcell" cc="tj" country="Tajikistan" operator="Indigo Tajikistan" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="MegaFon" cc="tj" country="Tajikistan" operator="TT Mobile" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2100" brand="Babilon-M" cc="tj" country="Tajikistan" operator="Babilon-Mobile" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Beeline" cc="tj" country="Tajikistan" operator="Tacom" status="Operational" 10 bands="TD-LTE 2300 / WiMAX" brand="Babilon-T" cc="tj" country="Tajikistan" operator="Babilon-T" status="Operational" 12 bands="UMTS 2100" brand="Tcell" cc="tj" country="Tajikistan" operator="Indigo" status="" 00-99 437 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="Beeline" cc="kg" country="Kyrgyzstan" operator="Sky Mobile LLC" status="Operational" 03 bands="CDMA2000 850" brand="Fonex" cc="kg" country="Kyrgyzstan" operator="Aktel Ltd" status="Not operational" 05 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2100" brand="MegaCom" cc="kg" country="Kyrgyzstan" operator="Alfa Telecom CJSC" status="Operational" 09 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 2600" brand="O!" cc="kg" country="Kyrgyzstan" operator="NurTelecom LLC" status="Operational" 00-99 438 01 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="MTS" cc="tm" country="Turkmenistan" operator="MTS Turkmenistan" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="TM-Cell" cc="tm" country="Turkmenistan" operator="Altyn Asyr" status="Operational" 03 bands="CDMA 450" brand="AGTS CDMA" cc="tm" country="Turkmenistan" operator="AŞTU" status="Operational" 00-99 440 00 bands="UMTS 1800" brand="Y!Mobile" cc="jp" country="Japan" operator="SoftBank Corp." status="Operational" 01 bands="WiMAX 2500 / TD-LTE 2500" brand="UQ WiMAX" cc="jp" country="Japan" operator="UQ Communications Inc." status="Operational" 02 bands="WiMAX 2500" cc="jp" country="Japan" operator="Hanshin Cable Engineering Co., Ltd." status="" 03 bands="MVNO" brand="IIJmio" cc="jp" country="Japan" operator="Internet Initiative Japan Inc." status="Operational" 04 bands="" cc="jp" country="Japan" operator="Japan Radio Company, Ltd." status="" 05 bands="TD-LTE 2500" cc="jp" country="Japan" operator="Wireless City Planning Inc." status="Operational" 06 bands="" cc="jp" country="Japan" operator="SAKURA Internet Inc." status="" 10 bands="UMTS 850 / UMTS 1800 / UMTS 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 1800 / LTE 2100 / TD-LTE 3500" brand="NTT docomo" cc="jp" country="Japan" operator="NTT DoCoMo, Inc." status="Operational" 20 bands="UMTS 900 / UMTS 2100 / LTE 700 / LTE 900 / LTE 1500 / LTE 1800 / LTE 2100 / TD-LTE 3500" brand="SoftBank" cc="jp" country="Japan" operator="SoftBank Corp." status="Operational" 21 bands="UMTS 900 / UMTS 2100 / LTE 700 / LTE 900 / LTE 1500 / LTE 1800 / LTE 2100 / TD-LTE 3500" brand="SoftBank" cc="jp" country="Japan" operator="SoftBank Corp." status="Operational" 50 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 51 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 52 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 53 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 54 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 70 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 71 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 72 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 73 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 74 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 75 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 76 bands="CDMA2000 850 / CDMA2000 2100 / LTE 700 / LTE 850 / LTE 1500 / LTE 2100 / TD-LTE 3500" brand="au" cc="jp" country="Japan" operator="KDDI Corporation" status="Operational" 78 bands="CDMA2000 850 / CDMA2000 2100" brand="au" cc="jp" country="Japan" operator="Okinawa Cellular Telephone" status="Operational" 00-99 441 00 bands="TD-LTE 2500" cc="jp" country="Japan" operator="Wireless City Planning Inc." status="Operational" 01 bands="UMTS 900 / UMTS 2100 / LTE 700 / LTE 900 / LTE 1500 / LTE 1800 / LTE 2100 / TD-LTE 3500" brand="SoftBank" cc="jp" country="Japan" operator="SoftBank Corp." status="Operational" 10 bands="WiMAX 2500 / TD-LTE 2500" brand="UQ WiMAX" cc="jp" country="Japan" operator="UQ Communications Inc." status="Operational" 00-99 450 01 bands="Satellite" cc="kr" country="South Korea" operator="Globalstar Asia Pacific" status="Operational" 02 bands="5G" brand="KT" cc="kr" country="South Korea" operator="KT" status="" 03 bands="CDMA2000 800" brand="Power 017" cc="kr" country="South Korea" operator="Shinsegi Telecom, Inc." status="Not operational" 04 bands="" brand="KT" cc="kr" country="South Korea" operator="KT" status="" 05 bands="CDMA2000 800 / UMTS 2100 / LTE 850 / LTE 1800 / LTE 2100 / LTE 2600" brand="SKTelecom" cc="kr" country="South Korea" operator="SK Telecom" status="Operational" 06 bands="CDMA2000 1800 / LTE 850 / LTE 2100 / LTE 2600" brand="LG U+" cc="kr" country="South Korea" operator="LG Telecom" status="Operational" 07 bands="" brand="KT" cc="kr" country="South Korea" operator="KT" status="" 08 bands="UMTS 2100 / LTE 900 / LTE 1800 / LTE 2100" brand="olleh" cc="kr" country="South Korea" operator="KT" status="Operational" 11 bands="MVNO" cc="kr" country="South Korea" operator="Korea Cable Telecom" status="Operational" 12 bands="" brand="SKTelecom" cc="kr" country="South Korea" operator="SK Telecom" status="" 00-99 452 01 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="MobiFone" cc="vn" country="Vietnam" operator="Vietnam Mobile Telecom Services Company" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800" brand="Vinaphone" cc="vn" country="Vietnam" operator="Vietnam Telecom Services Company" status="Operational" 03 bands="CDMA2000 800" brand="S-Fone" cc="vn" country="Vietnam" operator="S-Telecom" status="Not operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Viettel Mobile" cc="vn" country="Vietnam" operator="Viettel Telecom" status="Operational" 05 bands="GSM 900 / UMTS 2100" brand="Vietnamobile" cc="vn" country="Vietnam" operator="Hanoi Telecom" status="Operational" 06 bands="CDMA2000 450" brand="EVNTelecom" cc="vn" country="Vietnam" operator="EVN Telecom" status="Not operational" 07 bands="GSM 1800" brand="Gmobile" cc="vn" country="Vietnam" operator="GTEL Mobile JSC" status="Operational" 08 bands="UMTS 2100" brand="EVNTelecom" cc="vn" country="Vietnam" operator="EVN Telecom" status="Not operational" 00-99 454 00 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="1O1O / One2Free / New World Mobility / SUNMobile" cc="hk" country="Hong Kong" operator="CSL Limited" status="Operational" 01 bands="MVNO" cc="hk" country="Hong Kong" operator="CITIC Telecom 1616" status="Operational" 02 bands="GSM 900 / GSM 1800" cc="hk" country="Hong Kong" operator="CSL Limited" status="Operational" 03 bands="UMTS 900 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2600" brand="3" cc="hk" country="Hong Kong" operator="Hutchison Telecom" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="3 (2G)" cc="hk" country="Hong Kong" operator="Hutchison Telecom" status="Operational" 05 bands="CDMA 800" brand="3 (CDMA)" cc="hk" country="Hong Kong" operator="Hutchison Telecom" status="Not operational" 06 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2600" brand="SmarTone" cc="hk" country="Hong Kong" operator="SmarTone Mobile Communications Limited" status="Operational" 07 bands="MVNO" brand="China Unicom" cc="hk" country="Hong Kong" operator="China Unicom (Hong Kong) Limited" status="Operational" 08 bands="MVNO" brand="Truphone" cc="hk" country="Hong Kong" operator="Truphone Limited" status="Operational" 09 bands="MVNO" cc="hk" country="Hong Kong" operator="China Motion Telecom" status="Operational" 10 bands="GSM 1800" brand="New World Mobility" cc="hk" country="Hong Kong" operator="CSL Limited" status="Not operational" 11 bands="MVNO" cc="hk" country="Hong Kong" operator="China-Hong Kong Telecom" status="Operational" 12 bands="GSM 1800 / LTE 1800 / TD-LTE 2300 / LTE 2600" brand="CMCC HK" cc="hk" country="Hong Kong" operator="China Mobile Hong Kong Company Limited" status="Operational" 13 bands="MVNO" brand="CMCC HK" cc="hk" country="Hong Kong" operator="China Mobile Hong Kong Company Limited" status="Operational" 14 bands="GSM 900 / GSM 1800" cc="hk" country="Hong Kong" operator="Hutchison Telecom" status="Operational" 15 bands="GSM 1800" cc="hk" country="Hong Kong" operator="SmarTone Mobile Communications Limited" status="Operational" 16 bands="GSM 1800" brand="PCCW Mobile (2G)" cc="hk" country="Hong Kong" operator="PCCW-HKT" status="Operational" 17 bands="GSM 1800" cc="hk" country="Hong Kong" operator="SmarTone Mobile Communications Limited" status="Operational" 18 bands="GSM 900 / GSM 1800" cc="hk" country="Hong Kong" operator="CSL Limited" status="Not operational" 19 bands="UMTS 2100" brand="PCCW Mobile (3G)" cc="hk" country="Hong Kong" operator="PCCW-HKT" status="Operational" 20 bands="LTE 1800 / LTE 2600" brand="PCCW Mobile (4G)" cc="hk" country="Hong Kong" operator="PCCW-HKT" status="Operational" 21 bands="MVNO" cc="hk" country="Hong Kong" operator="21Vianet Mobile Ltd." status="" 22 bands="MVNO" cc="hk" country="Hong Kong" operator="263 Mobile Communications (HongKong) Limited" status="Operational" 23 bands="MVNO" brand="Lycamobile" cc="hk" country="Hong Kong" operator="Lycamobile Hong Kong Ltd" status="Operational" 24 bands="MVNO" cc="hk" country="Hong Kong" operator="Multibyte Info Technology Ltd" status="Operational" 25 bands="" cc="hk" country="Hong Kong" operator="Hong Kong Government" status="" 26 bands="" cc="hk" country="Hong Kong" operator="Hong Kong Government" status="" 29 bands="CDMA 800" brand="PCCW Mobile (CDMA)" cc="hk" country="Hong Kong" operator="PCCW-HKT" status="Operational" 30 bands="" cc="hk" country="Hong Kong" operator="China Data Enterprises Ltd" status="" 31 bands="MVNO" brand="CTExcel" cc="hk" country="Hong Kong" operator="China Telecom Global Limited" status="Operational" 32 bands="MVNO" cc="hk" country="Hong Kong" operator="Hong Kong Broadband Network Ltd" status="Operational" 35 bands="MVNO" cc="hk" country="Hong Kong" operator="Webbing Hong Kong Ltd" status="Operational" 00-99 455 00 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="SmarTone" cc="mo" country="Macau (China)" operator="Smartone – Comunicações Móveis, S.A." status="Operational" 01 bands="GSM 900 / GSM 1800 / LTE 1800" brand="CTM" cc="mo" country="Macau (China)" operator="Companhia de Telecomunicações de Macau, S.A.R.L." status="Operational" 02 bands="CDMA 800" brand="China Telecom" cc="mo" country="Macau (China)" operator="China Telecom (Macau) Company Limited" status="Operational" 03 bands="GSM 900 / GSM 1800" brand="3" cc="mo" country="Macau (China)" operator="Hutchison Telephone (Macau), Limitada" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="CTM" cc="mo" country="Macau (China)" operator="Companhia de Telecomunicações de Macau, S.A.R.L." status="Operational" 05 bands="UMTS 900 / UMTS 2100 / LTE 1800" brand="3" cc="mo" country="Macau (China)" operator="Hutchison Telephone (Macau), Limitada" status="Operational" 06 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="SmarTone" cc="mo" country="Macau (China)" operator="Smartone – Comunicações Móveis, S.A." status="Operational" 07 bands="LTE 1800" brand="China Telecom" cc="mo" country="Macau (China)" operator="China Telecom (Macau) Limitada" status="Operational" 00-99 456 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Cellcard" cc="kh" country="Cambodia" operator="CamGSM / The Royal Group" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Smart" cc="kh" country="Cambodia" operator="Smart Axiata Co. Ltd" status="Operational" 03 bands="GSM 1800 / UMTS 2100" brand="qb" cc="kh" country="Cambodia" operator="Cambodia Advance Communications Co. Ltd" status="Operational" 04 bands="GSM 1800 / UMTS 2100" brand="qb" cc="kh" country="Cambodia" operator="Cambodia Advance Communications Co. Ltd" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2100" brand="Smart" cc="kh" country="Cambodia" operator="Smart Axiata Co. Ltd" status="Operational" 06 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2100" brand="Smart" cc="kh" country="Cambodia" operator="Smart Axiata Co. Ltd" status="Operational" 08 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Metfone" cc="kh" country="Cambodia" operator="Viettel" status="Operational" 09 bands="GSM 900 / GSM 1800" brand="Metfone" cc="kh" country="Cambodia" operator="Viettel" status="Operational" 11 bands="LTE 850" brand="SEATEL" cc="kh" country="Cambodia" operator="SEATEL Cambodia" status="Operational" 18 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Cellcard" cc="kh" country="Cambodia" operator="The Royal Group" status="Operational" 00-99 457 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="LaoTel" cc="la" country="Laos" operator="Lao Telecom" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="ETL" cc="la" country="Laos" operator="Enterprise of Telecommunications Lao" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE" brand="Unitel" cc="la" country="Laos" operator="Star Telecom Co., Ltd" status="Operational" 08 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Beeline" cc="la" country="Laos" operator="VimpelCom Lao Ltd" status="Operational" 00-99 460 00 bands="GSM 900 / GSM 1800 / TD-SCDMA 1900 / TD-SCDMA 2000 / TD-LTE 1900 / TD-LTE 2300 / TD-LTE 2500" brand="China Mobile" cc="cn" country="China" operator="China Mobile" status="Operational" 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800 / TD-LTE 2300 / TD-LTE 2500" brand="China Unicom" cc="cn" country="China" operator="China Unicom" status="Operational" 02 bands="GSM 900 / GSM 1800 / TD-SCDMA 1900 / TD-SCDMA 2000 / TD-LTE 1900 / TD-LTE 2300 / TD-LTE 2500" brand="China Mobile" cc="cn" country="China" operator="China Mobile" status="Not operational" 03 bands="CDMA2000 800 / LTE 850 / LTE 1800 / LTE 2100 / TD-LTE 2300 / TD-LTE 2500" brand="China Telecom" cc="cn" country="China" operator="China Telecom" status="Operational" 04 bands="" cc="cn" country="China" operator="Global Star Satellite" status="" 05 bands="CDMA2000 800 / LTE 850 / LTE 1800 / LTE 2100 / TD-LTE 2300 / TD-LTE 2500" brand="China Telecom" cc="cn" country="China" operator="China Telecom" status="Not operational" 06 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="China Unicom" cc="cn" country="China" operator="China Unicom" status="Not operational" 07 bands="GSM 900 / GSM 1800 / TD-SCDMA 1900 / TD-SCDMA 2000 / TD-LTE 1900 / TD-LTE 2300 / TD-LTE 2500" brand="China Mobile" cc="cn" country="China" operator="China Mobile" status="Not operational" 08 bands="" brand="China Mobile" cc="cn" country="China" operator="China Mobile" status="" 09 bands="" brand="China Unicom" cc="cn" country="China" operator="China Unicom" status="" 11 bands="" brand="China Telecom" cc="cn" country="China" operator="China Telecom" status="" 20 bands="GSM-R" brand="China Tietong" cc="cn" country="China" operator="China Tietong" status="Operational" 00-99 466 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="FarEasTone" cc="tw" country="Taiwan" operator="Far EasTone Telecommunications Co Ltd" status="Operational" 02 bands="GSM 900" brand="FarEasTone" cc="tw" country="Taiwan" operator="Far EasTone Telecommunications Co Ltd" status="" 03 bands="UMTS 2100" brand="FarEasTone" cc="tw" country="Taiwan" operator="Far EasTone Telecommunications Co Ltd" status="" 05 bands="CDMA2000 800 / LTE 700" brand="APTG" cc="tw" country="Taiwan" operator="Asia Pacific Telecom" status="Operational" 06 bands="GSM 1800" brand="FarEasTone" cc="tw" country="Taiwan" operator="Far EasTone Telecommunications Co Ltd" status="Operational" 07 bands="WiMAX 2600" brand="FarEasTone" cc="tw" country="Taiwan" operator="Far EasTone Telecommunications Co Ltd" status="Not operational" 09 bands="WiMAX 2600" brand="VMAX" cc="tw" country="Taiwan" operator="Vmax Telecom" status="Operational" 10 bands="WiMAX 2600" brand="G1" cc="tw" country="Taiwan" operator="Global Mobile Corp." status="Operational" 11 bands="GSM 1800" brand="Chunghwa LDM" cc="tw" country="Taiwan" operator="LDTA/Chunghwa Telecom" status="Operational" 12 bands="LTE 700 / LTE 900" cc="tw" country="Taiwan" operator="Ambit Microsystems" status="Operational" 56 bands="WiMAX 2600 / PHS" brand="FITEL" cc="tw" country="Taiwan" operator="First International Telecom" status="Not operational" 68 bands="WiMAX 2600" cc="tw" country="Taiwan" operator="Tatung InfoComm" status="Not operational" 88 bands="GSM 1800" brand="FarEasTone" cc="tw" country="Taiwan" operator="Far EasTone Telecommunications Co Ltd" status="Operational" 89 bands="UMTS 2100 / LTE 900 / LTE 2600" brand="T Star" cc="tw" country="Taiwan" operator="Taiwan Star Telecom" status="Operational" 90 bands="LTE 900" brand="T Star" cc="tw" country="Taiwan" operator="Taiwan Star Telecom" status="" 92 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2600" brand="Chunghwa" cc="tw" country="Taiwan" operator="Chunghwa Telecom" status="Operational" 93 bands="GSM 900" brand="MobiTai" cc="tw" country="Taiwan" operator="Mobitai Communications" status="Not operational" 97 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 700 / LTE 1800" brand="Taiwan Mobile" cc="tw" country="Taiwan" operator="Taiwan Mobile Co. Ltd" status="Operational" 99 bands="GSM 900" brand="TransAsia" cc="tw" country="Taiwan" operator="TransAsia Telecoms" status="Not operational" 00-99 467 05 bands="UMTS 2100" brand="Koryolink" cc="kp" country="North Korea" operator="Cheo Technology Jv Company" status="Operational" 06 bands="UMTS 2100" brand="Koryolink" cc="kp" country="North Korea" operator="Cheo Technology Jv Company" status="Operational" 193 bands="GSM 900" brand="SunNet" cc="kp" country="North Korea" operator="Korea Posts and Telecommunications Corporation" status="Not operational" 00-99 470 01 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Grameenphone" cc="bd" country="Bangladesh" operator="GrameenPhone Ltd" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Robi" cc="bd" country="Bangladesh" operator="Axiata Bangladesh Ltd." status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Banglalink" cc="bd" country="Bangladesh" operator="Banglalink Digital Communications Ltd" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="TeleTalk" cc="bd" country="Bangladesh" operator="Teletalk Bangladesh Limited" status="Operational" 05 bands="CDMA 800 / GSM 900 / GSM 1800" brand="Citycell" cc="bd" country="Bangladesh" operator="Pacific Bangladesh Telecom Limited" status="Not Operational" 07 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Airtel" cc="bd" country="Bangladesh" operator="Bharti airtel Bangladesh Ltd." status="Operational" 09 bands="LTE 800 / LTE 2600 / WiMAX 3500" brand="ollo" cc="bd" country="Bangladesh" operator="Bangladesh Internet Exchange Limited (BIEL)" status="Operational" 00-99 472 01 bands="GSM 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Dhiraagu" cc="mv" country="Maldives" operator="Dhivehi Raajjeyge Gulhun" status="Operational" 02 bands="GSM 900 / UMTS 2100 / LTE 2600" brand="Ooredoo" cc="mv" country="Maldives" operator="Wataniya Telecom Maldives" status="Operational" 00-99 502 01 bands="CDMA2000 450" brand="ATUR 450" cc="my" country="Malaysia" operator="Telekom Malaysia Bhd" status="Not operational" 10 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" cc="my" country="Malaysia" operator="Maxis, DiGi, Celcom, XOX" status="Operational" 11 bands="CDMA2000 850 / LTE 850" brand="TM Homeline" cc="my" country="Malaysia" operator="Telekom Malaysia Bhd" status="Operational" 12 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Maxis" cc="my" country="Malaysia" operator="Maxis Communications Berhad" status="Operational" 13 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Celcom" cc="my" country="Malaysia" operator="Celcom Axiata Berhad" status="Operational" 14 cc="my" country="Malaysia" operator="Telekom Malaysia Berhad for PSTN SMS" status="" 150 bands="MVNO" brand="Tune Talk" cc="my" country="Malaysia" operator="Tune Talk Sdn Bhd" status="Operational" 151 bands="MVNO" brand="SalamFone" cc="my" country="Malaysia" operator="Baraka Telecom Sdn Bhd" status="Not operational" 152 bands="WiMAX 2300 / TD-LTE 2300 / TD-LTE 2600" brand="Yes" cc="my" country="Malaysia" operator="YTL Communications Sdn Bhd" status="Operational" 153 bands="WiMAX 2300 / LTE 850" brand="Webe" cc="my" country="Malaysia" operator="Packet One Networks Sdn Bhd" status="Operational" 154 bands="MVNO" brand="Tron" cc="my" country="Malaysia" operator="Talk Focus Sdn Bhd" status="Operational" 155 bands="MVNO" brand="Clixster" cc="my" country="Malaysia" operator="Clixster Mobile Sdn Bhd" status="Operational" 156 bands="MVNO" brand="Altel" cc="my" country="Malaysia" operator="Altel Communications Sdn Bhd" status="Operational" 157 bands="MVNO" brand="Telin" cc="my" country="Malaysia" operator="Telekomunikasi Indonesia International (M) Sdn Bhd" status="Operational" 16 bands="GSM 1800 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2600" brand="DiGi" cc="my" country="Malaysia" operator="DiGi Telecommunications" status="Operational" 17 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="Maxis" cc="my" country="Malaysia" operator="Maxis Communications Berhad" status="Operational" 18 bands="UMTS 2100 / LTE 1800 / LTE 2600" brand="U Mobile" cc="my" country="Malaysia" operator="U Mobile Sdn Bhd" status="Operational" 19 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600" brand="Celcom" cc="my" country="Malaysia" operator="Celcom Axiata Berhad" status="Operational" 20 bands="DMR" brand="Electcoms" cc="my" country="Malaysia" operator="Electcoms Berhad" status="Operational" 00-99 505 01 bands="UMTS 850 / UMTS 2100 / LTE 700 / LTE 900 / LTE 1800 / LTE 2100" brand="Telstra" cc="au" country="Australia" operator="Telstra Corporation Limited" status="Operational" 02 bands="UMTS 900 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2100 / TD-LTE 2300" brand="Optus" cc="au" country="Australia" operator="Singtel Optus Proprietary Limited" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 900 / UMTS 2100 / LTE 850 / LTE 1800 / LTE 2100" brand="Vodafone" cc="au" country="Australia" operator="Vodafone Hutchison Australia Proprietary Limited" status="Operational" 04 bands="" cc="au" country="Australia" operator="Department of Defence" status="Operational" 05 brand="Ozitel" cc="au" country="Australia" status="Not operational" 06 bands="UMTS 2100" brand="3" cc="au" country="Australia" operator="Vodafone Hutchison Australia Proprietary Limited" status="Not operational" 07 bands="" brand="Vodafone" cc="au" country="Australia" operator="Vodafone Network Pty. Ltd." status="" 08 bands="GSM 900" brand="One.Tel" cc="au" country="Australia" operator="One.Tel Limited" status="Not operational" 09 brand="Airnet" cc="au" country="Australia" status="Not operational" 10 bands="GSM 900" brand="Norfolk Telecom" cc="nf" country="Norfolk Island" operator="Norfolk Telecom" status="Operational" 11 bands="" brand="Telstra" cc="au" country="Australia" operator="Telstra Corporation Ltd." status="" 12 bands="UMTS 2100" brand="3" cc="au" country="Australia" operator="Vodafone Hutchison Australia Proprietary Limited" status="Not operational" 13 bands="GSM-R 1800" brand="RailCorp" cc="au" country="Australia" operator="Railcorp, Transport for New South Wales" status="Operational" 14 bands="MVNO" brand="AAPT" cc="au" country="Australia" operator="TPG Telecom" status="Operational" 15 brand="3GIS" cc="au" country="Australia" status="Not operational" 16 bands="GSM-R 1800" brand="VicTrack" cc="au" country="Australia" operator="Victorian Rail Track" status="Operational" 17 bands="TD-LTE 2300" cc="au" country="Australia" operator="Optus" status="" 18 brand="Pactel" cc="au" country="Australia" operator="Pactel International Pty Ltd" status="" 19 bands="MVNO" brand="Lycamobile" cc="au" country="Australia" operator="Lycamobile Pty Ltd" status="Operational" 20 bands="" cc="au" country="Australia" operator="Ausgrid Corporation" status="" 21 bands="GSM-R 1800" cc="au" country="Australia" operator="Queensland Rail Limited" status="" 22 bands="" cc="au" country="Australia" operator="iiNet Ltd" status="" 23 bands="LTE 2100" cc="au" country="Australia" operator="Challenge Networks Pty. Ltd." status="Planning" 24 bands="" cc="au" country="Australia" operator="Advanced Communications Technologies Pty. Ltd." status="" 25 bands="" cc="au" country="Australia" operator="Pilbara Iron Company Services Pty Ltd" status="" 26 bands="" cc="au" country="Australia" operator="Dialogue Communications Pty. Ltd." status="" 27 bands="" cc="au" country="Australia" operator="Nexium Telecommunications" status="" 28 bands="" cc="au" country="Australia" operator="RCOM International Pty Ltd" status="" 30 bands="" cc="au" country="Australia" operator="Compatel Limited" status="" 31 bands="" cc="au" country="Australia" operator="BHP Billiton" status="" 32 bands="" cc="au" country="Australia" operator="Thales Australia" status="" 33 bands="" cc="au" country="Australia" operator="CLX Networks Pty Ltd" status="" 34 bands="" cc="au" country="Australia" operator="Santos Limited" status="" 35 bands="" cc="au" country="Australia" operator="MessageBird Pty Ltd" status="" 36 bands="" brand="Optus" cc="au" country="Australia" operator="Optus Mobile Pty. Ltd." status="" 37 bands="" cc="au" country="Australia" operator="Yancoal Australia Ltd" status="" 38 bands="MVNO" brand="Truphone" cc="au" country="Australia" operator="Truphone Pty Ltd" status="Operational" 39 bands="" brand="Telstra" cc="au" country="Australia" operator="Telstra Corporation Ltd." status="" 40 bands="" cc="au" country="Australia" operator="CITIC Pacific Mining" status="" 41 bands="" cc="au" country="Australia" operator="Aqura Technologies Pty" status="" 42 bands="" brand="GEMCO" cc="au" country="Australia" operator="Groote Eylandt Mining Company Pty Ltd" status="" 50 bands="Satellite" cc="au" country="Australia" operator="Pivotel Group Pty Limited" status="Operational" 61 bands="LTE 1800 / LTE 2100" brand="CommTel NS" cc="au" country="Australia" operator="Commtel Network Solutions Pty Ltd" status="Implement / Design" 62 bands="TD-LTE 2300" brand="NBN" cc="au" country="Australia" operator="National Broadband Network Co." status="Operational" 68 bands="TD-LTE 2300" brand="NBN" cc="au" country="Australia" operator="National Broadband Network Co." status="Operational" 71 bands="" brand="Telstra" cc="au" country="Australia" operator="Telstra Corporation Limited" status="Operational" 72 bands="" brand="Telstra" cc="au" country="Australia" operator="Telstra Corporation Limited" status="Operational" 88 bands="Satellite" cc="au" country="Australia" operator="Pivotel Group Pty Limited" status="Operational" 90 bands="" brand="Optus" cc="au" country="Australia" operator="Singtel Optus Proprietary Limited" status="Operational" 99 bands="GSM 1800" brand="One.Tel" cc="au" country="Australia" operator="One.Tel" status="Not operational" 00-99 510 00 bands="Satellite" brand="PSN" cc="id" country="Indonesia" operator="PT Pasifik Satelit Nusantara (ACeS)" status="Operational" 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 900 / LTE 1800" brand="Indosat Ooredoo" cc="id" country="Indonesia" operator="PT Indonesian Satellite Corporation Tbk (INDOSAT)" status="Operational" 03 bands="CDMA 800" brand="StarOne" cc="id" country="Indonesia" operator="PT Indosat Tbk" status="Not operational" 07 bands="CDMA 800" brand="TelkomFlexi" cc="id" country="Indonesia" operator="PT Telkom" status="Not operational" 08 bands="GSM 1800 / UMTS 2100" brand="AXIS" cc="id" country="Indonesia" operator="PT Natrindo Telepon Seluler" status="Not operational" 09 bands="LTE 850 / TD-LTE 2300" brand="Smartfren" cc="id" country="Indonesia" operator="PT Smartfren Telecom" status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 900 / LTE 1800" brand="Telkomsel" cc="id" country="Indonesia" operator="PT Telekomunikasi Selular" status="Operational" 11 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 900 / LTE 1800" brand="XL" cc="id" country="Indonesia" operator="PT XL Axiata Tbk" status="Operational" 20 bands="GSM 1800" brand="TELKOMMobile" cc="id" country="Indonesia" operator="PT Telkom Indonesia Tbk" status="Not operational" 21 bands="GSM 1800" brand="IM3" cc="id" country="Indonesia" operator="PT Indonesian Satellite Corporation Tbk (INDOSAT)" status="Not operational" 27 bands="CDMA 450 / LTE 450" brand="Net1" cc="id" country="Indonesia" operator="PT Sampoerna Telekomunikasi Indonesia" status="Operational" 28 bands="LTE 850 / TD-LTE 2300" brand="Fren/Hepi" cc="id" country="Indonesia" operator="PT Mobile-8 Telecom" status="Operational" 88 bands="TD-LTE 2300" brand="BOLT! Super 4G" cc="id" country="Indonesia" operator="PT Internux" status="Operational" 89 bands="GSM 1800 / UMTS 2100 / LTE 1800" brand="3" cc="id" country="Indonesia" operator="PT Hutchison CP Telecommunications" status="Operational" 99 bands="CDMA 800" brand="Esia" cc="id" country="Indonesia" operator="PT Bakrie Telecom" status="Not Operational" 00-99 514 01 bands="GSM 900 / GSM 1800 / UMTS 850 / LTE" brand="Telkomcel" cc="tl" country="East Timor" operator="PT Telekomunikasi Indonesia International" status="Operational" 02 bands="GSM 900 / UMTS / LTE" brand="TT" cc="tl" country="East Timor" operator="Timor Telecom" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS / LTE" brand="Telemor" cc="tl" country="East Timor" operator="Viettel Timor-Leste" status="Operational" 00-99 515 01 bands="GSM 900" brand="Islacom" cc="ph" country="Philippines" operator="Globe Telecom via Innove Communications" status="Not operational" 02 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 900 / UMTS 2100 / LTE 700 / LTE 1800 / TD-LTE 2500" brand="Globe" cc="ph" country="Philippines" operator="Globe Telecom" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 850 / LTE 1800 / LTE 2100 / TD-LTE 2300 / TD-LTE 2500" brand="SMART" cc="ph" country="Philippines" operator="PLDT via Smart Communications" status="Operational" 05 bands="GSM 1800 / UMTS 2100" brand="Sun Cellular" cc="ph" country="Philippines" operator="Digital Telecommunications Philippines" status="Operational" 11 bands="" cc="ph" country="Philippines" operator="PLDT via ACeS Philippines" status="" 18 bands="GSM 900 / UMTS 2100" brand="Cure" cc="ph" country="Philippines" operator="PLDT via Smart's Connectivity Unlimited Resources Enterprise" status="Not operational" 24 bands="MVNO" brand="ABS-CBN Mobile" cc="ph" country="Philippines" operator="ABS-CBN Convergence with Globe Telecom" status="Operational" 88 bands="iDEN" cc="ph" country="Philippines" operator="Next Mobile Inc." status="Operational" 00-99 520 00 bands="UMTS 850" brand="TrueMove H & my by CAT" cc="th" country="Thailand" operator="CAT Telecom" status="Operational" 01 bands="GSM 900 / UMTS 900" brand="AIS" cc="th" country="Thailand" operator="Advanced Info Service" status="Not operational" 02 bands="CDMA 800" brand="CAT CDMA" cc="th" country="Thailand" operator="CAT Telecom" status="Not operational" 03 bands="UMTS 2100 / LTE 900 / LTE 1800 / LTE 2100" brand="AIS" cc="th" country="Thailand" operator="Advanced Wireless Network Company Ltd." status="Operational" 04 bands="UMTS 2100 / LTE 900 / LTE 1800 / LTE 2100" brand="TrueMove H" cc="th" country="Thailand" operator="Real Future Company Ltd." status="Operational" 05 bands="UMTS 850 / UMTS 2100 / LTE 1800 / LTE 2100" brand="dtac TriNet" cc="th" country="Thailand" operator="DTAC Network Company Ltd." status="Operational" 15 bands="UMTS 2100" brand="TOT 3G" cc="th" country="Thailand" operator="TOT Public Company Limited" status="Operational" 18 bands="GSM 1800" brand="dtac" cc="th" country="Thailand" operator="Total Access Communications Public Company Ltd." status="Operational" 20 bands="Satellite" brand="ACeS" cc="th" country="Thailand" operator="ACeS" status="" 23 bands="GSM 1800" brand="AIS GSM 1800" cc="th" country="Thailand" operator="Digital Phone Company Ltd." status="Not operational" 25 bands="PHS 1900" brand="WE PCT" cc="th" country="Thailand" operator="True Corporation" status="Not operational" 47 bands="" cc="th" country="Thailand" operator="Telephone Organization of Thailand (TOT)" status="" 99 bands="GSM 1800" brand="TrueMove" cc="th" country="Thailand" operator="True Corporation" status="Not operational" 00-99 525 01 bands="UMTS 900 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2600" brand="SingTel" cc="sg" country="Singapore" operator="Singapore Telecom" status="Operational" 02 bands="GSM 1800" brand="SingTel-G18" cc="sg" country="Singapore" operator="Singapore Telecom" status="Not operational" 03 bands="UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600" brand="M1" cc="sg" country="Singapore" operator="M1 Limited" status="Operational" 05 bands="UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2600 / TD-LTE 2600" brand="StarHub" cc="sg" country="Singapore" operator="StarHub Mobile" status="Operational" 06 bands="" brand="StarHub" cc="sg" country="Singapore" operator="StarHub Mobile" status="" 07 bands="" brand="SingTel" cc="sg" country="Singapore" operator="Singapore Telecom" status="" 08 bands="" brand="StarHub" cc="sg" country="Singapore" operator="StarHub Mobile" status="" 09 bands="MVNO" brand="Circles.Life" cc="sg" country="Singapore" operator="Liberty Wireless Pte Ltd" status="Operational" 10 bands="" cc="sg" country="Singapore" operator="TPG Telecom Pte Ltd" status="" 12 bands="iDEN 800" brand="Grid" cc="sg" country="Singapore" operator="GRID Communications Pte Ltd." status="Operational" 00-99 528 01 bands="" cc="bn" country="Brunei" operator="Jabatan Telekom Brunei" status="" 02 bands="UMTS 2100" brand="B-Mobile" cc="bn" country="Brunei" operator="B-Mobile Communications Sdn Bhd" status="Operational" 11 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="DSTCom" cc="bn" country="Brunei" operator="Data Stream Technology" status="Operational" 00-99 530 00 bands="AMPS 800 / TDMA 800" brand="Telecom" cc="nz" country="New Zealand" operator="Telecom New Zealand" status="Not operational" 01 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="Vodafone" cc="nz" country="New Zealand" operator="Vodafone New Zealand" status="Operational" 02 bands="CDMA2000 800" brand="Telecom" cc="nz" country="New Zealand" operator="Telecom New Zealand" status="Not operational" 03 bands="UMTS-TDD 2000" brand="Woosh" cc="nz" country="New Zealand" operator="Woosh Wireless" status="Operational" 04 bands="UMTS 2100" brand="Vodafone" cc="nz" country="New Zealand" operator="TelstraClear New Zealand" status="Not operational" 05 bands="UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / TD-LTE 2300 / LTE 2600" brand="Spark" cc="nz" country="New Zealand" operator="Spark New Zealand" status="Operational" 06 bands="MVNO" brand="Skinny" cc="nz" country="New Zealand" operator="Spark New Zealand" status="Operational" 07 bands="" cc="nz" country="New Zealand" operator="Bluereach Limited" status="" 24 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 700 / LTE 1800" brand="2degrees" cc="nz" country="New Zealand" operator="2degrees" status="Operational" 00-99 536 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Digicel" cc="nr" country="Nauru" operator="Digicel (Nauru) Corporation" status="Operational" 00-99 537 01 bands="GSM 900 / UMTS 900" brand="bmobile" cc="pg" country="Papua New Guinea" operator="Bemobile Limited" status="Operational" 02 bands="CDMA2000 450 / LTE 700" brand="citifon" cc="pg" country="Papua New Guinea" operator="Telikom PNG Ltd." status="Operational" 03 bands="GSM 900 / UMTS 900 / LTE 700" brand="Digicel" cc="pg" country="Papua New Guinea" operator="Digicel PNG" status="Operational" 00-99 539 01 bands="GSM 900" brand="U-Call" cc="to" country="Tonga" operator="Tonga Communications Corporation" status="Operational" 43 bands="" cc="to" country="Tonga" operator="Shoreline Communication" status="Operational" 88 bands="GSM 900" brand="Digicel" cc="to" country="Tonga" operator="Digicel (Tonga) Limited" status="Operational" 00-99 540 01 bands="GSM 900" brand="BREEZE" cc="sb" country="Solomon Islands" operator="Solomon Telekom Co Ltd" status="Operational" 02 bands="GSM 900 / GSM 1800" brand="BeMobile" cc="sb" country="Solomon Islands" operator="BMobile (SI) Ltd" status="Operational" 00-99 541 00 bands="GSM 900" brand="AIL" cc="vu" country="Vanuatu" operator="ACeS International (AIL)" status="Operational" 01 bands="GSM 900" brand="SMILE" cc="vu" country="Vanuatu" operator="Telecom Vanuatu Ltd" status="Operational" 05 bands="GSM 900 / UMTS 900 / LTE 700" brand="Digicel" cc="vu" country="Vanuatu" operator="Digicel Vanuatu Ltd" status="Operational" 07 bands="TD-LTE 2300" brand="WanTok" cc="vu" country="Vanuatu" operator="WanTok Vanuatu Ltd" status="Operational" 00-99 542 01 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Vodafone" cc="fj" country="Fiji" operator="Vodafone Fiji" status="Operational" 02 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 1800 / WiMAX" brand="Digicel" cc="fj" country="Fiji" operator="Digicel Fiji" status="Operational" 03 bands="CDMA2000 850 / LTE 700" cc="fj" country="Fiji" operator="Telecom Fiji Ltd" status="Operational" 00-99 543 01 bands="" cc="wf" country="Wallis and Futuna" operator="Manuia" status="" 00-99 544 11 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 700 / LTE 1700" brand="Bluesky" cc="as" country="American Samoa (United States of America)" operator="Bluesky" status="Operational" 00-99 545 01 bands="UMTS 850 / LTE 700" brand="Kiribati - TSKL" cc="ki" country="Kiribati" operator="Telecom Services Kiribati Ltd" status="Operational" 02 bands="" cc="ki" country="Kiribati" operator="OceanLink" status="" 09 bands="GSM 900" brand="Kiribati - Frigate Net" cc="ki" country="Kiribati" operator="Telecom Services Kiribati Ltd" status="Operational" 00-99 546 01 bands="GSM 900 / UMTS 900 / LTE 800 / LTE 1800 / LTE 2600" brand="Mobilis" cc="nc" country="New Caledonia (France)" operator="OPT New Caledonia" status="Operational" 00-99 547 05 bands="WiMAX / LTE 800 / LTE 2600" brand="Ora" cc="pf" country="French Polynesia" operator="VITI" status="Operational" 10 bands="GSM 900" cc="pf" country="French Polynesia" operator="Mara Telecom" status="Not operational" 15 bands="GSM 900 / UMTS 2100" brand="Vodafone" cc="pf" country="French Polynesia" operator="Pacific Mobile Telecom" status="Operational" 20 bands="GSM 900 / UMTS 2100 / LTE" brand="Vini" cc="pf" country="French Polynesia" operator="Tikiphone SA" status="Operational" 00-99 548 01 bands="GSM 900 / UMTS 900 / LTE" brand="Bluesky" cc="ck" country="Cook Islands (Pacific Ocean)" operator="Telecom Cook Islands" status="Operational" 00-99 549 01 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Digicel" cc="ws" country="Samoa" operator="Digicel Pacific Ltd." status="Operational" 27 bands="GSM 900" brand="Bluesky" cc="ws" country="Samoa" operator="Bluesky Samoa Ltd" status="Operational" 00-99 550 01 bands="GSM 900" cc="fm" country="Federated States of Micronesia" operator="FSMTC" status="Operational" 00-99 551 01 cc="mh" country="Marshall Islands" operator="Marshall Islands National Telecommunications Authority (MINTA)" status="Operational" 00-99 552 01 bands="GSM 900 / UMTS 900 / LTE 700" brand="PNCC" cc="pw" country="Palau" operator="Palau National Communications Corp." status="Operational" 02 bands="" brand="PalauTel" cc="pw" country="Palau" operator="Palau Equipment Company Inc." status="" 80 bands="GSM 1800" brand="Palau Mobile" cc="pw" country="Palau" operator="Palau Mobile Corporation" status="Not operational" 00-99 553 01 bands="GSM 900" brand="TTC" cc="tv" country="Tuvalu" operator="Tuvalu Telecom" status="Operational" 00-99 554 01 bands="LTE 700" cc="tk" country="Tokelau" operator="Teletok" status="Operational" 00-99 555 01 bands="GSM 900" brand="Telecom Niue" cc="nu" country="Niue" operator="Telecom Niue" status="Operational" 00-99 602 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Orange" cc="eg" country="Egypt" operator="Orange Egypt" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Vodafone" cc="eg" country="Egypt" operator="Vodafone Egypt" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Etisalat" cc="eg" country="Egypt" operator="Etisalat Egypt" status="Operational" 04 bands="LTE" brand="WE" cc="eg" country="Egypt" operator="Telecom Egypt" status="Operational" 00-99 603 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Mobilis" cc="dz" country="Algeria" operator="Algérie Télécom" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Djezzy" cc="dz" country="Algeria" operator="Optimum Telecom Algérie Spa" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Ooredoo" cc="dz" country="Algeria" operator="Wataniya Telecom Algérie" status="Operational" 07 bands="CDMA 1900" brand="AT" cc="dz" country="Algeria" operator="Algérie Télécom" status="Operational" 09 bands="LTE" brand="AT" cc="dz" country="Algeria" operator="Algérie Télécom" status="Operational" 21 bands="GSM-R" brand="ANESRIF" cc="dz" country="Algeria" operator="Anesrif" status="Ongoing" 00-99 604 00 bands="GSM 900 / GSM 1800 / LTE 800" brand="Orange Morocco" cc="ma" country="Morocco" operator="Médi Télécom" status="Operational" 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 2600" brand="IAM" cc="ma" country="Morocco" operator="Ittissalat Al-Maghrib (Maroc Telecom)" status="Operational" 02 bands="GSM 900 / GSM 1800" brand="INWI" cc="ma" country="Morocco" operator="Wana Corporate" status="Operational" 04 bands="" cc="ma" country="Morocco" operator="Al Houria Telecom" status="" 05 bands="GSM 900 / GSM 1800 / LTE 1800" brand="INWI" cc="ma" country="Morocco" operator="Wana Corporate" status="Operational" 06 bands="" brand="IAM" cc="ma" country="Morocco" operator="Ittissalat Al-Maghrib (Maroc Telecom)" status="" 99 bands="" cc="ma" country="Morocco" operator="Al Houria Telecom" status="" 00-99 605 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Orange" cc="tn" country="Tunisia" operator="Orange Tunisie" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Tunicell" cc="tn" country="Tunisia" operator="Tunisie Telecom" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800 / LTE 1800" brand="OOREDOO TN" cc="tn" country="Tunisia" operator="ooredoo Tunisiana" status="Operational" 00-99 606 00 bands="GSM900 / GSM 1800 / UMTS 2100 / LTE" brand="Libyana" cc="ly" country="Libya" operator="Libyana" status="Operational" 01 bands="GSM900 / GSM 1800" brand="Madar" cc="ly" country="Libya" operator="Al-Madar Al-Jadeed" status="Operational" 02 bands="GSM900 / GSM 1800" brand="Al-Jeel Phone" cc="ly" country="Libya" operator="Al-Jeel Al-Jadeed" status="Operational" 03 bands="GSM900 / GSM 1800 / UMTS 2100" brand="Libya Phone" cc="ly" country="Libya" operator="Libya Telecom and Technology (LTT)" status="Operational" 06 bands="CDMA2000" brand="Hatef Libya" cc="ly" country="Libya" operator="Hatef Libya" status="Operational" 00-99 607 01 bands="GSM 900 / GSM 1800" brand="Gamcel" cc="gm" country="Gambia" operator="Gamcel" status="Operational" 02 bands="GSM 900 / GSM 1800" brand="Africell" cc="gm" country="Gambia" operator="Africell" status="Operational" 03 bands="GSM 900 / GSM 1800" brand="Comium" cc="gm" country="Gambia" operator="Comium" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="QCell" cc="gm" country="Gambia" operator="QCell Gambia" status="Operational" 05 bands="WiMAX / LTE" cc="gm" country="Gambia" operator="GAMTEL-Ecowan" status="" 06 bands="TD-LTE 2300" cc="gm" country="Gambia" operator="NETPAGE" status="Operational" 00-99 608 01 bands="GSM 900 / UMTS 2100" brand="Orange" cc="sn" country="Senegal" operator="Sonatel" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 4G" brand="Tigo" cc="sn" country="Senegal" operator="Millicom International Cellular S.A." status="Operational" 03 bands="GSM 900 / UMTS 2100" brand="Expresso" cc="sn" country="Senegal" operator="Sudatel" status="Operational" 04 bands="" cc="sn" country="Senegal" operator="CSU-SA" status="" 00-99 609 01 bands="GSM 900" brand="Mattel" cc="mr" country="Mauritania" operator="Mattel" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Chinguitel" cc="mr" country="Mauritania" operator="Chinguitel" status="Operational" 10 bands="GSM 900" brand="Mauritel" cc="mr" country="Mauritania" operator="Mauritel Mobiles" status="Operational" 00-99 610 01 bands="GSM 900" brand="Malitel" cc="ml" country="Mali" operator="Malitel SA" status="Operational" 02 bands="GSM 900" brand="Orange" cc="ml" country="Mali" operator="Orange Mali SA" status="Operational" 00-99 611 01 bands="GSM 900 / GSM 1800" brand="Orange" cc="gn" country="Guinea" operator="Orange S.A." status="Operational" 02 bands="GSM 900" brand="Sotelgui" cc="gn" country="Guinea" operator="Sotelgui Lagui" status="Operational" 03 bands="GSM 900" brand="Telecel Guinee" cc="gn" country="Guinea" operator="INTERCEL Guinée" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="MTN" cc="gn" country="Guinea" operator="Areeba Guinea" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Cellcom" cc="gn" country="Guinea" operator="Cellcom" status="Operational" 00-99 612 01 bands="" cc="ci" country="Ivory Coast" operator="Cora de Comstar" status="Not operational" 02 bands="GSM 900 / GSM 1800 / UMTS" brand="Moov" cc="ci" country="Ivory Coast" operator="Atlantique Cellulaire" status="Operational" 03 bands="GSM 900 / UMTS" brand="Orange" cc="ci" country="Ivory Coast" operator="Orange" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="KoZ" cc="ci" country="Ivory Coast" operator="Comium Ivory Coast Inc" status="Operational" 05 bands="GSM 900 / UMTS" brand="MTN" cc="ci" country="Ivory Coast" operator="Loteny Telecom" status="Operational" 06 bands="GSM 1800" brand="GreenN" cc="ci" country="Ivory Coast" operator="Oricel" status="Operational" 07 bands="GSM 1800" brand="café" cc="ci" country="Ivory Coast" operator="Aircomm" status="Operational" 18 bands="TD-LTE 2300" cc="ci" country="Ivory Coast" operator="YooMee" status="Operational" 00-99 613 01 bands="GSM 900 / UMTS" brand="Telmob" cc="bf" country="Burkina Faso" operator="Onatel" status="Operational" 02 bands="GSM 900 / UMTS" brand="Orange" cc="bf" country="Burkina Faso" operator="Orange Burkina Faso" status="Operational" 03 bands="GSM 900" brand="Telecel Faso" cc="bf" country="Burkina Faso" operator="Telecel Faso SA" status="Operational" 00-99 614 01 bands="GSM 900" brand="SahelCom" cc="ne" country="Niger" operator="La Société Sahélienne de Télécommunications (SahelCom)" status="Operational" 02 bands="GSM 900" brand="Airtel" cc="ne" country="Niger" operator="Bharti Airtel Limited" status="Operational" 03 bands="GSM 900" brand="Moov" cc="ne" country="Niger" operator="Atlantique Telecom (subsidiary of Etisalat)" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="Orange" cc="ne" country="Niger" operator="Orange Niger" status="Operational" 00-99 615 01 bands="GSM 900" brand="Togo Cell" cc="tg" country="Togo" operator="Togo Telecom" status="Operational" 03 bands="GSM 900" brand="Moov" cc="tg" country="Togo" operator="Moov Togo" status="Operational" 00-99 616 01 bands="GSM 900 / GSM 1800 / LTE 1800 / CDMA / WiMAX" brand="Libercom" cc="bj" country="Benin" operator="Benin Telecoms Mobile" status="Operational" 02 bands="GSM 900 / UMTS" brand="Moov" cc="bj" country="Benin" operator="Telecel Benin" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="MTN" cc="bj" country="Benin" operator="Spacetel Benin" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="BBCOM" cc="bj" country="Benin" operator="Bell Benin Communications" status="Operational" 05 bands="GSM 900 / GSM 1800" brand="Glo" cc="bj" country="Benin" operator="Glo Communication Benin" status="Operational" 00-99 617 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="my.t" cc="mu" country="Mauritius" operator="Cellplus Mobile Communications Ltd." status="Operational" 02 bands="CDMA2000" brand="MOKOZE / AZU" cc="mu" country="Mauritius" operator="Mahanagar Telephone Mauritius Limited (MTML)" status="Operational" 03 bands="GSM 900 / LTE 1800" brand="CHILI" cc="mu" country="Mauritius" operator="Mahanagar Telephone Mauritius Limited (MTML)" status="Operational" 10 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Emtel" cc="mu" country="Mauritius" operator="Emtel Ltd." status="Operational" 00-99 618 01 bands="GSM 900" brand="Lonestar Cell" cc="lr" country="Liberia" operator="Lonestar Communications Corporation" status="Operational" 02 bands="" brand="Libercell" cc="lr" country="Liberia" operator="Atlantic Wireless (Liberia) Inc." status="Not operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Novafone" cc="lr" country="Liberia" operator="Novafone Inc." status="Operational" 07 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Orange LBR" cc="lr" country="Liberia" operator="Orange Liberia." status="Operational" 20 bands="CDMA2000" brand="LIBTELCO" cc="lr" country="Liberia" operator="Liberia Telecommunications Corporation" status="Operational" 00-99 619 01 bands="GSM 900 / UMTS" brand="Airtel" cc="sl" country="Sierra Leone" operator="Bharti Airtel Limited" status="Operational" 02 bands="" brand="Africell" cc="sl" country="Sierra Leone" operator="Lintel Sierra Leone Limited" status="" 03 bands="GSM 900" brand="Africell" cc="sl" country="Sierra Leone" operator="Lintel Sierra Leone Limited" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="Comium" cc="sl" country="Sierra Leone" operator="Comium (Sierra Leone) Ltd." status="Not operational" 05 bands="GSM 900" brand="Africell" cc="sl" country="Sierra Leone" operator="Lintel Sierra Leone Limited" status="Operational" 06 bands="CDMA 800" brand="SierraTel" cc="sl" country="Sierra Leone" operator="Sierra Leone Telephony" status="Operational" 09 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Smart Mobile" cc="sl" country="Sierra Leone" operator="InterGroup Telecom SL" status="Operational" 25 bands="" brand="Mobitel" cc="sl" country="Sierra Leone" operator="Mobitel" status="Reserved" 40 bands="GSM" cc="sl" country="Sierra Leone" operator="Datatel (SL) Ltd." status="" 50 bands="CDMA" cc="sl" country="Sierra Leone" operator="Datatel (SL) Ltd." status="" 00-99 620 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE 800" brand="MTN" cc="gh" country="Ghana" operator="MTN Group" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS / LTE 1800" brand="Vodafone" cc="gh" country="Ghana" operator="Vodafone Group" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS" brand="AirtelTigo" cc="gh" country="Ghana" operator="Millicom Ghana" status="Operational" 04 bands="CDMA2000 850" brand="Expresso" cc="gh" country="Ghana" operator="Kasapa / Hutchison Telecom" status="Operational" 06 bands="GSM 900 / GSM 1800 / UMTS" brand="AirtelTigo" cc="gh" country="Ghana" operator="Airtel" status="Operational" 07 bands="GSM 900 / GSM 1800 / UMTS" brand="Globacom" cc="gh" country="Ghana" operator="Globacom Group" status="Operational" 08 bands="LTE 2600" brand="Surfline" cc="gh" country="Ghana" operator="Surfline Communications Ltd" status="Operational" 10 bands="TD-LTE 2600" brand="Blu" cc="gh" country="Ghana" operator="Blu Telecommunications" status="Operational" 11 bands="" cc="gh" country="Ghana" operator="Netafrique Dot Com Ltd" status="" 00-99 621 00 bands="LTE 1900" cc="ng" country="Nigeria" operator="Capcom" status="Not operational" 20 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Airtel" cc="ng" country="Nigeria" operator="Bharti Airtel Limited" status="Operational" 22 bands="LTE 800" brand="InterC" cc="ng" country="Nigeria" operator="InterC Network Ltd." status="Operational" 24 bands="TD-LTE 2300" cc="ng" country="Nigeria" operator="Spectranet" status="Operational" 25 bands="CDMA2000 800 / CDMA2000 1900" brand="Visafone" cc="ng" country="Nigeria" operator="Visafone Communications Ltd." status="Not operational" 26 bands="TD-LTE 2300" cc="ng" country="Nigeria" operator="Swift" status="Operational" 27 bands="LTE 800" brand="Smile" cc="ng" country="Nigeria" operator="Smile Communications Nigeria" status="Operational" 30 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 2600 / LTE 3500" brand="MTN" cc="ng" country="Nigeria" operator="MTN Nigeria Communications Limited" status="Operational" 40 bands="LTE 900 / LTE 1800" brand="Ntel" cc="ng" country="Nigeria" operator="Nigerian Mobile Telecommunications Limited" status="Operational" 50 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 700" brand="Glo" cc="ng" country="Nigeria" operator="Globacom Ltd" status="Operational" 60 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="9mobile" cc="ng" country="Nigeria" operator="Etisalat). In transition since 2017" status="Operational" 00-99 622 01 bands="GSM 900 / UMTS" brand="Airtel" cc="td" country="Chad" operator="Bharti Airtel SA" status="Operational" 02 bands="CDMA2000" brand="Tawali" cc="td" country="Chad" operator="SotelTchad" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS / LTE 2600" brand="Tigo" cc="td" country="Chad" operator="Millicom" status="Operational" 07 bands="GSM 900 / GSM 1800" brand="Salam" cc="td" country="Chad" operator="SotelTchad" status="Operational" 00-99 623 01 bands="GSM 900" brand="CTP" cc="cf" country="Central African Republic" operator="Centrafrique Telecom Plus" status="Operational" 02 bands="GSM 900" brand="TC" cc="cf" country="Central African Republic" operator="Telecel Centrafrique" status="Operational" 03 bands="GSM 1800 / UMTS" brand="Orange" cc="cf" country="Central African Republic" operator="Orange RCA" status="Operational" 04 bands="GSM 900" brand="Nationlink" cc="cf" country="Central African Republic" operator="Nationlink Telecom RCA" status="Operational" 00-99 624 01 bands="GSM 900 / TD-LTE 2500" brand="MTN Cameroon" cc="cm" country="Cameroon" operator="Mobile Telephone Network Cameroon Ltd" status="Operational" 02 bands="GSM 900" brand="Orange" cc="cm" country="Cameroon" operator="Orange Cameroun S.A." status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Nexttel" cc="cm" country="Cameroon" operator="Viettel Cameroun" status="Operational" 00-99 625 01 bands="GSM 900 / UMTS" brand="CVMOVEL" cc="cv" country="Cape Verde" operator="CVMóvel, S.A." status="Operational" 02 bands="GSM 1800 / UMTS 2100" brand="T+" cc="cv" country="Cape Verde" operator="UNITEL T+ TELECOMUNICACÕES, S.A." status="Operational" 00-99 626 01 bands="GSM 900" brand="CSTmovel" cc="st" country="Sao Tome and Principe" operator="Companhia Santomese de Telecomunicaçôe" status="Operational" 02 bands="GSM 900" brand="Unitel STP" cc="st" country="Sao Tome and Principe" operator="Unitel Sao Tome and Principe" status="Operational" 00-99 627 01 bands="GSM 900" brand="Orange GQ" cc="gq" country="Equatorial Guinea" operator="GETESA" status="Operational" 03 bands="GSM 900 / GSM 1800" brand="Hits GQ" cc="gq" country="Equatorial Guinea" operator="HiTs EG.SA" status="Operational" 00-99 628 01 bands="GSM 900 / LTE" brand="Libertis" cc="ga" country="Gabon" operator="Gabon Telecom & Libertis S.A." status="Operational" 02 bands="GSM 900 / LTE" brand="Moov" cc="ga" country="Gabon" operator="Atlantique Télécom (Etisalat Group) Gabon S.A." status="Operational" 03 bands="GSM 900 / LTE" brand="Airtel" cc="ga" country="Gabon" operator="Airtel Gabon S.A." status="Operational" 04 bands="GSM 900 / GSM 1800" brand="Azur" cc="ga" country="Gabon" operator="USAN Gabon S.A." status="Operational" 05 bands="" brand="RAG" cc="ga" country="Gabon" operator="Réseau de l’Administration Gabonaise" status="" 00-99 629 01 bands="GSM 900 / UMTS 2100" brand="Airtel" cc="cg" country="Congo" operator="Celtel Congo" status="Operational" 07 bands="GSM 900" cc="cg" country="Congo" operator="Warid Telecom" status="Operational" 10 bands="GSM 900" brand="Libertis Telecom" cc="cg" country="Congo" operator="MTN CONGO S.A" status="Operational" 00-99 630 01 bands="GSM 900 / GSM 1800 / UMTS" brand="Vodacom" cc="cd" country="Democratic Republic of the Congo" operator="Vodacom Congo RDC sprl" status="Operational" 02 bands="GSM 900 / UMTS" brand="Airtel" cc="cd" country="Democratic Republic of the Congo" operator="Airtel sprl" status="Operational" 04 bands="" cc="cd" country="Democratic Republic of the Congo" operator="Cellco" status="" 05 bands="GSM 900 / GSM 1800" brand="Supercell" cc="cd" country="Democratic Republic of the Congo" operator="Supercell SPRL" status="Operational" 10 bands="GSM / LTE" brand="MTN" cc="cd" country="Democratic Republic of the Congo" status="Operational" 86 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Orange S.A." cc="cd" country="Democratic Republic of the Congo" operator="Orange RDC sarl" status="Operational" 88 bands="GSM 900 / GSM 1800" brand="YTT" cc="cd" country="Democratic Republic of the Congo" operator="Yozma Timeturns sprl" status="Not operational" 89 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Tigo" cc="cd" country="Democratic Republic of the Congo" operator="OASIS sprl" status="Operational" 90 bands="GSM 900 / GSM 1800" brand="Africell" cc="cd" country="Democratic Republic of the Congo" operator="Africell RDC sprl" status="Operational" 00-99 631 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="UNITEL" cc="ao" country="Angola" operator="UNITEL S.a.r.l." status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 900 / LTE 1800" brand="MOVICEL" cc="ao" country="Angola" operator="MOVICEL Telecommunications S.A." status="Operational" 00-99 632 01 bands="GSM 900 / GSM 1800" brand="Guinetel" cc="gw" country="Guinea-Bissau" operator="Guinétel S.A." status="Operational" 02 bands="GSM 900 / GSM 1800" brand="MTN Areeba" cc="gw" country="Guinea-Bissau" operator="Spacetel Guiné-Bissau S.A." status="Operational" 03 bands="GSM 900 / GSM 1800 / LTE" brand="Orange" cc="gw" country="Guinea-Bissau" status="Operational" 07 bands="GSM 900 / GSM 1800" brand="Guinetel" cc="gw" country="Guinea-Bissau" operator="Guinétel S.A." status="Operational" 00-99 633 01 bands="GSM 900 / UMTS" brand="Cable & Wireless" cc="sc" country="Seychelles" operator="Cable & Wireless Seychelles" status="Operational" 02 bands="GSM 1800" brand="Mediatech" cc="sc" country="Seychelles" operator="Mediatech International" status="Not operational" 10 bands="GSM 900 / UMTS 2100 / LTE 800" brand="Airtel" cc="sc" country="Seychelles" operator="Telecom Seychelles Ltd" status="Operational" 00-99 634 01 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Zain SD" cc="sd" country="Sudan" operator="Zain Group - Sudan" status="Operational" 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="MTN" cc="sd" country="Sudan" operator="MTN Sudan" status="Operational" 03 bands="" brand="MTN" cc="sd" country="Sudan" operator="MTN Sudan" status="" 05 bands="CDMA2000 450" brand="canar" cc="sd" country="Sudan" operator="Canar Telecom" status="Operational" 07 bands="GSM 1800 / UMTS 2100 / LTE 1800 / CDMA2000 800" brand="Sudani One" cc="sd" country="Sudan" operator="Sudatel Group" status="Operational" 09 brand="Privet Network" cc="sd" country="Sudan" operator="NEC" status="" 00-99 635 10 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="MTN" cc="rw" country="Rwanda" operator="MTN Rwandacell SARL" status="Operational" 11 bands="CDMA" brand="Rwandatel" cc="rw" country="Rwanda" operator="Rwandatel S.A." status="Not operational" 12 bands="GSM" brand="Rwandatel" cc="rw" country="Rwanda" operator="Rwandatel S.A." status="Not operational" 13 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Tigo" cc="rw" country="Rwanda" operator="TIGO RWANDA S.A" status="Operational" 14 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Airtel" cc="rw" country="Rwanda" operator="Airtel RWANDA" status="Operational" 17 bands="LTE 800" brand="Olleh" cc="rw" country="Rwanda" operator="Olleh Rwanda Networks" status="Operational" 00-99 636 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="MTN" cc="et" country="Ethiopia" operator="Ethio Telecom" status="Operational" 00-99 637 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE" brand="Telesom" cc="so" country="Somalia" operator="Telesom" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="Somafone" cc="so" country="Somalia" operator="Somafone FZLLC" status="Operational" 10 bands="GSM 900" brand="Nationlink" cc="so" country="Somalia" operator="NationLink Telecom" status="Operational" 20 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="SOMNET" cc="so" country="Somalia" operator="SOMNET" status="Operational" 30 bands="GSM 900" brand="Golis" cc="so" country="Somalia" operator="Golis Telecom Somalia" status="Operational" 50 bands="GSM 900 / UMTS" brand="Hormuud" cc="so" country="Somalia" operator="Hormuud Telecom Somalia Inc" status="Operational" 57 bands="GSM 900 / GSM 1800" brand="UNITEL" cc="so" country="Somalia" operator="UNITEL S.a.r.l." status="Operational" 60 bands="GSM 900 / GSM 1800" brand="Nationlink" cc="so" country="Somalia" operator="Nationlink Telecom" status="Operational" 67 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Horntel Group" cc="so" country="Somalia" operator="HTG Group Somalia" status="Operational" 70 bands="" cc="so" country="Somalia" operator="Onkod Telecom Ltd." status="Not operational" 71 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="Somtel" cc="so" country="Somalia" operator="Somtel" status="Operational" 82 bands="GSM 900 / GSM 1800 / CDMA2000 / LTE" brand="Telcom" cc="so" country="Somalia" operator="Telcom Somalia" status="Operational" 00-99 638 01 bands="GSM 900 / UMTS" brand="Evatis" cc="dj" country="Djibouti" operator="Djibouti Telecom SA" status="Operational" 00-99 639 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800" brand="Safaricom" cc="ke" country="Kenya" operator="Safaricom Limited" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="Airtel" cc="ke" country="Kenya" operator="Bharti Airtel" status="Operational" 05 bands="GSM 900" brand="yu" cc="ke" country="Kenya" operator="Essar Telecom Kenya" status="Not operational" 07 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 800" brand="Telkom" cc="ke" country="Kenya" operator="Telkom Kenya" status="Operational" 00-99 640 01 bands="UMTS 900" cc="tz" country="Tanzania" operator="Rural NetCo Limited" status="Not operational" 02 bands="GSM 900 / GSM 1800 / LTE 800" brand="tiGO" cc="tz" country="Tanzania" operator="MIC Tanzania Limited" status="Operational" 03 bands="GSM 900 / GSM 1800 / LTE 1800" brand="Zantel" cc="tz" country="Tanzania" operator="Zanzibar Telecom Ltd" status="Operational" 04 bands="GSM 900 / GSM 1800 / LTE 1800" brand="Vodacom" cc="tz" country="Tanzania" operator="Vodacom Tanzania Limited" status="Operational" 05 bands="GSM 900 / GSM 1800" brand="Airtel" cc="tz" country="Tanzania" operator="Bharti Airtel" status="Operational" 06 bands="CDMA 800" brand="Sasatel (Dovetel)" cc="tz" country="Tanzania" operator="Dovetel Limited" status="Not operational" 07 bands="CDMA 800 / LTE 1800 / TD-LTE 2300" brand="TTCL Mobile" cc="tz" country="Tanzania" operator="Tanzania Telecommunication Company LTD (TTCL)" status="Operational" 08 bands="TD-LTE 2300" brand="Smart" cc="tz" country="Tanzania" operator="Benson Informatics Limited" status="Operational" 09 bands="GSM 900 / GSM 1800" brand="Halotel" cc="tz" country="Tanzania" operator="Viettel Tanzania Limited" status="Operational" 11 bands="LTE 800" brand="SmileCom" cc="tz" country="Tanzania" operator="Smile Telecoms Holdings Ltd." status="Operational" 12 bands="" cc="tz" country="Tanzania" operator="MyCell Limited" status="Not operational" 13 bands="" brand="Cootel" cc="tz" country="Tanzania" operator="Wiafrica Tanzania Limited" status="" 00-99 641 01 bands="GSM 900 / UMTS 2100" brand="Airtel" cc="ug" country="Uganda" operator="Bharti Airtel" status="Operational" 04 bands="LTE" cc="ug" country="Uganda" operator="Tangerine Uganda Limited" status="Operational" 06 bands="TD-LTE 2600" brand="Vodafone" cc="ug" country="Uganda" operator="Afrimax Uganda" status="Operational" 10 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 2600" brand="MTN" cc="ug" country="Uganda" operator="MTN Uganda" status="Operational" 11 bands="GSM 900 / UMTS 2100" brand="Uganda Telecom" cc="ug" country="Uganda" operator="Uganda Telecom Ltd." status="Operational" 14 bands="GSM 900 / GSM 1800 / UMTS / LTE 800" brand="Africell" cc="ug" country="Uganda" operator="Africell Uganda" status="Operational" 16 bands="" cc="ug" country="Uganda" operator="SimbaNET Uganda Limited" status="" 18 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Smart" cc="ug" country="Uganda" operator="Suretelecom Uganda Ltd." status="Operational" 22 bands="GSM 900 / GSM 1800 / UMTS" brand="Airtel" cc="ug" country="Uganda" operator="Bharti Airtel" status="Operational" 26 bands="MVNO" brand="Lycamobile" cc="ug" country="Uganda" operator="Lycamobile Network Services Uganda Limited" status="Operational" 30 bands="" cc="ug" country="Uganda" operator="Anupam Global Soft Uganda Limited" status="Not operational" 33 bands="LTE 800" brand="Smile" cc="ug" country="Uganda" operator="Smile Communications Uganda Limited" status="Operational" 40 bands="" cc="ug" country="Uganda" operator="Civil Aviation Authority (CAA)" status="" 44 bands="MVNO" brand="K2" cc="ug" country="Uganda" operator="K2 Telecom Ltd" status="Operational" 66 bands="" brand="i-Tel" cc="ug" country="Uganda" operator="i-Tel Ltd" status="Not operational" 00-99 642 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE" brand="econet Leo" cc="bi" country="Burundi" operator="Econet Wireless Burundi PLC" status="Operational" 02 bands="GSM 900" brand="Tempo" cc="bi" country="Burundi" operator="VTEL MEA" status="Not operational" 03 bands="GSM 900" brand="Onatel" cc="bi" country="Burundi" operator="Onatel" status="Operational" 07 bands="GSM 1800 / UMTS" brand="Smart Mobile" cc="bi" country="Burundi" operator="LACELL SU" status="Operational" 08 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100 / LTE" brand="Lumitel" cc="bi" country="Burundi" operator="Viettel Burundi" status="Operational" 82 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="econet Leo" cc="bi" country="Burundi" operator="Econet Wireless Burundi PLC" status="Operational" 00-99 643 01 bands="GSM 900 / GSM 1800 / UMTS 900 / UMTS 2100" brand="mCel" cc="mz" country="Mozambique" operator="Mocambique Celular S.A." status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Movitel" cc="mz" country="Mozambique" operator="Movitel, SA" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="Vodacom" cc="mz" country="Mozambique" operator="Vodacom Mozambique, S.A." status="Operational" 00-99 645 01 bands="GSM 900 / LTE" brand="Airtel" cc="zm" country="Zambia" operator="Bharti Airtel" status="Operational" 02 bands="GSM 900 / LTE 1800" brand="MTN" cc="zm" country="Zambia" operator="MTN Group" status="Operational" 03 bands="GSM 900 / TD-LTE 2300" brand="ZAMTEL" cc="zm" country="Zambia" operator="Zambia Telecommunications Company Ltd" status="Operational" 00-99 646 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE" brand="Airtel" cc="mg" country="Madagascar" operator="Bharti Airtel" status="Operational" 02 bands="GSM 900 / LTE" brand="Orange" cc="mg" country="Madagascar" operator="Orange Madagascar S.A." status="Operational" 03 bands="GSM 900" brand="Sacel" cc="mg" country="Madagascar" operator="Sacel Madagascar S.A." status="Not operational" 04 bands="GSM 900 / LTE" brand="Telma" cc="mg" country="Madagascar" operator="Telma Mobile S.A." status="Operational" 00-99 647 00 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Orange" country="French Indian Ocean Territories (France) - YT/RE" operator="Orange La Réunion" status="Operational" 01 bands="GSM 900 / GSM 1800" country="French Indian Ocean Territories (France) - YT/RE" operator="BJT Partners" status="" 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Free" country="French Indian Ocean Territories (France) - YT/RE" operator="Telco OI" status="Operational" 03 bands="" brand="Free" country="French Indian Ocean Territories (France) - YT/RE" operator="Telco OI" status="" 04 bands="LTE" brand="4G Réunion" country="French Indian Ocean Territories (France) - YT/RE" operator="Zeop mobile" status="" 10 bands="GSM 900 / LTE 800 / LTE 1800 / LTE 2600" brand="SFR Réunion" country="French Indian Ocean Territories (France) - YT/RE" operator="Société Réunionnaise du Radiotéléphone" status="Operational" 00-99 648 01 bands="GSM 900 / LTE" brand="Net*One" cc="zw" country="Zimbabwe" operator="Net*One Cellular (Pvt) Ltd" status="Operational" 03 bands="GSM 900" brand="Telecel" cc="zw" country="Zimbabwe" operator="Telecel Zimbabwe (PVT) Ltd" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 1800" brand="Econet" cc="zw" country="Zimbabwe" operator="Econet Wireless" status="Operational" 00-99 649 01 bands="GSM 900 / GSM 1800 / LTE 800 / LTE 1800" brand="MTC" cc="na" country="Namibia" operator="MTC Namibia" status="Operational" 02 bands="CDMA2000 800" brand="switch" cc="na" country="Namibia" operator="Telecom Namibia" status="Operational" 03 bands="GSM 900 / GSM 1800 / LTE 1800 / LTE 2600" brand="TN Mobile" cc="na" country="Namibia" operator="Telecom Namibia" status="Operational" 04 bands="WiMAX 2500" cc="na" country="Namibia" operator="Paratus Telecommunications (Pty)" status="Operational" 05 bands="" cc="na" country="Namibia" operator="Demshi Investments CC" status="" 00-99 650 01 bands="GSM 900 / GSM 1800 / LTE 2500" brand="TNM" cc="mw" country="Malawi" operator="Telecom Network Malawi" status="Operational" 02 bands="CDMA / LTE 850" brand="Access" cc="mw" country="Malawi" operator="Access Communications Ltd" status="Operational" 10 bands="GSM 900 / UMTS 2100" brand="Airtel" cc="mw" country="Malawi" operator="Bharti Airtel Limited" status="Operational" 00-99 651 01 bands="GSM 900 / LTE 800" brand="Vodacom" cc="ls" country="Lesotho" operator="Vodacom Lesotho (Pty) Ltd" status="Operational" 02 bands="GSM / UMTS" brand="Econet Telecom" cc="ls" country="Lesotho" operator="Econet Ezi-cel" status="Operational" 00-99 652 01 bands="GSM 900 / UMTS / LTE 1800" brand="Mascom" cc="bw" country="Botswana" operator="Mascom Wireless (Pty) Limited" status="Operational" 02 bands="GSM 900 / UMTS 2100 / LTE 1800" brand="Orange" cc="bw" country="Botswana" operator="Orange (Botswana) Pty Limited" status="Operational" 04 bands="GSM 900 / GSM 1800 / LTE 1800" brand="BTC Mobile" cc="bw" country="Botswana" operator="Botswana Telecommunications Corporation" status="Operational" 00-99 653 01 bands="" cc="sz" country="Swaziland" operator="SPTC" status="" 02 bands="" cc="sz" country="Swaziland" operator="Swazi Mobile Limited" status="Operational" 10 bands="GSM 900" brand="Swazi MTN" cc="sz" country="Swaziland" operator="Swazi MTN Limited" status="Operational" 00-99 654 01 bands="GSM 900" brand="HURI" cc="km" country="Comoros" operator="Comoros Telecom" status="Operational" 02 bands="GSM 900 / UMTS 900 / LTE 800" brand="TELCO SA" cc="km" country="Comoros" operator="Telecom Malagasy (Telma)" status="Operational" 00-99 655 01 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 900 / LTE 1800 / LTE 2100" brand="Vodacom" cc="za" country="South Africa" operator="Vodacom" status="Operational" 02 bands="GSM 1800 / UMTS 2100 / LTE 1800 / TD-LTE 2300" brand="Telkom" cc="za" country="South Africa" operator="Telkom SA SOC Ltd" status="Operational" 04 bands="" cc="za" country="South Africa" operator="Sasol (Pty) Ltd." status="" 06 bands="" cc="za" country="South Africa" operator="Sentech (Pty) Ltd" status="Operational" 07 bands="GSM 900 / GSM 1800 / UMTS 900 / LTE 1800 / LTE 2100" brand="Cell C" cc="za" country="South Africa" operator="Cell C (Pty) Ltd" status="Operational" 10 bands="GSM 900 / UMTS 900 / UMTS 2100 / LTE 1800 / LTE 2100" brand="MTN" cc="za" country="South Africa" operator="MTN Group" status="Operational" 11 bands="TETRA 410" cc="za" country="South Africa" operator="South African Police Service Gauteng" status="Operational" 12 bands="" brand="MTN" cc="za" country="South Africa" operator="MTN Group" status="" 13 bands="CDMA 800" brand="Neotel" cc="za" country="South Africa" operator="Neotel Pty Ltd" status="Operational" 14 bands="LTE 1800" brand="Neotel" cc="za" country="South Africa" operator="Neotel Pty Ltd" status="Operational" 16 bands="" cc="za" country="South Africa" operator="Phoenix System Integration (Pty) Ltd" status="Not operational" 17 bands="" cc="za" country="South Africa" operator="Sishen Iron Ore Company (Ltd) Pty" status="" 19 bands="TD-LTE" cc="za" country="South Africa" operator="Wireless Business Solutions (Pty) Ltd" status="Operational" 21 bands="TETRA 410" cc="za" country="South Africa" operator="Cape Town Metropolitan Council" status="Operational" 24 bands="" cc="za" country="South Africa" operator="SMSPortal (Pty) Ltd." status="" 25 bands="" cc="za" country="South Africa" operator="Wirels Connect" status="" 27 bands="" cc="za" country="South Africa" operator="A to Z Vaal Industrial Supplies Pty Ltd" status="" 28 bands="" cc="za" country="South Africa" operator="Hymax Talking Solutions (Pty) Ltd" status="" 30 bands="" cc="za" country="South Africa" operator="Bokamoso Consortium" status="Operational" 31 bands="" cc="za" country="South Africa" operator="Karabo Telecoms (Pty) Ltd." status="Operational" 32 bands="" cc="za" country="South Africa" operator="Ilizwi Telecommunications" status="Operational" 33 bands="" cc="za" country="South Africa" operator="Thinta Thinta Telecommunications Pty Ltd" status="Operational" 34 bands="" cc="za" country="South Africa" operator="Bokone Telecoms Pty Ltd" status="" 35 bands="" cc="za" country="South Africa" operator="Kingdom Communications Pty Ltd" status="" 36 bands="" cc="za" country="South Africa" operator="Amatole Telecommunications Pty Ltd" status="" 38 bands="" brand="iBurst" cc="za" country="South Africa" operator="Wireless Business Solutions (Pty) Ltd" status="" 41 bands="" cc="za" country="South Africa" operator="South African Police Service" status="" 46 bands="MVNO" cc="za" country="South Africa" operator="SMS Cellular Services (Pty) Ltd" status="Operational" 50 bands="" cc="za" country="South Africa" operator="Ericsson South Africa (Pty) Ltd" status="" 51 bands="" cc="za" country="South Africa" operator="Integrat (Pty) Ltd" status="" 53 bands="MVNO" brand="Lycamobile" cc="za" country="South Africa" operator="Lycamobile (Pty) Ltd" status="" 73 bands="" brand="iBurst" cc="za" country="South Africa" operator="Wireless Business Solutions (Pty) Ltd" status="" 74 bands="" brand="iBurst" cc="za" country="South Africa" operator="Wireless Business Solutions (Pty) Ltd" status="" 00-99 657 01 bands="GSM 900" brand="Eritel" cc="er" country="Eritrea" operator="Eritrea Telecommunications Services Corporation" status="Operational" 00-99 658 01 bands="GSM 900 / GSM 1800 / LTE 1800" brand="Sure" cc="sh" country="Saint Helena, Ascension and Tristan da Cunha" operator="Sure South Atlantic Ltd." status="Operational" 00-99 659 02 bands="GSM 900 / GSM 1800 / UMTS 2100" brand="MTN" cc="ss" country="South Sudan" operator="MTN South Sudan" status="Operational" 03 bands="GSM 900 / GSM 1800" brand="Gemtel" cc="ss" country="South Sudan" operator="Gemtel" status="Operational" 04 bands="GSM 900 / GSM 1800" brand="Vivacell" cc="ss" country="South Sudan" operator="Network of the World (NOW)" status="Operational" 06 bands="GSM 900 / GSM 1800" brand="Zain" cc="ss" country="South Sudan" operator="Zain South Sudan" status="Operational" 07 bands="CDMA" brand="Sudani" cc="ss" country="South Sudan" operator="Sudani" status="Operational" 00-99 702 67 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 700 / LTE 1900" brand="DigiCell" cc="bz" country="Belize" operator="Belize Telemedia Limited (BTL)" status="Operational" 68 bands="" brand="INTELCO" cc="bz" country="Belize" operator="International Telecommunications Ltd." status="Not operational" 69 bands="CDMA2000 850 / LTE 700" brand="SMART" cc="bz" country="Belize" operator="Speednet Communications Limited" status="Operational" 99 bands="CDMA2000 850" brand="SMART" cc="bz" country="Belize" operator="Speednet Communications Limited" status="Operational" 00-99 704 01 bands="CDMA 1900 / GSM 900 / GSM 1900 / UMTS 1900" brand="Claro" cc="gt" country="Guatemala" operator="Telecomunicaciones de Guatemala, S.A." status="Operational" 02 bands="GSM 850 / TDMA 800 / UMTS 850 / LTE 850" brand="Tigo" cc="gt" country="Guatemala" operator="Millicom / Local partners" status="Operational" 03 bands="CDMA 1900 / GSM 1900 / UMTS 1900 / LTE 1900" brand="movistar" cc="gt" country="Guatemala" operator="Telefónica Móviles Guatemala (Telefónica)" status="Operational" 00-99 706 01 bands="GSM 1900 / UMTS 1900" brand="Claro" cc="sv" country="El Salvador" operator="CTE Telecom Personal, S.A. de C.V." status="Operational" 02 bands="GSM 900 / UMTS 900" brand="digicel" cc="sv" country="El Salvador" operator="Digicel, S.A. de C.V." status="Operational" 03 bands="GSM 850 / UMTS 850 / LTE 850" brand="Tigo" cc="sv" country="El Salvador" operator="Telemovil El Salvador S.A." status="Operational" 04 bands="GSM 850 / GSM 1900 / UMTS 1900 / LTE 1900" brand="movistar" cc="sv" country="El Salvador" operator="Telefónica Móviles El Salvador" status="Operational" 05 bands="iDEN" brand="RED" cc="sv" country="El Salvador" operator="INTELFON, S.A. de C.V." status="Operational" 00-99 708 001 bands="GSM 1900 / UMTS 1900 / LTE 1700" brand="Claro" cc="hn" country="Honduras" operator="Servicios de Comunicaciones de Honduras S.A. de C.V." status="Operational" 002 bands="CDMA 850 / GSM 850 / UMTS 850 / LTE 1700" brand="Tigo" cc="hn" country="Honduras" operator="Celtel" status="Operational" 030 bands="GSM 1900" brand="Hondutel" cc="hn" country="Honduras" operator="Empresa Hondureña de Telecomunicaciones" status="Operational" 040 bands="GSM 1900" brand="Digicel" cc="hn" country="Honduras" operator="Digicel de Honduras" status="Operational" 000-999 710 21 bands="GSM 1900 / UMTS 850 / LTE 1700" brand="Claro" cc="ni" country="Nicaragua" operator="Empresa Nicaragüense de Telecomunicaciones, S.A. (ENITEL) (América Móvil)" status="Operational" 30 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 1900" brand="movistar" cc="ni" country="Nicaragua" operator="Telefonía Celular de Nicaragua, S.A. (Telefónica, S.A.)" status="Operational" 73 bands="GSM 1900 / UMTS 850" brand="Claro" cc="ni" country="Nicaragua" operator="Servicios de Comunicaciones S.A." status="Operational" 00-99 712 01 bands="GSM 1800 / UMTS 850 / LTE 2600" brand="Kolbi ICE" cc="cr" country="Costa Rica" operator="Instituto Costarricense de Electricidad" status="Operational" 02 bands="GSM 1800 / UMTS 850 / LTE 2600" brand="Kolbi ICE" cc="cr" country="Costa Rica" operator="Instituto Costarricense de Electricidad" status="Operational" 03 bands="GSM 1800 / UMTS 2100 / LTE 1800" brand="Claro" cc="cr" country="Costa Rica" operator="Claro CR Telecomunicaciones (Aló)" status="Operational" 04 bands="GSM 1800 / UMTS 850 / UMTS 2100 / LTE 1800" brand="movistar" cc="cr" country="Costa Rica" operator="Telefónica Móviles Costa Rica" status="Operational" 20 bands="GSM 1800 / UMTS 850" brand="fullmóvil" cc="cr" country="Costa Rica" operator="Virtualis S.A." status="Operational" 00-99 714 01 bands="GSM 850 / UMTS 850 / LTE 700" brand="Cable & Wireless" cc="pa" country="Panama" operator="Cable & Wireless Panama S.A." status="Operational" 02 bands="GSM 850 / UMTS 850 / UMTS 1900 / LTE 700" brand="movistar" cc="pa" country="Panama" operator="Telefónica Moviles Panama S.A, Bell South Corp. (BSC)" status="Operational" 03 bands="GSM 1900 / UMTS 1900 / LTE 700 / LTE 1900" brand="Claro" cc="pa" country="Panama" operator="América Móvil" status="Operational" 04 bands="GSM 1900 / UMTS 1900" brand="Digicel" cc="pa" country="Panama" operator="Digicel Group" status="Operational" 00-99 716 06 bands="CDMA2000 850 / GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 700 / LTE 1700" brand="Movistar" cc="pe" country="Peru" operator="Telefónica del Perú S.A.A." status="Operational" 07 bands="iDEN" brand="Entel" cc="pe" country="Peru" operator="Entel Perú S.A." status="Operational" 10 bands="GSM 1900 / UMTS 850 / LTE 700 / LTE 1900 / TD-LTE 3500" brand="Claro" cc="pe" country="Peru" operator="América Móvil Perú" status="Operational" 15 bands="GSM 1900 / UMTS 1900 / LTE 900" brand="Bitel" cc="pe" country="Peru" operator="Viettel Peru S.A.C." status="Operational" 17 bands="UMTS 1900 / LTE 1700 / TD-LTE 2300" brand="Entel" cc="pe" country="Peru" operator="Entel Perú S.A." status="Operational" 00-99 722 010 bands="GSM 850 / GSM 1900 / UMTS / LTE 1700" brand="Movistar" cc="ar" country="Argentina" operator="Telefónica Móviles Argentina S.A." status="Operational" 020 bands="iDEN 800" brand="Nextel" cc="ar" country="Argentina" operator="NII Holdings" status="Operational" 034 bands="" brand="Personal" cc="ar" country="Argentina" operator="Telecom Personal S.A." status="Operational" 040 bands="" brand="Globalstar" cc="ar" country="Argentina" operator="TE.SA.M Argentina S.A." status="Operational" 070 bands="GSM 1900" brand="Movistar" cc="ar" country="Argentina" operator="Telefónica Móviles Argentina S.A." status="Operational" 310 bands="GSM 1900" brand="Claro" cc="ar" country="Argentina" operator="AMX Argentina S.A." status="Operational" 320 bands="GSM 850 / GSM 1900 / UMTS / LTE 1700" brand="Claro" cc="ar" country="Argentina" operator="AMX Argentina S.A." status="Operational" 330 bands="GSM 850 / GSM 1900 / UMTS / LTE 1700" brand="Claro" cc="ar" country="Argentina" operator="AMX Argentina S.A." status="Operational" 341 bands="GSM 850 / GSM 1900 / UMTS / LTE 700 / LTE 1700 / LTE 2600" brand="Personal" cc="ar" country="Argentina" operator="Telecom Personal S.A." status="Operational" 350 bands="GSM 900" brand="PORT-HABLE" cc="ar" country="Argentina" operator="Hutchison Telecommunications Argentina S.A." status="Not operational" 000-999 724 00 bands="iDEN 850" brand="Nextel" cc="br" country="Brazil" operator="NII Holdings, Inc." status="Operational" 01 bands="MVNO" cc="br" country="Brazil" operator="SISTEER DO BRASIL TELECOMUNICAÇÔES" status="" 02 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="TIM" cc="br" country="Brazil" operator="Telecom Italia Mobile" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="TIM" cc="br" country="Brazil" operator="Telecom Italia Mobile" status="Operational" 04 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="TIM" cc="br" country="Brazil" operator="Telecom Italia Mobile" status="Operational" 05 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="Claro" cc="br" country="Brazil" operator="Claro" status="Operational" 06 bands="GSM 850 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="Vivo" cc="br" country="Brazil" operator="Vivo S.A." status="Operational" 10 bands="GSM 850 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="Vivo" cc="br" country="Brazil" operator="Vivo S.A." status="Operational" 11 bands="GSM 850 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800 / LTE 2600" brand="Vivo" cc="br" country="Brazil" operator="Vivo S.A." status="Operational" 15 bands="GSM 900 / GSM 1800 / UMTS 850" brand="Sercomtel" cc="br" country="Brazil" operator="Sercomtel Celular" status="Operational" 16 bands="GSM 1800 / UMTS 2100" brand="Brasil Telecom GSM" cc="br" country="Brazil" operator="Brasil Telecom GSM" status="Not operational" 17 bands="MVNO" brand="Correios" cc="br" country="Brazil" operator="Correios Celular" status="Operational" 18 bands="MVNO" brand="datora" cc="br" country="Brazil" operator="Datora (Vodafone)" status="Operational" 23 bands="GSM 850 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Vivo" cc="br" country="Brazil" operator="Vivo S.A." status="Operational" 24 bands="" cc="br" country="Brazil" operator="Amazonia Celular" status="" 30 bands="" brand="Oi" cc="br" country="Brazil" operator="TNL PCS Oi" status="" 31 bands="GSM 1800 / UMTS 2100 / LTE 1800 / LTE 2600" brand="Oi" cc="br" country="Brazil" operator="TNL PCS Oi" status="Operational" 32 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800" brand="Algar Telecom" cc="br" country="Brazil" operator="Algar Telecom S.A." status="Operational" 33 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800" brand="Algar Telecom" cc="br" country="Brazil" operator="Algar Telecom S.A." status="Operational" 34 bands="GSM 900 / GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1800" brand="Algar Telecom" cc="br" country="Brazil" operator="Algar Telecom S.A." status="Operational" 35 bands="" cc="br" country="Brazil" operator="Telcom Telecomunicações" status="" 36 bands="" cc="br" country="Brazil" operator="Options Telecomunicações" status="" 37 bands="" brand="aeiou" cc="br" country="Brazil" operator="Unicel" status="Not operational" 38 bands="" brand="Claro" cc="br" country="Brazil" operator="Claro" status="" 39 bands="UMTS 2100 / LTE 1800" brand="Nextel" cc="br" country="Brazil" operator="NII Holdings, Inc." status="Operational" 54 bands="MVNO" brand="Conecta" cc="br" country="Brazil" operator="PORTO SEGURO TELECOMUNICAÇÔES" status="Operational" 99 bands="" brand="Local" cc="br" country="Brazil" operator="Local ( purpose or usage)" status="" 00-99 730 01 bands="GSM 1900 / UMTS 1900 / LTE 700 / LTE 2600" brand="entel" cc="cl" country="Chile" operator="Entel Telefonía Móvil S.A." status="Operational" 02 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 700 / LTE 2600" brand="movistar" cc="cl" country="Chile" operator="Telefónica Móvil de Chile" status="Operational" 03 bands="GSM 1900 / UMTS 850 / UMTS 1900 / LTE 2600" brand="CLARO CL" cc="cl" country="Chile" operator="Claro Chile S.A." status="Operational" 04 bands="iDEN 800" brand="WOM" cc="cl" country="Chile" operator="Novator Partners" status="Operational" 05 bands="" cc="cl" country="Chile" operator="Multikom S.A." status="" 06 bands="MVNO" brand="Telsur" cc="cl" country="Chile" operator="Blue Two Chile S.A." status="Operational" 07 bands="" brand="movistar" cc="cl" country="Chile" operator="Telefónica Móvil de Chile" status="" 08 bands="MVNO" brand="VTR Móvil" cc="cl" country="Chile" operator="VTR S.A." status="Operational" 09 bands="UMTS 1700 / LTE 1700" brand="WOM" cc="cl" country="Chile" operator="Novator Partners" status="Operational" 10 bands="GSM 1900 / UMTS 1900" brand="entel" cc="cl" country="Chile" operator="Entel Telefonía Móvil S.A." status="Operational" 11 bands="" cc="cl" country="Chile" operator="Celupago S.A." status="" 12 bands="MVNO" brand="Wanderers Móvil" cc="cl" country="Chile" operator="Telestar Móvil S.A." status="Operational" 13 bands="MVNO" brand="Virgin Mobile" cc="cl" country="Chile" operator="Tribe Mobile Chile SPA" status="Operational" 14 bands="" cc="cl" country="Chile" operator="Netline Telefónica Móvil Ltda" status="" 15 bands="" cc="cl" country="Chile" operator="Cibeles Telecom S.A." status="" 16 bands="MVNO" cc="cl" country="Chile" operator="Nomade Telecomunicaciones S.A." status="" 17 bands="" cc="cl" country="Chile" operator="COMPATEL Chile Limitada" status="" 18 bands="" cc="cl" country="Chile" operator="Empresas Bunker S.A." status="" 19 bands="MVNO" brand="móvil Falabella" cc="cl" country="Chile" operator="Sociedad Falabella Móvil SPA" status="Operational" 20 bands="" cc="cl" country="Chile" operator="Inversiones Santa Fe Limitada" status="" 99 bands="GSM 1900 / UMTS 1900" brand="Will" cc="cl" country="Chile" operator="WILL Telefonía" status="Operational" 00-99 732 001 bands="" brand="movistar" cc="co" country="Colombia" operator="Colombia Telecomunicaciones S.A. ESP" status="Operational" 002 bands="" brand="Edatel" cc="co" country="Colombia" operator="Edatel S.A. ESP" status="" 003 bands="" cc="co" country="Colombia" operator="LLEIDA S.A.S." status="" 004 bands="" cc="co" country="Colombia" operator="COMPATEL COLOMBIA SAS" status="" 020 bands="LTE 2600" brand="Tigo" cc="co" country="Colombia" operator="Une EPM Telecomunicaciones S.A. E.S.P." status="Operational" 099 bands="GSM 900" brand="EMCALI" cc="co" country="Colombia" operator="Empresas Municipales de Cali" status="Operational" 101 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 2600" brand="Claro" cc="co" country="Colombia" operator="COMCEL S.A." status="Operational" 102 bands="GSM 850 / GSM 1900 / CDMA 850" cc="co" country="Colombia" operator="Bellsouth Colombia" status="Not operational" 103 bands="GSM 1900 / UMTS / LTE 1700" brand="Tigo" cc="co" country="Colombia" operator="Colombia Móvil S.A. ESP" status="Operational" 111 bands="GSM 1900 / UMTS / LTE 1700" brand="Tigo" cc="co" country="Colombia" operator="Colombia Móvil S.A. ESP" status="Operational" 123 bands="GSM 850 / GSM 1900 / UMTS / LTE 1700 / CDMA 850" brand="movistar" cc="co" country="Colombia" operator="Colombia Telecomunicaciones S.A. ESP" status="Operational" 130 bands="GSM 850 / iDEN / LTE 1700" brand="AVANTEL" cc="co" country="Colombia" operator="Avantel S.A.S" status="Operational" 142 bands="" cc="co" country="Colombia" operator="Une EPM Telecomunicaciones S.A. E.S.P." status="" 154 bands="MVNO" brand="Virgin Mobile" cc="co" country="Colombia" operator="Virgin Mobile Colombia S.A.S." status="Operational" 165 bands="" cc="co" country="Colombia" operator="Colombia Móvil S.A. ESP" status="" 176 bands="TD-LTE 2600" cc="co" country="Colombia" operator="DirecTV Colombia Ltda" status="Operational" 187 bands="LTE 1700" brand="eTb" cc="co" country="Colombia" operator="Empresa de Telecomunicaciones de Bogotá S.A. ESP" status="Operational" 199 bands="" cc="co" country="Colombia" operator="SUMA Movil SAS" status="" 000-999 734 01 bands="GSM 900" brand="Digitel" cc="ve" country="Venezuela" operator="Corporacion Digitel C.A." status="Not operational" 02 bands="GSM 900 / GSM 1800 / UMTS 900 / LTE 1800" brand="Digitel GSM" cc="ve" country="Venezuela" operator="Corporacion Digitel C.A." status="Operational" 03 bands="LTE 2600" brand="DirecTV" cc="ve" country="Venezuela" operator="Galaxy Entertainment de Venezuela C.A." status="" 04 bands="GSM 850 / GSM 1900 / UMTS 1900 / LTE 1700" brand="movistar" cc="ve" country="Venezuela" operator="Telefónica Móviles Venezuela" status="Operational" 06 bands="CDMA2000 850 / GSM 850 / UMTS 1900 / LTE 1700" brand="Movilnet" cc="ve" country="Venezuela" operator="Telecomunicaciones Movilnet" status="Operational" 00-99 736 01 bands="GSM 1900 / UMTS / LTE 1700" brand="Viva" cc="bo" country="Bolivia" operator="Nuevatel PCS De Bolivia SA" status="Operational" 02 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 700" brand="Entel" cc="bo" country="Bolivia" operator="Entel SA" status="Operational" 03 bands="GSM 850 / UMTS / LTE 700" brand="Tigo" cc="bo" country="Bolivia" operator="Telefónica Celular De Bolivia S.A" status="Operational" 00-99 738 01 bands="GSM 900" brand="Digicel" cc="gy" country="Guyana" operator="U-Mobile (Cellular) Inc." status="Operational" 02 bands="GSM 900 / LTE" brand="GT&T Cellink Plus" cc="gy" country="Guyana" operator="Guyana Telephone & Telegraph Co." status="Operational" 03 bands="TD-LTE" cc="gy" country="Guyana" operator="Quark Communications Inc." status="" 05 bands="" cc="gy" country="Guyana" operator="eGovernment Unit, Ministry of the Presidency" status="" 00-99 740 00 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 1900" brand="Movistar" cc="ec" country="Ecuador" operator="Otecel S.A." status="Operational" 01 bands="GSM 850 / UMTS 850 / UMTS 1900 / LTE 1700" brand="Claro" cc="ec" country="Ecuador" operator="CONECEL S.A." status="Operational" 02 bands="GSM 850 / UMTS 1900 / LTE 1700" brand="CNT Mobile" cc="ec" country="Ecuador" operator="Corporación Nacional de Telecomunicaciones (CNT EP)" status="Operational" 03 bands="MVNO" brand="Tuenti" cc="ec" country="Ecuador" operator="Otecel S.A." status="Operational" 00-99 744 01 bands="GSM 1900 / UMTS 900" brand="VOX" cc="py" country="Paraguay" operator="Hola Paraguay S.A" status="Operational" 02 bands="GSM 1900 / UMTS 1900 / LTE 1700" brand="Claro/Hutchison" cc="py" country="Paraguay" operator="AMX Paraguay S.A." status="Operational" 03 bands="" cc="py" country="Paraguay" operator="Compañia Privada de Comunicaciones S.A." status="" 04 bands="GSM 850 / UMTS 850 / LTE 1700" brand="Tigo" cc="py" country="Paraguay" operator="Telefónica Celular Del Paraguay S.A. (Telecel)" status="Operational" 05 bands="GSM 850 / GSM 1900 / UMTS 850 / UMTS 1900 / LTE 1900" brand="Personal" cc="py" country="Paraguay" operator="Núcleo S.A(TIM)" status="Operational" 06 bands="GSM 1800 / LTE 1700" brand="Copaco" cc="py" country="Paraguay" operator="Copaco S.A." status="Operational" 00-99 746 02 bands="GSM 900 / GSM 1800 / UMTS 2100 / LTE 700 / LTE 1800" brand="Telesur" cc="sr" country="Suriname" operator="Telecommunications Company Suriname (Telesur)" status="Operational" 03 bands="GSM 900 / GSM 1800 / UMTS 850" brand="Digicel" cc="sr" country="Suriname" operator="Digicel Group Limited" status="Operational" 04 bands="GSM 900 / UMTS" brand="Digicel" cc="sr" country="Suriname" operator="Digicel Group Limited" status="Not operational" 05 bands="CDMA 450" brand="Telesur" cc="sr" country="Suriname" operator="Telecommunications Company Suriname (Telesur)" status="" 00-99 748 00 bands="TDMA" brand="Antel" cc="uy" country="Uruguay" operator="Administración Nacional de Telecomunicaciones" status="" 01 bands="GSM 1800 / UMTS 850 / UMTS 2100 / LTE 700 / LTE 1700" brand="Antel" cc="uy" country="Uruguay" operator="Administración Nacional de Telecomunicaciones" status="Operational" 03 bands="" brand="Antel" cc="uy" country="Uruguay" operator="Administración Nacional de Telecomunicaciones" status="" 07 bands="GSM 850 / GSM 1900 / UMTS 850 / LTE 1900" brand="Movistar" cc="uy" country="Uruguay" operator="Telefónica Móviles Uruguay" status="Operational" 10 bands="GSM 1900 / UMTS 1900 / LTE 1700" brand="Claro" cc="uy" country="Uruguay" operator="AM Wireless Uruguay S.A." status="Operational" 00-99 750 001 bands="GSM 900" brand="Sure" cc="fk" country="Falkland Islands (United Kingdom)" operator="Sure South Atlantic Ltd." status="Operational" 000-999 901 01 bands="Satellite" brand="ICO" country="International operators" operator="ICO Satellite Management" status="Not operational" 02 bands="" country="International operators" operator="Unassigned" status="Returned spare" 03 bands="Satellite" brand="Iridium" country="International operators" status="Operational" 04 bands="Satellite" country="International operators" operator="Unassigned" status="Returned spare" 05 bands="Satellite" country="International operators" operator="Thuraya RMSS Network" status="Operational" 06 bands="Satellite" country="International operators" operator="Thuraya Satellite Telecommunications Company" status="Operational" 07 bands="" country="International operators" operator="Unassigned" status="Returned spare" 08 bands="" country="International operators" operator="Unassigned" status="Returned spare" 09 bands="" country="International operators" operator="Unassigned" status="Returned spare" 10 bands="Satellite" brand="ACeS" country="International operators" status="Not operational" 11 bands="Satellite" brand="Inmarsat" country="International operators" status="Operational" 12 bands="GSM 1800 / LTE 800" brand="Telenor" country="International operators" operator="Telenor Maritime AS" status="Operational" 13 bands="GSM 1800" brand="GSM.AQ" country="International operators" operator="BebbiCell AG" status="Operational" 14 bands="GSM 1800" brand="AeroMobile" country="International operators" operator="AeroMobile AS" status="Operational" 15 bands="GSM 1800" brand="OnAir" country="International operators" operator="OnAir Switzerland Sarl" status="Operational" 16 bands="" brand="Cisco Jasper" country="International operators" operator="Cisco Systems, Inc." status="Operational" 17 bands="GSM 1800" brand="Navitas" country="International operators" operator="JT Group Limited" status="Not operational" 18 bands="GSM 900 / GSM 1900 / CDMA2000 1900 / UMTS 1900" brand="Cellular @Sea" country="International operators" operator="AT&T Mobility" status="Operational" 19 bands="GSM 900 / GSM 1800 / UMTS 2100" country="International operators" operator="Vodafone Malta Maritime" status="Operational" 20 bands="" country="International operators" operator="Intermatica" status="" 21 bands="GSM 1800" country="International operators" operator="Wins Limited" status="Operational" 22 bands="" country="International operators" operator="MediaLincc Ltd" status="" 23 bands="" country="International operators" operator="Unassigned" status="Returned spare" 24 bands="" brand="iNum" country="International operators" operator="Voxbone" status="" 25 bands="" country="International operators" operator="Unassigned" status="Returned spare" 26 bands="GSM 1800 / GSM 1900" brand="TIM@sea" country="International operators" operator="Telecom Italia Mobile" status="Operational" 27 bands="GSM 1800" brand="OnMarine" country="International operators" operator="Monaco Telecom" status="Operational" 28 bands="Roaming SIM" brand="Vodafone" country="International operators" operator="GDSP (Vodafone's Global Data Service Platform)" status="Operational" 29 bands="" brand="Telenor" country="International operators" status="" 30 bands="" country="International operators" operator="Unassigned" status="Returned spare" 31 bands="GSM 900" brand="Orange" country="International operators" operator="Orange S.A." status="Operational" 32 bands="GSM 900" brand="Sky High" country="International operators" operator="MegaFon" status="Operational" 33 bands="" country="International operators" operator="Smart Communications" status="" 34 bands="" country="International operators" operator="tyntec GmbH" status="" 35 bands="GSM 850" country="International operators" operator="Globecomm Network Services" status="Operational" 36 bands="GSM 1800" country="International operators" operator="Azerfon" status="Operational" 37 bands="MVNO" country="International operators" operator="Transatel" status="Operational" 38 bands="MVNO" country="International operators" operator="Multiregional TransitTelecom (MTT)" status="Operational" 39 bands="MVNO" country="International operators" operator="MTX Connect Ltd" status="Operational" 40 bands="" country="International operators" operator="Deutsche Telekom AG" status="" 41 bands="MVNO" country="International operators" operator="BodyTrace Netherlands B.V." status="Operational" 42 bands="" country="International operators" operator="DCN Hub ehf" status="" 43 bands="MVNO" country="International operators" operator="EMnify GmbH" status="Operational" 44 bands="" country="International operators" operator="AT&T Inc." status="" 45 bands="" country="International operators" operator="Advanced Wireless Network Company Limited" status="" 46 bands="MVNO" country="International operators" operator="Telecom26 AG" status="Operational" 47 bands="" country="International operators" operator="Ooredoo" status="" 48 bands="" brand="Com4" country="International operators" operator="Communication for Devices in Sweden AB" status="" 49 bands="" country="International operators" operator="Zain Kuwait" status="" 50 bands="Satellite" country="International operators" operator="EchoStar Mobile" status="" 51 bands="" country="International operators" operator="VisionNG" status="" 52 bands="" country="International operators" operator="Manx Telecom Trading Ltd." status="" 53 bands="" country="International operators" operator="Deutsche Telekom AG" status="" 54 bands="" country="International operators" operator="Teleena Holding B.V." status="" 55 bands="" country="International operators" operator="Beezz Communication Solutions Ltd." status="" 56 bands="" brand="ETSI" country="International operators" operator="European Telecommunications Standards Institute" status="" 57 bands="" country="International operators" operator="SAP" status="" 58 bands="" brand="BICS" country="International operators" operator="Belgacom ICS SA" status="" 88 bands="" country="International operators" operator="UN Office for the Coordination of Humanitarian Affairs (OCHA)" status="" 00-99 995 01 bands="GSM 900" brand="FonePlus" cc="io" country="British Indian Ocean Territory (United Kingdom)" operator="Sure (Diego Garcia) Ltd" status="Operational" 00-99 python-stdnum-1.8.1/stdnum/au/0000755000000000000000000000000013224171743016233 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/au/abn.py0000644000000000000000000000516313223166517017354 0ustar rootroot00000000000000# abn.py - functions for handling Australian Business Numbers (ABNs) # # Copyright (C) 2016 Vincent Bastos # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ABN (Australian Business Number). The Australian Business Number (ABN) is an identifier issued to entities registered in the Australian Business Register (ABR). The number consists of 11 digits of which the first two are check digits. More information: * https://en.wikipedia.org/wiki/Australian_Business_Number * https://abr.business.gov.au/ >>> validate('83 914 571 673') '83914571673' >>> validate('99 999 999 999') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('51824753556') '51 824 753 556' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def calc_check_digits(number): """Calculate the check digits that should be prepended to make the number valid.""" weights = (3, 5, 7, 9, 11, 13, 15, 17, 19) s = sum(-w * int(n) for w, n in zip(weights, number)) return str(11 + (s - 1) % 89) def validate(number): """Check if the number is a valid ABN. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 11: raise InvalidLength() if calc_check_digits(number[2:]) != number[:2]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid ABN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[0:2], number[2:5], number[5:8], number[8:])) python-stdnum-1.8.1/stdnum/au/__init__.py0000644000000000000000000000155213223166517020351 0ustar rootroot00000000000000# __init__.py - collection of Australian numbers # coding: utf-8 # # Copyright (C) 2016 Vincent Bastos # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Australian numbers.""" python-stdnum-1.8.1/stdnum/au/tfn.py0000644000000000000000000000513113223166517017376 0ustar rootroot00000000000000# tfn.py - functions for handling Australian Tax File Numbers (TFNs) # # Copyright (C) 2016 Vincent Bastos # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """TFN (Australian Tax File Number). The Tax File Number (TFN) is issued by the Australian Taxation Office (ATO) to taxpaying individuals and organisations. A business has both a TFN and an Australian Business Number (ABN). The number consists of 8 (older numbers) or 9 digits and includes a check digit but otherwise without structure. More information: * https://en.wikipedia.org/wiki/Tax_file_number * https://www.ato.gov.au/Individuals/Tax-file-number/ >>> validate('123 456 782') '123456782' >>> validate('999 999 999') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('123456782') '123 456 782' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def checksum(number): """Calculate the checksum.""" weights = (1, 4, 3, 7, 5, 8, 6, 9, 10) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def validate(number): """Check if the number is a valid TFN. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) not in (8, 9): raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid TFN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[0:3], number[3:6], number[6:])) python-stdnum-1.8.1/stdnum/au/acn.py0000644000000000000000000000520113223166517017346 0ustar rootroot00000000000000# acn.py - functions for handling Australian Company Numbers (ACNs) # # Copyright (C) 2016 Vincent Bastos # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ACN (Australian Company Number). The Australian Company Number (ACN) is a company identifier issued by the Australian Securities and Investments Commission. More information: * https://en.wikipedia.org/wiki/Australian_Company_Number >>> validate('004 085 616') '004085616' >>> validate('010 499 966') '010499966' >>> validate('999 999 999') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('004085616') '004 085 616' >>> to_abn('002 724 334') '43002724334' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def calc_check_digit(number): """Calculate the checksum.""" return str((sum(int(n) * (i - 8) for i, n in enumerate(number))) % 10) def validate(number): """Check if the number is a valid ACN. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid ACN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[0:3], number[3:6], number[6:])) def to_abn(number): """Convert the number to an Australian Business Number (ABN).""" from stdnum.au import abn number = compact(number) return abn.calc_check_digits(number) + number python-stdnum-1.8.1/stdnum/tr/0000755000000000000000000000000013224171744016254 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/tr/tckimlik.py0000644000000000000000000000712513223166521020436 0ustar rootroot00000000000000# tckimlik.py - functions for handling T.C. Kimlik No. # coding: utf-8 # # Copyright (C) 2016-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """T.C. Kimlik No. (Turkish personal identification number) The Turkish Identification Number (Türkiye Cumhuriyeti Kimlik Numarası) is a unique personal identification number assigned to every citizen of Turkey. The number consists of 11 digits and the last two digits are check digits. More information: * https://en.wikipedia.org/wiki/Turkish_Identification_Number * https://tckimlik.nvi.gov.tr/ >>> validate('17291716060') '17291716060' >>> validate('17291716050') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('1729171606') Traceback (most recent call last): ... InvalidLength: ... >>> validate('07291716092') # number must not start with a 0 Traceback (most recent call last): ... InvalidFormat: ... """ from stdnum.exceptions import * from stdnum.util import clean, get_soap_client tckimlik_wsdl = 'https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL' """The WSDL URL of the T.C. Kimlik validation service.""" def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number).strip() def calc_check_digits(number): """Calculate the check digits for the specified number. The number passed should not have the check digit included.""" check1 = (10 - sum((3, 1)[i % 2] * int(n) for i, n in enumerate(number[:9]))) % 10 check2 = (check1 + sum(int(n) for n in number[:9])) % 10 return '%d%d' % (check1, check2) def validate(number): """Check if the number is a valid .C. Kimlik number. This checks the length and check digits.""" number = compact(number) if not number.isdigit() or number[0] == '0': raise InvalidFormat() if len(number) != 11: raise InvalidLength() if calc_check_digits(number) != number[-2:]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid .C. Kimlik number.""" try: return bool(validate(number)) except ValidationError: return False def check_kps(number, name, surname, birth_year): # pragma: no cover """Query the online T.C. Kimlik validation service run by the Directorate of Population and Citizenship Affairs. This returns a boolean but may raise a SOAP exception for missing or invalid values.""" # this function isn't automatically tested because it would require # network access for the tests and unnecessarily load the online service number = compact(number) client = get_soap_client(tckimlik_wsdl) result = client.TCKimlikNoDogrula( TCKimlikNo=number, Ad=name, Soyad=surname, DogumYili=birth_year) if hasattr(result, 'get'): return result.get('TCKimlikNoDogrulaResult') return result python-stdnum-1.8.1/stdnum/tr/__init__.py0000644000000000000000000000154413223166521020365 0ustar rootroot00000000000000# __init__.py - collection of Turkish numbers # coding: utf-8 # # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Turkish numbers.""" python-stdnum-1.8.1/stdnum/ar/0000755000000000000000000000000013224171743016230 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ar/cuit.py0000644000000000000000000000465413223166517017561 0ustar rootroot00000000000000# cuit.py - functions for handling Argentinian VAT numbers # coding: utf-8 # # Copyright (C) 2009 Mariano Reingart # Copyright (C) 2011 Sebastián Marró # Copyright (C) 2008-2011 Cédric Krier # Copyright (C) 2008-2011 B2CK # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CUIT (Código Único de Identificación Tributaria, Argentinian tax number). The CUIT is a taxpayer identification number used for VAT (IVA, Impuesto al Valor Agregado) and other taxes. >>> validate('200-5536168-2') '20055361682' >>> validate('2026756539') Traceback (most recent call last): ... InvalidLength: ... >>> validate('2026756A393') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('20267565392') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def calc_check_digit(number): """Calculate the check digit.""" weights = (5, 4, 3, 2, 7, 6, 5, 4, 3, 2) check = sum(w * int(n) for w, n in zip(weights, number)) % 11 return '012345678990'[11 - check] def validate(number): """Check if the number is a valid CUIT.""" number = compact(number) if len(number) != 11: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid CUIT.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ar/__init__.py0000644000000000000000000000165113156325246020347 0ustar rootroot00000000000000# __init__.py - collection of Argentinian numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Argentinian numbers.""" # provide vat as an alias from stdnum.ar import cuit as vat python-stdnum-1.8.1/stdnum/ar/cbu.py0000644000000000000000000000532013223166517017355 0ustar rootroot00000000000000# cbu.py - functions for handling Argentinian CBU numbers # coding: utf-8 # # Copyright (C) 2016 Luciano Rossi # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CBU (Clave Bancaria Uniforme, Argentine bank account number). CBU it s a code of the Banks of Argentina to identify customer accounts. The number consists of 22 digits and consists of a 3 digit bank identiefyer, followed by a 4 digit branch identifyer, a check digit, a 13 digit account identifyer and another check digit. More information: * https://es.wikipedia.org/wiki/Clave_Bancaria_Uniforme * http://www.clientebancario.gov.ar/mediospago/mp080000.asp >>> validate('2850590940090418135201') '2850590940090418135201' >>> format('2850590940090418135201') '28505909 40090418135201' >>> validate('2810590940090418135201') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def calc_check_digit(number): """Calculate the check digit.""" weights = (3, 1, 7, 9) check = sum(int(n) * weights[i % 4] for i, n in enumerate(reversed(number))) return str((10 - check) % 10) def validate(number): """Check if the number is a valid CBU.""" number = compact(number) if len(number) != 22: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if calc_check_digit(number[:7]) != number[7]: raise InvalidChecksum() if calc_check_digit(number[8:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid CBU.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[:8], number[8:])) python-stdnum-1.8.1/stdnum/at/0000755000000000000000000000000013224171743016232 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/at/businessid.py0000644000000000000000000000422513223166517020761 0ustar rootroot00000000000000# businessid.py - functions for handling Austrian company register numbers # # Copyright (C) 2015 Holvi Payment Services Oy # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Austrian Company Register Numbers. The Austrian company register number consist of digits followed by a single letter, e.g. "122119m". Sometimes it is presented with preceding "FN", e.g. "FN 122119m". >>> validate('FN 122119m') '122119m' >>> validate('122119m') '122119m' >>> validate('m123123') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('abc') Traceback (most recent call last): ... InvalidFormat: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace. Preceding "FN" is also removed.""" number = clean(number, ' -./').strip() if number.upper().startswith('FN'): number = number[2:] return number def validate(number): """Check if the number is a valid company register number. This only checks the formatting.""" number = compact(number) if not number[-1:].isalpha() or not number[:-1].isdigit(): raise InvalidFormat() return number def is_valid(number): """Check if the number is a valid company register number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/at/uid.py0000644000000000000000000000447513223166517017401 0ustar rootroot00000000000000# vat.py - functions for handling Austrian VAT numbers # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number). The Austrian UID is a 9-digit number that starts with a U (optionally preceded with AT). The last digit is a check digit. >>> validate('AT U13585627') 'U13585627' >>> calc_check_digit('U1358562') '7' >>> validate('U13585626') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -./').upper().strip() if number.startswith('AT'): number = number[2:] return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" return str((6 - luhn.checksum(number[1:])) % 10) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if number[:1] != 'U' or not number[1:].isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/at/__init__.py0000644000000000000000000000164213156325246020351 0ustar rootroot00000000000000# __init__.py - collection of Austrian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Austrian numbers.""" # provide vat as an alias from stdnum.at import uid as vat python-stdnum-1.8.1/stdnum/gb/0000755000000000000000000000000013224171743016216 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/gb/__init__.py0000644000000000000000000000156213156325247020337 0ustar rootroot00000000000000# __init__.py - collection of United Kingdom numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of United Kingdom numbers.""" python-stdnum-1.8.1/stdnum/gb/sedol.py0000644000000000000000000000526513223166520017702 0ustar rootroot00000000000000# sedol.py - functions for handling SEDOL numbers # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """SEDOL number (Stock Exchange Daily Official List number). The SEDOL number is a security identifier used in the United Kingdom and Ireland assigned by the London Stock Exchange. A SEDOL is seven characters in length consisting of six alphanumeric digits, followed by a check digit. >>> validate('B15KXQ8') 'B15KXQ8' >>> validate('B15KXQ7') Traceback (most recent call last): ... InvalidChecksum: ... >>> to_isin('B15KXQ8') 'GB00B15KXQ89' """ from stdnum.exceptions import * from stdnum.util import clean # the letters allowed in an SEDOL (vowels are never used) _alphabet = '0123456789 BCD FGH JKLMN PQRST VWXYZ' def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip().upper() def calc_check_digit(number): """Calculate the check digits for the number.""" weights = (1, 3, 1, 7, 3, 9) s = sum(w * _alphabet.index(n) for w, n in zip(weights, number)) return str((10 - s) % 10) def validate(number): """Check if the number is valid. This checks the length and check digit.""" number = compact(number) if not all(x in _alphabet for x in number): raise InvalidFormat() if len(number) != 7: raise InvalidLength() if number[0].isdigit() and not number.isdigit(): # new style SEDOLs are supposed to start with a letter, old-style # numbers should be fully numeric raise InvalidFormat() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is valid.""" try: return bool(validate(number)) except ValidationError: return False def to_isin(number): """Convert the number to an ISIN.""" from stdnum import isin return isin.from_natid('GB', number) python-stdnum-1.8.1/stdnum/gb/vat.py0000644000000000000000000001022513223166520017356 0ustar rootroot00000000000000# vat.py - functions for handling United Kingdom VAT numbers # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VAT (United Kingdom (and Isle of Man) VAT registration number). The VAT number can either be a 9-digit standard number, a 12-digit standard number followed by a 3-digit branch identifier, a 5-digit number for government departments (first two digits are GD) or a 5-digit number for health authorities (first two digits are HA). The 9-digit variants use a weighted checksum. >>> validate('GB 980 7806 84') '980780684' >>> validate('802311781') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> format('980780684') '980 7806 84' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').upper().strip() if number.startswith('GB'): number = number[2:] return number def checksum(number): """Calculate the checksum. The checksum is only used for the 9 digits of the number and the result can either be 0 or 42.""" weights = (8, 7, 6, 5, 4, 3, 2, 10, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 97 def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if len(number) == 5: if not number[2:].isdigit(): raise InvalidFormat() if number.startswith('GD') and int(number[2:]) < 500: # government department pass elif number.startswith('HA') and int(number[2:]) >= 500: # health authority pass else: raise InvalidComponent() elif len(number) == 11 and number[0:6] in ('GD8888', 'HA8888'): if not number[6:].isdigit(): raise InvalidFormat() if number.startswith('GD') and int(number[6:9]) < 500: # government department pass elif number.startswith('HA') and int(number[6:9]) >= 500: # health authority pass else: raise InvalidComponent() if int(number[6:9]) % 97 != int(number[9:11]): raise InvalidChecksum() elif len(number) in (9, 12): if not number.isdigit(): raise InvalidFormat() # standard number: nnn nnnn nn # branch trader: nnn nnnn nn nnn (ignore the last thee digits) # restarting: 100 nnnn nn if int(number[:3]) >= 100: if checksum(number[:9]) not in (0, 42, 55): raise InvalidChecksum() else: if checksum(number[:9]) != 0: raise InvalidChecksum() else: raise InvalidLength() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) if len(number) == 5: # government department or health authority return number if len(number) == 12: # includes branch number return number[:3] + ' ' + number[3:7] + ' ' + number[7:9] + ' ' + number[9:] # standard number: nnn nnnn nn return number[:3] + ' ' + number[3:7] + ' ' + number[7:] python-stdnum-1.8.1/stdnum/gb/upn.py0000644000000000000000000000757513223166520017404 0ustar rootroot00000000000000# upn.py - functions for handling English UPNs # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """UPN (English Unique Pupil Number). The Unique Pupil Number (UPN) is a 13-character code that identifies pupils in English state schools and is designed to aid tracking pupil progress through the school system. The number consists of a check letter, a 3-digit LA (Local Authority) number for the issuing school, a 4-digit DfE number (School Establishment Number), 2 digits for the issue year and 3 digits for a serial number. Temporary numbers have a 2-digit serial and a letter. More information: * https://www.gov.uk/government/publications/unique-pupil-numbers >>> validate('B801200005001') 'B801200005001' >>> validate('A801200005001') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('X80120000A001') # middle part must be numeric Traceback (most recent call last): ... InvalidFormat: ... >>> validate('E000200005001') # LA number must be known Traceback (most recent call last): ... InvalidComponent: ... """ from stdnum.exceptions import * from stdnum.util import clean # The allowed characters in an UPN. _alphabet = 'ABCDEFGHJKLMNPQRTUVWXYZ0123456789' # The known values for the LA (Local Authority) number. # https://www.gov.uk/government/statistics/new-local-authority-codes-january-2011 _la_numbers = set(( 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 330, 331, 332, 333, 334, 335, 336, 340, 341, 342, 343, 344, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 370, 371, 372, 373, 380, 381, 382, 383, 384, 390, 391, 392, 393, 394, 420, 800, 801, 802, 803, 805, 806, 807, 808, 810, 811, 812, 813, 815, 816, 821, 822, 823, 825, 826, 830, 831, 835, 836, 837, 840, 841, 845, 846, 850, 851, 852, 855, 856, 857, 860, 861, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 908, 909, 916, 919, 921, 925, 926, 928, 929, 931, 933, 935, 936, 937, 938)) def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').upper().strip() def calc_check_digit(number): """Calculate the check digit for the number.""" check = sum(i * _alphabet.index(n) for i, n in enumerate(number[-12:], 2)) % 23 return _alphabet[check] def validate(number): """Check if the number is a valid UPN. This checks length, formatting and check digits.""" number = compact(number) if len(number) != 13: raise InvalidLength() if not number[1:-1].isdigit() or number[-1] not in _alphabet: raise InvalidFormat() if int(number[1:4]) not in _la_numbers: raise InvalidComponent() if calc_check_digit(number[1:]) != number[0]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid UPN.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/gb/nhs.py0000644000000000000000000000540313223166520017356 0ustar rootroot00000000000000# nhs.py - functions for handling United Kingdom NHS numbers # # Copyright (C) 2016-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NHS (United Kingdom National Health Service patient identifier). The NHS number is used by the NHS (National Health Service) and its partners to uniquely identify patients. The number is used in England, Wales and the Isle of Man. The number is assigned at birth and consists of 10 digits where the final digit is a check digit. More information: * https://en.wikipedia.org/wiki/NHS_number * http://www.nhs.uk/NHSEngland/thenhs/records/nhs-number/ * https://digital.nhs.uk/article/301/NHS-Number * http://www.datadictionary.nhs.uk/data_dictionary/attributes/n/nhs/nhs_number_de.asp >>> validate('943-476-5870') '9434765870' >>> validate('9434765871') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> format('9434765870') '943 476 5870' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def checksum(number): """Calculate the checksum. The checksum is only used for the 9 digits of the number and the result can either be 0 or 42.""" return sum(i * int(n) for i, n in enumerate(reversed(number), 1)) % 11 def validate(number): """Check if the number is valid. This checks the length and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is valid.""" try: return bool(validate(number)) except ValidationError: return False def format(number, separator=' '): """Reformat the number to the standard presentation format.""" number = compact(number) return separator.join((number[0:3], number[3:6], number[6:])) python-stdnum-1.8.1/stdnum/isil.py0000644000000000000000000000711513223166521017141 0ustar rootroot00000000000000# isil.py - functions for handling identifiers for libraries and related # organizations # # Copyright (C) 2011-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ISIL (International Standard Identifier for Libraries). The ISIL is the International Standard Identifier for Libraries and Related Organizations (ISO 15511) used to uniquely identify libraries, archives, museums, and similar organisations. The identifier can be up to 15 characters that may use digits, letters (case insensitive) hyphens, colons and slashes. The non-alphanumeric characters are part of the identifier and are not just for readability. The identifier consists of two parts separated by a hyphen. The first part is either a two-letter ISO 3166 country code or a (not two-letter) non-national prefix that identifies the agency that issued the ISIL. The second part is the is the identifier issued by that agency. Only the first part can be validated since it is registered globally. There may be some validation possible with the second parts (some agencies provide web services for validation) but there is no common format to these services. More information: * https://en.wikipedia.org/wiki/ISBT_128 * http://biblstandard.dk/isil/ * https://www.iso.org/standard/57332.html >>> validate('IT-RM0267') 'IT-RM0267' >>> validate('OCLC-DLC') 'OCLC-DLC' >>> validate('WW-RM0267') # unregistered country code Traceback (most recent call last): ... InvalidComponent: ... >>> format('it-RM0267') 'IT-RM0267' """ from stdnum.exceptions import * from stdnum.util import clean # the valid characters in an ISIL _alphabet = set( '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-:/') def compact(number): """Convert the ISIL to the minimal representation. This strips surrounding whitespace.""" return clean(number, '').strip() def _is_known_agency(agency): """Check whether the specified agency is valid.""" # look it up in the db from stdnum import numdb results = numdb.get('isil').info(agency.upper() + '$') # there should be only one part and it should have properties return len(results) == 1 and bool(results[0][1]) def validate(number): """Check if the number provided is a valid ISIL.""" number = compact(number) if not all(x in _alphabet for x in number): raise InvalidFormat() if len(number) > 15: raise InvalidLength() if not _is_known_agency(number.split('-')[0]): raise InvalidComponent() return number def is_valid(number): """Check if the number provided is a valid ISIL.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) parts = number.split('-') if len(parts) > 1 and _is_known_agency(parts[0]): parts[0] = parts[0].upper() return '-'.join(parts) python-stdnum-1.8.1/stdnum/nl/0000755000000000000000000000000013224171743016237 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/nl/bsn.py0000644000000000000000000000544013223166521017373 0ustar rootroot00000000000000# bsn.py - functions for handling BSNs # # Copyright (C) 2010-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """BSN (Burgerservicenummer, Dutch national identification number). The BSN is a unique personal identifier and has been introduced as the successor to the sofinummer. The number consists of up to 9 digits (the leading 0's are commonly left out) and contains a simple checksum. More information: * https://en.wikipedia.org/wiki/National_identification_number#Netherlands * https://nl.wikipedia.org/wiki/Burgerservicenummer * http://www.burgerservicenummer.nl/ >>> validate('1112.22.333') '111222333' >>> validate('1112.52.333') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('1112223334') Traceback (most recent call last): ... InvalidLength: ... >>> format('111222333') '1112.22.333' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').strip() # pad with leading zeroes return (9 - len(number)) * '0' + number def checksum(number): """Calculate the checksum over the number. A valid number should have a checksum of 0.""" return (sum((9 - i) * int(n) for i, n in enumerate(number[:-1])) - int(number[-1])) % 11 def validate(number): """Check if the number is a valid BSN. This checks the length and whether the check digit is correct.""" number = compact(number) if not number.isdigit() or int(number) <= 0: raise InvalidFormat() if len(number) != 9: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid BSN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the passed number to the standard presentation format.""" number = compact(number) return number[:4] + '.' + number[4:6] + '.' + number[6:] python-stdnum-1.8.1/stdnum/nl/postcode.py0000644000000000000000000000440613223166521020432 0ustar rootroot00000000000000# postcode.py - functions for handling Dutch postal codes # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Postcode (Dutch postal code). The Dutch postal code consists of four numbers followed by two letters. >>> validate('2601 DC') '2601 DC' >>> validate('NL-2611ET') '2611 ET' >>> validate('26112 ET') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('2611 SS') # a few letter combinations are banned Traceback (most recent call last): ... InvalidComponent: ... """ import re from stdnum.exceptions import * from stdnum.util import clean _postcode_re = re.compile(r'^(?P[1-9][0-9]{3})(?P[A-Z]{2})$') _postcode_blacklist = ('SA', 'SD', 'SS') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('NL'): number = number[2:] return number def validate(number): """Check if the number is in the correct format. This currently does not check whether the code corresponds to a real address.""" number = compact(number) match = _postcode_re.search(number) if not match: raise InvalidFormat() if match.group('pt2') in _postcode_blacklist: raise InvalidComponent() return '%s %s' % (match.group('pt1'), match.group('pt2')) def is_valid(number): """Check if the number is a valid postal code.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/nl/onderwijsnummer.py0000644000000000000000000000437013223166521022042 0ustar rootroot00000000000000# onderwijsnummer.py - functions for handling onderwijsnummers # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Onderwijsnummer (Dutch student school number). The onderwijsnummers (education number) is very similar to the BSN (Dutch national identification number) for students without a BSN. It uses a checksum mechanism similar to the BSN. More information: * https://nl.wikipedia.org/wiki/Onderwijsnummer >>> validate('1012.22.331') '101222331' >>> validate('100252333') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('1012.22.3333') Traceback (most recent call last): ... InvalidLength: ... >>> validate('2112.22.337') # number must start with 10 Traceback (most recent call last): ... InvalidFormat: ... """ from stdnum.exceptions import * from stdnum.nl.bsn import checksum, compact __all__ = ['compact', 'validate', 'is_valid'] def validate(number): """Check if the number is a valid onderwijsnummer. This checks the length and whether the check digit is correct and whether it starts with the right sequence.""" number = compact(number) if not number.isdigit() or int(number) <= 0: raise InvalidFormat() if not number.startswith('10'): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if checksum(number) != 5: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid onderwijsnummer.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/nl/__init__.py0000644000000000000000000000171113156325252020350 0ustar rootroot00000000000000# __init__.py - collection of Dutch numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Dutch numbers.""" # provide aliases from stdnum.nl import btw as vat from stdnum.nl import postcode as postcal_code python-stdnum-1.8.1/stdnum/nl/brin.py0000644000000000000000000000504413223166521017543 0ustar rootroot00000000000000# brin.py - functions for handling Brin numbers # # Copyright (C) 2013-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Brin number (Dutch number for schools). The Brin (Basis Registratie Instellingen) is a number to identify schools and related institutions. The number consists of four alphanumeric characters, sometimes extended with two digits to indicate the site (this complete code is called the vestigingsnummer). The register of these numbers can be downloaded from: https://www.duo.nl/open_onderwijsdata/databestanden/ >>> validate('05 KO') '05KO' >>> validate('07NU 00') '07NU00' >>> validate('12KB1') Traceback (most recent call last): ... InvalidLength: ... >>> validate('30AJ0A') # location code has letter Traceback (most recent call last): ... InvalidFormat: ... """ import re from stdnum.exceptions import * from stdnum.util import clean # this regular expression is based on what was found in the online # database: the first two digits are always numeric, followed by two # letters and an optional two letter location identifier _brin_re = re.compile(r'^(?P[0-9]{2}[A-Z]{2})(?P[0-9]{2})?$') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -.').upper().strip() def validate(number): """Check if the number is a valid Brun number. This currently does not check whether the number points to a registered school.""" number = compact(number) if len(number) not in (4, 6): raise InvalidLength() match = _brin_re.search(number) if not match: raise InvalidFormat() return number def is_valid(number): """Check if the number is a valid Brun number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/nl/btw.py0000644000000000000000000000430013223166521017377 0ustar rootroot00000000000000# btw.py - functions for handling Dutch VAT numbers # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """BTW-nummer (Omzetbelastingnummer, the Dutch VAT number). The BTW-nummer is the Dutch number for VAT. It consists of a RSIN or BSN followed by a B and two digits that identify the unit within the organisation (usually 01). >>> validate('004495445B01') '004495445B01' >>> validate('NL4495445B01') '004495445B01' >>> validate('123456789B90') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.nl import bsn from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').upper().strip() if number.startswith('NL'): number = number[2:] return bsn.compact(number[:-3]) + number[-3:] def validate(number): """Check if the number is a valid BTW number. This checks the length, formatting and check digit.""" number = compact(number) if not number[10:].isdigit() or int(number[10:]) <= 0: raise InvalidFormat() if len(number) != 12: raise InvalidLength() if number[9] != 'B': raise InvalidFormat() bsn.validate(number[:9]) return number def is_valid(number): """Check if the number is a valid BTW number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/exceptions.py0000644000000000000000000000423713223166520020363 0ustar rootroot00000000000000# exceptions.py - collection of stdnum exceptions # coding: utf-8 # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of exceptions. The validation functions of stdnum should raise one of the below exceptions when validation of the number fails. """ class ValidationError(Exception): """Top-level error for validating numbers. This exception should normally not be raised, only subclasses of this exception.""" def __str__(self): return ''.join(self.args[:1]) or getattr(self, 'message', '') class InvalidFormat(ValidationError): """Something is wrong with the format of the number. This generally means characters or delimiters that are not allowed are part of the number or required parts are missing.""" message = 'The number has an invalid format.' class InvalidChecksum(ValidationError): """The number's internal checksum or check digit does not match.""" message = "The number's checksum or check digit is invalid." class InvalidLength(InvalidFormat): """The length of the number is wrong.""" message = 'The number has an invalid length.' class InvalidComponent(ValidationError): """One of the parts of the number has an invalid reference. Some part of the number refers to some external entity like a country code, a date or a predefined collection of values. The number contains some invalid reference.""" message = 'One of the parts of the number are invalid or unknown.' python-stdnum-1.8.1/stdnum/de/0000755000000000000000000000000013224171743016216 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/de/wkn.py0000644000000000000000000000446713223166520017376 0ustar rootroot00000000000000# wkn.py - functions for handling Wertpapierkennnummer # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Wertpapierkennnummer (German securities identification code). The WKN, WPKN, WPK (Wertpapierkennnummer) is a German code to identify securities. It is a 6-digit alphanumeric number without a check digit that no longer has any structure. It is expected to be replaced by the ISIN. >>> validate('A0MNRK') 'A0MNRK' >>> validate('AOMNRK') # no capital o allowed Traceback (most recent call last): ... InvalidFormat: ... >>> to_isin('SKWM02') 'DE000SKWM021' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip().upper() # O and I are not valid but are accounted for in the check digit calculation _alphabet = '0123456789ABCDEFGH JKLMN PQRSTUVWXYZ' def validate(number): """Check if the number provided is valid. This checks the length and check digit.""" number = compact(number) if not all(x in _alphabet for x in number): raise InvalidFormat() if len(number) != 6: raise InvalidLength() return number def is_valid(number): """Check if the number provided is valid. This checks the length and check digit.""" try: return bool(validate(number)) except ValidationError: return False def to_isin(number): """Convert the number to an ISIN.""" from stdnum import isin return isin.from_natid('DE', number) python-stdnum-1.8.1/stdnum/de/__init__.py0000644000000000000000000000154213156325246020334 0ustar rootroot00000000000000# __init__.py - collection of German numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of German numbers.""" python-stdnum-1.8.1/stdnum/de/vat.py0000644000000000000000000000415013223166520017356 0ustar rootroot00000000000000# vat.py - functions for handling German VAT numbers # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number). The number is 10 digits long and uses the ISO 7064 Mod 11, 10 check digit algorithm. >>> compact('DE 136,695 976') '136695976' >>> validate('DE136695976') '136695976' >>> validate('136695978') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.iso7064 import mod_11_10 from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -./,').upper().strip() if number.startswith('DE'): number = number[2:] return number def validate(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or number[0] == '0': raise InvalidFormat() if len(number) != 9: raise InvalidLength() mod_11_10.validate(number) return number def is_valid(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/de/idnr.py0000644000000000000000000000612513223166520017524 0ustar rootroot00000000000000# idnr.py - functions for handling German tax id # coding: utf-8 # # Copyright (C) 2017 Holvi Payment Services Oy # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """IdNr (Steuerliche Identifikationsnummer, German personal tax number). The IdNr (or Steuer-IdNr) is a personal identification number that is assigned to individuals in Germany for tax purposes and is meant to replace the Steuernummer. The number consists of 11 digits and does not embed any personal information. More information: * https://de.wikipedia.org/wiki/Steuerliche_Identifikationsnummer * http://www.identifikationsmerkmal.de/ >>> validate('36 574 261 809') '36574261809' >>> validate('36574261890') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('36554266806') # more digits repeated Traceback (most recent call last): ... InvalidFormat: ... >>> format('36574261809') '36 574 261 809' """ from collections import defaultdict from stdnum.exceptions import * from stdnum.iso7064 import mod_11_10 from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -./,').strip() def validate(number): """Check if the number provided is a valid tax identification number. This checks the length, formatting and check digit.""" number = compact(number) if len(number) != 11: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if number.startswith('0'): raise InvalidFormat() # In the first 10 digits exactly one digit must be repeated two or # three times and other digits can appear only once. counter = defaultdict(int) for n in number[:10]: counter[n] += 1 counts = [c for c in counter.values() if c > 1] if len(counts) != 1 or counts[0] not in (2, 3): raise InvalidFormat() return mod_11_10.validate(number) def is_valid(number): """Check if the number provided is a valid tax identification number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[:2], number[2:5], number[5:8], number[8:])) python-stdnum-1.8.1/stdnum/se/0000755000000000000000000000000013224171744016236 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/se/__init__.py0000644000000000000000000000154413156325252020352 0ustar rootroot00000000000000# __init__.py - collection of Swedish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Swedish numbers.""" python-stdnum-1.8.1/stdnum/se/vat.py0000644000000000000000000000410513223166521017376 0ustar rootroot00000000000000# vat.py - functions for handling Swedish VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VAT (Moms, Mervärdesskatt, Swedish VAT number). The Momsregistreringsnummer is used for VAT (Moms, Mervärdesskatt) purposes and consists of 12 digits of which the last two should be 01. The first 10 digits should have a valid Luhn checksum. >>> validate('SE 123456789701') '123456789701' >>> validate('123456789101') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.se import orgnr from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').upper().strip() if number.startswith('SE'): number = number[2:] return number def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or number[-2:] != '01': raise InvalidFormat() orgnr.validate(number[:-2]) return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/se/orgnr.py0000644000000000000000000000446113223166521017740 0ustar rootroot00000000000000# orgnr.py - functions for handling Swedish organisation numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # Copyright (C) 2014 Tomas Thor Jonsson # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Orgnr (Organisationsnummer, Swedish company number). The Orgnr (Organisationsnummer) is the national number to identify Swedish companies and consists of 10 digits. These are the first 10 digits in the Swedish VAT number, i.e. it's the VAT number without the 'SE' in front and the '01' at the end. >>> validate('1234567897') '1234567897' >>> validate('1234567891') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... >>> format('123456-7897') '123456-7897' """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -.').strip() def validate(number): """Check if the number is a valid organisation number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() return luhn.validate(number) def is_valid(number): """Check if the number is a valid organisation number""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:6] + '-' + number[6:] python-stdnum-1.8.1/stdnum/isbn.dat0000644000000000000000000003716313223166520017261 0ustar rootroot00000000000000# generated from RangeMessage.xml, downloaded from # https://www.isbn-international.org/export_rangemessage.xml # file serial 352b2404-54ce-4d18-828a-ed60209b93e1 # file date Thu, 21 Dec 2017 17:54:41 CET 978 0-5,600-649,7-7,80-94,950-989,9900-9989,99900-99999 0 agency="English language" 00-19,200-227,2280-2289,229-638,6390-6398,6399000-6399999,640-647 6480000-6489999,649-654,6550-6559,656-699,7000-8499,85000-89999 900000-949999,9500000-9999999 1 agency="English language" 00-09,100-399,4000-5499,55000-73199,7320000-7399999,74000-77499 7750000-7753999,77540-86979,869800-972999,9730-9877,987800-998999 9990000-9999999 2 agency="French language" 00-19,200-349,35000-39999,400-489,490000-494999,495-699,7000-8399 84000-89999,900000-919799,91980-91980,919810-919942,9199430-9199689 919969-949999,9500000-9999999 3 agency="German language" 00-02,030-033,0340-0369,03700-03999,04-19,200-699,7000-8499,85000-89999 900000-949999,9500000-9539999,95400-96999,9700000-9899999,99000-99499 99500-99999 4 agency="Japan" 00-19,200-699,7000-8499,85000-89999,900000-949999,9500000-9999999 5 agency="former U.S.S.R" 00000-00499,0050-0099,01-19,200-420,4210-4299,430-430,4310-4399,440-440 4410-4499,450-603,6040000-6049999,605-699,7000-8499,85000-89999 900000-909999,91000-91999,9200-9299,93000-94999,9500000-9500999 9501-9799,98000-98999,9900000-9909999,9910-9999 600 agency="Iran" 00-09,100-499,5000-8999,90000-98679,9868-9929,993-995,99600-99999 601 agency="Kazakhstan" 00-19,200-699,7000-7999,80000-84999,85-99 602 agency="Indonesia" 00-07,0800-0899,0900-1099,1100-1199,1200-1399,14000-14999,1500-1699 17000-17999,18000-18999,19000-19999,200-499,50000-53999,5400-5999 60000-61999,6200-6749,6750-6999,70000-74999,7500-7999,8000-9499 95000-99999 603 agency="Saudi Arabia" 00-04,05-49,500-799,8000-8999,90000-99999 604 agency="Vietnam" 0-4,50-89,900-979,9800-9999 605 agency="Turkey" 01-02,030-039,04-09,100-199,2000-2399,240-399,4000-5999,60000-89999 9000-9999 606 agency="Romania" 000-099,10-49,500-799,8000-9099,910-919,92000-97499,975-999 607 agency="Mexico" 00-39,400-749,7500-9499,95000-99999 608 agency="Macedonia" 0-0,10-19,200-449,4500-6499,65000-69999,7-9 609 agency="Lithuania" 00-39,400-799,8000-9499,95000-99999 611 agency="Thailand" 612 agency="Peru" 00-29,300-399,4000-4499,45000-49999,50-99 613 agency="Mauritius" 0-9 614 agency="Lebanon" 00-39,400-799,8000-9499,95000-99999 615 agency="Hungary" 00-09,100-499,5000-7999,80000-89999 616 agency="Thailand" 00-19,200-699,7000-8999,90000-99999 617 agency="Ukraine" 00-49,500-699,7000-8999,90000-99999 618 agency="Greece" 00-19,200-499,5000-7999,80000-99999 619 agency="Bulgaria" 00-14,150-699,7000-8999,90000-99999 620 agency="Mauritius" 0-9 621 agency="Philippines" 00-29,400-599,8000-8999,95000-99999 622 agency="Iran" 00-03 7 agency="China, People's Republic" 00-09,100-499,5000-7999,80000-89999,900000-999999 80 agency="former Czechoslovakia" 00-19,200-699,7000-8499,85000-89999,900000-999999 81 agency="India" 00-19,200-699,7000-8499,85000-89999,900000-999999 82 agency="Norway" 00-19,200-689,690000-699999,7000-8999,90000-98999,990000-999999 83 agency="Poland" 00-19,200-599,60000-69999,7000-8499,85000-89999,900000-999999 84 agency="Spain" 00-12,1300-1399,140-149,15000-19999,200-699,7000-8499,85000-89999 9000-9199,920000-923999,92400-92999,930000-949999,95000-96999,9700-9999 85 agency="Brazil" 00-19,200-454,455000-455299,45530-45599,456-528,52900-53199,5320-5339 534-543,5440-5479,54800-54999,5500-5999,60000-69999,7000-8499 85000-89999,900000-924999,92500-94499,9450-9599,96-97,98000-99999 86 agency="former Yugoslavia" 00-29,300-599,6000-7999,80000-89999,900000-999999 87 agency="Denmark" 00-29,400-649,7000-7999,85000-94999,970000-999999 88 agency="Italy" 00-19,200-326,3270-3389,339-599,6000-8499,85000-89999,900000-909999 910-929,9300-9399,940000-947999,94800-94999,95000-99999 89 agency="Korea, Republic" 00-24,250-549,5500-8499,85000-94999,950000-969999,97000-98999,990-999 90 agency="Netherlands" 00-19,200-499,5000-6999,70000-79999,800000-849999,8500-8999,90-90,94-94 91 agency="Sweden" 0-1,20-49,500-649,7000-7999,85000-94999,970000-999999 92 agency="International NGO Publishers and EU Organizations" 0-5,60-79,800-899,9000-9499,95000-98999,990000-999999 93 agency="India" 00-09,100-499,5000-7999,80000-94999,950000-999999 94 agency="Netherlands" 000-599,6000-8999,90000-99999 950 agency="Argentina" 00-49,500-899,9000-9899,99000-99999 951 agency="Finland" 0-1,20-54,550-889,8900-9499,95000-99999 952 agency="Finland" 00-19,200-499,5000-5999,60-65,6600-6699,67000-69999,7000-7999,80-94 9500-9899,99000-99999 953 agency="Croatia" 0-0,10-14,150-509,51-54,55000-59999,6000-9499,95000-99999 954 agency="Bulgaria" 00-28,2900-2999,300-799,8000-8999,90000-92999,9300-9999 955 agency="Sri Lanka" 0000-1999,20-35,3600-3799,38000-38999,3900-4099,41000-44999,4500-4999 50000-54999,550-719,7200-9499,95000-99999 956 agency="Chile" 00-08,09000-09999,10-19,200-599,6000-6999,7000-9999 957 agency="Taiwan" 00-02,0300-0499,05-19,2000-2099,21-27,28000-30999,31-43,440-819 8200-9699,97000-99999 958 agency="Colombia" 00-53,5400-5599,56000-56999,57000-59999,600-799,8000-9499,95000-99999 959 agency="Cuba" 00-19,200-699,7000-8499,85000-99999 960 agency="Greece" 00-19,200-659,6600-6899,690-699,7000-8499,85000-92999,93-93,9400-9799 98000-99999 961 agency="Slovenia" 00-19,200-599,6000-8999,90000-94999 962 agency="Hong Kong, China" 00-19,200-699,7000-8499,85000-86999,8700-8999,900-999 963 agency="Hungary" 00-19,200-699,7000-8499,85000-89999,9000-9999 964 agency="Iran" 00-14,150-249,2500-2999,300-549,5500-8999,90000-96999,970-989,9900-9999 965 agency="Israel" 00-19,200-599,7000-7999,90000-99999 966 agency="Ukraine" 00-12,130-139,14-14,1500-1699,170-199,2000-2789,279-289,2900-2999 300-699,7000-8999,90000-90999,910-949,95000-97999,980-999 967 agency="Malaysia" 00-00,0100-0999,10000-19999,2000-2499,300-499,5000-5999,60-89,900-989 9900-9989,99900-99999 968 agency="Mexico" 01-39,400-499,5000-7999,800-899,9000-9999 969 agency="Pakistan" 0-1,20-22,23000-23999,24-39,400-749,7500-9999 970 agency="Mexico" 01-59,600-899,9000-9099,91000-96999,9700-9999 971 agency="Philippines" 000-015,0160-0199,02-02,0300-0599,06-49,500-849,8500-9099,91000-95999 9600-9699,97-98,9900-9999 972 agency="Portugal" 0-1,20-54,550-799,8000-9499,95000-99999 973 agency="Romania" 0-0,100-169,1700-1999,20-54,550-759,7600-8499,85000-88999,8900-9499 95000-99999 974 agency="Thailand" 00-19,200-699,7000-8499,85000-89999,90000-94999,9500-9999 975 agency="Turkey" 00000-01999,02-23,2400-2499,250-599,6000-9199,92000-98999,990-999 976 agency="Caribbean Community" 0-3,40-59,600-799,8000-9499,95000-99999 977 agency="Egypt" 00-19,200-499,5000-6999,700-849,85000-89999,90-99 978 agency="Nigeria" 000-199,2000-2999,30000-79999,8000-8999,900-999 979 agency="Indonesia" 000-099,1000-1499,15000-19999,20-29,3000-3999,400-799,8000-9499 95000-99999 980 agency="Venezuela" 00-19,200-599,6000-9999 981 agency="Singapore" 00-16,17000-19999,200-299,3000-3099,310-399,4000-9999 982 agency="South Pacific" 00-09,100-699,70-89,9000-9799,98000-99999 983 agency="Malaysia" 00-01,020-199,2000-3999,40000-44999,45-49,50-79,800-899,9000-9899 99000-99999 984 agency="Bangladesh" 00-39,400-799,8000-8999,90000-99999 985 agency="Belarus" 00-39,400-599,6000-8999,90000-99999 986 agency="Taiwan" 00-11,120-559,5600-7999,80000-99999 987 agency="Argentina" 00-09,1000-1999,20000-29999,30-35,3600-3999,4000-4199,42-43,4400-4499 45000-48999,4900-4999,500-899,9000-9499,95000-99999 988 agency="Hong Kong, China" 00-11,12000-14999,15000-16999,17000-19999,200-769,77000-79999,8000-9699 97000-99999 989 agency="Portugal" 0-1,20-53,54000-54999,550-799,8000-9499,95000-99999 9921 agency="Kuwait" 0-0,30-39,700-899,9700-9999 9922 agency="Iraq" 20-29,600-799,9000-9999 9923 agency="Jordan" 0-0,10-49,700-899,9700-9999 9924 agency="Cambodia" 30-39,500-649,9000-9999 9925 agency="Cyprus" 0-2,30-54,550-734,7350-9999 9926 agency="Bosnia and Herzegovina" 0-1,20-39,400-799,8000-9999 9927 agency="Qatar" 00-09,100-399,4000-4999 9928 agency="Albania" 00-09,100-399,4000-4999 9929 agency="Guatemala" 0-3,40-54,550-799,8000-9999 9930 agency="Costa Rica" 00-49,500-939,9400-9999 9931 agency="Algeria" 00-29,300-899,9000-9999 9932 agency="Lao People's Democratic Republic" 00-39,400-849,8500-9999 9933 agency="Syria" 0-0,10-39,400-899,9000-9999 9934 agency="Latvia" 0-0,10-49,500-799,8000-9999 9935 agency="Iceland" 0-0,10-39,400-899,9000-9999 9936 agency="Afghanistan" 0-1,20-39,400-799,8000-9999 9937 agency="Nepal" 0-2,30-49,500-799,8000-9999 9938 agency="Tunisia" 00-79,800-949,9500-9999 9939 agency="Armenia" 0-4,50-79,800-899,9000-9999 9940 agency="Montenegro" 0-1,20-49,500-899,9000-9999 9941 agency="Georgia" 0-0,10-39,400-799,8-8,9000-9999 9942 agency="Ecuador" 00-74,750-849,8500-8999,900-984,9850-9999 9943 agency="Uzbekistan" 00-29,300-399,4000-9749,975-999 9944 agency="Turkey" 0000-0999,100-499,5000-5999,60-69,700-799,80-89,900-999 9945 agency="Dominican Republic" 00-00,010-079,08-39,400-569,57-57,580-849,8500-9999 9946 agency="Korea, P.D.R." 0-1,20-39,400-899,9000-9999 9947 agency="Algeria" 0-1,20-79,800-999 9948 agency="United Arab Emirates" 00-39,400-849,8500-9999 9949 agency="Estonia" 0-0,10-39,400-699,70-71,7200-7499,75-89,9000-9999 9950 agency="Palestine" 00-29,300-849,8500-9999 9951 agency="Kosova" 00-39,400-849,8500-9999 9952 agency="Azerbaijan" 0-1,20-39,400-799,8000-9999 9953 agency="Lebanon" 0-0,10-39,400-599,60-89,9000-9299,93-96,970-999 9954 agency="Morocco" 0-1,20-39,400-799,8000-9899,99-99 9955 agency="Lithuania" 00-39,400-929,9300-9999 9956 agency="Cameroon" 0-0,10-39,400-899,9000-9999 9957 agency="Jordan" 00-39,400-649,65-67,680-699,70-84,8500-8799,88-99 9958 agency="Bosnia and Herzegovina" 00-01,020-029,0300-0399,040-089,0900-0999,10-18,1900-1999,20-49,500-899 9000-9999 9959 agency="Libya" 0-1,20-79,800-949,9500-9699,970-979,98-99 9960 agency="Saudi Arabia" 00-59,600-899,9000-9999 9961 agency="Algeria" 0-2,30-69,700-949,9500-9999 9962 agency="Panama" 00-54,5500-5599,56-59,600-849,8500-9999 9963 agency="Cyprus" 0-1,2000-2499,250-279,2800-2999,30-54,550-734,7350-7499,7500-9999 9964 agency="Ghana" 0-6,70-94,950-999 9965 agency="Kazakhstan" 00-39,400-899,9000-9999 9966 agency="Kenya" 000-149,1500-1999,20-69,7000-7499,750-959,9600-9999 9967 agency="Kyrgyz Republic" 00-39,400-899,9000-9999 9968 agency="Costa Rica" 00-49,500-939,9400-9999 9970 agency="Uganda" 00-39,400-899,9000-9999 9971 agency="Singapore" 0-5,60-89,900-989,9900-9999 9972 agency="Peru" 00-09,1-1,200-249,2500-2999,30-59,600-899,9000-9999 9973 agency="Tunisia" 00-05,060-089,0900-0999,10-69,700-969,9700-9999 9974 agency="Uruguay" 0-2,30-54,550-749,7500-8799,880-909,91-94,95-99 9975 agency="Moldova" 0-0,100-299,3000-3999,4000-4499,45-89,900-949,9500-9999 9976 agency="Tanzania" 0-4,5000-5899,59-89,900-989,9900-9999 9977 agency="Costa Rica" 00-89,900-989,9900-9999 9978 agency="Ecuador" 00-29,300-399,40-94,950-989,9900-9999 9979 agency="Iceland" 0-4,50-64,650-659,66-75,760-899,9000-9999 9980 agency="Papua New Guinea" 0-3,40-89,900-989,9900-9999 9981 agency="Morocco" 00-09,100-159,1600-1999,20-79,800-949,9500-9999 9982 agency="Zambia" 00-79,800-989,9900-9999 9983 agency="Gambia" 80-94,950-989,9900-9999 9984 agency="Latvia" 00-49,500-899,9000-9999 9985 agency="Estonia" 0-4,50-79,800-899,9000-9999 9986 agency="Lithuania" 00-39,400-899,9000-9399,940-969,97-99 9987 agency="Tanzania" 00-39,400-879,8800-9999 9988 agency="Ghana" 0-2,30-54,550-749,7500-9999 9989 agency="Macedonia" 0-0,100-199,2000-2999,30-59,600-949,9500-9999 99901 agency="Bahrain" 00-49,500-799,80-99 99902 agency="Reserved Agency" 99903 agency="Mauritius" 0-1,20-89,900-999 99904 agency="Curaçao" 0-5,60-89,900-999 99905 agency="Bolivia" 0-3,40-79,800-999 99906 agency="Kuwait" 0-2,30-59,600-699,70-89,90-94,950-999 99908 agency="Malawi" 0-0,10-89,900-999 99909 agency="Malta" 0-3,40-94,950-999 99910 agency="Sierra Leone" 0-2,30-89,900-999 99911 agency="Lesotho" 00-59,600-999 99912 agency="Botswana" 0-3,400-599,60-89,900-999 99913 agency="Andorra" 0-2,30-35,600-604 99914 agency="International NGO Publishers" 0-4,50-69,7-7,80-89,900-999 99915 agency="Maldives" 0-4,50-79,800-999 99916 agency="Namibia" 0-2,30-69,700-999 99917 agency="Brunei Darussalam" 0-2,30-89,900-999 99918 agency="Faroe Islands" 0-3,40-79,800-999 99919 agency="Benin" 0-2,300-399,40-69,70-79,800-849,850-899,900-999 99920 agency="Andorra" 0-4,50-89,900-999 99921 agency="Qatar" 0-1,20-69,700-799,8-8,90-99 99922 agency="Guatemala" 0-3,40-69,700-999 99923 agency="El Salvador" 0-1,20-79,800-999 99924 agency="Nicaragua" 0-1,20-79,800-999 99925 agency="Paraguay" 0-3,40-79,800-999 99926 agency="Honduras" 0-0,10-59,600-869,87-89,90-99 99927 agency="Albania" 0-2,30-59,600-999 99928 agency="Georgia" 0-0,10-79,800-999 99929 agency="Mongolia" 0-4,50-79,800-999 99930 agency="Armenia" 0-4,50-79,800-999 99931 agency="Seychelles" 0-4,50-79,800-999 99932 agency="Malta" 0-0,10-59,600-699,7-7,80-99 99933 agency="Nepal" 0-2,30-59,600-999 99934 agency="Dominican Republic" 0-1,20-79,800-999 99935 agency="Haiti" 0-2,30-59,600-699,7-8,90-99 99936 agency="Bhutan" 0-0,10-59,600-999 99937 agency="Macau" 0-1,20-59,600-999 99938 agency="Srpska, Republic of" 0-1,20-59,600-899,90-99 99939 agency="Guatemala" 0-5,60-89,900-999 99940 agency="Georgia" 0-0,10-69,700-999 99941 agency="Armenia" 0-2,30-79,800-999 99942 agency="Sudan" 0-4,50-79,800-999 99943 agency="Albania" 0-2,30-59,600-999 99944 agency="Ethiopia" 0-4,50-79,800-999 99945 agency="Namibia" 0-5,60-89,900-999 99946 agency="Nepal" 0-2,30-59,600-999 99947 agency="Tajikistan" 0-2,30-69,700-999 99948 agency="Eritrea" 0-4,50-79,800-999 99949 agency="Mauritius" 0-1,20-89,900-999 99950 agency="Cambodia" 0-4,50-79,800-999 99951 agency="Reserved Agency" 99952 agency="Mali" 0-4,50-79,800-999 99953 agency="Paraguay" 0-2,30-79,800-939,94-99 99954 agency="Bolivia" 0-2,30-69,700-879,88-99 99955 agency="Srpska, Republic of" 0-1,20-59,600-799,80-99 99956 agency="Albania" 00-59,600-859,86-99 99957 agency="Malta" 0-1,20-79,800-939,94-99 99958 agency="Bahrain" 0-4,50-93,940-949,950-999 99959 agency="Luxembourg" 0-2,30-59,600-999 99960 agency="Malawi" 0-0,10-94,950-999 99961 agency="El Salvador" 0-2,300-399,40-89,900-999 99962 agency="Mongolia" 0-4,50-79,800-999 99963 agency="Cambodia" 00-49,500-919,92-99 99964 agency="Nicaragua" 0-1,20-79,800-999 99965 agency="Macau" 0-2,300-359,36-62,630-999 99966 agency="Kuwait" 0-2,30-69,700-799,80-96,970-999 99967 agency="Paraguay" 0-1,20-59,600-899 99968 agency="Botswana" 0-3,400-599,60-89,900-999 99969 agency="Oman" 0-4,50-79,800-999 99970 agency="Haiti" 0-4,50-89,900-999 99971 agency="Myanmar" 0-5,60-84,850-999 99972 agency="Faroe Islands" 0-4,50-89,900-999 99973 agency="Mongolia" 0-3,40-79,800-999 99974 agency="Bolivia" 40-79,800-999 99975 agency="Tajikistan" 0-3,40-79,800-999 99976 agency="Srpska, Republic of" 0-1,20-59,600-799 99977 agency="Rwanda" 0-1,40-69,700-799 99978 agency="Mongolia" 0-4,50-79,800-999 99979 agency="Honduras" 0-4,50-79,800-999 99980 agency="Bhutan" 0-0,30-59,800-999 979 10-12 10 agency="France" 00-19,200-699,7000-8999,90000-97599,976000-999999 11 agency="Korea, Republic" 00-24,250-549,5500-8499,85000-94999,950000-999999 12 agency="Italy" 200-200 python-stdnum-1.8.1/stdnum/verhoeff.py0000644000000000000000000000707013223166521020005 0ustar rootroot00000000000000# verhoeff.py - functions for performing the Verhoeff checksum # # Copyright (C) 2010-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The Verhoeff algorithm. The Verhoeff algorithm is a checksum algorithm that should catch most common (typing) errors in numbers. The algorithm uses two tables for permutations and multiplications and as a result is more complex than the Luhn algorithm. More information: * https://en.wikipedia.org/wiki/Verhoeff_algorithm * https://en.wikibooks.org/wiki/Algorithm_Implementation/Checksums/Verhoeff_Algorithm The module provides the checksum() function to calculate the Verhoeff checksum a calc_check_digit() function to generate a check digit that can be append to an existing number to result in a number with a valid checksum and validation functions. >>> validate('1234') Traceback (most recent call last): ... InvalidChecksum: ... >>> checksum('1234') 1 >>> calc_check_digit('1234') '0' >>> validate('12340') '12340' """ from stdnum.exceptions import * # These are the multiplication and permutation tables used in the # Verhoeff algorithm. _multiplication_table = ( (0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (1, 2, 3, 4, 0, 6, 7, 8, 9, 5), (2, 3, 4, 0, 1, 7, 8, 9, 5, 6), (3, 4, 0, 1, 2, 8, 9, 5, 6, 7), (4, 0, 1, 2, 3, 9, 5, 6, 7, 8), (5, 9, 8, 7, 6, 0, 4, 3, 2, 1), (6, 5, 9, 8, 7, 1, 0, 4, 3, 2), (7, 6, 5, 9, 8, 2, 1, 0, 4, 3), (8, 7, 6, 5, 9, 3, 2, 1, 0, 4), (9, 8, 7, 6, 5, 4, 3, 2, 1, 0)) _permutation_table = ( (0, 1, 2, 3, 4, 5, 6, 7, 8, 9), (1, 5, 7, 6, 2, 8, 3, 0, 9, 4), (5, 8, 0, 3, 7, 9, 6, 1, 4, 2), (8, 9, 1, 6, 0, 4, 3, 5, 2, 7), (9, 4, 5, 3, 1, 2, 6, 8, 7, 0), (4, 2, 8, 6, 5, 7, 3, 9, 0, 1), (2, 7, 9, 3, 8, 0, 6, 4, 1, 5), (7, 0, 4, 6, 9, 1, 3, 2, 5, 8)) def checksum(number): """Calculate the Verhoeff checksum over the provided number. The checksum is returned as an int. Valid numbers should have a checksum of 0.""" # transform number list number = tuple(int(n) for n in reversed(str(number))) # calculate checksum check = 0 for i, n in enumerate(number): check = _multiplication_table[check][_permutation_table[i % 8][n]] return check def validate(number): """Check if the number provided passes the Verhoeff checksum.""" if not bool(number): raise InvalidFormat() try: valid = checksum(number) == 0 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided passes the Verhoeff checksum.""" try: return bool(validate(number)) except ValidationError: return False def calc_check_digit(number): """Calculate the extra digit that should be appended to the number to make it a valid number.""" return str(_multiplication_table[checksum(str(number) + '0')].index(0)) python-stdnum-1.8.1/stdnum/cy/0000755000000000000000000000000013224171743016241 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/cy/__init__.py0000644000000000000000000000154413156325246020361 0ustar rootroot00000000000000# __init__.py - collection of Cypriot numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Cypriot numbers.""" python-stdnum-1.8.1/stdnum/cy/vat.py0000644000000000000000000000514013223166520017401 0ustar rootroot00000000000000# vat.py - functions for handling Cypriot VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number). The Cypriot Αριθμός Εγγραφής Φ.Π.Α. (VAT) number consists of 9 digits where the last one is a is a letter and functions as a check digit. >>> compact('CY-10259033P') '10259033P' >>> validate('CY-10259033P ') '10259033P' >>> validate('CY-10259033Z') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('CY'): number = number[2:] return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" translation = { '0': 1, '1': 0, '2': 5, '3': 7, '4': 9, '5': 13, '6': 15, '7': 17, '8': 19, '9': 21, } return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[( sum(translation[x] for x in number[::2]) + sum(int(x) for x in number[1::2]) ) % 26] def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number[:-1].isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if number[0:2] == '12': raise InvalidComponent() if number[-1] != calc_check_digit(number[:-1]): raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/lei.py0000644000000000000000000000420313223166521016745 0ustar rootroot00000000000000# lei.py - functions for handling Legal Entity Identifiers (LEIs) # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """LEI (Legal Entity Identifier). The Legal Entity Identifier (LEI) is used to identify legal entities for use in financial transactions. A LEI is a 20-character alphanumeric string that consists of a 4-character issuing LOU (Local Operating Unit), 2 digits that are often 0, 13 digits to identify the organisation and 2 check digits. More information: * https://en.wikipedia.org/wiki/Legal_Entity_Identifier * http://www.lei-lookup.com/ * https://www.gleif.org/ * http://openleis.com/ >>> validate('213800KUD8LAJWSQ9D15') '213800KUD8LAJWSQ9D15' >>> validate('213800KUD8LXJWSQ9D15') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.iso7064 import mod_97_10 from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding white space.""" return clean(number, ' -').strip().upper() def validate(number): """Check if the number is valid. This checks the length, format and check digits.""" number = compact(number) mod_97_10.validate(number) return number def is_valid(number): """Check if the number is valid.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/sm/0000755000000000000000000000000013224171744016246 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/sm/__init__.py0000644000000000000000000000164613156325252020365 0ustar rootroot00000000000000# __init__.py - collection of San Marino numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of San Marino numbers.""" # provide vat as an alias from stdnum.sm import coe as vat python-stdnum-1.8.1/stdnum/sm/coe.py0000644000000000000000000000467213223166521017373 0ustar rootroot00000000000000# coe.py - functions for handling San Marino tax numbers # coding: utf-8 # # Copyright (C) 2008-2011 Cédric Krier # Copyright (C) 2008-2011 B2CK # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """COE (Codice operatore economico, San Marino national tax number). The COE is a tax identification number of up to 5-digits used in San Marino. Leading zeroes are commonly dropped. >>> validate('51') '51' >>> validate('024165') '24165' >>> validate('2416A') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('1124165') Traceback (most recent call last): ... InvalidLength: ... """ from stdnum.exceptions import * from stdnum.util import clean # a collection of all registered numbers with 2 or less digits _lownumbers = set(( 2, 4, 6, 7, 8, 9, 10, 11, 13, 16, 18, 19, 20, 21, 25, 26, 30, 32, 33, 35, 36, 37, 38, 39, 40, 42, 45, 47, 49, 51, 52, 55, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 79, 80, 81, 84, 85, 87, 88, 91, 92, 94, 95, 96, 97, 99)) def compact(number): """Convert the number to the minimal representation. This strips surrounding whitespace and separation dash.""" return clean(number, '.').strip().lstrip('0') def validate(number): """Check if the number is a valid COE. This checks the length and formatting.""" number = compact(number) if len(number) > 5 or len(number) == 0: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if len(number) < 3 and int(number) not in _lownumbers: raise InvalidComponent() return number def is_valid(number): """Check if the number is a valid COE.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/hu/0000755000000000000000000000000013224171743016242 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/hu/__init__.py0000644000000000000000000000164513156325250020357 0ustar rootroot00000000000000# __init__.py - collection of Hungarian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Hungarian numbers.""" # provide vat as an alias from stdnum.hu import anum as vat python-stdnum-1.8.1/stdnum/hu/anum.py0000644000000000000000000000440613223166520017554 0ustar rootroot00000000000000# anum.py - functions for handling Hungarian VAT numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ANUM (Közösségi adószám, Hungarian VAT number). The ANUM is the Hungarian VAT (Közösségi adószám) number. It is an 8-digit taxpayer registration number that includes a weighted checksum. >>> validate('HU-12892312') '12892312' >>> validate('HU-12892313') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('HU'): number = number[2:] return number def checksum(number): """Calculate the checksum. Valid numbers should have a checksum of 0.""" weights = (9, 7, 3, 1, 9, 7, 3, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 10 def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 8: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ie/0000755000000000000000000000000013224171743016223 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ie/pps.py0000644000000000000000000000614613223166520017402 0ustar rootroot00000000000000# pps.py - functions for handling Irish PPS numbers # # Copyright (C) 2012, 2013 Arthur de Jong # Copyright (C) 2014 Olivier Dony # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PPS No (Personal Public Service Number, Irish personal number). The Personal Public Service number consists of 7 digits, and one or two letters. The first letter is a check character. When present (which should be the case for new numbers as of 2013), the second letter can be 'A' (for individuals) or 'H' (for non-individuals, such as limited companies, trusts, partnerships and unincorporated bodies). Pre-2013 values may have 'W', 'T', or 'X' as the second letter ; it is ignored by the check. >>> validate('6433435F') # pre-2013 '6433435F' >>> validate('6433435FT') # pre-2013 with special final 'T' '6433435FT' >>> validate('6433435FW') # pre-2013 format for married women '6433435FW' >>> validate('6433435E') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('6433435OA') # 2013 format (personal) '6433435OA' >>> validate('6433435IH') # 2013 format (non-personal) '6433435IH' >>> validate('6433435VH') # 2013 format (incorrect check) Traceback (most recent call last): ... InvalidChecksum: ... """ import re from stdnum.exceptions import * from stdnum.ie import vat from stdnum.util import clean pps_re = re.compile(r'^\d{7}[A-W][AHWTX]?$') """Regular expression used to check syntax of PPS numbers.""" def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').upper().strip() def validate(number): """Check if the number provided is a valid PPS number. This checks the length, formatting and check digit.""" number = compact(number) if not pps_re.match(number): raise InvalidFormat() if len(number) == 9 and number[8] in 'AH': # new 2013 format if number[7] != vat.calc_check_digit(number[:7] + number[8:]): raise InvalidChecksum() else: # old format, last letter ignored if number[7] != vat.calc_check_digit(number[:7]): raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid PPS number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ie/__init__.py0000644000000000000000000000154013156325250020332 0ustar rootroot00000000000000# __init__.py - collection of Irish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Irish numbers.""" python-stdnum-1.8.1/stdnum/ie/vat.py0000644000000000000000000000716513223166520017374 0ustar rootroot00000000000000# vat.py - functions for handling Irish VAT numbers # # Copyright (C) 2012-2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VAT (Irish tax reference number). The Irish VAT number consists of 8 or 9 digits. The number is either 7 digits and 1 letter (optionally followed by a W for married women), 7 digits and 2 letters, or 6 digits and 2 letters or symbols (in second and last position). >>> validate('IE 6433435F') # pre-2013 format '6433435F' >>> validate('IE 6433435OA') # 2013 format '6433435OA' >>> validate('6433435E') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('8D79739I') # old style number '8D79739I' >>> validate('8?79739J') # incorrect old style Traceback (most recent call last): ... InvalidFormat: ... >>> convert('1F23456T') '0234561T' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('IE'): number = number[2:] return number _alphabet = 'WABCDEFGHIJKLMNOPQRSTUV' def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" number = compact(number).zfill(7) return _alphabet[( sum((8 - i) * int(n) for i, n in enumerate(number[:7])) + 9 * _alphabet.index(number[7:])) % 23] def validate(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number[:1].isdigit() or not number[2:7].isdigit(): raise InvalidFormat() if not all(x in _alphabet for x in number[7:]): raise InvalidFormat() if len(number) not in (8, 9): raise InvalidLength() if number[:7].isdigit(): # new system (7 digits followed by 1 or 2 letters) if number[7] != calc_check_digit(number[:7] + number[8:]): raise InvalidChecksum() elif number[1] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ+*': # old system (second character is a letter or symbol) if number[7] != calc_check_digit(number[2:7] + number[0]): raise InvalidChecksum() else: raise InvalidFormat() return number def is_valid(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False def convert(number): """Convert an "old" style 8-digit VAT number where the second character is a letter to the new 8-digit format where only the last digit is a character.""" number = compact(number) if len(number) == 8 and not number[1].isdigit(): number = '0' + number[2:7] + number[0] + number[7:] return number python-stdnum-1.8.1/stdnum/rs/0000755000000000000000000000000013224171744016253 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/rs/__init__.py0000644000000000000000000000164013223166521020361 0ustar rootroot00000000000000# __init__.py - collection of Serbian numbers # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Serbian numbers.""" # provide vat as an alias from stdnum.rs import pib as vat python-stdnum-1.8.1/stdnum/rs/pib.py0000644000000000000000000000364113223166521017377 0ustar rootroot00000000000000# pib.py - functions for handling Serbian VAT numbers # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PIB (Poreski Identifikacioni Broj, Serbian tax identification number). The Serbian tax identification number consists of 9 digits where the last digit is a check digit. >>> validate('101134702') '101134702' >>> validate('101134703') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.iso7064 import mod_11_10 from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -.').strip() def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() mod_11_10.validate(number) return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/lv/0000755000000000000000000000000013224171743016247 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/lv/__init__.py0000644000000000000000000000164013156325251020360 0ustar rootroot00000000000000# __init__.py - collection of Latvian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Latvian numbers.""" # provide vat as an alias from stdnum.lv import pvn as vat python-stdnum-1.8.1/stdnum/lv/pvn.py0000644000000000000000000000740313223166521017425 0ustar rootroot00000000000000# pvn.py - functions for handling Latvian PVN (VAT) numbers # coding: utf-8 # # Copyright (C) 2012-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PVN (Pievienotās vērtības nodokļa, Latvian VAT number). The PVN is a 11-digit number that can either be a reference to a legal entity (in which case the first digit > 3) or a natural person (in which case it should be the same as the personal code (personas kods)). Personal codes start with 6 digits to denote the birth date in the form ddmmyy. >>> validate('LV 4000 3521 600') '40003521600' >>> validate('40003521601') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('161175-19997') # personal code '16117519997' >>> validate('161375-19997') # invalid date Traceback (most recent call last): ... InvalidComponent: ... """ import datetime from stdnum.exceptions import * from stdnum.util import clean # validation functions are available on-line but it is not allowed # to perform automated queries: # https://www6.vid.gov.lv/VID_PDB?aspxerrorpath=/vid_pdb/pvn.asp def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('LV'): number = number[2:] return number def checksum(number): """Calculate the checksum for legal entities.""" weights = (9, 1, 4, 8, 3, 10, 2, 5, 7, 6, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def calc_check_digit_pers(number): """Calculate the check digit for personal codes. The number passed should not have the check digit included.""" # note that this algorithm has not been confirmed by an independent source weights = (10, 5, 8, 4, 2, 1, 6, 3, 7, 9) check = 1 + sum(weights[i] * int(n) for i, n in enumerate(number)) return str(check % 11 % 10) def get_birth_date(number): """Split the date parts from the number and return the birth date.""" day = int(number[0:2]) month = int(number[2:4]) year = int(number[4:6]) year += 1800 + int(number[6]) * 100 try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 11: raise InvalidLength() if number[0] > '3': # legal entity if checksum(number) != 3: raise InvalidChecksum() else: # natural resident, check if birth date is valid get_birth_date(number) # TODO: check that the birth date is not in the future if calc_check_digit_pers(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/be/0000755000000000000000000000000013224171743016214 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/be/__init__.py0000644000000000000000000000166313223166517020335 0ustar rootroot00000000000000# __init__.py - collection of Belgian numbers # coding: utf-8 # # Copyright (C) 2012-2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Belgian numbers.""" # provide businessid as an alias from stdnum.be import vat as businessid python-stdnum-1.8.1/stdnum/be/vat.py0000644000000000000000000000463713223166517017374 0ustar rootroot00000000000000# vat.py - functions for handling Belgian VAT numbers # # Copyright (C) 2012-2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """BTW, TVA, NWSt, ondernemingsnummer (Belgian enterprise number). The enterprise number (ondernemingsnummer) is a unique identifier of companies within the Belgian administrative services. It was previously the VAT ID number. The number consists of 10 digits. >>> compact('BE403019261') '0403019261' >>> compact('(0)403019261') '0403019261' >>> validate('BE 428759497') '0428759497' >>> validate('BE431150351') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -./').upper().strip() if number.startswith('BE'): number = number[2:] if number.startswith('(0)'): number = '0' + number[3:] if len(number) == 9: number = '0' + number # old format had 9 digits return number def checksum(number): """Calculate the checksum.""" return (int(number[:-2]) + int(number[-2:])) % 97 def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/mx/0000755000000000000000000000000013224171743016252 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/mx/__init__.py0000644000000000000000000000164013156325252020364 0ustar rootroot00000000000000# __init__.py - collection of Mexican numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Mexican numbers.""" # provide vat as an alias from stdnum.mx import rfc as vat python-stdnum-1.8.1/stdnum/mx/rfc.py0000644000000000000000000001240313223166521017373 0ustar rootroot00000000000000# rfc.py - functions for handling Mexican tax numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """RFC (Registro Federal de Contribuyentes, Mexican tax number). This number is used to identify individuals and companies for tax purposes. The company number is 12 digits where the first 3 letters or digits are derived from the name of the company, the following 6 contain the date of incorporation, followed by 3 check digits. Personal numbers consist of 13 digits where the first 4 characters from the person's name, followed by their birth date and 3 check digits. The first two check digits are calculated based on the person's or company's full name. The last check digit is calculated over all the preceding digits in the number. However, it seems a lot of numbers (estimated at around 1.5% of all numbers) are in use with invalid check digits so this test is disabled by default. More information: * http://www.sisi.org.mx/jspsi/documentos/2005/seguimiento/06101/0610100162005_065.doc * https://es.wikipedia.org/wiki/Registro_Federal_de_Contribuyentes_(M%C3%A9xico) An online validation service is available at: * https://portalsat.plataforma.sat.gob.mx/ConsultaRFC/ >>> validate('GODE 561231 GR8') # personal number 'GODE561231GR8' >>> validate('MAB-930714-8T4') # company number 'MAB9307148T4' >>> validate('COMG-600703') # personal number without serial 'COMG600703' >>> validate('VACE-460910-SX6') 'VACE460910SX6' >>> validate('VACE-460910-SX6', validate_check_digits=True) Traceback (most recent call last): ... InvalidChecksum: ... >>> format('GODE561231GR8') 'GODE 561231 GR8' """ import datetime import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching numbers _rfc_re = re.compile(r'^[A-Z&Ñ]{3,4}[0-9]{6}[0-9A-Z]{0,5}$') # regular expression for matching the last 3 check digits _check_digits_re = re.compile(r'^[1-9A-V][1-9A-Z][0-9A]$') # these values should not appear as first part of a personal number _name_blacklist = set([ 'BUEI', 'BUEY', 'CACA', 'CACO', 'CAGA', 'CAGO', 'CAKA', 'CAKO', 'COGE', 'COJA', 'COJE', 'COJI', 'COJO', 'CULO', 'FETO', 'GUEY', 'JOTO', 'KACA', 'KACO', 'KAGA', 'KAGO', 'KAKA', 'KOGE', 'KOJO', 'KULO', 'MAME', 'MAMO', 'MEAR', 'MEAS', 'MEON', 'MION', 'MOCO', 'MULA', 'PEDA', 'PEDO', 'PENE', 'PUTA', 'PUTO', 'QULO', 'RATA', 'RUIN', ]) # characters used for checksum calculation, _alphabet = '0123456789ABCDEFGHIJKLMN&OPQRSTUVWXYZ Ñ' def compact(number): """Convert the number to the minimal representation. This strips surrounding whitespace and separation dash.""" return clean(number, '-_ ').upper().strip() def _get_date(number): """Convert the part of the number that represents a date into a datetime. Note that the century may be incorrect.""" year = int(number[0:2]) month = int(number[2:4]) day = int(number[4:6]) try: return datetime.date(year + 2000, month, day) except ValueError: raise InvalidComponent() def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" number = (' ' + number)[-12:] check = sum(_alphabet.index(n) * (13 - i) for i, n in enumerate(number)) return _alphabet[(11 - check) % 11] def validate(number, validate_check_digits=False): """Check if the number is a valid RFC.""" number = compact(number) if not _rfc_re.match(number): raise InvalidFormat() if len(number) in (10, 13): # number assigned to person if number[:4] in _name_blacklist: raise InvalidComponent() _get_date(number[4:10]) elif len(number) == 12: # number assigned to company _get_date(number[3:9]) else: raise InvalidLength() if validate_check_digits and len(number) >= 12: if not _check_digits_re.match(number[-3:]): raise InvalidComponent() if number[-1] != calc_check_digit(number[:-1]): raise InvalidChecksum() return number def is_valid(number, validate_check_digits=False): """Check if the number provided is a valid RFC.""" try: return bool(validate(number, validate_check_digits)) except ValidationError: return False def format(number, separator=' '): """Reformat the number to the standard presentation format.""" number = compact(number) if len(number) == 12: return separator.join(( number[:3], number[3:9], number[9:])).strip(separator) return separator.join(( number[:4], number[4:10], number[10:])).strip(separator) python-stdnum-1.8.1/stdnum/hr/0000755000000000000000000000000013224171743016237 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/hr/__init__.py0000644000000000000000000000164213156325250020351 0ustar rootroot00000000000000# __init__.py - collection of Croatian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Croatian numbers.""" # provide vat as an alias from stdnum.hr import oib as vat python-stdnum-1.8.1/stdnum/hr/oib.py0000644000000000000000000000423413223166520017361 0ustar rootroot00000000000000# cnp.py - functions for handling Croatian OIB numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """OIB (Osobni identifikacijski broj, Croatian identification number). The personal identification number is used to identify persons and legal entities in Croatia. It has 11 digits (sometimes prefixed by HR), contains no personal information and uses the ISO 7064 Mod 11, 10 checksum algorithm. >>> validate('HR 33392005961') '33392005961' >>> validate('33392005962') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.iso7064 import mod_11_10 from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('HR'): number = number[2:] return number def validate(number): """Check if the number is a valid OIB number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 11: raise InvalidLength() mod_11_10.validate(number) return number def is_valid(number): """Check if the number is a valid OIB number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/isil.dat0000644000000000000000000001002313223166520017250 0ustar rootroot00000000000000# generated from ISIL Registration Authority, downloaded from # http://biblstandard.dk/isil/ O$ ra="See OCLC" US$ country="United States of America" ra_url="http://www.loc.gov/marc/organizations/" ra="Library of Congress" AR$ country="Argentine Republic" ra_url="http://www.iram.org.ar" ra="Argentine Standardization and Certification Institute (IRAM)" AT$ country="Austria" ra_url="http://www.obvsg.at" ra="Die Österreichische Bibliothekenverbund und Service GmbH" AU$ country="Australia" ra_url="http://www.nla.gov.au/ilrs" ra="National Library of Australia" BE$ country="Belgium" ra_url="http://www.kbr.be" ra="Royal Library of Belgium" BY$ country="Belarus" ra_url="http://www.nlb.by/portal/page/portal/index?lang=en" ra="National Library of Belarus" CA$ country="Canada" ra_url="http://www.collectionscanada.ca/ill/s16-206-e.html#3.2.2" ra="Library and Archives Canada" CH$ country="Switzerland" ra_url="http://www.nb.admin.ch/slb/slb_professionnel/01540/index.html?lang=en" ra="Swiss National Library" CY$ country="Cyprus" ra_url="http://library.cut.ac.cy/en/isil" ra="Cyprus University of Technology – Library" DE$ country="Germany" ra_url="http://sigel.staatsbibliothek-berlin.de/" ra="Staatsbibliothek zu Berlin" DK$ country="Denmark" ra_url="http://www.kulturstyrelsen.dk/english/institutions/libraries/national-solutions/standards/danish-library-number/" ra="Danish Agency for Culture and Palaces" EG$ country="Egypt" ra_url="http://www.sti.sci.eg/index.php?option=com_content&view=article&id=30:focal-point&catid=1:pages&Itemid=56" ra="Egyptian National Scientific and Technical Information Network (ENSTINET)" FI$ country="Finland" ra_url="http://isil.kansalliskirjasto.fi/en/" ra="The National Library of Finland" FR$ country="France" ra_url="http://www.abes.fr" ra="Agence Bibliographique de l'Enseignement Superieur" GB$ country="United Kingdom" ra_url="http://www.bl.uk/bibliographic/isilagency.html" ra="British Library" GL$ country="Greenland" ra_url="http://www.katak.gl/ISIL/Greenlandic_library_identifiers.html" ra="Central and Public Library of Greenland" IL$ country="Israel" ra_url="http://nli.org.il/eng" ra="National Library of Israel" IR$ country="Islamic Republic of Iran" ra_url="http://www.nlai.ir/special_services/stds/isil.htm" ra="National Library and Archives of Islamic Republic of Iran of Iran" IT$ country="Italy" ra_url="http://www.iccu.sbn.it/genera.jsp?id=78&l=en" ra="Istituto Centrale per il Catalogo Unico delle biblioteche italiane e per le informazioni bibliografiche" JP$ country="Japan" ra_url="http://www.ndl.go.jp/en/library/isil/index.html" ra="National Diet Library" KR$ country="Republic of Korea" ra_url="http://www.nl.go.kr/isil/" ra="The National Library of Korea" LU$ country="Luxembourg" ra_url="http://www.anlux.public.lu" ra="Archives nationales de Luxembourg" NL$ country="The Netherlands" ra_url="http://www.kb.nl/expertise/voor-bibliotheken/interbibliotheciar-leenverkeer/internationale-standard-identifier-for-libraries-isil" ra="Koninklijke Bibliotheek, National Library of the Netherlands" NO$ country="Norway" ra_url="http://www.nb.no/" ra="National Library of Norway" NZ$ country="New Zealand" ra_url="http://natlib.govt.nz/" ra="National Library of New Zealand Te Puna Matauranga o Aotearoa" QA$ country="Qatar" ra_url="http://www.qnl.qa/" ra="Qatar National Library (QNL)" RU$ country="Russian Federation" ra_url="http://english.gpntb.ru/" ra="Russian National Public Library for Science and Technology" SI$ country="The Republic of Slovenia" ra_url="http://www.nuk.uni-lj.si/nukeng3.asp?id=311364382" ra="National and University Library" SK$ country="Slovak Republic" ra_url="http://www.snk.sk/en/information-for/libraries-and-librarians/isil.html" ra="Slovak National Library" EUR$ country="Code for common European organizations." ra_url="http://www.eui.eu/Research/HistoricalArchivesOfEU/FindingAidsAndResearch/HAEU-Non-national-ISIL-Allocation-Agency.aspx" ra="HAEU" OCLC$ country="WorldCat Symbol" ra_url="http://www.oclc.org" ra="OCLC" ZDB$ country="Staatsbibliothek zu Berlin - Zeitschriftendatenbank" ra="Staatsbibliothek zu Berlin" python-stdnum-1.8.1/stdnum/meid.py0000644000000000000000000001540213223166521017115 0ustar rootroot00000000000000# meid.py - functions for handling Mobile Equipment Identifiers (MEIDs) # # Copyright (C) 2010-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """MEID (Mobile Equipment Identifier). The Mobile Equipment Identifier is used to identify a physical piece of CDMA mobile station equipment. >>> validate('AF 01 23 45 0A BC DE C') 'AF0123450ABCDE' >>> validate('29360 87365 0070 3710 0') 'AF0123450ABCDE' >>> validate('29360 87365 0070 3710 0', strip_check_digit=False) 'AF0123450ABCDEC' >>> validate('29360 87365 0070 3710 1') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('af0123450abcDEC', add_check_digit=True) 'AF 01 23 45 0A BC DE C' >>> format('af0123450abcDEC', format='dec', add_check_digit=True) '29360 87365 0070 3710 0' """ from stdnum.exceptions import * from stdnum.util import clean _hex_alphabet = '0123456789ABCDEF' def _cleanup(number): """Remove any grouping information from the number and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def _ishex(number): for x in number: if x not in _hex_alphabet: return False return True def _parse(number): number = _cleanup(number) if len(number) in (14, 15): # 14 or 15 digit hex representation if not _ishex(number): raise InvalidFormat() return number[0:14], number[14:] elif len(number) in (18, 19): # 18-digit decimal representation if not number.isdigit(): raise InvalidFormat() return number[0:18], number[18:] else: raise InvalidLength() def calc_check_digit(number): """Calculate the check digit for the number. The number should not already have a check digit.""" # both the 18-digit decimal format and the 14-digit hex format # containing only decimal digits should use the decimal Luhn check from stdnum import luhn if number.isdigit(): return luhn.calc_check_digit(number) else: return luhn.calc_check_digit(number, alphabet=_hex_alphabet) def compact(number, strip_check_digit=True): """Convert the MEID number to the minimal (hexadecimal) representation. This strips grouping information, removes surrounding whitespace and converts to hexadecimal if needed. If the check digit is to be preserved and conversion is done a new check digit is recalculated.""" # first parse the number number, cd = _parse(number) # strip check digit if needed if strip_check_digit: cd = '' # convert to hex if needed if len(number) == 18: number = '%08X%06X' % (int(number[0:10]), int(number[10:18])) if cd: cd = calc_check_digit(number) # put parts back together again return number + cd def _bit_length(n): """Return the number of bits necessary to store the number in binary.""" try: return n.bit_length() except AttributeError: # pragma: no cover (Python 2.6 only) import math return int(math.log(n, 2)) + 1 def validate(number, strip_check_digit=True): """Check if the number is a valid MEID number. This converts the representation format of the number (if it is decimal it is not converted to hexadecimal).""" from stdnum import luhn # first parse the number number, cd = _parse(number) if len(number) == 18: # decimal format can be easily determined if cd: luhn.validate(number + cd) # convert to hex manufacturer_code = int(number[0:10]) serial_num = int(number[10:18]) if _bit_length(manufacturer_code) > 32 or _bit_length(serial_num) > 24: raise InvalidComponent() number = '%08X%06X' % (manufacturer_code, serial_num) cd = calc_check_digit(number) elif number.isdigit(): # if the remaining hex format is fully decimal it is an IMEI number from stdnum import imei imei.validate(number + cd) else: # normal hex Luhn validation if cd: luhn.validate(number + cd, alphabet=_hex_alphabet) if strip_check_digit: cd = '' return number + cd def is_valid(number): """Check if the number is a valid MEID number.""" try: return bool(validate(number)) except ValidationError: return False def format(number, separator=' ', format=None, add_check_digit=False): """Reformat the number to the standard presentation format. The separator used can be provided. If the format is specified (either 'hex' or 'dec') the number is reformatted in that format, otherwise the current representation is kept. If add_check_digit is True a check digit will be added if it is not present yet.""" # first parse the number number, cd = _parse(number) # format conversions if needed if format == 'dec' and len(number) == 14: # convert to decimal number = '%010d%08d' % (int(number[0:8], 16), int(number[8:14], 16)) if cd: cd = calc_check_digit(number) elif format == 'hex' and len(number) == 18: # convert to hex number = '%08X%06X' % (int(number[0:10]), int(number[10:18])) if cd: cd = calc_check_digit(number) # see if we need to add a check digit if add_check_digit and not cd: cd = calc_check_digit(number) # split number according to format if len(number) == 14: number = [number[i * 2:i * 2 + 2] for i in range(7)] + [cd] else: number = (number[:5], number[5:10], number[10:14], number[14:], cd) return separator.join(x for x in number if x) def to_binary(number): """Convert the number to its binary representation (without the check digit).""" from binascii import a2b_hex return a2b_hex(compact(number, strip_check_digit=True)) def to_pseudo_esn(number): """Convert the provided MEID to a pseudo ESN (pESN). The ESN is returned in compact hexadecimal representation.""" import hashlib # return the last 6 digits of the SHA1 hash prefixed with the reserved # manufacturer code return '80' + hashlib.sha1(to_binary(number)).hexdigest()[-6:].upper() python-stdnum-1.8.1/stdnum/iso9362.py0000644000000000000000000000212613223166521017314 0ustar rootroot00000000000000# iso9362.py - compatibility module for stdnum.bic # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # flake8: noqa import sys import warnings warnings.warn( 'The stdnum.iso9362 module has been renamed, use stdnum.bic instead.', DeprecationWarning, stacklevel=2) # We ensure that stdnum.bic is exposed in this module's place import stdnum.bic sys.modules[__name__] = stdnum.bic python-stdnum-1.8.1/stdnum/iban.py0000644000000000000000000001064513223166520017113 0ustar rootroot00000000000000# iban.py - functions for handling International Bank Account Numbers (IBANs) # # Copyright (C) 2011-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """IBAN (International Bank Account Number). The IBAN is used to identify bank accounts across national borders. The first two letters are a country code. The next two digits are check digits for the ISO 7064 Mod 97, 10 checksum. Each country uses its own format for the remainder of the number. Some countries may also use checksum algorithms within their number but this is only checked for a few countries. More information: * https://en.wikipedia.org/wiki/International_Bank_Account_Number * https://www.swift.com/products_services/bic_and_iban_format_registration_iban_format_r >>> validate('GR16 0110 1050 0000 1054 7023 795') 'GR1601101050000010547023795' >>> validate('BE31435411161155') 'BE31435411161155' >>> compact('GR16 0110 1050 0000 1054 7023 795') 'GR1601101050000010547023795' >>> format('GR1601101050000010547023795') 'GR16 0110 1050 0000 1054 7023 795' >>> calc_check_digits('BExx435411161155') '31' """ import re from stdnum import numdb from stdnum.exceptions import * from stdnum.iso7064 import mod_97_10 from stdnum.util import clean, get_cc_module # our open copy of the IBAN database _ibandb = numdb.get('iban') # regular expression to check IBAN structure _struct_re = re.compile(r'([1-9][0-9]*)!([nac])') # cache of country codes to modules _country_modules = {} def compact(number): """Convert the iban number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def calc_check_digits(number): """Calculate the check digits that should be put in the number to make it valid. Check digits in the supplied number are ignored.""" number = compact(number) return mod_97_10.calc_check_digits(number[4:] + number[:2]) def _struct_to_re(structure): """Convert an IBAN structure to a refular expression that can be used to validate the number.""" def conv(match): chars = { 'n': '[0-9]', 'a': '[A-Z]', 'c': '[A-Za-z0-9]', }[match.group(2)] return '%s{%s}' % (chars, match.group(1)) return re.compile('^%s$' % _struct_re.sub(conv, structure)) def _get_cc_module(cc): """Get the VAT number module based on the country code.""" # Greece uses a "wrong" country code cc = cc.lower() if cc not in _country_modules: _country_modules[cc] = get_cc_module(cc, 'iban') return _country_modules[cc] def validate(number, check_country=True): """Check if the number provided is a valid IBAN. The country-specific check can be disabled with the check_country argument.""" number = compact(number) # ensure that checksum is valid mod_97_10.validate(number[4:] + number[:4]) # look up the number info = _ibandb.info(number) # check if the bban part of number has the correct structure bban = number[4:] if not _struct_to_re(info[0][1].get('bban', '')).match(bban): raise InvalidFormat() # check the country-specific module if it exists if check_country: module = _get_cc_module(number[:2]) if module: module.validate(number) # return the compact representation return number def is_valid(number, check_country=True): """Check if the number provided is a valid IBAN.""" try: return bool(validate(number, check_country=check_country)) except ValidationError: return False def format(number, separator=' '): """Reformat the passed number to the space-separated format.""" number = compact(number) return separator.join(number[i:i + 4] for i in range(0, len(number), 4)) python-stdnum-1.8.1/stdnum/imei.py0000644000000000000000000000677213223166520017133 0ustar rootroot00000000000000# imei.py - functions for handling International Mobile Equipment Identity # (IMEI) numbers # # Copyright (C) 2010-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """IMEI (International Mobile Equipment Identity). The IMEI is used to identify mobile phones. An IMEI is 14, 15 (when the check digit is included) or 16 digits (IMEISV) long. The check digit is validated using the Luhn algorithm. More information: * https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity >>> validate('35686800-004141-20') '3568680000414120' >>> validate('35-417803-685978-1') Traceback (most recent call last): ... InvalidChecksum: ... >>> compact('35686800-004141-20') '3568680000414120' >>> format('354178036859789') '35-417803-685978-9' >>> format('35686800-004141', add_check_digit=True) '35-686800-004141-8' >>> imei_type('35686800-004141-20') 'IMEISV' >>> split('35686800-004141') ('35686800', '004141', '') """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the IMEI number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def validate(number): """Check if the number provided is a valid IMEI (or IMEISV) number.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) == 15: # only 15 digit IMEI has check digit luhn.validate(number) elif len(number) not in (14, 16): # neither IMEI without check digit or IMEISV (which doesn't have one) raise InvalidLength() return number def imei_type(number): """Check the passed number and return 'IMEI', 'IMEISV' or None (for invalid) for checking the type of number passed.""" try: number = validate(number) except ValidationError: return None if len(number) in (14, 15): return 'IMEI' else: # len(number) == 16: return 'IMEISV' def is_valid(number): """Check if the number provided is a valid IMEI (or IMEISV) number.""" try: return bool(validate(number)) except ValidationError: return False def split(number): """Split the number into a Type Allocation Code (TAC), serial number and either the checksum (for IMEI) or the software version number (for IMEISV).""" number = compact(number) return (number[:8], number[8:14], number[14:]) def format(number, separator='-', add_check_digit=False): """Reformat the number to the standard presentation format.""" number = compact(number) if len(number) == 14 and add_check_digit: number += luhn.calc_check_digit(number) number = (number[:2], number[2:8], number[8:14], number[14:]) return separator.join(x for x in number if x) python-stdnum-1.8.1/stdnum/my/0000755000000000000000000000000013224171743016253 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/my/bp.dat0000644000000000000000000001754713222423432017355 0ustar rootroot00000000000000# generated from National Registration Department of Malaysia, downloaded from # http://www.jpn.gov.my/informasi/kod-negeri/ # http://www.jpn.gov.my/en/informasi/kod-negara/ 01 state="Johor" country="Malaysia" countries="Malaysia" 02 state="Kedah" country="Malaysia" countries="Malaysia" 03 state="Kelantan" country="Malaysia" countries="Malaysia" 04 state="Melaka" country="Malaysia" countries="Malaysia" 05 state="Negeri Sembilan" country="Malaysia" countries="Malaysia" 06 state="Pahang" country="Malaysia" countries="Malaysia" 07 state="Pulau Pinang" country="Malaysia" countries="Malaysia" 08 state="Perak" country="Malaysia" countries="Malaysia" 09 state="Perlis" country="Malaysia" countries="Malaysia" 10 state="Selangor" country="Malaysia" countries="Malaysia" 11 state="Terengganu" country="Malaysia" countries="Malaysia" 12 state="Sabah" country="Malaysia" countries="Malaysia" 13 state="Sarawak" country="Malaysia" countries="Malaysia" 14 state="Wilayah Persekutuan (Kuala Lumpur)" country="Malaysia" countries="Malaysia" 15 state="Wilayah Persekutuan (Labuan)" country="Malaysia" countries="Malaysia" 16 state="Wilayah Persekutuan (Putrajaya)" country="Malaysia" countries="Malaysia" 21 state="Johor" country="Malaysia" countries="Malaysia" 22 state="Johor" country="Malaysia" countries="Malaysia" 23 state="Johor" country="Malaysia" countries="Malaysia" 24 state="Johor" country="Malaysia" countries="Malaysia" 25 state="Kedah" country="Malaysia" countries="Malaysia" 26 state="Kedah" country="Malaysia" countries="Malaysia" 27 state="Kedah" country="Malaysia" countries="Malaysia" 28 state="Kelantan" country="Malaysia" countries="Malaysia" 29 state="Kelantan" country="Malaysia" countries="Malaysia" 30 state="Melaka" country="Malaysia" countries="Malaysia" 31 state="Negeri Sembilan" country="Malaysia" countries="Malaysia" 32 state="Pahang" country="Malaysia" countries="Malaysia" 33 state="Pahang" country="Malaysia" countries="Malaysia" 34 state="Pulau Pinang" country="Malaysia" countries="Malaysia" 35 state="Pulau Pinang" country="Malaysia" countries="Malaysia" 36 state="Perak" country="Malaysia" countries="Malaysia" 37 state="Perak" country="Malaysia" countries="Malaysia" 38 state="Perak" country="Malaysia" countries="Malaysia" 39 state="Perak" country="Malaysia" countries="Malaysia" 40 state="Perlis" country="Malaysia" countries="Malaysia" 41 state="Selangor" country="Malaysia" countries="Malaysia" 42 state="Selangor" country="Malaysia" countries="Malaysia" 43 state="Selangor" country="Malaysia" countries="Malaysia" 44 state="Selangor" country="Malaysia" countries="Malaysia" 45 state="Terengganu" country="Malaysia" countries="Malaysia" 46 state="Terengganu" country="Malaysia" countries="Malaysia" 47 state="Sabah" country="Malaysia" countries="Malaysia" 48 state="Sabah" country="Malaysia" countries="Malaysia" 49 state="Sabah" country="Malaysia" countries="Malaysia" 50 state="Sarawak" country="Malaysia" countries="Malaysia" 51 state="Sarawak" country="Malaysia" countries="Malaysia" 52 state="Sarawak" country="Malaysia" countries="Malaysia" 53 state="Sarawak" country="Malaysia" countries="Malaysia" 54 state="Wilayah Persekutuan (Kuala Lumpur)" country="Malaysia" countries="Malaysia" 55 state="Wilayah Persekutuan (Kuala Lumpur)" country="Malaysia" countries="Malaysia" 56 state="Wilayah Persekutuan (Kuala Lumpur)" country="Malaysia" countries="Malaysia" 57 state="Wilayah Persekutuan (Kuala Lumpur)" country="Malaysia" countries="Malaysia" 58 state="Wilayah Persekutuan (Labuan)" country="Malaysia" countries="Malaysia" 59 state="Negeri Sembilan" country="Malaysia" countries="Malaysia" 60 country="BRUNEI" countries="BRUNEI" 61 country="INDONESIA" countries="INDONESIA" 62 countries="CAMBODIA, DEMOCRATIC KAMPUCHE, KAMPUCHEA" 63 country="LAOS" countries="LAOS" 64 countries="BURMA, MYANMAR" 65 country="PHILIPPINES" countries="PHILIPPINES" 66 country="SINGAPURA" countries="SINGAPURA" 67 country="THAILAND" countries="THAILAND" 68 country="VIETNAM" countries="VIETNAM" 71,72 country="LUAR NEGARA" countries="LUAR NEGARA" 74 country="CHINA" countries="CHINA" 75 country="INDIA" countries="INDIA" 76 country="PAKISTAN" countries="PAKISTAN" 77 countries="ARAB SAUDI, SAUDI ARABIA" 78 country="SRI LANKA" countries="SRI LANKA" 79 country="BANGLADESH" countries="BANGLADESH" 82 state="Negeri Tidak Diketahui" country="Malaysia" countries="Malaysia" 83 countries="AMERICAN SAMOA, ASIA PASIFIK, AUSTRALIA, CHRISTMAS ISLAND, COCOS(KEELING) ISLANDS, COOK ISLANDS, FIJI, FRENCH POLYNESIA, GUAM, HEARD AND MCDONALD ISLANDS, MARSHALL ISLANDS, MICRONESIA, NEW CALEDONIA, NEW ZEALAND, NIUE, NORFOLK ISLANDS, PAPUA NEW GUINEA, TIMOR LESTE, TOKELAU, UNITED STATES MINOR OUTLYING ISLANDS, WALLIS AND FUTUNA ISLANDS" 84 countries="AMERIKA SELATAN, ANGUILLA, ARGENTINA, ARUBA, BOLIVIA, BRAZIL, CHILE, COLOMBIA, ECUADOR, FRENCH GUIANA, GUADELOUPE, GUYANA, PARAGUAY, PERU, SOUTH GEORGIA & THE SOUTH SANDWICH ISLANDS, SURINAME, URUGUAY, VENEZUELA" 85 countries="AFRIKA, AFRIKA SELATAN, ALGERIA, ANGOLA, BOTSWANA, BURUNDI, CAMEROON, CENTRAL AFRICAN REPUBLIC, CHAD, CONGO-BRAZZAVILLE, CONGO-KINSHASA, DJIBOUTI, EGYPT, ERITREA, ETHIOPIA, GABON, GAMBIA, GHANA, GUINEA, KENYA, LIBERIA, MALAWI, MALI, MAURITANIA, MAYOTTE, MOROCCO, MOZAMBIQUE, NAMIBIA, NIGER, NIGERIA, REUNION, RWANDA, SENEGAL, SIERRA LEONE, SOMALIA, SUDAN, SWAZILAND, TANZANIA, TOGO, TONGA, TUNISIA, UGANDA, WESTERN SAHARA, ZAIRE, ZAMBIA, ZIMBABWE" 86 countries="ARMENIA, AUSTRIA, BELGIUM, CYPRUS, DENMARK, EUROPAH, FAEROE ISLANDS, FINLAND, FINLAND, METROPOLITAN, FRANCE, GERMANY, GERMANY (DEM.REP), GERMANY (FED.REP), GREECE, HOLY SEE (VATICAN CITY), ITALY, LUXEMBOURG, MACEDONIA, MALTA, MEDITERANEAN, MONACO, NETHERLANDS, NORWAY, PORTUGAL, REP. OF MOLDOVA, SLOVAKIA, SLOVENIA, SPAIN, SWEDEN, SWITZERLAND, UK-DEPENDENT TERRITORIES CIT, UK-NATIONAL OVERSEAS, UK-OVERSEAS CITIZEN, UK-PROTECTED PERSON, UK-SUBJECT" 87 countries="BRITAIN, GREAT BRITAIN, IRELAND" 88 countries="BAHRAIN, IRAN, IRAQ, ISRAEL, JORDAN, KUWAIT, LEBANON, OMAN, QATAR, REPUBLIC OF YEMEN, SYRIA, TIMUR TENGAH, TURKEY, UNITED ARAB EMIRATE, YEMEN ARAB REP., YEMEN PEOPLE DEM.RE" 89 countries="JAPAN, KOREA (SELATAN), KOREA (UTARA), TAIWAN, TIMUR JAUH" 90 countries="BAHAMAS, BARBADOS, BELIZE, CARIBBEAN, COSTA RICA, CUBA, DOMINICA, DOMINICAN REPUBLIC, EL SALVADOR, GRENADA, GUATEMALA, HAITI, HONDURAS, JAMAICA, MARTINIQUE, MEXICO, NICARAGUA, PANAMA, PUERTO RICO, ST. KITTS AND NEVIS, ST. LUCIA, ST. VINCENT AND THE GRENADINES, TRINIDAD & TOBAGO, TURKS AND CAICOS ISLANDS, VIRGIN ISLANDS (USA)" 91 countries="AMERIKA UTARA, CANADA, GREENLAND, NETHERLANDS ANTILLES, ST. PIERRE AND MIQUELON, UNITED STATES OF AMERICA" 92 countries="ALBANIA, BELARUS, BOSNIA HERZEGOVINA, BULGARIA, BYELORUSSIA, CROATIA, CZECH REPUBLIC, CZECHOSLOVAKIA, ESTONIA, GEORGIA, HUNGARY, LATVIA, LITHUANIA, MONTENEGRO, POLAND, REPUBLIC OF KOSOVO, ROMANIA, RUSSIAN FEDERATION, SERBIA, U.S.S.R, UKRAINE" 93 countries="AFGHANISTAN, ANDORRA/ANDORA, ANTARTICA, ANTIGUA & BARBUDA, AZERBAIJAN, BENIN, BERMUDA, BHUTAN, BORA-BORA, BOUVET ISLAND, BRITISH INDIAN OCEAN TERRITORY, BURKINA FASO/BURKINA, CAPE VERDE, CAYMAN ISLANDS, COMOROS, DAHOMEY, EQUATORIAL GUINEA, FALKLAND ISLANDS, FRENCH SOUTHERN TERRITORIES, GIBRALTAR, GUINEA-BISSAU, HONG KONG, ICELAND, IVORY COAST, KAZAKHSTAN, KIRIBATI, KYRGYZSTAN, LESOTHO, LIBYA, LIECHTENSTEIN, MACAU, MADAGASCAR, MAGHRIBI, MALAGASY, MALDIVES, MAURITIUS, MONGOLIA, MONTSERRAT, NAURU, NEPAL, NORTHERN MARIANAS ISLANDS, OUTER MONGOLIA, PALAU, PALESTINE, PITCAIRN ISLANDS, SAMAO BARAT, SAMOA, SAN MARINO, SAO TOME & PRINCIPE, SEYCHELLES, SOLOMON ISLANDS, ST. HELENA, ST.LUCIA, ST.VICENT, SVALBARD AND JAN MAYEN ISLANDS, SWAPO, TAJIKISTAN, TURKMENISTAN, TUVALU, UPPER VOLTA, UZBEKISTAN, VANUATU, VATICAN CITY, VIRGIN ISLANDS (BRITISH), WESTERN SAMOA, YUGOSLAVIA" 98 countries="STATELESS PERSON ARTICLE 1/1954, Tanpa Negara" 99 countries="MAKLUMAT TIADA, MEKAH, NEUTRAL ZONE, REFUGEE, REFUGEE ARTICLE 1/1951, UN SPECIALIZED AGENCY, UNITED NATIONS ORGANIZATION, UNSPECIFIED NATIONALITY" python-stdnum-1.8.1/stdnum/my/__init__.py0000644000000000000000000000155013156325252020365 0ustar rootroot00000000000000# __init__.py - collection of Malaysian numbers # coding: utf-8 # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Malaysian numbers.""" python-stdnum-1.8.1/stdnum/my/nric.py0000644000000000000000000000702013223166521017554 0ustar rootroot00000000000000# nric.py - functions for handling NRIC numbers # # Copyright (C) 2013, 2014 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NRIC No. (Malaysian National Registration Identity Card Number). The NRIC No. is the unique identifier for issued to Malaysian citizens and permanent residents. The number consist of 12 digits in three sections. The first 6 digits represent the birth date, followed by two digits represeting the birth place and finally four digits. The gender of a person can be derived from the last digit: odd numbers for males and even numbers for females. >>> validate('770305-02-1234') '770305021234' >>> validate('771305-02-1234') # invalid date Traceback (most recent call last): ... InvalidComponent: ... >>> validate('770305-17-1234') # unknown birth place code Traceback (most recent call last): ... InvalidComponent: ... >>> format('770305021234') '770305-02-1234' """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -*').strip() def get_birth_date(number): """Split the date parts from the number and return the birth date. Note that in some cases it may return the registration date instead of the birth date and it may be a century off.""" number = compact(number) year = int(number[0:2]) month = int(number[2:4]) day = int(number[4:6]) # this is a bit broken but it's easy try: return datetime.date(year + 1900, month, day) except ValueError: pass try: return datetime.date(year + 2000, month, day) except ValueError: raise InvalidComponent() def get_birth_place(number): """Use the number to look up the place of birth of the person. This can either be a state or federal territory within Malaysia or a country outside of Malaysia.""" from stdnum import numdb number = compact(number) results = numdb.get('my/bp').info(number[6:8])[0][1] if not results: raise InvalidComponent() return results def validate(number): """Check if the number is a valid NRIC number. This checks the length, formatting and birth date and place.""" number = compact(number) if len(number) != 12: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() get_birth_date(number) get_birth_place(number) return number def is_valid(number): """Check if the number is a valid NRIC number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:6] + '-' + number[6:8] + '-' + number[8:] python-stdnum-1.8.1/stdnum/lt/0000755000000000000000000000000013224171743016245 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/lt/pvm.py0000644000000000000000000000564413223166521017427 0ustar rootroot00000000000000# pvm.py - functions for handling Lithuanian VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT number). The PVM is used for VAT purposes in Lithuania. It is 9 digits (for legal entities) or 12 digits long (for temporarily registered taxpayers). This module does not check the format of Lithuanian personal codes (Asmens kodas). >>> validate('119511515') # organisation '119511515' >>> validate('LT 100001919017') # temporarily registered '100001919017' >>> validate('100001919018') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('100004801610') # second step in check digit calculation '100004801610' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('LT'): number = number[2:] return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" check = sum((1 + i % 9) * int(n) for i, n in enumerate(number)) % 11 if check == 10: check = sum((1 + (i + 2) % 9) * int(n) for i, n in enumerate(number)) return str(check % 11 % 10) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) == 9: # legal entities if number[7] != '1': raise InvalidComponent() elif len(number) == 12: # temporary tax payers and natural persons if number[10] != '1': raise InvalidComponent() else: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/lt/__init__.py0000644000000000000000000000164613156325251020364 0ustar rootroot00000000000000# __init__.py - collection of Lithuanian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Lithuanian numbers.""" # provide vat as an alias from stdnum.lt import pvm as vat python-stdnum-1.8.1/stdnum/cn/0000755000000000000000000000000013224171743016226 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/cn/__init__.py0000644000000000000000000000155513156325246020350 0ustar rootroot00000000000000# __init__.py - collection of United States numbers # coding: utf-8 # # Copyright (C) 2014 Jiangge Zhang # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of China (PRC) numbers.""" python-stdnum-1.8.1/stdnum/cn/loc.dat0000644000000000000000000075363313223166520017512 0ustar rootroot00000000000000# generated from National Bureau of Statistics of the People's # Republic of China, downloaded from https://github.com/cn/GB2260 # 2018-01-01 12:14:49.217641 110101 county="东城区" prefecture="市辖区" province="北京市" 110102 county="西城区" prefecture="市辖区" province="北京市" 110103 county="崇文区" prefecture="市辖区" province="北京市" 110104 county="宣武区" prefecture="市辖区" province="北京市" 110105 county="朝阳区" prefecture="市辖区" province="北京市" 110106 county="丰台区" prefecture="市辖区" province="北京市" 110107 county="石景山区" prefecture="市辖区" province="北京市" 110108 county="海淀区" prefecture="市辖区" province="北京市" 110109 county="门头沟区" prefecture="市辖区" province="北京市" 110111 county="房山区" prefecture="市辖区" province="北京市" 110112 county="通州区" prefecture="市辖区" province="北京市" 110113 county="顺义区" prefecture="市辖区" province="北京市" 110114 county="昌平区" prefecture="市辖区" province="北京市" 110115 county="大兴区" prefecture="市辖区" province="北京市" 110116 county="怀柔区" prefecture="市辖区" province="北京市" 110117 county="平谷区" prefecture="市辖区" province="北京市" 110228 county="密云县" prefecture="县" province="北京市" 110229 county="延庆县" prefecture="县" province="北京市" 120101 county="和平区" prefecture="市辖区" province="天津市" 120102 county="河东区" prefecture="市辖区" province="天津市" 120103 county="河西区" prefecture="市辖区" province="天津市" 120104 county="南开区" prefecture="市辖区" province="天津市" 120105 county="河北区" prefecture="市辖区" province="天津市" 120106 county="红桥区" prefecture="市辖区" province="天津市" 120107 county="塘沽区" prefecture="市辖区" province="天津市" 120108 county="汉沽区" prefecture="市辖区" province="天津市" 120109 county="大港区" prefecture="市辖区" province="天津市" 120110 county="东丽区" prefecture="市辖区" province="天津市" 120111 county="西青区" prefecture="市辖区" province="天津市" 120112 county="津南区" prefecture="市辖区" province="天津市" 120113 county="北辰区" prefecture="市辖区" province="天津市" 120114 county="武清区" prefecture="市辖区" province="天津市" 120115 county="宝坻区" prefecture="市辖区" province="天津市" 120116 county="滨海新区" prefecture="市辖区" province="天津市" 120221 county="宁河县" prefecture="县" province="天津市" 120223 county="静海县" prefecture="县" province="天津市" 120225 county="蓟县" prefecture="县" province="天津市" 130101 county="市辖区" prefecture="石家庄市" province="河北省" 130102 county="长安区" prefecture="石家庄市" province="河北省" 130103 county="桥东区" prefecture="石家庄市" province="河北省" 130104 county="桥西区" prefecture="石家庄市" province="河北省" 130105 county="新华区" prefecture="石家庄市" province="河北省" 130107 county="井陉矿区" prefecture="石家庄市" province="河北省" 130108 county="裕华区" prefecture="石家庄市" province="河北省" 130109 county="藁城区" prefecture="石家庄市" province="河北省" 130110 county="鹿泉区" prefecture="石家庄市" province="河北省" 130111 county="栾城区" prefecture="石家庄市" province="河北省" 130121 county="井陉县" prefecture="石家庄市" province="河北省" 130123 county="正定县" prefecture="石家庄市" province="河北省" 130124 county="栾城县" prefecture="石家庄市" province="河北省" 130125 county="行唐县" prefecture="石家庄市" province="河北省" 130126 county="灵寿县" prefecture="石家庄市" province="河北省" 130127 county="高邑县" prefecture="石家庄市" province="河北省" 130128 county="深泽县" prefecture="石家庄市" province="河北省" 130129 county="赞皇县" prefecture="石家庄市" province="河北省" 130130 county="无极县" prefecture="石家庄市" province="河北省" 130131 county="平山县" prefecture="石家庄市" province="河北省" 130132 county="元氏县" prefecture="石家庄市" province="河北省" 130133 county="赵县" prefecture="石家庄市" province="河北省" 130181 county="辛集市" prefecture="石家庄市" province="河北省" 130182 county="藁城市" prefecture="石家庄市" province="河北省" 130183 county="晋州市" prefecture="石家庄市" province="河北省" 130184 county="新乐市" prefecture="石家庄市" province="河北省" 130185 county="鹿泉市" prefecture="石家庄市" province="河北省" 130201 county="市辖区" prefecture="唐山市" province="河北省" 130202 county="路南区" prefecture="唐山市" province="河北省" 130203 county="路北区" prefecture="唐山市" province="河北省" 130204 county="古冶区" prefecture="唐山市" province="河北省" 130205 county="开平区" prefecture="唐山市" province="河北省" 130207 county="丰南区" prefecture="唐山市" province="河北省" 130208 county="丰润区" prefecture="唐山市" province="河北省" 130209 county="曹妃甸区" prefecture="唐山市" province="河北省" 130223 county="滦县" prefecture="唐山市" province="河北省" 130224 county="滦南县" prefecture="唐山市" province="河北省" 130225 county="乐亭县" prefecture="唐山市" province="河北省" 130227 county="迁西县" prefecture="唐山市" province="河北省" 130229 county="玉田县" prefecture="唐山市" province="河北省" 130230 county="唐海县" prefecture="唐山市" province="河北省" 130281 county="遵化市" prefecture="唐山市" province="河北省" 130283 county="迁安市" prefecture="唐山市" province="河北省" 130301 county="市辖区" prefecture="秦皇岛市" province="河北省" 130302 county="海港区" prefecture="秦皇岛市" province="河北省" 130303 county="山海关区" prefecture="秦皇岛市" province="河北省" 130304 county="北戴河区" prefecture="秦皇岛市" province="河北省" 130321 county="青龙满族自治县" prefecture="秦皇岛市" province="河北省" 130322 county="昌黎县" prefecture="秦皇岛市" province="河北省" 130323 county="抚宁县" prefecture="秦皇岛市" province="河北省" 130324 county="卢龙县" prefecture="秦皇岛市" province="河北省" 130401 county="市辖区" prefecture="邯郸市" province="河北省" 130402 county="邯山区" prefecture="邯郸市" province="河北省" 130403 county="丛台区" prefecture="邯郸市" province="河北省" 130404 county="复兴区" prefecture="邯郸市" province="河北省" 130406 county="峰峰矿区" prefecture="邯郸市" province="河北省" 130421 county="邯郸县" prefecture="邯郸市" province="河北省" 130423 county="临漳县" prefecture="邯郸市" province="河北省" 130424 county="成安县" prefecture="邯郸市" province="河北省" 130425 county="大名县" prefecture="邯郸市" province="河北省" 130426 county="涉县" prefecture="邯郸市" province="河北省" 130427 county="磁县" prefecture="邯郸市" province="河北省" 130428 county="肥乡县" prefecture="邯郸市" province="河北省" 130429 county="永年县" prefecture="邯郸市" province="河北省" 130430 county="邱县" prefecture="邯郸市" province="河北省" 130431 county="鸡泽县" prefecture="邯郸市" province="河北省" 130432 county="广平县" prefecture="邯郸市" province="河北省" 130433 county="馆陶县" prefecture="邯郸市" province="河北省" 130434 county="魏县" prefecture="邯郸市" province="河北省" 130435 county="曲周县" prefecture="邯郸市" province="河北省" 130481 county="武安市" prefecture="邯郸市" province="河北省" 130501 county="市辖区" prefecture="邢台市" province="河北省" 130502 county="桥东区" prefecture="邢台市" province="河北省" 130503 county="桥西区" prefecture="邢台市" province="河北省" 130521 county="邢台县" prefecture="邢台市" province="河北省" 130522 county="临城县" prefecture="邢台市" province="河北省" 130523 county="内丘县" prefecture="邢台市" province="河北省" 130524 county="柏乡县" prefecture="邢台市" province="河北省" 130525 county="隆尧县" prefecture="邢台市" province="河北省" 130526 county="任县" prefecture="邢台市" province="河北省" 130527 county="南和县" prefecture="邢台市" province="河北省" 130528 county="宁晋县" prefecture="邢台市" province="河北省" 130529 county="巨鹿县" prefecture="邢台市" province="河北省" 130530 county="新河县" prefecture="邢台市" province="河北省" 130531 county="广宗县" prefecture="邢台市" province="河北省" 130532 county="平乡县" prefecture="邢台市" province="河北省" 130533 county="威县" prefecture="邢台市" province="河北省" 130534 county="清河县" prefecture="邢台市" province="河北省" 130535 county="临西县" prefecture="邢台市" province="河北省" 130581 county="南宫市" prefecture="邢台市" province="河北省" 130582 county="沙河市" prefecture="邢台市" province="河北省" 130601 county="市辖区" prefecture="保定市" province="河北省" 130602 county="新市区" prefecture="保定市" province="河北省" 130603 county="北市区" prefecture="保定市" province="河北省" 130604 county="南市区" prefecture="保定市" province="河北省" 130621 county="满城县" prefecture="保定市" province="河北省" 130622 county="清苑县" prefecture="保定市" province="河北省" 130623 county="涞水县" prefecture="保定市" province="河北省" 130624 county="阜平县" prefecture="保定市" province="河北省" 130625 county="徐水县" prefecture="保定市" province="河北省" 130626 county="定兴县" prefecture="保定市" province="河北省" 130627 county="唐县" prefecture="保定市" province="河北省" 130628 county="高阳县" prefecture="保定市" province="河北省" 130629 county="容城县" prefecture="保定市" province="河北省" 130630 county="涞源县" prefecture="保定市" province="河北省" 130631 county="望都县" prefecture="保定市" province="河北省" 130632 county="安新县" prefecture="保定市" province="河北省" 130633 county="易县" prefecture="保定市" province="河北省" 130634 county="曲阳县" prefecture="保定市" province="河北省" 130635 county="蠡县" prefecture="保定市" province="河北省" 130636 county="顺平县" prefecture="保定市" province="河北省" 130637 county="博野县" prefecture="保定市" province="河北省" 130638 county="雄县" prefecture="保定市" province="河北省" 130681 county="涿州市" prefecture="保定市" province="河北省" 130682 county="定州市" prefecture="保定市" province="河北省" 130683 county="安国市" prefecture="保定市" province="河北省" 130684 county="高碑店市" prefecture="保定市" province="河北省" 130701 county="市辖区" prefecture="张家口市" province="河北省" 130702 county="桥东区" prefecture="张家口市" province="河北省" 130703 county="桥西区" prefecture="张家口市" province="河北省" 130705 county="宣化区" prefecture="张家口市" province="河北省" 130706 county="下花园区" prefecture="张家口市" province="河北省" 130721 county="宣化县" prefecture="张家口市" province="河北省" 130722 county="张北县" prefecture="张家口市" province="河北省" 130723 county="康保县" prefecture="张家口市" province="河北省" 130724 county="沽源县" prefecture="张家口市" province="河北省" 130725 county="尚义县" prefecture="张家口市" province="河北省" 130726 county="蔚县" prefecture="张家口市" province="河北省" 130727 county="阳原县" prefecture="张家口市" province="河北省" 130728 county="怀安县" prefecture="张家口市" province="河北省" 130729 county="万全县" prefecture="张家口市" province="河北省" 130730 county="怀来县" prefecture="张家口市" province="河北省" 130731 county="涿鹿县" prefecture="张家口市" province="河北省" 130732 county="赤城县" prefecture="张家口市" province="河北省" 130733 county="崇礼县" prefecture="张家口市" province="河北省" 130801 county="市辖区" prefecture="承德市" province="河北省" 130802 county="双桥区" prefecture="承德市" province="河北省" 130803 county="双滦区" prefecture="承德市" province="河北省" 130804 county="鹰手营子矿区" prefecture="承德市" province="河北省" 130821 county="承德县" prefecture="承德市" province="河北省" 130822 county="兴隆县" prefecture="承德市" province="河北省" 130823 county="平泉县" prefecture="承德市" province="河北省" 130824 county="滦平县" prefecture="承德市" province="河北省" 130825 county="隆化县" prefecture="承德市" province="河北省" 130826 county="丰宁满族自治县" prefecture="承德市" province="河北省" 130827 county="宽城满族自治县" prefecture="承德市" province="河北省" 130828 county="围场满族蒙古族自治县" prefecture="承德市" province="河北省" 130901 county="市辖区" prefecture="沧州市" province="河北省" 130902 county="新华区" prefecture="沧州市" province="河北省" 130903 county="运河区" prefecture="沧州市" province="河北省" 130921 county="沧县" prefecture="沧州市" province="河北省" 130922 county="青县" prefecture="沧州市" province="河北省" 130923 county="东光县" prefecture="沧州市" province="河北省" 130924 county="海兴县" prefecture="沧州市" province="河北省" 130925 county="盐山县" prefecture="沧州市" province="河北省" 130926 county="肃宁县" prefecture="沧州市" province="河北省" 130927 county="南皮县" prefecture="沧州市" province="河北省" 130928 county="吴桥县" prefecture="沧州市" province="河北省" 130929 county="献县" prefecture="沧州市" province="河北省" 130930 county="孟村回族自治县" prefecture="沧州市" province="河北省" 130981 county="泊头市" prefecture="沧州市" province="河北省" 130982 county="任丘市" prefecture="沧州市" province="河北省" 130983 county="黄骅市" prefecture="沧州市" province="河北省" 130984 county="河间市" prefecture="沧州市" province="河北省" 131001 county="市辖区" prefecture="廊坊市" province="河北省" 131002 county="安次区" prefecture="廊坊市" province="河北省" 131003 county="广阳区" prefecture="廊坊市" province="河北省" 131022 county="固安县" prefecture="廊坊市" province="河北省" 131023 county="永清县" prefecture="廊坊市" province="河北省" 131024 county="香河县" prefecture="廊坊市" province="河北省" 131025 county="大城县" prefecture="廊坊市" province="河北省" 131026 county="文安县" prefecture="廊坊市" province="河北省" 131028 county="大厂回族自治县" prefecture="廊坊市" province="河北省" 131081 county="霸州市" prefecture="廊坊市" province="河北省" 131082 county="三河市" prefecture="廊坊市" province="河北省" 131101 county="市辖区" prefecture="衡水市" province="河北省" 131102 county="桃城区" prefecture="衡水市" province="河北省" 131121 county="枣强县" prefecture="衡水市" province="河北省" 131122 county="武邑县" prefecture="衡水市" province="河北省" 131123 county="武强县" prefecture="衡水市" province="河北省" 131124 county="饶阳县" prefecture="衡水市" province="河北省" 131125 county="安平县" prefecture="衡水市" province="河北省" 131126 county="故城县" prefecture="衡水市" province="河北省" 131127 county="景县" prefecture="衡水市" province="河北省" 131128 county="阜城县" prefecture="衡水市" province="河北省" 131181 county="冀州市" prefecture="衡水市" province="河北省" 131182 county="深州市" prefecture="衡水市" province="河北省" 140101 county="市辖区" prefecture="太原市" province="山西省" 140105 county="小店区" prefecture="太原市" province="山西省" 140106 county="迎泽区" prefecture="太原市" province="山西省" 140107 county="杏花岭区" prefecture="太原市" province="山西省" 140108 county="尖草坪区" prefecture="太原市" province="山西省" 140109 county="万柏林区" prefecture="太原市" province="山西省" 140110 county="晋源区" prefecture="太原市" province="山西省" 140121 county="清徐县" prefecture="太原市" province="山西省" 140122 county="阳曲县" prefecture="太原市" province="山西省" 140123 county="娄烦县" prefecture="太原市" province="山西省" 140181 county="古交市" prefecture="太原市" province="山西省" 140201 county="市辖区" prefecture="大同市" province="山西省" 140202 county="城区" prefecture="大同市" province="山西省" 140203 county="矿区" prefecture="大同市" province="山西省" 140211 county="南郊区" prefecture="大同市" province="山西省" 140212 county="新荣区" prefecture="大同市" province="山西省" 140221 county="阳高县" prefecture="大同市" province="山西省" 140222 county="天镇县" prefecture="大同市" province="山西省" 140223 county="广灵县" prefecture="大同市" province="山西省" 140224 county="灵丘县" prefecture="大同市" province="山西省" 140225 county="浑源县" prefecture="大同市" province="山西省" 140226 county="左云县" prefecture="大同市" province="山西省" 140227 county="大同县" prefecture="大同市" province="山西省" 140301 county="市辖区" prefecture="阳泉市" province="山西省" 140302 county="城区" prefecture="阳泉市" province="山西省" 140303 county="矿区" prefecture="阳泉市" province="山西省" 140311 county="郊区" prefecture="阳泉市" province="山西省" 140321 county="平定县" prefecture="阳泉市" province="山西省" 140322 county="盂县" prefecture="阳泉市" province="山西省" 140401 county="市辖区" prefecture="长治市" province="山西省" 140402 county="城区" prefecture="长治市" province="山西省" 140411 county="郊区" prefecture="长治市" province="山西省" 140421 county="长治县" prefecture="长治市" province="山西省" 140423 county="襄垣县" prefecture="长治市" province="山西省" 140424 county="屯留县" prefecture="长治市" province="山西省" 140425 county="平顺县" prefecture="长治市" province="山西省" 140426 county="黎城县" prefecture="长治市" province="山西省" 140427 county="壶关县" prefecture="长治市" province="山西省" 140428 county="长子县" prefecture="长治市" province="山西省" 140429 county="武乡县" prefecture="长治市" province="山西省" 140430 county="沁县" prefecture="长治市" province="山西省" 140431 county="沁源县" prefecture="长治市" province="山西省" 140481 county="潞城市" prefecture="长治市" province="山西省" 140501 county="市辖区" prefecture="晋城市" province="山西省" 140502 county="城区" prefecture="晋城市" province="山西省" 140521 county="沁水县" prefecture="晋城市" province="山西省" 140522 county="阳城县" prefecture="晋城市" province="山西省" 140524 county="陵川县" prefecture="晋城市" province="山西省" 140525 county="泽州县" prefecture="晋城市" province="山西省" 140581 county="高平市" prefecture="晋城市" province="山西省" 140601 county="市辖区" prefecture="朔州市" province="山西省" 140602 county="朔城区" prefecture="朔州市" province="山西省" 140603 county="平鲁区" prefecture="朔州市" province="山西省" 140621 county="山阴县" prefecture="朔州市" province="山西省" 140622 county="应县" prefecture="朔州市" province="山西省" 140623 county="右玉县" prefecture="朔州市" province="山西省" 140624 county="怀仁县" prefecture="朔州市" province="山西省" 140701 county="市辖区" prefecture="晋中市" province="山西省" 140702 county="榆次区" prefecture="晋中市" province="山西省" 140721 county="榆社县" prefecture="晋中市" province="山西省" 140722 county="左权县" prefecture="晋中市" province="山西省" 140723 county="和顺县" prefecture="晋中市" province="山西省" 140724 county="昔阳县" prefecture="晋中市" province="山西省" 140725 county="寿阳县" prefecture="晋中市" province="山西省" 140726 county="太谷县" prefecture="晋中市" province="山西省" 140727 county="祁县" prefecture="晋中市" province="山西省" 140728 county="平遥县" prefecture="晋中市" province="山西省" 140729 county="灵石县" prefecture="晋中市" province="山西省" 140781 county="介休市" prefecture="晋中市" province="山西省" 140801 county="市辖区" prefecture="运城市" province="山西省" 140802 county="盐湖区" prefecture="运城市" province="山西省" 140821 county="临猗县" prefecture="运城市" province="山西省" 140822 county="万荣县" prefecture="运城市" province="山西省" 140823 county="闻喜县" prefecture="运城市" province="山西省" 140824 county="稷山县" prefecture="运城市" province="山西省" 140825 county="新绛县" prefecture="运城市" province="山西省" 140826 county="绛县" prefecture="运城市" province="山西省" 140827 county="垣曲县" prefecture="运城市" province="山西省" 140828 county="夏县" prefecture="运城市" province="山西省" 140829 county="平陆县" prefecture="运城市" province="山西省" 140830 county="芮城县" prefecture="运城市" province="山西省" 140881 county="永济市" prefecture="运城市" province="山西省" 140882 county="河津市" prefecture="运城市" province="山西省" 140901 county="市辖区" prefecture="忻州市" province="山西省" 140902 county="忻府区" prefecture="忻州市" province="山西省" 140921 county="定襄县" prefecture="忻州市" province="山西省" 140922 county="五台县" prefecture="忻州市" province="山西省" 140923 county="代县" prefecture="忻州市" province="山西省" 140924 county="繁峙县" prefecture="忻州市" province="山西省" 140925 county="宁武县" prefecture="忻州市" province="山西省" 140926 county="静乐县" prefecture="忻州市" province="山西省" 140927 county="神池县" prefecture="忻州市" province="山西省" 140928 county="五寨县" prefecture="忻州市" province="山西省" 140929 county="岢岚县" prefecture="忻州市" province="山西省" 140930 county="河曲县" prefecture="忻州市" province="山西省" 140931 county="保德县" prefecture="忻州市" province="山西省" 140932 county="偏关县" prefecture="忻州市" province="山西省" 140981 county="原平市" prefecture="忻州市" province="山西省" 141001 county="市辖区" prefecture="临汾市" province="山西省" 141002 county="尧都区" prefecture="临汾市" province="山西省" 141021 county="曲沃县" prefecture="临汾市" province="山西省" 141022 county="翼城县" prefecture="临汾市" province="山西省" 141023 county="襄汾县" prefecture="临汾市" province="山西省" 141024 county="洪洞县" prefecture="临汾市" province="山西省" 141025 county="古县" prefecture="临汾市" province="山西省" 141026 county="安泽县" prefecture="临汾市" province="山西省" 141027 county="浮山县" prefecture="临汾市" province="山西省" 141028 county="吉县" prefecture="临汾市" province="山西省" 141029 county="乡宁县" prefecture="临汾市" province="山西省" 141030 county="大宁县" prefecture="临汾市" province="山西省" 141031 county="隰县" prefecture="临汾市" province="山西省" 141032 county="永和县" prefecture="临汾市" province="山西省" 141033 county="蒲县" prefecture="临汾市" province="山西省" 141034 county="汾西县" prefecture="临汾市" province="山西省" 141081 county="侯马市" prefecture="临汾市" province="山西省" 141082 county="霍州市" prefecture="临汾市" province="山西省" 141101 county="市辖区" prefecture="吕梁市" province="山西省" 141102 county="离石区" prefecture="吕梁市" province="山西省" 141121 county="文水县" prefecture="吕梁市" province="山西省" 141122 county="交城县" prefecture="吕梁市" province="山西省" 141123 county="兴县" prefecture="吕梁市" province="山西省" 141124 county="临县" prefecture="吕梁市" province="山西省" 141125 county="柳林县" prefecture="吕梁市" province="山西省" 141126 county="石楼县" prefecture="吕梁市" province="山西省" 141127 county="岚县" prefecture="吕梁市" province="山西省" 141128 county="方山县" prefecture="吕梁市" province="山西省" 141129 county="中阳县" prefecture="吕梁市" province="山西省" 141130 county="交口县" prefecture="吕梁市" province="山西省" 141181 county="孝义市" prefecture="吕梁市" province="山西省" 141182 county="汾阳市" prefecture="吕梁市" province="山西省" 142301 county="孝义市" prefecture="吕梁地区" province="山西省" 142302 county="离石市" prefecture="吕梁地区" province="山西省" 142303 county="汾阳市" prefecture="吕梁地区" province="山西省" 142322 county="文水县" prefecture="吕梁地区" province="山西省" 142323 county="交城县" prefecture="吕梁地区" province="山西省" 142325 county="兴县" prefecture="吕梁地区" province="山西省" 142326 county="临县" prefecture="吕梁地区" province="山西省" 142327 county="柳林县" prefecture="吕梁地区" province="山西省" 142328 county="石楼县" prefecture="吕梁地区" province="山西省" 142329 county="岚县" prefecture="吕梁地区" province="山西省" 142330 county="方山县" prefecture="吕梁地区" province="山西省" 142332 county="中阳县" prefecture="吕梁地区" province="山西省" 142333 county="交口县" prefecture="吕梁地区" province="山西省" 150101 county="市辖区" prefecture="呼和浩特市" province="内蒙古自治区" 150102 county="新城区" prefecture="呼和浩特市" province="内蒙古自治区" 150103 county="回民区" prefecture="呼和浩特市" province="内蒙古自治区" 150104 county="玉泉区" prefecture="呼和浩特市" province="内蒙古自治区" 150105 county="赛罕区" prefecture="呼和浩特市" province="内蒙古自治区" 150121 county="土默特左旗" prefecture="呼和浩特市" province="内蒙古自治区" 150122 county="托克托县" prefecture="呼和浩特市" province="内蒙古自治区" 150123 county="和林格尔县" prefecture="呼和浩特市" province="内蒙古自治区" 150124 county="清水河县" prefecture="呼和浩特市" province="内蒙古自治区" 150125 county="武川县" prefecture="呼和浩特市" province="内蒙古自治区" 150201 county="市辖区" prefecture="包头市" province="内蒙古自治区" 150202 county="东河区" prefecture="包头市" province="内蒙古自治区" 150203 county="昆都仑区" prefecture="包头市" province="内蒙古自治区" 150204 county="青山区" prefecture="包头市" province="内蒙古自治区" 150205 county="石拐区" prefecture="包头市" province="内蒙古自治区" 150206 county="白云鄂博矿区" prefecture="包头市" province="内蒙古自治区" 150207 county="九原区" prefecture="包头市" province="内蒙古自治区" 150221 county="土默特右旗" prefecture="包头市" province="内蒙古自治区" 150222 county="固阳县" prefecture="包头市" province="内蒙古自治区" 150223 county="达尔罕茂明安联合旗" prefecture="包头市" province="内蒙古自治区" 150301 county="市辖区" prefecture="乌海市" province="内蒙古自治区" 150302 county="海勃湾区" prefecture="乌海市" province="内蒙古自治区" 150303 county="海南区" prefecture="乌海市" province="内蒙古自治区" 150304 county="乌达区" prefecture="乌海市" province="内蒙古自治区" 150401 county="市辖区" prefecture="赤峰市" province="内蒙古自治区" 150402 county="红山区" prefecture="赤峰市" province="内蒙古自治区" 150403 county="元宝山区" prefecture="赤峰市" province="内蒙古自治区" 150404 county="松山区" prefecture="赤峰市" province="内蒙古自治区" 150421 county="阿鲁科尔沁旗" prefecture="赤峰市" province="内蒙古自治区" 150422 county="巴林左旗" prefecture="赤峰市" province="内蒙古自治区" 150423 county="巴林右旗" prefecture="赤峰市" province="内蒙古自治区" 150424 county="林西县" prefecture="赤峰市" province="内蒙古自治区" 150425 county="克什克腾旗" prefecture="赤峰市" province="内蒙古自治区" 150426 county="翁牛特旗" prefecture="赤峰市" province="内蒙古自治区" 150428 county="喀喇沁旗" prefecture="赤峰市" province="内蒙古自治区" 150429 county="宁城县" prefecture="赤峰市" province="内蒙古自治区" 150430 county="敖汉旗" prefecture="赤峰市" province="内蒙古自治区" 150501 county="市辖区" prefecture="通辽市" province="内蒙古自治区" 150502 county="科尔沁区" prefecture="通辽市" province="内蒙古自治区" 150521 county="科尔沁左翼中旗" prefecture="通辽市" province="内蒙古自治区" 150522 county="科尔沁左翼后旗" prefecture="通辽市" province="内蒙古自治区" 150523 county="开鲁县" prefecture="通辽市" province="内蒙古自治区" 150524 county="库伦旗" prefecture="通辽市" province="内蒙古自治区" 150525 county="奈曼旗" prefecture="通辽市" province="内蒙古自治区" 150526 county="扎鲁特旗" prefecture="通辽市" province="内蒙古自治区" 150581 county="霍林郭勒市" prefecture="通辽市" province="内蒙古自治区" 150601 county="市辖区" prefecture="鄂尔多斯市" province="内蒙古自治区" 150602 county="东胜区" prefecture="鄂尔多斯市" province="内蒙古自治区" 150621 county="达拉特旗" prefecture="鄂尔多斯市" province="内蒙古自治区" 150622 county="准格尔旗" prefecture="鄂尔多斯市" province="内蒙古自治区" 150623 county="鄂托克前旗" prefecture="鄂尔多斯市" province="内蒙古自治区" 150624 county="鄂托克旗" prefecture="鄂尔多斯市" province="内蒙古自治区" 150625 county="杭锦旗" prefecture="鄂尔多斯市" province="内蒙古自治区" 150626 county="乌审旗" prefecture="鄂尔多斯市" province="内蒙古自治区" 150627 county="伊金霍洛旗" prefecture="鄂尔多斯市" province="内蒙古自治区" 150701 county="市辖区" prefecture="呼伦贝尔市" province="内蒙古自治区" 150702 county="海拉尔区" prefecture="呼伦贝尔市" province="内蒙古自治区" 150703 county="扎赉诺尔区" prefecture="呼伦贝尔市" province="内蒙古自治区" 150721 county="阿荣旗" prefecture="呼伦贝尔市" province="内蒙古自治区" 150722 county="莫力达瓦达斡尔族自治旗" prefecture="呼伦贝尔市" province="内蒙古自治区" 150723 county="鄂伦春自治旗" prefecture="呼伦贝尔市" province="内蒙古自治区" 150724 county="鄂温克族自治旗" prefecture="呼伦贝尔市" province="内蒙古自治区" 150725 county="陈巴尔虎旗" prefecture="呼伦贝尔市" province="内蒙古自治区" 150726 county="新巴尔虎左旗" prefecture="呼伦贝尔市" province="内蒙古自治区" 150727 county="新巴尔虎右旗" prefecture="呼伦贝尔市" province="内蒙古自治区" 150781 county="满洲里市" prefecture="呼伦贝尔市" province="内蒙古自治区" 150782 county="牙克石市" prefecture="呼伦贝尔市" province="内蒙古自治区" 150783 county="扎兰屯市" prefecture="呼伦贝尔市" province="内蒙古自治区" 150784 county="额尔古纳市" prefecture="呼伦贝尔市" province="内蒙古自治区" 150785 county="根河市" prefecture="呼伦贝尔市" province="内蒙古自治区" 150801 county="市辖区" prefecture="巴彦淖尔市" province="内蒙古自治区" 150802 county="临河区" prefecture="巴彦淖尔市" province="内蒙古自治区" 150821 county="五原县" prefecture="巴彦淖尔市" province="内蒙古自治区" 150822 county="磴口县" prefecture="巴彦淖尔市" province="内蒙古自治区" 150823 county="乌拉特前旗" prefecture="巴彦淖尔市" province="内蒙古自治区" 150824 county="乌拉特中旗" prefecture="巴彦淖尔市" province="内蒙古自治区" 150825 county="乌拉特后旗" prefecture="巴彦淖尔市" province="内蒙古自治区" 150826 county="杭锦后旗" prefecture="巴彦淖尔市" province="内蒙古自治区" 150901 county="市辖区" prefecture="乌兰察布市" province="内蒙古自治区" 150902 county="集宁区" prefecture="乌兰察布市" province="内蒙古自治区" 150921 county="卓资县" prefecture="乌兰察布市" province="内蒙古自治区" 150922 county="化德县" prefecture="乌兰察布市" province="内蒙古自治区" 150923 county="商都县" prefecture="乌兰察布市" province="内蒙古自治区" 150924 county="兴和县" prefecture="乌兰察布市" province="内蒙古自治区" 150925 county="凉城县" prefecture="乌兰察布市" province="内蒙古自治区" 150926 county="察哈尔右翼前旗" prefecture="乌兰察布市" province="内蒙古自治区" 150927 county="察哈尔右翼中旗" prefecture="乌兰察布市" province="内蒙古自治区" 150928 county="察哈尔右翼后旗" prefecture="乌兰察布市" province="内蒙古自治区" 150929 county="四子王旗" prefecture="乌兰察布市" province="内蒙古自治区" 150981 county="丰镇市" prefecture="乌兰察布市" province="内蒙古自治区" 152201 county="乌兰浩特市" prefecture="兴安盟" province="内蒙古自治区" 152202 county="阿尔山市" prefecture="兴安盟" province="内蒙古自治区" 152221 county="科尔沁右翼前旗" prefecture="兴安盟" province="内蒙古自治区" 152222 county="科尔沁右翼中旗" prefecture="兴安盟" province="内蒙古自治区" 152223 county="扎赉特旗" prefecture="兴安盟" province="内蒙古自治区" 152224 county="突泉县" prefecture="兴安盟" province="内蒙古自治区" 152501 county="二连浩特市" prefecture="锡林郭勒盟" province="内蒙古自治区" 152502 county="锡林浩特市" prefecture="锡林郭勒盟" province="内蒙古自治区" 152522 county="阿巴嘎旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152523 county="苏尼特左旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152524 county="苏尼特右旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152525 county="东乌珠穆沁旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152526 county="西乌珠穆沁旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152527 county="太仆寺旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152528 county="镶黄旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152529 county="正镶白旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152530 county="正蓝旗" prefecture="锡林郭勒盟" province="内蒙古自治区" 152531 county="多伦县" prefecture="锡林郭勒盟" province="内蒙古自治区" 152601 county="集宁市" prefecture="乌兰察布盟" province="内蒙古自治区" 152602 county="丰镇市" prefecture="乌兰察布盟" province="内蒙古自治区" 152624 county="卓资县" prefecture="乌兰察布盟" province="内蒙古自治区" 152625 county="化德县" prefecture="乌兰察布盟" province="内蒙古自治区" 152626 county="商都县" prefecture="乌兰察布盟" province="内蒙古自治区" 152627 county="兴和县" prefecture="乌兰察布盟" province="内蒙古自治区" 152629 county="凉城县" prefecture="乌兰察布盟" province="内蒙古自治区" 152630 county="察哈尔右翼前旗" prefecture="乌兰察布盟" province="内蒙古自治区" 152631 county="察哈尔右翼中旗" prefecture="乌兰察布盟" province="内蒙古自治区" 152632 county="察哈尔右翼后旗" prefecture="乌兰察布盟" province="内蒙古自治区" 152634 county="四子王旗" prefecture="乌兰察布盟" province="内蒙古自治区" 152801 county="临河市" prefecture="巴彦淖尔盟" province="内蒙古自治区" 152822 county="五原县" prefecture="巴彦淖尔盟" province="内蒙古自治区" 152823 county="磴口县" prefecture="巴彦淖尔盟" province="内蒙古自治区" 152824 county="乌拉特前旗" prefecture="巴彦淖尔盟" province="内蒙古自治区" 152825 county="乌拉特中旗" prefecture="巴彦淖尔盟" province="内蒙古自治区" 152826 county="乌拉特后旗" prefecture="巴彦淖尔盟" province="内蒙古自治区" 152827 county="杭锦后旗" prefecture="巴彦淖尔盟" province="内蒙古自治区" 152921 county="阿拉善左旗" prefecture="阿拉善盟" province="内蒙古自治区" 152922 county="阿拉善右旗" prefecture="阿拉善盟" province="内蒙古自治区" 152923 county="额济纳旗" prefecture="阿拉善盟" province="内蒙古自治区" 210101 county="市辖区" prefecture="沈阳市" province="辽宁省" 210102 county="和平区" prefecture="沈阳市" province="辽宁省" 210103 county="沈河区" prefecture="沈阳市" province="辽宁省" 210104 county="大东区" prefecture="沈阳市" province="辽宁省" 210105 county="皇姑区" prefecture="沈阳市" province="辽宁省" 210106 county="铁西区" prefecture="沈阳市" province="辽宁省" 210111 county="苏家屯区" prefecture="沈阳市" province="辽宁省" 210112 county="浑南区" prefecture="沈阳市" province="辽宁省" 210113 county="沈北新区" prefecture="沈阳市" province="辽宁省" 210114 county="于洪区" prefecture="沈阳市" province="辽宁省" 210122 county="辽中县" prefecture="沈阳市" province="辽宁省" 210123 county="康平县" prefecture="沈阳市" province="辽宁省" 210124 county="法库县" prefecture="沈阳市" province="辽宁省" 210181 county="新民市" prefecture="沈阳市" province="辽宁省" 210201 county="市辖区" prefecture="大连市" province="辽宁省" 210202 county="中山区" prefecture="大连市" province="辽宁省" 210203 county="西岗区" prefecture="大连市" province="辽宁省" 210204 county="沙河口区" prefecture="大连市" province="辽宁省" 210211 county="甘井子区" prefecture="大连市" province="辽宁省" 210212 county="旅顺口区" prefecture="大连市" province="辽宁省" 210213 county="金州区" prefecture="大连市" province="辽宁省" 210224 county="长海县" prefecture="大连市" province="辽宁省" 210281 county="瓦房店市" prefecture="大连市" province="辽宁省" 210282 county="普兰店市" prefecture="大连市" province="辽宁省" 210283 county="庄河市" prefecture="大连市" province="辽宁省" 210301 county="市辖区" prefecture="鞍山市" province="辽宁省" 210302 county="铁东区" prefecture="鞍山市" province="辽宁省" 210303 county="铁西区" prefecture="鞍山市" province="辽宁省" 210304 county="立山区" prefecture="鞍山市" province="辽宁省" 210311 county="千山区" prefecture="鞍山市" province="辽宁省" 210321 county="台安县" prefecture="鞍山市" province="辽宁省" 210323 county="岫岩满族自治县" prefecture="鞍山市" province="辽宁省" 210381 county="海城市" prefecture="鞍山市" province="辽宁省" 210401 county="市辖区" prefecture="抚顺市" province="辽宁省" 210402 county="新抚区" prefecture="抚顺市" province="辽宁省" 210403 county="东洲区" prefecture="抚顺市" province="辽宁省" 210404 county="望花区" prefecture="抚顺市" province="辽宁省" 210411 county="顺城区" prefecture="抚顺市" province="辽宁省" 210421 county="抚顺县" prefecture="抚顺市" province="辽宁省" 210422 county="新宾满族自治县" prefecture="抚顺市" province="辽宁省" 210423 county="清原满族自治县" prefecture="抚顺市" province="辽宁省" 210501 county="市辖区" prefecture="本溪市" province="辽宁省" 210502 county="平山区" prefecture="本溪市" province="辽宁省" 210503 county="溪湖区" prefecture="本溪市" province="辽宁省" 210504 county="明山区" prefecture="本溪市" province="辽宁省" 210505 county="南芬区" prefecture="本溪市" province="辽宁省" 210521 county="本溪满族自治县" prefecture="本溪市" province="辽宁省" 210522 county="桓仁满族自治县" prefecture="本溪市" province="辽宁省" 210601 county="市辖区" prefecture="丹东市" province="辽宁省" 210602 county="元宝区" prefecture="丹东市" province="辽宁省" 210603 county="振兴区" prefecture="丹东市" province="辽宁省" 210604 county="振安区" prefecture="丹东市" province="辽宁省" 210624 county="宽甸满族自治县" prefecture="丹东市" province="辽宁省" 210681 county="东港市" prefecture="丹东市" province="辽宁省" 210682 county="凤城市" prefecture="丹东市" province="辽宁省" 210701 county="市辖区" prefecture="锦州市" province="辽宁省" 210702 county="古塔区" prefecture="锦州市" province="辽宁省" 210703 county="凌河区" prefecture="锦州市" province="辽宁省" 210711 county="太和区" prefecture="锦州市" province="辽宁省" 210726 county="黑山县" prefecture="锦州市" province="辽宁省" 210727 county="义县" prefecture="锦州市" province="辽宁省" 210781 county="凌海市" prefecture="锦州市" province="辽宁省" 210782 county="北镇市" prefecture="锦州市" province="辽宁省" 210801 county="市辖区" prefecture="营口市" province="辽宁省" 210802 county="站前区" prefecture="营口市" province="辽宁省" 210803 county="西市区" prefecture="营口市" province="辽宁省" 210804 county="鲅鱼圈区" prefecture="营口市" province="辽宁省" 210811 county="老边区" prefecture="营口市" province="辽宁省" 210881 county="盖州市" prefecture="营口市" province="辽宁省" 210882 county="大石桥市" prefecture="营口市" province="辽宁省" 210901 county="市辖区" prefecture="阜新市" province="辽宁省" 210902 county="海州区" prefecture="阜新市" province="辽宁省" 210903 county="新邱区" prefecture="阜新市" province="辽宁省" 210904 county="太平区" prefecture="阜新市" province="辽宁省" 210905 county="清河门区" prefecture="阜新市" province="辽宁省" 210911 county="细河区" prefecture="阜新市" province="辽宁省" 210921 county="阜新蒙古族自治县" prefecture="阜新市" province="辽宁省" 210922 county="彰武县" prefecture="阜新市" province="辽宁省" 211001 county="市辖区" prefecture="辽阳市" province="辽宁省" 211002 county="白塔区" prefecture="辽阳市" province="辽宁省" 211003 county="文圣区" prefecture="辽阳市" province="辽宁省" 211004 county="宏伟区" prefecture="辽阳市" province="辽宁省" 211005 county="弓长岭区" prefecture="辽阳市" province="辽宁省" 211011 county="太子河区" prefecture="辽阳市" province="辽宁省" 211021 county="辽阳县" prefecture="辽阳市" province="辽宁省" 211081 county="灯塔市" prefecture="辽阳市" province="辽宁省" 211101 county="市辖区" prefecture="盘锦市" province="辽宁省" 211102 county="双台子区" prefecture="盘锦市" province="辽宁省" 211103 county="兴隆台区" prefecture="盘锦市" province="辽宁省" 211121 county="大洼县" prefecture="盘锦市" province="辽宁省" 211122 county="盘山县" prefecture="盘锦市" province="辽宁省" 211201 county="市辖区" prefecture="铁岭市" province="辽宁省" 211202 county="银州区" prefecture="铁岭市" province="辽宁省" 211204 county="清河区" prefecture="铁岭市" province="辽宁省" 211221 county="铁岭县" prefecture="铁岭市" province="辽宁省" 211223 county="西丰县" prefecture="铁岭市" province="辽宁省" 211224 county="昌图县" prefecture="铁岭市" province="辽宁省" 211281 county="调兵山市" prefecture="铁岭市" province="辽宁省" 211282 county="开原市" prefecture="铁岭市" province="辽宁省" 211301 county="市辖区" prefecture="朝阳市" province="辽宁省" 211302 county="双塔区" prefecture="朝阳市" province="辽宁省" 211303 county="龙城区" prefecture="朝阳市" province="辽宁省" 211321 county="朝阳县" prefecture="朝阳市" province="辽宁省" 211322 county="建平县" prefecture="朝阳市" province="辽宁省" 211324 county="喀喇沁左翼蒙古族自治县" prefecture="朝阳市" province="辽宁省" 211381 county="北票市" prefecture="朝阳市" province="辽宁省" 211382 county="凌源市" prefecture="朝阳市" province="辽宁省" 211401 county="市辖区" prefecture="葫芦岛市" province="辽宁省" 211402 county="连山区" prefecture="葫芦岛市" province="辽宁省" 211403 county="龙港区" prefecture="葫芦岛市" province="辽宁省" 211404 county="南票区" prefecture="葫芦岛市" province="辽宁省" 211421 county="绥中县" prefecture="葫芦岛市" province="辽宁省" 211422 county="建昌县" prefecture="葫芦岛市" province="辽宁省" 211481 county="兴城市" prefecture="葫芦岛市" province="辽宁省" 220101 county="市辖区" prefecture="长春市" province="吉林省" 220102 county="南关区" prefecture="长春市" province="吉林省" 220103 county="宽城区" prefecture="长春市" province="吉林省" 220104 county="朝阳区" prefecture="长春市" province="吉林省" 220105 county="二道区" prefecture="长春市" province="吉林省" 220106 county="绿园区" prefecture="长春市" province="吉林省" 220112 county="双阳区" prefecture="长春市" province="吉林省" 220113 county="九台区" prefecture="长春市" province="吉林省" 220122 county="农安县" prefecture="长春市" province="吉林省" 220181 county="九台市" prefecture="长春市" province="吉林省" 220182 county="榆树市" prefecture="长春市" province="吉林省" 220183 county="德惠市" prefecture="长春市" province="吉林省" 220201 county="市辖区" prefecture="吉林市" province="吉林省" 220202 county="昌邑区" prefecture="吉林市" province="吉林省" 220203 county="龙潭区" prefecture="吉林市" province="吉林省" 220204 county="船营区" prefecture="吉林市" province="吉林省" 220211 county="丰满区" prefecture="吉林市" province="吉林省" 220221 county="永吉县" prefecture="吉林市" province="吉林省" 220281 county="蛟河市" prefecture="吉林市" province="吉林省" 220282 county="桦甸市" prefecture="吉林市" province="吉林省" 220283 county="舒兰市" prefecture="吉林市" province="吉林省" 220284 county="磐石市" prefecture="吉林市" province="吉林省" 220301 county="市辖区" prefecture="四平市" province="吉林省" 220302 county="铁西区" prefecture="四平市" province="吉林省" 220303 county="铁东区" prefecture="四平市" province="吉林省" 220322 county="梨树县" prefecture="四平市" province="吉林省" 220323 county="伊通满族自治县" prefecture="四平市" province="吉林省" 220381 county="公主岭市" prefecture="四平市" province="吉林省" 220382 county="双辽市" prefecture="四平市" province="吉林省" 220401 county="市辖区" prefecture="辽源市" province="吉林省" 220402 county="龙山区" prefecture="辽源市" province="吉林省" 220403 county="西安区" prefecture="辽源市" province="吉林省" 220421 county="东丰县" prefecture="辽源市" province="吉林省" 220422 county="东辽县" prefecture="辽源市" province="吉林省" 220501 county="市辖区" prefecture="通化市" province="吉林省" 220502 county="东昌区" prefecture="通化市" province="吉林省" 220503 county="二道江区" prefecture="通化市" province="吉林省" 220521 county="通化县" prefecture="通化市" province="吉林省" 220523 county="辉南县" prefecture="通化市" province="吉林省" 220524 county="柳河县" prefecture="通化市" province="吉林省" 220581 county="梅河口市" prefecture="通化市" province="吉林省" 220582 county="集安市" prefecture="通化市" province="吉林省" 220601 county="市辖区" prefecture="白山市" province="吉林省" 220602 county="浑江区" prefecture="白山市" province="吉林省" 220604 county="江源区" prefecture="白山市" province="吉林省" 220605 county="江源区" prefecture="白山市" province="吉林省" 220621 county="抚松县" prefecture="白山市" province="吉林省" 220622 county="靖宇县" prefecture="白山市" province="吉林省" 220623 county="长白朝鲜族自治县" prefecture="白山市" province="吉林省" 220625 county="江源县" prefecture="白山市" province="吉林省" 220681 county="临江市" prefecture="白山市" province="吉林省" 220701 county="市辖区" prefecture="松原市" province="吉林省" 220702 county="宁江区" prefecture="松原市" province="吉林省" 220721 county="前郭尔罗斯蒙古族自治县" prefecture="松原市" province="吉林省" 220722 county="长岭县" prefecture="松原市" province="吉林省" 220723 county="乾安县" prefecture="松原市" province="吉林省" 220724 county="扶余县" prefecture="松原市" province="吉林省" 220781 county="扶余市" prefecture="松原市" province="吉林省" 220801 county="市辖区" prefecture="白城市" province="吉林省" 220802 county="洮北区" prefecture="白城市" province="吉林省" 220821 county="镇赉县" prefecture="白城市" province="吉林省" 220822 county="通榆县" prefecture="白城市" province="吉林省" 220881 county="洮南市" prefecture="白城市" province="吉林省" 220882 county="大安市" prefecture="白城市" province="吉林省" 222401 county="延吉市" prefecture="延边朝鲜族自治州" province="吉林省" 222402 county="图们市" prefecture="延边朝鲜族自治州" province="吉林省" 222403 county="敦化市" prefecture="延边朝鲜族自治州" province="吉林省" 222404 county="珲春市" prefecture="延边朝鲜族自治州" province="吉林省" 222405 county="龙井市" prefecture="延边朝鲜族自治州" province="吉林省" 222406 county="和龙市" prefecture="延边朝鲜族自治州" province="吉林省" 222424 county="汪清县" prefecture="延边朝鲜族自治州" province="吉林省" 222426 county="安图县" prefecture="延边朝鲜族自治州" province="吉林省" 230101 county="市辖区" prefecture="哈尔滨市" province="黑龙江省" 230102 county="道里区" prefecture="哈尔滨市" province="黑龙江省" 230103 county="南岗区" prefecture="哈尔滨市" province="黑龙江省" 230104 county="道外区" prefecture="哈尔滨市" province="黑龙江省" 230105 county="太平区" prefecture="哈尔滨市" province="黑龙江省" 230106 county="香坊区" prefecture="哈尔滨市" province="黑龙江省" 230107 county="动力区" prefecture="哈尔滨市" province="黑龙江省" 230108 county="平房区" prefecture="哈尔滨市" province="黑龙江省" 230109 county="松北区" prefecture="哈尔滨市" province="黑龙江省" 230110 county="香坊区" prefecture="哈尔滨市" province="黑龙江省" 230111 county="呼兰区" prefecture="哈尔滨市" province="黑龙江省" 230112 county="阿城区" prefecture="哈尔滨市" province="黑龙江省" 230121 county="呼兰县" prefecture="哈尔滨市" province="黑龙江省" 230123 county="依兰县" prefecture="哈尔滨市" province="黑龙江省" 230124 county="方正县" prefecture="哈尔滨市" province="黑龙江省" 230125 county="宾县" prefecture="哈尔滨市" province="黑龙江省" 230126 county="巴彦县" prefecture="哈尔滨市" province="黑龙江省" 230127 county="木兰县" prefecture="哈尔滨市" province="黑龙江省" 230128 county="通河县" prefecture="哈尔滨市" province="黑龙江省" 230129 county="延寿县" prefecture="哈尔滨市" province="黑龙江省" 230181 county="阿城市" prefecture="哈尔滨市" province="黑龙江省" 230182 county="双城市" prefecture="哈尔滨市" province="黑龙江省" 230183 county="尚志市" prefecture="哈尔滨市" province="黑龙江省" 230184 county="五常市" prefecture="哈尔滨市" province="黑龙江省" 230201 county="市辖区" prefecture="齐齐哈尔市" province="黑龙江省" 230202 county="龙沙区" prefecture="齐齐哈尔市" province="黑龙江省" 230203 county="建华区" prefecture="齐齐哈尔市" province="黑龙江省" 230204 county="铁锋区" prefecture="齐齐哈尔市" province="黑龙江省" 230205 county="昂昂溪区" prefecture="齐齐哈尔市" province="黑龙江省" 230206 county="富拉尔基区" prefecture="齐齐哈尔市" province="黑龙江省" 230207 county="碾子山区" prefecture="齐齐哈尔市" province="黑龙江省" 230208 county="梅里斯达斡尔族区" prefecture="齐齐哈尔市" province="黑龙江省" 230221 county="龙江县" prefecture="齐齐哈尔市" province="黑龙江省" 230223 county="依安县" prefecture="齐齐哈尔市" province="黑龙江省" 230224 county="泰来县" prefecture="齐齐哈尔市" province="黑龙江省" 230225 county="甘南县" prefecture="齐齐哈尔市" province="黑龙江省" 230227 county="富裕县" prefecture="齐齐哈尔市" province="黑龙江省" 230229 county="克山县" prefecture="齐齐哈尔市" province="黑龙江省" 230230 county="克东县" prefecture="齐齐哈尔市" province="黑龙江省" 230231 county="拜泉县" prefecture="齐齐哈尔市" province="黑龙江省" 230281 county="讷河市" prefecture="齐齐哈尔市" province="黑龙江省" 230301 county="市辖区" prefecture="鸡西市" province="黑龙江省" 230302 county="鸡冠区" prefecture="鸡西市" province="黑龙江省" 230303 county="恒山区" prefecture="鸡西市" province="黑龙江省" 230304 county="滴道区" prefecture="鸡西市" province="黑龙江省" 230305 county="梨树区" prefecture="鸡西市" province="黑龙江省" 230306 county="城子河区" prefecture="鸡西市" province="黑龙江省" 230307 county="麻山区" prefecture="鸡西市" province="黑龙江省" 230321 county="鸡东县" prefecture="鸡西市" province="黑龙江省" 230381 county="虎林市" prefecture="鸡西市" province="黑龙江省" 230382 county="密山市" prefecture="鸡西市" province="黑龙江省" 230401 county="市辖区" prefecture="鹤岗市" province="黑龙江省" 230402 county="向阳区" prefecture="鹤岗市" province="黑龙江省" 230403 county="工农区" prefecture="鹤岗市" province="黑龙江省" 230404 county="南山区" prefecture="鹤岗市" province="黑龙江省" 230405 county="兴安区" prefecture="鹤岗市" province="黑龙江省" 230406 county="东山区" prefecture="鹤岗市" province="黑龙江省" 230407 county="兴山区" prefecture="鹤岗市" province="黑龙江省" 230421 county="萝北县" prefecture="鹤岗市" province="黑龙江省" 230422 county="绥滨县" prefecture="鹤岗市" province="黑龙江省" 230501 county="市辖区" prefecture="双鸭山市" province="黑龙江省" 230502 county="尖山区" prefecture="双鸭山市" province="黑龙江省" 230503 county="岭东区" prefecture="双鸭山市" province="黑龙江省" 230505 county="四方台区" prefecture="双鸭山市" province="黑龙江省" 230506 county="宝山区" prefecture="双鸭山市" province="黑龙江省" 230521 county="集贤县" prefecture="双鸭山市" province="黑龙江省" 230522 county="友谊县" prefecture="双鸭山市" province="黑龙江省" 230523 county="宝清县" prefecture="双鸭山市" province="黑龙江省" 230524 county="饶河县" prefecture="双鸭山市" province="黑龙江省" 230601 county="市辖区" prefecture="大庆市" province="黑龙江省" 230602 county="萨尔图区" prefecture="大庆市" province="黑龙江省" 230603 county="龙凤区" prefecture="大庆市" province="黑龙江省" 230604 county="让胡路区" prefecture="大庆市" province="黑龙江省" 230605 county="红岗区" prefecture="大庆市" province="黑龙江省" 230606 county="大同区" prefecture="大庆市" province="黑龙江省" 230621 county="肇州县" prefecture="大庆市" province="黑龙江省" 230622 county="肇源县" prefecture="大庆市" province="黑龙江省" 230623 county="林甸县" prefecture="大庆市" province="黑龙江省" 230624 county="杜尔伯特蒙古族自治县" prefecture="大庆市" province="黑龙江省" 230701 county="市辖区" prefecture="伊春市" province="黑龙江省" 230702 county="伊春区" prefecture="伊春市" province="黑龙江省" 230703 county="南岔区" prefecture="伊春市" province="黑龙江省" 230704 county="友好区" prefecture="伊春市" province="黑龙江省" 230705 county="西林区" prefecture="伊春市" province="黑龙江省" 230706 county="翠峦区" prefecture="伊春市" province="黑龙江省" 230707 county="新青区" prefecture="伊春市" province="黑龙江省" 230708 county="美溪区" prefecture="伊春市" province="黑龙江省" 230709 county="金山屯区" prefecture="伊春市" province="黑龙江省" 230710 county="五营区" prefecture="伊春市" province="黑龙江省" 230711 county="乌马河区" prefecture="伊春市" province="黑龙江省" 230712 county="汤旺河区" prefecture="伊春市" province="黑龙江省" 230713 county="带岭区" prefecture="伊春市" province="黑龙江省" 230714 county="乌伊岭区" prefecture="伊春市" province="黑龙江省" 230715 county="红星区" prefecture="伊春市" province="黑龙江省" 230716 county="上甘岭区" prefecture="伊春市" province="黑龙江省" 230722 county="嘉荫县" prefecture="伊春市" province="黑龙江省" 230781 county="铁力市" prefecture="伊春市" province="黑龙江省" 230801 county="市辖区" prefecture="佳木斯市" province="黑龙江省" 230802 county="永红区" prefecture="佳木斯市" province="黑龙江省" 230803 county="向阳区" prefecture="佳木斯市" province="黑龙江省" 230804 county="前进区" prefecture="佳木斯市" province="黑龙江省" 230805 county="东风区" prefecture="佳木斯市" province="黑龙江省" 230811 county="郊区" prefecture="佳木斯市" province="黑龙江省" 230822 county="桦南县" prefecture="佳木斯市" province="黑龙江省" 230826 county="桦川县" prefecture="佳木斯市" province="黑龙江省" 230828 county="汤原县" prefecture="佳木斯市" province="黑龙江省" 230833 county="抚远县" prefecture="佳木斯市" province="黑龙江省" 230881 county="同江市" prefecture="佳木斯市" province="黑龙江省" 230882 county="富锦市" prefecture="佳木斯市" province="黑龙江省" 230901 county="市辖区" prefecture="七台河市" province="黑龙江省" 230902 county="新兴区" prefecture="七台河市" province="黑龙江省" 230903 county="桃山区" prefecture="七台河市" province="黑龙江省" 230904 county="茄子河区" prefecture="七台河市" province="黑龙江省" 230921 county="勃利县" prefecture="七台河市" province="黑龙江省" 231001 county="市辖区" prefecture="牡丹江市" province="黑龙江省" 231002 county="东安区" prefecture="牡丹江市" province="黑龙江省" 231003 county="阳明区" prefecture="牡丹江市" province="黑龙江省" 231004 county="爱民区" prefecture="牡丹江市" province="黑龙江省" 231005 county="西安区" prefecture="牡丹江市" province="黑龙江省" 231024 county="东宁县" prefecture="牡丹江市" province="黑龙江省" 231025 county="林口县" prefecture="牡丹江市" province="黑龙江省" 231081 county="绥芬河市" prefecture="牡丹江市" province="黑龙江省" 231083 county="海林市" prefecture="牡丹江市" province="黑龙江省" 231084 county="宁安市" prefecture="牡丹江市" province="黑龙江省" 231085 county="穆棱市" prefecture="牡丹江市" province="黑龙江省" 231101 county="市辖区" prefecture="黑河市" province="黑龙江省" 231102 county="爱辉区" prefecture="黑河市" province="黑龙江省" 231121 county="嫩江县" prefecture="黑河市" province="黑龙江省" 231123 county="逊克县" prefecture="黑河市" province="黑龙江省" 231124 county="孙吴县" prefecture="黑河市" province="黑龙江省" 231181 county="北安市" prefecture="黑河市" province="黑龙江省" 231182 county="五大连池市" prefecture="黑河市" province="黑龙江省" 231201 county="市辖区" prefecture="绥化市" province="黑龙江省" 231202 county="北林区" prefecture="绥化市" province="黑龙江省" 231221 county="望奎县" prefecture="绥化市" province="黑龙江省" 231222 county="兰西县" prefecture="绥化市" province="黑龙江省" 231223 county="青冈县" prefecture="绥化市" province="黑龙江省" 231224 county="庆安县" prefecture="绥化市" province="黑龙江省" 231225 county="明水县" prefecture="绥化市" province="黑龙江省" 231226 county="绥棱县" prefecture="绥化市" province="黑龙江省" 231281 county="安达市" prefecture="绥化市" province="黑龙江省" 231282 county="肇东市" prefecture="绥化市" province="黑龙江省" 231283 county="海伦市" prefecture="绥化市" province="黑龙江省" 232701 county="加格达奇区" prefecture="大兴安岭地区" province="黑龙江省" 232702 county="松岭区" prefecture="大兴安岭地区" province="黑龙江省" 232703 county="新林区" prefecture="大兴安岭地区" province="黑龙江省" 232704 county="呼中区" prefecture="大兴安岭地区" province="黑龙江省" 232721 county="呼玛县" prefecture="大兴安岭地区" province="黑龙江省" 232722 county="塔河县" prefecture="大兴安岭地区" province="黑龙江省" 232723 county="漠河县" prefecture="大兴安岭地区" province="黑龙江省" 310101 county="黄浦区" prefecture="市辖区" province="上海市" 310103 county="卢湾区" prefecture="市辖区" province="上海市" 310104 county="徐汇区" prefecture="市辖区" province="上海市" 310105 county="长宁区" prefecture="市辖区" province="上海市" 310106 county="静安区" prefecture="市辖区" province="上海市" 310107 county="普陀区" prefecture="市辖区" province="上海市" 310108 county="闸北区" prefecture="市辖区" province="上海市" 310109 county="虹口区" prefecture="市辖区" province="上海市" 310110 county="杨浦区" prefecture="市辖区" province="上海市" 310112 county="闵行区" prefecture="市辖区" province="上海市" 310113 county="宝山区" prefecture="市辖区" province="上海市" 310114 county="嘉定区" prefecture="市辖区" province="上海市" 310115 county="浦东新区" prefecture="市辖区" province="上海市" 310116 county="金山区" prefecture="市辖区" province="上海市" 310117 county="松江区" prefecture="市辖区" province="上海市" 310118 county="青浦区" prefecture="市辖区" province="上海市" 310119 county="南汇区" prefecture="市辖区" province="上海市" 310120 county="奉贤区" prefecture="市辖区" province="上海市" 310230 county="崇明县" prefecture="县" province="上海市" 320101 county="市辖区" prefecture="南京市" province="江苏省" 320102 county="玄武区" prefecture="南京市" province="江苏省" 320103 county="白下区" prefecture="南京市" province="江苏省" 320104 county="秦淮区" prefecture="南京市" province="江苏省" 320105 county="建邺区" prefecture="南京市" province="江苏省" 320106 county="鼓楼区" prefecture="南京市" province="江苏省" 320107 county="下关区" prefecture="南京市" province="江苏省" 320111 county="浦口区" prefecture="南京市" province="江苏省" 320113 county="栖霞区" prefecture="南京市" province="江苏省" 320114 county="雨花台区" prefecture="南京市" province="江苏省" 320115 county="江宁区" prefecture="南京市" province="江苏省" 320116 county="六合区" prefecture="南京市" province="江苏省" 320117 county="溧水区" prefecture="南京市" province="江苏省" 320118 county="高淳区" prefecture="南京市" province="江苏省" 320124 county="溧水县" prefecture="南京市" province="江苏省" 320125 county="高淳县" prefecture="南京市" province="江苏省" 320201 county="市辖区" prefecture="无锡市" province="江苏省" 320202 county="崇安区" prefecture="无锡市" province="江苏省" 320203 county="南长区" prefecture="无锡市" province="江苏省" 320204 county="北塘区" prefecture="无锡市" province="江苏省" 320205 county="锡山区" prefecture="无锡市" province="江苏省" 320206 county="惠山区" prefecture="无锡市" province="江苏省" 320211 county="滨湖区" prefecture="无锡市" province="江苏省" 320281 county="江阴市" prefecture="无锡市" province="江苏省" 320282 county="宜兴市" prefecture="无锡市" province="江苏省" 320301 county="市辖区" prefecture="徐州市" province="江苏省" 320302 county="鼓楼区" prefecture="徐州市" province="江苏省" 320303 county="云龙区" prefecture="徐州市" province="江苏省" 320304 county="九里区" prefecture="徐州市" province="江苏省" 320305 county="贾汪区" prefecture="徐州市" province="江苏省" 320311 county="泉山区" prefecture="徐州市" province="江苏省" 320312 county="铜山区" prefecture="徐州市" province="江苏省" 320321 county="丰县" prefecture="徐州市" province="江苏省" 320322 county="沛县" prefecture="徐州市" province="江苏省" 320323 county="铜山县" prefecture="徐州市" province="江苏省" 320324 county="睢宁县" prefecture="徐州市" province="江苏省" 320381 county="新沂市" prefecture="徐州市" province="江苏省" 320382 county="邳州市" prefecture="徐州市" province="江苏省" 320401 county="市辖区" prefecture="常州市" province="江苏省" 320402 county="天宁区" prefecture="常州市" province="江苏省" 320404 county="钟楼区" prefecture="常州市" province="江苏省" 320405 county="戚墅堰区" prefecture="常州市" province="江苏省" 320411 county="新北区" prefecture="常州市" province="江苏省" 320412 county="武进区" prefecture="常州市" province="江苏省" 320481 county="溧阳市" prefecture="常州市" province="江苏省" 320482 county="金坛市" prefecture="常州市" province="江苏省" 320501 county="市辖区" prefecture="苏州市" province="江苏省" 320502 county="沧浪区" prefecture="苏州市" province="江苏省" 320503 county="平江区" prefecture="苏州市" province="江苏省" 320504 county="金阊区" prefecture="苏州市" province="江苏省" 320505 county="虎丘区" prefecture="苏州市" province="江苏省" 320506 county="吴中区" prefecture="苏州市" province="江苏省" 320507 county="相城区" prefecture="苏州市" province="江苏省" 320508 county="姑苏区" prefecture="苏州市" province="江苏省" 320509 county="吴江区" prefecture="苏州市" province="江苏省" 320581 county="常熟市" prefecture="苏州市" province="江苏省" 320582 county="张家港市" prefecture="苏州市" province="江苏省" 320583 county="昆山市" prefecture="苏州市" province="江苏省" 320584 county="吴江市" prefecture="苏州市" province="江苏省" 320585 county="太仓市" prefecture="苏州市" province="江苏省" 320601 county="市辖区" prefecture="南通市" province="江苏省" 320602 county="崇川区" prefecture="南通市" province="江苏省" 320611 county="港闸区" prefecture="南通市" province="江苏省" 320612 county="通州区" prefecture="南通市" province="江苏省" 320621 county="海安县" prefecture="南通市" province="江苏省" 320623 county="如东县" prefecture="南通市" province="江苏省" 320681 county="启东市" prefecture="南通市" province="江苏省" 320682 county="如皋市" prefecture="南通市" province="江苏省" 320683 county="通州市" prefecture="南通市" province="江苏省" 320684 county="海门市" prefecture="南通市" province="江苏省" 320701 county="市辖区" prefecture="连云港市" province="江苏省" 320703 county="连云区" prefecture="连云港市" province="江苏省" 320705 county="新浦区" prefecture="连云港市" province="江苏省" 320706 county="海州区" prefecture="连云港市" province="江苏省" 320707 county="赣榆区" prefecture="连云港市" province="江苏省" 320721 county="赣榆县" prefecture="连云港市" province="江苏省" 320722 county="东海县" prefecture="连云港市" province="江苏省" 320723 county="灌云县" prefecture="连云港市" province="江苏省" 320724 county="灌南县" prefecture="连云港市" province="江苏省" 320801 county="市辖区" prefecture="淮安市" province="江苏省" 320802 county="清河区" prefecture="淮安市" province="江苏省" 320803 county="淮安区" prefecture="淮安市" province="江苏省" 320804 county="淮阴区" prefecture="淮安市" province="江苏省" 320811 county="清浦区" prefecture="淮安市" province="江苏省" 320826 county="涟水县" prefecture="淮安市" province="江苏省" 320829 county="洪泽县" prefecture="淮安市" province="江苏省" 320830 county="盱眙县" prefecture="淮安市" province="江苏省" 320831 county="金湖县" prefecture="淮安市" province="江苏省" 320901 county="市辖区" prefecture="盐城市" province="江苏省" 320902 county="亭湖区" prefecture="盐城市" province="江苏省" 320903 county="盐都区" prefecture="盐城市" province="江苏省" 320921 county="响水县" prefecture="盐城市" province="江苏省" 320922 county="滨海县" prefecture="盐城市" province="江苏省" 320923 county="阜宁县" prefecture="盐城市" province="江苏省" 320924 county="射阳县" prefecture="盐城市" province="江苏省" 320925 county="建湖县" prefecture="盐城市" province="江苏省" 320928 county="盐都县" prefecture="盐城市" province="江苏省" 320981 county="东台市" prefecture="盐城市" province="江苏省" 320982 county="大丰市" prefecture="盐城市" province="江苏省" 321001 county="市辖区" prefecture="扬州市" province="江苏省" 321002 county="广陵区" prefecture="扬州市" province="江苏省" 321003 county="邗江区" prefecture="扬州市" province="江苏省" 321011 county="维扬区" prefecture="扬州市" province="江苏省" 321012 county="江都区" prefecture="扬州市" province="江苏省" 321023 county="宝应县" prefecture="扬州市" province="江苏省" 321081 county="仪征市" prefecture="扬州市" province="江苏省" 321084 county="高邮市" prefecture="扬州市" province="江苏省" 321088 county="江都市" prefecture="扬州市" province="江苏省" 321101 county="市辖区" prefecture="镇江市" province="江苏省" 321102 county="京口区" prefecture="镇江市" province="江苏省" 321111 county="润州区" prefecture="镇江市" province="江苏省" 321112 county="丹徒区" prefecture="镇江市" province="江苏省" 321181 county="丹阳市" prefecture="镇江市" province="江苏省" 321182 county="扬中市" prefecture="镇江市" province="江苏省" 321183 county="句容市" prefecture="镇江市" province="江苏省" 321201 county="市辖区" prefecture="泰州市" province="江苏省" 321202 county="海陵区" prefecture="泰州市" province="江苏省" 321203 county="高港区" prefecture="泰州市" province="江苏省" 321204 county="姜堰区" prefecture="泰州市" province="江苏省" 321281 county="兴化市" prefecture="泰州市" province="江苏省" 321282 county="靖江市" prefecture="泰州市" province="江苏省" 321283 county="泰兴市" prefecture="泰州市" province="江苏省" 321284 county="姜堰市" prefecture="泰州市" province="江苏省" 321301 county="市辖区" prefecture="宿迁市" province="江苏省" 321302 county="宿城区" prefecture="宿迁市" province="江苏省" 321311 county="宿豫区" prefecture="宿迁市" province="江苏省" 321321 county="宿豫县" prefecture="宿迁市" province="江苏省" 321322 county="沭阳县" prefecture="宿迁市" province="江苏省" 321323 county="泗阳县" prefecture="宿迁市" province="江苏省" 321324 county="泗洪县" prefecture="宿迁市" province="江苏省" 330101 county="市辖区" prefecture="杭州市" province="浙江省" 330102 county="上城区" prefecture="杭州市" province="浙江省" 330103 county="下城区" prefecture="杭州市" province="浙江省" 330104 county="江干区" prefecture="杭州市" province="浙江省" 330105 county="拱墅区" prefecture="杭州市" province="浙江省" 330106 county="西湖区" prefecture="杭州市" province="浙江省" 330108 county="滨江区" prefecture="杭州市" province="浙江省" 330109 county="萧山区" prefecture="杭州市" province="浙江省" 330110 county="余杭区" prefecture="杭州市" province="浙江省" 330122 county="桐庐县" prefecture="杭州市" province="浙江省" 330127 county="淳安县" prefecture="杭州市" province="浙江省" 330182 county="建德市" prefecture="杭州市" province="浙江省" 330183 county="富阳市" prefecture="杭州市" province="浙江省" 330185 county="临安市" prefecture="杭州市" province="浙江省" 330201 county="市辖区" prefecture="宁波市" province="浙江省" 330203 county="海曙区" prefecture="宁波市" province="浙江省" 330204 county="江东区" prefecture="宁波市" province="浙江省" 330205 county="江北区" prefecture="宁波市" province="浙江省" 330206 county="北仑区" prefecture="宁波市" province="浙江省" 330211 county="镇海区" prefecture="宁波市" province="浙江省" 330212 county="鄞州区" prefecture="宁波市" province="浙江省" 330225 county="象山县" prefecture="宁波市" province="浙江省" 330226 county="宁海县" prefecture="宁波市" province="浙江省" 330281 county="余姚市" prefecture="宁波市" province="浙江省" 330282 county="慈溪市" prefecture="宁波市" province="浙江省" 330283 county="奉化市" prefecture="宁波市" province="浙江省" 330301 county="市辖区" prefecture="温州市" province="浙江省" 330302 county="鹿城区" prefecture="温州市" province="浙江省" 330303 county="龙湾区" prefecture="温州市" province="浙江省" 330304 county="瓯海区" prefecture="温州市" province="浙江省" 330322 county="洞头县" prefecture="温州市" province="浙江省" 330324 county="永嘉县" prefecture="温州市" province="浙江省" 330326 county="平阳县" prefecture="温州市" province="浙江省" 330327 county="苍南县" prefecture="温州市" province="浙江省" 330328 county="文成县" prefecture="温州市" province="浙江省" 330329 county="泰顺县" prefecture="温州市" province="浙江省" 330381 county="瑞安市" prefecture="温州市" province="浙江省" 330382 county="乐清市" prefecture="温州市" province="浙江省" 330401 county="市辖区" prefecture="嘉兴市" province="浙江省" 330402 county="南湖区" prefecture="嘉兴市" province="浙江省" 330411 county="秀洲区" prefecture="嘉兴市" province="浙江省" 330421 county="嘉善县" prefecture="嘉兴市" province="浙江省" 330424 county="海盐县" prefecture="嘉兴市" province="浙江省" 330481 county="海宁市" prefecture="嘉兴市" province="浙江省" 330482 county="平湖市" prefecture="嘉兴市" province="浙江省" 330483 county="桐乡市" prefecture="嘉兴市" province="浙江省" 330501 county="市辖区" prefecture="湖州市" province="浙江省" 330502 county="吴兴区" prefecture="湖州市" province="浙江省" 330503 county="南浔区" prefecture="湖州市" province="浙江省" 330521 county="德清县" prefecture="湖州市" province="浙江省" 330522 county="长兴县" prefecture="湖州市" province="浙江省" 330523 county="安吉县" prefecture="湖州市" province="浙江省" 330601 county="市辖区" prefecture="绍兴市" province="浙江省" 330602 county="越城区" prefecture="绍兴市" province="浙江省" 330603 county="柯桥区" prefecture="绍兴市" province="浙江省" 330604 county="上虞区" prefecture="绍兴市" province="浙江省" 330621 county="绍兴县" prefecture="绍兴市" province="浙江省" 330624 county="新昌县" prefecture="绍兴市" province="浙江省" 330681 county="诸暨市" prefecture="绍兴市" province="浙江省" 330682 county="上虞市" prefecture="绍兴市" province="浙江省" 330683 county="嵊州市" prefecture="绍兴市" province="浙江省" 330701 county="市辖区" prefecture="金华市" province="浙江省" 330702 county="婺城区" prefecture="金华市" province="浙江省" 330703 county="金东区" prefecture="金华市" province="浙江省" 330723 county="武义县" prefecture="金华市" province="浙江省" 330726 county="浦江县" prefecture="金华市" province="浙江省" 330727 county="磐安县" prefecture="金华市" province="浙江省" 330781 county="兰溪市" prefecture="金华市" province="浙江省" 330782 county="义乌市" prefecture="金华市" province="浙江省" 330783 county="东阳市" prefecture="金华市" province="浙江省" 330784 county="永康市" prefecture="金华市" province="浙江省" 330801 county="市辖区" prefecture="衢州市" province="浙江省" 330802 county="柯城区" prefecture="衢州市" province="浙江省" 330803 county="衢江区" prefecture="衢州市" province="浙江省" 330822 county="常山县" prefecture="衢州市" province="浙江省" 330824 county="开化县" prefecture="衢州市" province="浙江省" 330825 county="龙游县" prefecture="衢州市" province="浙江省" 330881 county="江山市" prefecture="衢州市" province="浙江省" 330901 county="市辖区" prefecture="舟山市" province="浙江省" 330902 county="定海区" prefecture="舟山市" province="浙江省" 330903 county="普陀区" prefecture="舟山市" province="浙江省" 330921 county="岱山县" prefecture="舟山市" province="浙江省" 330922 county="嵊泗县" prefecture="舟山市" province="浙江省" 331001 county="市辖区" prefecture="台州市" province="浙江省" 331002 county="椒江区" prefecture="台州市" province="浙江省" 331003 county="黄岩区" prefecture="台州市" province="浙江省" 331004 county="路桥区" prefecture="台州市" province="浙江省" 331021 county="玉环县" prefecture="台州市" province="浙江省" 331022 county="三门县" prefecture="台州市" province="浙江省" 331023 county="天台县" prefecture="台州市" province="浙江省" 331024 county="仙居县" prefecture="台州市" province="浙江省" 331081 county="温岭市" prefecture="台州市" province="浙江省" 331082 county="临海市" prefecture="台州市" province="浙江省" 331101 county="市辖区" prefecture="丽水市" province="浙江省" 331102 county="莲都区" prefecture="丽水市" province="浙江省" 331121 county="青田县" prefecture="丽水市" province="浙江省" 331122 county="缙云县" prefecture="丽水市" province="浙江省" 331123 county="遂昌县" prefecture="丽水市" province="浙江省" 331124 county="松阳县" prefecture="丽水市" province="浙江省" 331125 county="云和县" prefecture="丽水市" province="浙江省" 331126 county="庆元县" prefecture="丽水市" province="浙江省" 331127 county="景宁畲族自治县" prefecture="丽水市" province="浙江省" 331181 county="龙泉市" prefecture="丽水市" province="浙江省" 340101 county="市辖区" prefecture="合肥市" province="安徽省" 340102 county="瑶海区" prefecture="合肥市" province="安徽省" 340103 county="庐阳区" prefecture="合肥市" province="安徽省" 340104 county="蜀山区" prefecture="合肥市" province="安徽省" 340111 county="包河区" prefecture="合肥市" province="安徽省" 340121 county="长丰县" prefecture="合肥市" province="安徽省" 340122 county="肥东县" prefecture="合肥市" province="安徽省" 340123 county="肥西县" prefecture="合肥市" province="安徽省" 340124 county="庐江县" prefecture="合肥市" province="安徽省" 340181 county="巢湖市" prefecture="合肥市" province="安徽省" 340201 county="市辖区" prefecture="芜湖市" province="安徽省" 340202 county="镜湖区" prefecture="芜湖市" province="安徽省" 340203 county="弋江区" prefecture="芜湖市" province="安徽省" 340204 county="新芜区" prefecture="芜湖市" province="安徽省" 340207 county="鸠江区" prefecture="芜湖市" province="安徽省" 340208 county="三山区" prefecture="芜湖市" province="安徽省" 340221 county="芜湖县" prefecture="芜湖市" province="安徽省" 340222 county="繁昌县" prefecture="芜湖市" province="安徽省" 340223 county="南陵县" prefecture="芜湖市" province="安徽省" 340225 county="无为县" prefecture="芜湖市" province="安徽省" 340301 county="市辖区" prefecture="蚌埠市" province="安徽省" 340302 county="龙子湖区" prefecture="蚌埠市" province="安徽省" 340303 county="蚌山区" prefecture="蚌埠市" province="安徽省" 340304 county="禹会区" prefecture="蚌埠市" province="安徽省" 340311 county="淮上区" prefecture="蚌埠市" province="安徽省" 340321 county="怀远县" prefecture="蚌埠市" province="安徽省" 340322 county="五河县" prefecture="蚌埠市" province="安徽省" 340323 county="固镇县" prefecture="蚌埠市" province="安徽省" 340401 county="市辖区" prefecture="淮南市" province="安徽省" 340402 county="大通区" prefecture="淮南市" province="安徽省" 340403 county="田家庵区" prefecture="淮南市" province="安徽省" 340404 county="谢家集区" prefecture="淮南市" province="安徽省" 340405 county="八公山区" prefecture="淮南市" province="安徽省" 340406 county="潘集区" prefecture="淮南市" province="安徽省" 340421 county="凤台县" prefecture="淮南市" province="安徽省" 340501 county="市辖区" prefecture="马鞍山市" province="安徽省" 340502 county="金家庄区" prefecture="马鞍山市" province="安徽省" 340503 county="花山区" prefecture="马鞍山市" province="安徽省" 340504 county="雨山区" prefecture="马鞍山市" province="安徽省" 340506 county="博望区" prefecture="马鞍山市" province="安徽省" 340521 county="当涂县" prefecture="马鞍山市" province="安徽省" 340522 county="含山县" prefecture="马鞍山市" province="安徽省" 340523 county="和县" prefecture="马鞍山市" province="安徽省" 340601 county="市辖区" prefecture="淮北市" province="安徽省" 340602 county="杜集区" prefecture="淮北市" province="安徽省" 340603 county="相山区" prefecture="淮北市" province="安徽省" 340604 county="烈山区" prefecture="淮北市" province="安徽省" 340621 county="濉溪县" prefecture="淮北市" province="安徽省" 340701 county="市辖区" prefecture="铜陵市" province="安徽省" 340702 county="铜官山区" prefecture="铜陵市" province="安徽省" 340703 county="狮子山区" prefecture="铜陵市" province="安徽省" 340711 county="郊区" prefecture="铜陵市" province="安徽省" 340721 county="铜陵县" prefecture="铜陵市" province="安徽省" 340801 county="市辖区" prefecture="安庆市" province="安徽省" 340802 county="迎江区" prefecture="安庆市" province="安徽省" 340803 county="大观区" prefecture="安庆市" province="安徽省" 340811 county="宜秀区" prefecture="安庆市" province="安徽省" 340822 county="怀宁县" prefecture="安庆市" province="安徽省" 340823 county="枞阳县" prefecture="安庆市" province="安徽省" 340824 county="潜山县" prefecture="安庆市" province="安徽省" 340825 county="太湖县" prefecture="安庆市" province="安徽省" 340826 county="宿松县" prefecture="安庆市" province="安徽省" 340827 county="望江县" prefecture="安庆市" province="安徽省" 340828 county="岳西县" prefecture="安庆市" province="安徽省" 340881 county="桐城市" prefecture="安庆市" province="安徽省" 341001 county="市辖区" prefecture="黄山市" province="安徽省" 341002 county="屯溪区" prefecture="黄山市" province="安徽省" 341003 county="黄山区" prefecture="黄山市" province="安徽省" 341004 county="徽州区" prefecture="黄山市" province="安徽省" 341021 county="歙县" prefecture="黄山市" province="安徽省" 341022 county="休宁县" prefecture="黄山市" province="安徽省" 341023 county="黟县" prefecture="黄山市" province="安徽省" 341024 county="祁门县" prefecture="黄山市" province="安徽省" 341101 county="市辖区" prefecture="滁州市" province="安徽省" 341102 county="琅琊区" prefecture="滁州市" province="安徽省" 341103 county="南谯区" prefecture="滁州市" province="安徽省" 341122 county="来安县" prefecture="滁州市" province="安徽省" 341124 county="全椒县" prefecture="滁州市" province="安徽省" 341125 county="定远县" prefecture="滁州市" province="安徽省" 341126 county="凤阳县" prefecture="滁州市" province="安徽省" 341181 county="天长市" prefecture="滁州市" province="安徽省" 341182 county="明光市" prefecture="滁州市" province="安徽省" 341201 county="市辖区" prefecture="阜阳市" province="安徽省" 341202 county="颍州区" prefecture="阜阳市" province="安徽省" 341203 county="颍东区" prefecture="阜阳市" province="安徽省" 341204 county="颍泉区" prefecture="阜阳市" province="安徽省" 341221 county="临泉县" prefecture="阜阳市" province="安徽省" 341222 county="太和县" prefecture="阜阳市" province="安徽省" 341225 county="阜南县" prefecture="阜阳市" province="安徽省" 341226 county="颍上县" prefecture="阜阳市" province="安徽省" 341282 county="界首市" prefecture="阜阳市" province="安徽省" 341301 county="市辖区" prefecture="宿州市" province="安徽省" 341302 county="埇桥区" prefecture="宿州市" province="安徽省" 341321 county="砀山县" prefecture="宿州市" province="安徽省" 341322 county="萧县" prefecture="宿州市" province="安徽省" 341323 county="灵璧县" prefecture="宿州市" province="安徽省" 341324 county="泗县" prefecture="宿州市" province="安徽省" 341401 county="市辖区" prefecture="巢湖市" province="安徽省" 341402 county="居巢区" prefecture="巢湖市" province="安徽省" 341421 county="庐江县" prefecture="巢湖市" province="安徽省" 341422 county="无为县" prefecture="巢湖市" province="安徽省" 341423 county="含山县" prefecture="巢湖市" province="安徽省" 341424 county="和县" prefecture="巢湖市" province="安徽省" 341501 county="市辖区" prefecture="六安市" province="安徽省" 341502 county="金安区" prefecture="六安市" province="安徽省" 341503 county="裕安区" prefecture="六安市" province="安徽省" 341521 county="寿县" prefecture="六安市" province="安徽省" 341522 county="霍邱县" prefecture="六安市" province="安徽省" 341523 county="舒城县" prefecture="六安市" province="安徽省" 341524 county="金寨县" prefecture="六安市" province="安徽省" 341525 county="霍山县" prefecture="六安市" province="安徽省" 341601 county="市辖区" prefecture="亳州市" province="安徽省" 341602 county="谯城区" prefecture="亳州市" province="安徽省" 341621 county="涡阳县" prefecture="亳州市" province="安徽省" 341622 county="蒙城县" prefecture="亳州市" province="安徽省" 341623 county="利辛县" prefecture="亳州市" province="安徽省" 341701 county="市辖区" prefecture="池州市" province="安徽省" 341702 county="贵池区" prefecture="池州市" province="安徽省" 341721 county="东至县" prefecture="池州市" province="安徽省" 341722 county="石台县" prefecture="池州市" province="安徽省" 341723 county="青阳县" prefecture="池州市" province="安徽省" 341801 county="市辖区" prefecture="宣城市" province="安徽省" 341802 county="宣州区" prefecture="宣城市" province="安徽省" 341821 county="郎溪县" prefecture="宣城市" province="安徽省" 341822 county="广德县" prefecture="宣城市" province="安徽省" 341823 county="泾县" prefecture="宣城市" province="安徽省" 341824 county="绩溪县" prefecture="宣城市" province="安徽省" 341825 county="旌德县" prefecture="宣城市" province="安徽省" 341881 county="宁国市" prefecture="宣城市" province="安徽省" 350101 county="市辖区" prefecture="福州市" province="福建省" 350102 county="鼓楼区" prefecture="福州市" province="福建省" 350103 county="台江区" prefecture="福州市" province="福建省" 350104 county="仓山区" prefecture="福州市" province="福建省" 350105 county="马尾区" prefecture="福州市" province="福建省" 350111 county="晋安区" prefecture="福州市" province="福建省" 350121 county="闽侯县" prefecture="福州市" province="福建省" 350122 county="连江县" prefecture="福州市" province="福建省" 350123 county="罗源县" prefecture="福州市" province="福建省" 350124 county="闽清县" prefecture="福州市" province="福建省" 350125 county="永泰县" prefecture="福州市" province="福建省" 350128 county="平潭县" prefecture="福州市" province="福建省" 350181 county="福清市" prefecture="福州市" province="福建省" 350182 county="长乐市" prefecture="福州市" province="福建省" 350201 county="市辖区" prefecture="厦门市" province="福建省" 350202 county="鼓浪屿区" prefecture="厦门市" province="福建省" 350203 county="思明区" prefecture="厦门市" province="福建省" 350204 county="开元区" prefecture="厦门市" province="福建省" 350205 county="海沧区" prefecture="厦门市" province="福建省" 350206 county="湖里区" prefecture="厦门市" province="福建省" 350211 county="集美区" prefecture="厦门市" province="福建省" 350212 county="同安区" prefecture="厦门市" province="福建省" 350213 county="翔安区" prefecture="厦门市" province="福建省" 350301 county="市辖区" prefecture="莆田市" province="福建省" 350302 county="城厢区" prefecture="莆田市" province="福建省" 350303 county="涵江区" prefecture="莆田市" province="福建省" 350304 county="荔城区" prefecture="莆田市" province="福建省" 350305 county="秀屿区" prefecture="莆田市" province="福建省" 350322 county="仙游县" prefecture="莆田市" province="福建省" 350401 county="市辖区" prefecture="三明市" province="福建省" 350402 county="梅列区" prefecture="三明市" province="福建省" 350403 county="三元区" prefecture="三明市" province="福建省" 350421 county="明溪县" prefecture="三明市" province="福建省" 350423 county="清流县" prefecture="三明市" province="福建省" 350424 county="宁化县" prefecture="三明市" province="福建省" 350425 county="大田县" prefecture="三明市" province="福建省" 350426 county="尤溪县" prefecture="三明市" province="福建省" 350427 county="沙县" prefecture="三明市" province="福建省" 350428 county="将乐县" prefecture="三明市" province="福建省" 350429 county="泰宁县" prefecture="三明市" province="福建省" 350430 county="建宁县" prefecture="三明市" province="福建省" 350481 county="永安市" prefecture="三明市" province="福建省" 350501 county="市辖区" prefecture="泉州市" province="福建省" 350502 county="鲤城区" prefecture="泉州市" province="福建省" 350503 county="丰泽区" prefecture="泉州市" province="福建省" 350504 county="洛江区" prefecture="泉州市" province="福建省" 350505 county="泉港区" prefecture="泉州市" province="福建省" 350521 county="惠安县" prefecture="泉州市" province="福建省" 350524 county="安溪县" prefecture="泉州市" province="福建省" 350525 county="永春县" prefecture="泉州市" province="福建省" 350526 county="德化县" prefecture="泉州市" province="福建省" 350527 county="金门县" prefecture="泉州市" province="福建省" 350581 county="石狮市" prefecture="泉州市" province="福建省" 350582 county="晋江市" prefecture="泉州市" province="福建省" 350583 county="南安市" prefecture="泉州市" province="福建省" 350601 county="市辖区" prefecture="漳州市" province="福建省" 350602 county="芗城区" prefecture="漳州市" province="福建省" 350603 county="龙文区" prefecture="漳州市" province="福建省" 350622 county="云霄县" prefecture="漳州市" province="福建省" 350623 county="漳浦县" prefecture="漳州市" province="福建省" 350624 county="诏安县" prefecture="漳州市" province="福建省" 350625 county="长泰县" prefecture="漳州市" province="福建省" 350626 county="东山县" prefecture="漳州市" province="福建省" 350627 county="南靖县" prefecture="漳州市" province="福建省" 350628 county="平和县" prefecture="漳州市" province="福建省" 350629 county="华安县" prefecture="漳州市" province="福建省" 350681 county="龙海市" prefecture="漳州市" province="福建省" 350701 county="市辖区" prefecture="南平市" province="福建省" 350702 county="延平区" prefecture="南平市" province="福建省" 350721 county="顺昌县" prefecture="南平市" province="福建省" 350722 county="浦城县" prefecture="南平市" province="福建省" 350723 county="光泽县" prefecture="南平市" province="福建省" 350724 county="松溪县" prefecture="南平市" province="福建省" 350725 county="政和县" prefecture="南平市" province="福建省" 350781 county="邵武市" prefecture="南平市" province="福建省" 350782 county="武夷山市" prefecture="南平市" province="福建省" 350783 county="建瓯市" prefecture="南平市" province="福建省" 350784 county="建阳市" prefecture="南平市" province="福建省" 350801 county="市辖区" prefecture="龙岩市" province="福建省" 350802 county="新罗区" prefecture="龙岩市" province="福建省" 350821 county="长汀县" prefecture="龙岩市" province="福建省" 350822 county="永定县" prefecture="龙岩市" province="福建省" 350823 county="上杭县" prefecture="龙岩市" province="福建省" 350824 county="武平县" prefecture="龙岩市" province="福建省" 350825 county="连城县" prefecture="龙岩市" province="福建省" 350881 county="漳平市" prefecture="龙岩市" province="福建省" 350901 county="市辖区" prefecture="宁德市" province="福建省" 350902 county="蕉城区" prefecture="宁德市" province="福建省" 350921 county="霞浦县" prefecture="宁德市" province="福建省" 350922 county="古田县" prefecture="宁德市" province="福建省" 350923 county="屏南县" prefecture="宁德市" province="福建省" 350924 county="寿宁县" prefecture="宁德市" province="福建省" 350925 county="周宁县" prefecture="宁德市" province="福建省" 350926 county="柘荣县" prefecture="宁德市" province="福建省" 350981 county="福安市" prefecture="宁德市" province="福建省" 350982 county="福鼎市" prefecture="宁德市" province="福建省" 360101 county="市辖区" prefecture="南昌市" province="江西省" 360102 county="东湖区" prefecture="南昌市" province="江西省" 360103 county="西湖区" prefecture="南昌市" province="江西省" 360104 county="青云谱区" prefecture="南昌市" province="江西省" 360105 county="湾里区" prefecture="南昌市" province="江西省" 360111 county="青山湖区" prefecture="南昌市" province="江西省" 360121 county="南昌县" prefecture="南昌市" province="江西省" 360122 county="新建县" prefecture="南昌市" province="江西省" 360123 county="安义县" prefecture="南昌市" province="江西省" 360124 county="进贤县" prefecture="南昌市" province="江西省" 360201 county="市辖区" prefecture="景德镇市" province="江西省" 360202 county="昌江区" prefecture="景德镇市" province="江西省" 360203 county="珠山区" prefecture="景德镇市" province="江西省" 360222 county="浮梁县" prefecture="景德镇市" province="江西省" 360281 county="乐平市" prefecture="景德镇市" province="江西省" 360301 county="市辖区" prefecture="萍乡市" province="江西省" 360302 county="安源区" prefecture="萍乡市" province="江西省" 360313 county="湘东区" prefecture="萍乡市" province="江西省" 360321 county="莲花县" prefecture="萍乡市" province="江西省" 360322 county="上栗县" prefecture="萍乡市" province="江西省" 360323 county="芦溪县" prefecture="萍乡市" province="江西省" 360401 county="市辖区" prefecture="九江市" province="江西省" 360402 county="庐山区" prefecture="九江市" province="江西省" 360403 county="浔阳区" prefecture="九江市" province="江西省" 360421 county="九江县" prefecture="九江市" province="江西省" 360423 county="武宁县" prefecture="九江市" province="江西省" 360424 county="修水县" prefecture="九江市" province="江西省" 360425 county="永修县" prefecture="九江市" province="江西省" 360426 county="德安县" prefecture="九江市" province="江西省" 360427 county="星子县" prefecture="九江市" province="江西省" 360428 county="都昌县" prefecture="九江市" province="江西省" 360429 county="湖口县" prefecture="九江市" province="江西省" 360430 county="彭泽县" prefecture="九江市" province="江西省" 360481 county="瑞昌市" prefecture="九江市" province="江西省" 360482 county="共青城市" prefecture="九江市" province="江西省" 360501 county="市辖区" prefecture="新余市" province="江西省" 360502 county="渝水区" prefecture="新余市" province="江西省" 360521 county="分宜县" prefecture="新余市" province="江西省" 360601 county="市辖区" prefecture="鹰潭市" province="江西省" 360602 county="月湖区" prefecture="鹰潭市" province="江西省" 360622 county="余江县" prefecture="鹰潭市" province="江西省" 360681 county="贵溪市" prefecture="鹰潭市" province="江西省" 360701 county="市辖区" prefecture="赣州市" province="江西省" 360702 county="章贡区" prefecture="赣州市" province="江西省" 360703 county="南康区" prefecture="赣州市" province="江西省" 360721 county="赣县" prefecture="赣州市" province="江西省" 360722 county="信丰县" prefecture="赣州市" province="江西省" 360723 county="大余县" prefecture="赣州市" province="江西省" 360724 county="上犹县" prefecture="赣州市" province="江西省" 360725 county="崇义县" prefecture="赣州市" province="江西省" 360726 county="安远县" prefecture="赣州市" province="江西省" 360727 county="龙南县" prefecture="赣州市" province="江西省" 360728 county="定南县" prefecture="赣州市" province="江西省" 360729 county="全南县" prefecture="赣州市" province="江西省" 360730 county="宁都县" prefecture="赣州市" province="江西省" 360731 county="于都县" prefecture="赣州市" province="江西省" 360732 county="兴国县" prefecture="赣州市" province="江西省" 360733 county="会昌县" prefecture="赣州市" province="江西省" 360734 county="寻乌县" prefecture="赣州市" province="江西省" 360735 county="石城县" prefecture="赣州市" province="江西省" 360781 county="瑞金市" prefecture="赣州市" province="江西省" 360782 county="南康市" prefecture="赣州市" province="江西省" 360801 county="市辖区" prefecture="吉安市" province="江西省" 360802 county="吉州区" prefecture="吉安市" province="江西省" 360803 county="青原区" prefecture="吉安市" province="江西省" 360821 county="吉安县" prefecture="吉安市" province="江西省" 360822 county="吉水县" prefecture="吉安市" province="江西省" 360823 county="峡江县" prefecture="吉安市" province="江西省" 360824 county="新干县" prefecture="吉安市" province="江西省" 360825 county="永丰县" prefecture="吉安市" province="江西省" 360826 county="泰和县" prefecture="吉安市" province="江西省" 360827 county="遂川县" prefecture="吉安市" province="江西省" 360828 county="万安县" prefecture="吉安市" province="江西省" 360829 county="安福县" prefecture="吉安市" province="江西省" 360830 county="永新县" prefecture="吉安市" province="江西省" 360881 county="井冈山市" prefecture="吉安市" province="江西省" 360901 county="市辖区" prefecture="宜春市" province="江西省" 360902 county="袁州区" prefecture="宜春市" province="江西省" 360921 county="奉新县" prefecture="宜春市" province="江西省" 360922 county="万载县" prefecture="宜春市" province="江西省" 360923 county="上高县" prefecture="宜春市" province="江西省" 360924 county="宜丰县" prefecture="宜春市" province="江西省" 360925 county="靖安县" prefecture="宜春市" province="江西省" 360926 county="铜鼓县" prefecture="宜春市" province="江西省" 360981 county="丰城市" prefecture="宜春市" province="江西省" 360982 county="樟树市" prefecture="宜春市" province="江西省" 360983 county="高安市" prefecture="宜春市" province="江西省" 361001 county="市辖区" prefecture="抚州市" province="江西省" 361002 county="临川区" prefecture="抚州市" province="江西省" 361021 county="南城县" prefecture="抚州市" province="江西省" 361022 county="黎川县" prefecture="抚州市" province="江西省" 361023 county="南丰县" prefecture="抚州市" province="江西省" 361024 county="崇仁县" prefecture="抚州市" province="江西省" 361025 county="乐安县" prefecture="抚州市" province="江西省" 361026 county="宜黄县" prefecture="抚州市" province="江西省" 361027 county="金溪县" prefecture="抚州市" province="江西省" 361028 county="资溪县" prefecture="抚州市" province="江西省" 361029 county="东乡县" prefecture="抚州市" province="江西省" 361030 county="广昌县" prefecture="抚州市" province="江西省" 361101 county="市辖区" prefecture="上饶市" province="江西省" 361102 county="信州区" prefecture="上饶市" province="江西省" 361121 county="上饶县" prefecture="上饶市" province="江西省" 361122 county="广丰县" prefecture="上饶市" province="江西省" 361123 county="玉山县" prefecture="上饶市" province="江西省" 361124 county="铅山县" prefecture="上饶市" province="江西省" 361125 county="横峰县" prefecture="上饶市" province="江西省" 361126 county="弋阳县" prefecture="上饶市" province="江西省" 361127 county="余干县" prefecture="上饶市" province="江西省" 361128 county="鄱阳县" prefecture="上饶市" province="江西省" 361129 county="万年县" prefecture="上饶市" province="江西省" 361130 county="婺源县" prefecture="上饶市" province="江西省" 361181 county="德兴市" prefecture="上饶市" province="江西省" 370101 county="市辖区" prefecture="济南市" province="山东省" 370102 county="历下区" prefecture="济南市" province="山东省" 370103 county="市中区" prefecture="济南市" province="山东省" 370104 county="槐荫区" prefecture="济南市" province="山东省" 370105 county="天桥区" prefecture="济南市" province="山东省" 370112 county="历城区" prefecture="济南市" province="山东省" 370113 county="长清区" prefecture="济南市" province="山东省" 370124 county="平阴县" prefecture="济南市" province="山东省" 370125 county="济阳县" prefecture="济南市" province="山东省" 370126 county="商河县" prefecture="济南市" province="山东省" 370181 county="章丘市" prefecture="济南市" province="山东省" 370201 county="市辖区" prefecture="青岛市" province="山东省" 370202 county="市南区" prefecture="青岛市" province="山东省" 370203 county="市北区" prefecture="青岛市" province="山东省" 370205 county="四方区" prefecture="青岛市" province="山东省" 370211 county="黄岛区" prefecture="青岛市" province="山东省" 370212 county="崂山区" prefecture="青岛市" province="山东省" 370213 county="李沧区" prefecture="青岛市" province="山东省" 370214 county="城阳区" prefecture="青岛市" province="山东省" 370281 county="胶州市" prefecture="青岛市" province="山东省" 370282 county="即墨市" prefecture="青岛市" province="山东省" 370283 county="平度市" prefecture="青岛市" province="山东省" 370284 county="胶南市" prefecture="青岛市" province="山东省" 370285 county="莱西市" prefecture="青岛市" province="山东省" 370301 county="市辖区" prefecture="淄博市" province="山东省" 370302 county="淄川区" prefecture="淄博市" province="山东省" 370303 county="张店区" prefecture="淄博市" province="山东省" 370304 county="博山区" prefecture="淄博市" province="山东省" 370305 county="临淄区" prefecture="淄博市" province="山东省" 370306 county="周村区" prefecture="淄博市" province="山东省" 370321 county="桓台县" prefecture="淄博市" province="山东省" 370322 county="高青县" prefecture="淄博市" province="山东省" 370323 county="沂源县" prefecture="淄博市" province="山东省" 370401 county="市辖区" prefecture="枣庄市" province="山东省" 370402 county="市中区" prefecture="枣庄市" province="山东省" 370403 county="薛城区" prefecture="枣庄市" province="山东省" 370404 county="峄城区" prefecture="枣庄市" province="山东省" 370405 county="台儿庄区" prefecture="枣庄市" province="山东省" 370406 county="山亭区" prefecture="枣庄市" province="山东省" 370481 county="滕州市" prefecture="枣庄市" province="山东省" 370501 county="市辖区" prefecture="东营市" province="山东省" 370502 county="东营区" prefecture="东营市" province="山东省" 370503 county="河口区" prefecture="东营市" province="山东省" 370521 county="垦利县" prefecture="东营市" province="山东省" 370522 county="利津县" prefecture="东营市" province="山东省" 370523 county="广饶县" prefecture="东营市" province="山东省" 370601 county="市辖区" prefecture="烟台市" province="山东省" 370602 county="芝罘区" prefecture="烟台市" province="山东省" 370611 county="福山区" prefecture="烟台市" province="山东省" 370612 county="牟平区" prefecture="烟台市" province="山东省" 370613 county="莱山区" prefecture="烟台市" province="山东省" 370634 county="长岛县" prefecture="烟台市" province="山东省" 370681 county="龙口市" prefecture="烟台市" province="山东省" 370682 county="莱阳市" prefecture="烟台市" province="山东省" 370683 county="莱州市" prefecture="烟台市" province="山东省" 370684 county="蓬莱市" prefecture="烟台市" province="山东省" 370685 county="招远市" prefecture="烟台市" province="山东省" 370686 county="栖霞市" prefecture="烟台市" province="山东省" 370687 county="海阳市" prefecture="烟台市" province="山东省" 370701 county="市辖区" prefecture="潍坊市" province="山东省" 370702 county="潍城区" prefecture="潍坊市" province="山东省" 370703 county="寒亭区" prefecture="潍坊市" province="山东省" 370704 county="坊子区" prefecture="潍坊市" province="山东省" 370705 county="奎文区" prefecture="潍坊市" province="山东省" 370724 county="临朐县" prefecture="潍坊市" province="山东省" 370725 county="昌乐县" prefecture="潍坊市" province="山东省" 370781 county="青州市" prefecture="潍坊市" province="山东省" 370782 county="诸城市" prefecture="潍坊市" province="山东省" 370783 county="寿光市" prefecture="潍坊市" province="山东省" 370784 county="安丘市" prefecture="潍坊市" province="山东省" 370785 county="高密市" prefecture="潍坊市" province="山东省" 370786 county="昌邑市" prefecture="潍坊市" province="山东省" 370801 county="市辖区" prefecture="济宁市" province="山东省" 370802 county="市中区" prefecture="济宁市" province="山东省" 370811 county="任城区" prefecture="济宁市" province="山东省" 370812 county="兖州区" prefecture="济宁市" province="山东省" 370826 county="微山县" prefecture="济宁市" province="山东省" 370827 county="鱼台县" prefecture="济宁市" province="山东省" 370828 county="金乡县" prefecture="济宁市" province="山东省" 370829 county="嘉祥县" prefecture="济宁市" province="山东省" 370830 county="汶上县" prefecture="济宁市" province="山东省" 370831 county="泗水县" prefecture="济宁市" province="山东省" 370832 county="梁山县" prefecture="济宁市" province="山东省" 370881 county="曲阜市" prefecture="济宁市" province="山东省" 370882 county="兖州市" prefecture="济宁市" province="山东省" 370883 county="邹城市" prefecture="济宁市" province="山东省" 370901 county="市辖区" prefecture="泰安市" province="山东省" 370902 county="泰山区" prefecture="泰安市" province="山东省" 370903 county="岱岳区" prefecture="泰安市" province="山东省" 370911 county="岱岳区" prefecture="泰安市" province="山东省" 370921 county="宁阳县" prefecture="泰安市" province="山东省" 370923 county="东平县" prefecture="泰安市" province="山东省" 370982 county="新泰市" prefecture="泰安市" province="山东省" 370983 county="肥城市" prefecture="泰安市" province="山东省" 371001 county="市辖区" prefecture="威海市" province="山东省" 371002 county="环翠区" prefecture="威海市" province="山东省" 371003 county="文登区" prefecture="威海市" province="山东省" 371081 county="文登市" prefecture="威海市" province="山东省" 371082 county="荣成市" prefecture="威海市" province="山东省" 371083 county="乳山市" prefecture="威海市" province="山东省" 371101 county="市辖区" prefecture="日照市" province="山东省" 371102 county="东港区" prefecture="日照市" province="山东省" 371103 county="岚山区" prefecture="日照市" province="山东省" 371121 county="五莲县" prefecture="日照市" province="山东省" 371122 county="莒县" prefecture="日照市" province="山东省" 371201 county="市辖区" prefecture="莱芜市" province="山东省" 371202 county="莱城区" prefecture="莱芜市" province="山东省" 371203 county="钢城区" prefecture="莱芜市" province="山东省" 371301 county="市辖区" prefecture="临沂市" province="山东省" 371302 county="兰山区" prefecture="临沂市" province="山东省" 371311 county="罗庄区" prefecture="临沂市" province="山东省" 371312 county="河东区" prefecture="临沂市" province="山东省" 371321 county="沂南县" prefecture="临沂市" province="山东省" 371322 county="郯城县" prefecture="临沂市" province="山东省" 371323 county="沂水县" prefecture="临沂市" province="山东省" 371324 county="兰陵县" prefecture="临沂市" province="山东省" 371325 county="费县" prefecture="临沂市" province="山东省" 371326 county="平邑县" prefecture="临沂市" province="山东省" 371327 county="莒南县" prefecture="临沂市" province="山东省" 371328 county="蒙阴县" prefecture="临沂市" province="山东省" 371329 county="临沭县" prefecture="临沂市" province="山东省" 371401 county="市辖区" prefecture="德州市" province="山东省" 371402 county="德城区" prefecture="德州市" province="山东省" 371403 county="陵城区" prefecture="德州市" province="山东省" 371421 county="陵县" prefecture="德州市" province="山东省" 371422 county="宁津县" prefecture="德州市" province="山东省" 371423 county="庆云县" prefecture="德州市" province="山东省" 371424 county="临邑县" prefecture="德州市" province="山东省" 371425 county="齐河县" prefecture="德州市" province="山东省" 371426 county="平原县" prefecture="德州市" province="山东省" 371427 county="夏津县" prefecture="德州市" province="山东省" 371428 county="武城县" prefecture="德州市" province="山东省" 371481 county="乐陵市" prefecture="德州市" province="山东省" 371482 county="禹城市" prefecture="德州市" province="山东省" 371501 county="市辖区" prefecture="聊城市" province="山东省" 371502 county="东昌府区" prefecture="聊城市" province="山东省" 371521 county="阳谷县" prefecture="聊城市" province="山东省" 371522 county="莘县" prefecture="聊城市" province="山东省" 371523 county="茌平县" prefecture="聊城市" province="山东省" 371524 county="东阿县" prefecture="聊城市" province="山东省" 371525 county="冠县" prefecture="聊城市" province="山东省" 371526 county="高唐县" prefecture="聊城市" province="山东省" 371581 county="临清市" prefecture="聊城市" province="山东省" 371601 county="市辖区" prefecture="滨州市" province="山东省" 371602 county="滨城区" prefecture="滨州市" province="山东省" 371603 county="沾化区" prefecture="滨州市" province="山东省" 371621 county="惠民县" prefecture="滨州市" province="山东省" 371622 county="阳信县" prefecture="滨州市" province="山东省" 371623 county="无棣县" prefecture="滨州市" province="山东省" 371624 county="沾化县" prefecture="滨州市" province="山东省" 371625 county="博兴县" prefecture="滨州市" province="山东省" 371626 county="邹平县" prefecture="滨州市" province="山东省" 371701 county="市辖区" prefecture="菏泽市" province="山东省" 371702 county="牡丹区" prefecture="菏泽市" province="山东省" 371721 county="曹县" prefecture="菏泽市" province="山东省" 371722 county="单县" prefecture="菏泽市" province="山东省" 371723 county="成武县" prefecture="菏泽市" province="山东省" 371724 county="巨野县" prefecture="菏泽市" province="山东省" 371725 county="郓城县" prefecture="菏泽市" province="山东省" 371726 county="鄄城县" prefecture="菏泽市" province="山东省" 371727 county="定陶县" prefecture="菏泽市" province="山东省" 371728 county="东明县" prefecture="菏泽市" province="山东省" 410101 county="市辖区" prefecture="郑州市" province="河南省" 410102 county="中原区" prefecture="郑州市" province="河南省" 410103 county="二七区" prefecture="郑州市" province="河南省" 410104 county="管城回族区" prefecture="郑州市" province="河南省" 410105 county="金水区" prefecture="郑州市" province="河南省" 410106 county="上街区" prefecture="郑州市" province="河南省" 410108 county="惠济区" prefecture="郑州市" province="河南省" 410122 county="中牟县" prefecture="郑州市" province="河南省" 410181 county="巩义市" prefecture="郑州市" province="河南省" 410182 county="荥阳市" prefecture="郑州市" province="河南省" 410183 county="新密市" prefecture="郑州市" province="河南省" 410184 county="新郑市" prefecture="郑州市" province="河南省" 410185 county="登封市" prefecture="郑州市" province="河南省" 410201 county="市辖区" prefecture="开封市" province="河南省" 410202 county="龙亭区" prefecture="开封市" province="河南省" 410203 county="顺河回族区" prefecture="开封市" province="河南省" 410204 county="鼓楼区" prefecture="开封市" province="河南省" 410205 county="禹王台区" prefecture="开封市" province="河南省" 410211 county="金明区" prefecture="开封市" province="河南省" 410221 county="杞县" prefecture="开封市" province="河南省" 410222 county="通许县" prefecture="开封市" province="河南省" 410223 county="尉氏县" prefecture="开封市" province="河南省" 410224 county="开封县" prefecture="开封市" province="河南省" 410225 county="兰考县" prefecture="开封市" province="河南省" 410301 county="市辖区" prefecture="洛阳市" province="河南省" 410302 county="老城区" prefecture="洛阳市" province="河南省" 410303 county="西工区" prefecture="洛阳市" province="河南省" 410304 county="瀍河回族区" prefecture="洛阳市" province="河南省" 410305 county="涧西区" prefecture="洛阳市" province="河南省" 410306 county="吉利区" prefecture="洛阳市" province="河南省" 410307 county="洛龙区" prefecture="洛阳市" province="河南省" 410311 county="洛龙区" prefecture="洛阳市" province="河南省" 410322 county="孟津县" prefecture="洛阳市" province="河南省" 410323 county="新安县" prefecture="洛阳市" province="河南省" 410324 county="栾川县" prefecture="洛阳市" province="河南省" 410325 county="嵩县" prefecture="洛阳市" province="河南省" 410326 county="汝阳县" prefecture="洛阳市" province="河南省" 410327 county="宜阳县" prefecture="洛阳市" province="河南省" 410328 county="洛宁县" prefecture="洛阳市" province="河南省" 410329 county="伊川县" prefecture="洛阳市" province="河南省" 410381 county="偃师市" prefecture="洛阳市" province="河南省" 410401 county="市辖区" prefecture="平顶山市" province="河南省" 410402 county="新华区" prefecture="平顶山市" province="河南省" 410403 county="卫东区" prefecture="平顶山市" province="河南省" 410404 county="石龙区" prefecture="平顶山市" province="河南省" 410411 county="湛河区" prefecture="平顶山市" province="河南省" 410421 county="宝丰县" prefecture="平顶山市" province="河南省" 410422 county="叶县" prefecture="平顶山市" province="河南省" 410423 county="鲁山县" prefecture="平顶山市" province="河南省" 410425 county="郏县" prefecture="平顶山市" province="河南省" 410481 county="舞钢市" prefecture="平顶山市" province="河南省" 410482 county="汝州市" prefecture="平顶山市" province="河南省" 410501 county="市辖区" prefecture="安阳市" province="河南省" 410502 county="文峰区" prefecture="安阳市" province="河南省" 410503 county="北关区" prefecture="安阳市" province="河南省" 410505 county="殷都区" prefecture="安阳市" province="河南省" 410506 county="龙安区" prefecture="安阳市" province="河南省" 410522 county="安阳县" prefecture="安阳市" province="河南省" 410523 county="汤阴县" prefecture="安阳市" province="河南省" 410526 county="滑县" prefecture="安阳市" province="河南省" 410527 county="内黄县" prefecture="安阳市" province="河南省" 410581 county="林州市" prefecture="安阳市" province="河南省" 410601 county="市辖区" prefecture="鹤壁市" province="河南省" 410602 county="鹤山区" prefecture="鹤壁市" province="河南省" 410603 county="山城区" prefecture="鹤壁市" province="河南省" 410611 county="淇滨区" prefecture="鹤壁市" province="河南省" 410621 county="浚县" prefecture="鹤壁市" province="河南省" 410622 county="淇县" prefecture="鹤壁市" province="河南省" 410701 county="市辖区" prefecture="新乡市" province="河南省" 410702 county="红旗区" prefecture="新乡市" province="河南省" 410703 county="卫滨区" prefecture="新乡市" province="河南省" 410704 county="凤泉区" prefecture="新乡市" province="河南省" 410711 county="牧野区" prefecture="新乡市" province="河南省" 410721 county="新乡县" prefecture="新乡市" province="河南省" 410724 county="获嘉县" prefecture="新乡市" province="河南省" 410725 county="原阳县" prefecture="新乡市" province="河南省" 410726 county="延津县" prefecture="新乡市" province="河南省" 410727 county="封丘县" prefecture="新乡市" province="河南省" 410728 county="长垣县" prefecture="新乡市" province="河南省" 410781 county="卫辉市" prefecture="新乡市" province="河南省" 410782 county="辉县市" prefecture="新乡市" province="河南省" 410801 county="市辖区" prefecture="焦作市" province="河南省" 410802 county="解放区" prefecture="焦作市" province="河南省" 410803 county="中站区" prefecture="焦作市" province="河南省" 410804 county="马村区" prefecture="焦作市" province="河南省" 410811 county="山阳区" prefecture="焦作市" province="河南省" 410821 county="修武县" prefecture="焦作市" province="河南省" 410822 county="博爱县" prefecture="焦作市" province="河南省" 410823 county="武陟县" prefecture="焦作市" province="河南省" 410825 county="温县" prefecture="焦作市" province="河南省" 410881 county="济源市" prefecture="焦作市" province="河南省" 410882 county="沁阳市" prefecture="焦作市" province="河南省" 410883 county="孟州市" prefecture="焦作市" province="河南省" 410901 county="市辖区" prefecture="濮阳市" province="河南省" 410902 county="华龙区" prefecture="濮阳市" province="河南省" 410922 county="清丰县" prefecture="濮阳市" province="河南省" 410923 county="南乐县" prefecture="濮阳市" province="河南省" 410926 county="范县" prefecture="濮阳市" province="河南省" 410927 county="台前县" prefecture="濮阳市" province="河南省" 410928 county="濮阳县" prefecture="濮阳市" province="河南省" 411001 county="市辖区" prefecture="许昌市" province="河南省" 411002 county="魏都区" prefecture="许昌市" province="河南省" 411023 county="许昌县" prefecture="许昌市" province="河南省" 411024 county="鄢陵县" prefecture="许昌市" province="河南省" 411025 county="襄城县" prefecture="许昌市" province="河南省" 411081 county="禹州市" prefecture="许昌市" province="河南省" 411082 county="长葛市" prefecture="许昌市" province="河南省" 411101 county="市辖区" prefecture="漯河市" province="河南省" 411102 county="源汇区" prefecture="漯河市" province="河南省" 411103 county="郾城区" prefecture="漯河市" province="河南省" 411104 county="召陵区" prefecture="漯河市" province="河南省" 411121 county="舞阳县" prefecture="漯河市" province="河南省" 411122 county="临颍县" prefecture="漯河市" province="河南省" 411123 county="郾城县" prefecture="漯河市" province="河南省" 411201 county="市辖区" prefecture="三门峡市" province="河南省" 411202 county="湖滨区" prefecture="三门峡市" province="河南省" 411221 county="渑池县" prefecture="三门峡市" province="河南省" 411222 county="陕县" prefecture="三门峡市" province="河南省" 411224 county="卢氏县" prefecture="三门峡市" province="河南省" 411281 county="义马市" prefecture="三门峡市" province="河南省" 411282 county="灵宝市" prefecture="三门峡市" province="河南省" 411301 county="市辖区" prefecture="南阳市" province="河南省" 411302 county="宛城区" prefecture="南阳市" province="河南省" 411303 county="卧龙区" prefecture="南阳市" province="河南省" 411321 county="南召县" prefecture="南阳市" province="河南省" 411322 county="方城县" prefecture="南阳市" province="河南省" 411323 county="西峡县" prefecture="南阳市" province="河南省" 411324 county="镇平县" prefecture="南阳市" province="河南省" 411325 county="内乡县" prefecture="南阳市" province="河南省" 411326 county="淅川县" prefecture="南阳市" province="河南省" 411327 county="社旗县" prefecture="南阳市" province="河南省" 411328 county="唐河县" prefecture="南阳市" province="河南省" 411329 county="新野县" prefecture="南阳市" province="河南省" 411330 county="桐柏县" prefecture="南阳市" province="河南省" 411381 county="邓州市" prefecture="南阳市" province="河南省" 411401 county="市辖区" prefecture="商丘市" province="河南省" 411402 county="梁园区" prefecture="商丘市" province="河南省" 411403 county="睢阳区" prefecture="商丘市" province="河南省" 411421 county="民权县" prefecture="商丘市" province="河南省" 411422 county="睢县" prefecture="商丘市" province="河南省" 411423 county="宁陵县" prefecture="商丘市" province="河南省" 411424 county="柘城县" prefecture="商丘市" province="河南省" 411425 county="虞城县" prefecture="商丘市" province="河南省" 411426 county="夏邑县" prefecture="商丘市" province="河南省" 411481 county="永城市" prefecture="商丘市" province="河南省" 411501 county="市辖区" prefecture="信阳市" province="河南省" 411502 county="浉河区" prefecture="信阳市" province="河南省" 411503 county="平桥区" prefecture="信阳市" province="河南省" 411521 county="罗山县" prefecture="信阳市" province="河南省" 411522 county="光山县" prefecture="信阳市" province="河南省" 411523 county="新县" prefecture="信阳市" province="河南省" 411524 county="商城县" prefecture="信阳市" province="河南省" 411525 county="固始县" prefecture="信阳市" province="河南省" 411526 county="潢川县" prefecture="信阳市" province="河南省" 411527 county="淮滨县" prefecture="信阳市" province="河南省" 411528 county="息县" prefecture="信阳市" province="河南省" 411601 county="市辖区" prefecture="周口市" province="河南省" 411602 county="川汇区" prefecture="周口市" province="河南省" 411621 county="扶沟县" prefecture="周口市" province="河南省" 411622 county="西华县" prefecture="周口市" province="河南省" 411623 county="商水县" prefecture="周口市" province="河南省" 411624 county="沈丘县" prefecture="周口市" province="河南省" 411625 county="郸城县" prefecture="周口市" province="河南省" 411626 county="淮阳县" prefecture="周口市" province="河南省" 411627 county="太康县" prefecture="周口市" province="河南省" 411628 county="鹿邑县" prefecture="周口市" province="河南省" 411681 county="项城市" prefecture="周口市" province="河南省" 411701 county="市辖区" prefecture="驻马店市" province="河南省" 411702 county="驿城区" prefecture="驻马店市" province="河南省" 411721 county="西平县" prefecture="驻马店市" province="河南省" 411722 county="上蔡县" prefecture="驻马店市" province="河南省" 411723 county="平舆县" prefecture="驻马店市" province="河南省" 411724 county="正阳县" prefecture="驻马店市" province="河南省" 411725 county="确山县" prefecture="驻马店市" province="河南省" 411726 county="泌阳县" prefecture="驻马店市" province="河南省" 411727 county="汝南县" prefecture="驻马店市" province="河南省" 411728 county="遂平县" prefecture="驻马店市" province="河南省" 411729 county="新蔡县" prefecture="驻马店市" province="河南省" 419001 county="济源市" prefecture="省直辖县级行政区划" province="河南省" 420101 county="市辖区" prefecture="武汉市" province="湖北省" 420102 county="江岸区" prefecture="武汉市" province="湖北省" 420103 county="江汉区" prefecture="武汉市" province="湖北省" 420104 county="硚口区" prefecture="武汉市" province="湖北省" 420105 county="汉阳区" prefecture="武汉市" province="湖北省" 420106 county="武昌区" prefecture="武汉市" province="湖北省" 420107 county="青山区" prefecture="武汉市" province="湖北省" 420111 county="洪山区" prefecture="武汉市" province="湖北省" 420112 county="东西湖区" prefecture="武汉市" province="湖北省" 420113 county="汉南区" prefecture="武汉市" province="湖北省" 420114 county="蔡甸区" prefecture="武汉市" province="湖北省" 420115 county="江夏区" prefecture="武汉市" province="湖北省" 420116 county="黄陂区" prefecture="武汉市" province="湖北省" 420117 county="新洲区" prefecture="武汉市" province="湖北省" 420201 county="市辖区" prefecture="黄石市" province="湖北省" 420202 county="黄石港区" prefecture="黄石市" province="湖北省" 420203 county="西塞山区" prefecture="黄石市" province="湖北省" 420204 county="下陆区" prefecture="黄石市" province="湖北省" 420205 county="铁山区" prefecture="黄石市" province="湖北省" 420222 county="阳新县" prefecture="黄石市" province="湖北省" 420281 county="大冶市" prefecture="黄石市" province="湖北省" 420301 county="市辖区" prefecture="十堰市" province="湖北省" 420302 county="茅箭区" prefecture="十堰市" province="湖北省" 420303 county="张湾区" prefecture="十堰市" province="湖北省" 420304 county="郧阳区" prefecture="十堰市" province="湖北省" 420321 county="郧县" prefecture="十堰市" province="湖北省" 420322 county="郧西县" prefecture="十堰市" province="湖北省" 420323 county="竹山县" prefecture="十堰市" province="湖北省" 420324 county="竹溪县" prefecture="十堰市" province="湖北省" 420325 county="房县" prefecture="十堰市" province="湖北省" 420381 county="丹江口市" prefecture="十堰市" province="湖北省" 420501 county="市辖区" prefecture="宜昌市" province="湖北省" 420502 county="西陵区" prefecture="宜昌市" province="湖北省" 420503 county="伍家岗区" prefecture="宜昌市" province="湖北省" 420504 county="点军区" prefecture="宜昌市" province="湖北省" 420505 county="猇亭区" prefecture="宜昌市" province="湖北省" 420506 county="夷陵区" prefecture="宜昌市" province="湖北省" 420525 county="远安县" prefecture="宜昌市" province="湖北省" 420526 county="兴山县" prefecture="宜昌市" province="湖北省" 420527 county="秭归县" prefecture="宜昌市" province="湖北省" 420528 county="长阳土家族自治县" prefecture="宜昌市" province="湖北省" 420529 county="五峰土家族自治县" prefecture="宜昌市" province="湖北省" 420581 county="宜都市" prefecture="宜昌市" province="湖北省" 420582 county="当阳市" prefecture="宜昌市" province="湖北省" 420583 county="枝江市" prefecture="宜昌市" province="湖北省" 420601 county="市辖区" prefecture="襄阳市" province="湖北省" 420602 county="襄城区" prefecture="襄阳市" province="湖北省" 420606 county="樊城区" prefecture="襄阳市" province="湖北省" 420607 county="襄州区" prefecture="襄阳市" province="湖北省" 420624 county="南漳县" prefecture="襄阳市" province="湖北省" 420625 county="谷城县" prefecture="襄阳市" province="湖北省" 420626 county="保康县" prefecture="襄阳市" province="湖北省" 420682 county="老河口市" prefecture="襄阳市" province="湖北省" 420683 county="枣阳市" prefecture="襄阳市" province="湖北省" 420684 county="宜城市" prefecture="襄阳市" province="湖北省" 420701 county="市辖区" prefecture="鄂州市" province="湖北省" 420702 county="梁子湖区" prefecture="鄂州市" province="湖北省" 420703 county="华容区" prefecture="鄂州市" province="湖北省" 420704 county="鄂城区" prefecture="鄂州市" province="湖北省" 420801 county="市辖区" prefecture="荆门市" province="湖北省" 420802 county="东宝区" prefecture="荆门市" province="湖北省" 420804 county="掇刀区" prefecture="荆门市" province="湖北省" 420821 county="京山县" prefecture="荆门市" province="湖北省" 420822 county="沙洋县" prefecture="荆门市" province="湖北省" 420881 county="钟祥市" prefecture="荆门市" province="湖北省" 420901 county="市辖区" prefecture="孝感市" province="湖北省" 420902 county="孝南区" prefecture="孝感市" province="湖北省" 420921 county="孝昌县" prefecture="孝感市" province="湖北省" 420922 county="大悟县" prefecture="孝感市" province="湖北省" 420923 county="云梦县" prefecture="孝感市" province="湖北省" 420981 county="应城市" prefecture="孝感市" province="湖北省" 420982 county="安陆市" prefecture="孝感市" province="湖北省" 420984 county="汉川市" prefecture="孝感市" province="湖北省" 421001 county="市辖区" prefecture="荆州市" province="湖北省" 421002 county="沙市区" prefecture="荆州市" province="湖北省" 421003 county="荆州区" prefecture="荆州市" province="湖北省" 421022 county="公安县" prefecture="荆州市" province="湖北省" 421023 county="监利县" prefecture="荆州市" province="湖北省" 421024 county="江陵县" prefecture="荆州市" province="湖北省" 421081 county="石首市" prefecture="荆州市" province="湖北省" 421083 county="洪湖市" prefecture="荆州市" province="湖北省" 421087 county="松滋市" prefecture="荆州市" province="湖北省" 421101 county="市辖区" prefecture="黄冈市" province="湖北省" 421102 county="黄州区" prefecture="黄冈市" province="湖北省" 421121 county="团风县" prefecture="黄冈市" province="湖北省" 421122 county="红安县" prefecture="黄冈市" province="湖北省" 421123 county="罗田县" prefecture="黄冈市" province="湖北省" 421124 county="英山县" prefecture="黄冈市" province="湖北省" 421125 county="浠水县" prefecture="黄冈市" province="湖北省" 421126 county="蕲春县" prefecture="黄冈市" province="湖北省" 421127 county="黄梅县" prefecture="黄冈市" province="湖北省" 421181 county="麻城市" prefecture="黄冈市" province="湖北省" 421182 county="武穴市" prefecture="黄冈市" province="湖北省" 421201 county="市辖区" prefecture="咸宁市" province="湖北省" 421202 county="咸安区" prefecture="咸宁市" province="湖北省" 421221 county="嘉鱼县" prefecture="咸宁市" province="湖北省" 421222 county="通城县" prefecture="咸宁市" province="湖北省" 421223 county="崇阳县" prefecture="咸宁市" province="湖北省" 421224 county="通山县" prefecture="咸宁市" province="湖北省" 421281 county="赤壁市" prefecture="咸宁市" province="湖北省" 421301 county="市辖区" prefecture="随州市" province="湖北省" 421302 county="曾都区" prefecture="随州市" province="湖北省" 421303 county="曾都区" prefecture="随州市" province="湖北省" 421321 county="随县" prefecture="随州市" province="湖北省" 421381 county="广水市" prefecture="随州市" province="湖北省" 422801 county="恩施市" prefecture="恩施土家族苗族自治州" province="湖北省" 422802 county="利川市" prefecture="恩施土家族苗族自治州" province="湖北省" 422822 county="建始县" prefecture="恩施土家族苗族自治州" province="湖北省" 422823 county="巴东县" prefecture="恩施土家族苗族自治州" province="湖北省" 422825 county="宣恩县" prefecture="恩施土家族苗族自治州" province="湖北省" 422826 county="咸丰县" prefecture="恩施土家族苗族自治州" province="湖北省" 422827 county="来凤县" prefecture="恩施土家族苗族自治州" province="湖北省" 422828 county="鹤峰县" prefecture="恩施土家族苗族自治州" province="湖北省" 429004 county="仙桃市" prefecture="省直辖县级行政区划" province="湖北省" 429005 county="潜江市" prefecture="省直辖县级行政区划" province="湖北省" 429006 county="天门市" prefecture="省直辖县级行政区划" province="湖北省" 429021 county="神农架林区" prefecture="省直辖县级行政区划" province="湖北省" 430101 county="市辖区" prefecture="长沙市" province="湖南省" 430102 county="芙蓉区" prefecture="长沙市" province="湖南省" 430103 county="天心区" prefecture="长沙市" province="湖南省" 430104 county="岳麓区" prefecture="长沙市" province="湖南省" 430105 county="开福区" prefecture="长沙市" province="湖南省" 430111 county="雨花区" prefecture="长沙市" province="湖南省" 430112 county="望城区" prefecture="长沙市" province="湖南省" 430121 county="长沙县" prefecture="长沙市" province="湖南省" 430122 county="望城县" prefecture="长沙市" province="湖南省" 430124 county="宁乡县" prefecture="长沙市" province="湖南省" 430181 county="浏阳市" prefecture="长沙市" province="湖南省" 430201 county="市辖区" prefecture="株洲市" province="湖南省" 430202 county="荷塘区" prefecture="株洲市" province="湖南省" 430203 county="芦淞区" prefecture="株洲市" province="湖南省" 430204 county="石峰区" prefecture="株洲市" province="湖南省" 430211 county="天元区" prefecture="株洲市" province="湖南省" 430221 county="株洲县" prefecture="株洲市" province="湖南省" 430223 county="攸县" prefecture="株洲市" province="湖南省" 430224 county="茶陵县" prefecture="株洲市" province="湖南省" 430225 county="炎陵县" prefecture="株洲市" province="湖南省" 430281 county="醴陵市" prefecture="株洲市" province="湖南省" 430301 county="市辖区" prefecture="湘潭市" province="湖南省" 430302 county="雨湖区" prefecture="湘潭市" province="湖南省" 430304 county="岳塘区" prefecture="湘潭市" province="湖南省" 430321 county="湘潭县" prefecture="湘潭市" province="湖南省" 430381 county="湘乡市" prefecture="湘潭市" province="湖南省" 430382 county="韶山市" prefecture="湘潭市" province="湖南省" 430401 county="市辖区" prefecture="衡阳市" province="湖南省" 430405 county="珠晖区" prefecture="衡阳市" province="湖南省" 430406 county="雁峰区" prefecture="衡阳市" province="湖南省" 430407 county="石鼓区" prefecture="衡阳市" province="湖南省" 430408 county="蒸湘区" prefecture="衡阳市" province="湖南省" 430412 county="南岳区" prefecture="衡阳市" province="湖南省" 430421 county="衡阳县" prefecture="衡阳市" province="湖南省" 430422 county="衡南县" prefecture="衡阳市" province="湖南省" 430423 county="衡山县" prefecture="衡阳市" province="湖南省" 430424 county="衡东县" prefecture="衡阳市" province="湖南省" 430426 county="祁东县" prefecture="衡阳市" province="湖南省" 430481 county="耒阳市" prefecture="衡阳市" province="湖南省" 430482 county="常宁市" prefecture="衡阳市" province="湖南省" 430501 county="市辖区" prefecture="邵阳市" province="湖南省" 430502 county="双清区" prefecture="邵阳市" province="湖南省" 430503 county="大祥区" prefecture="邵阳市" province="湖南省" 430511 county="北塔区" prefecture="邵阳市" province="湖南省" 430521 county="邵东县" prefecture="邵阳市" province="湖南省" 430522 county="新邵县" prefecture="邵阳市" province="湖南省" 430523 county="邵阳县" prefecture="邵阳市" province="湖南省" 430524 county="隆回县" prefecture="邵阳市" province="湖南省" 430525 county="洞口县" prefecture="邵阳市" province="湖南省" 430527 county="绥宁县" prefecture="邵阳市" province="湖南省" 430528 county="新宁县" prefecture="邵阳市" province="湖南省" 430529 county="城步苗族自治县" prefecture="邵阳市" province="湖南省" 430581 county="武冈市" prefecture="邵阳市" province="湖南省" 430601 county="市辖区" prefecture="岳阳市" province="湖南省" 430602 county="岳阳楼区" prefecture="岳阳市" province="湖南省" 430603 county="云溪区" prefecture="岳阳市" province="湖南省" 430611 county="君山区" prefecture="岳阳市" province="湖南省" 430621 county="岳阳县" prefecture="岳阳市" province="湖南省" 430623 county="华容县" prefecture="岳阳市" province="湖南省" 430624 county="湘阴县" prefecture="岳阳市" province="湖南省" 430626 county="平江县" prefecture="岳阳市" province="湖南省" 430681 county="汨罗市" prefecture="岳阳市" province="湖南省" 430682 county="临湘市" prefecture="岳阳市" province="湖南省" 430701 county="市辖区" prefecture="常德市" province="湖南省" 430702 county="武陵区" prefecture="常德市" province="湖南省" 430703 county="鼎城区" prefecture="常德市" province="湖南省" 430721 county="安乡县" prefecture="常德市" province="湖南省" 430722 county="汉寿县" prefecture="常德市" province="湖南省" 430723 county="澧县" prefecture="常德市" province="湖南省" 430724 county="临澧县" prefecture="常德市" province="湖南省" 430725 county="桃源县" prefecture="常德市" province="湖南省" 430726 county="石门县" prefecture="常德市" province="湖南省" 430781 county="津市市" prefecture="常德市" province="湖南省" 430801 county="市辖区" prefecture="张家界市" province="湖南省" 430802 county="永定区" prefecture="张家界市" province="湖南省" 430811 county="武陵源区" prefecture="张家界市" province="湖南省" 430821 county="慈利县" prefecture="张家界市" province="湖南省" 430822 county="桑植县" prefecture="张家界市" province="湖南省" 430901 county="市辖区" prefecture="益阳市" province="湖南省" 430902 county="资阳区" prefecture="益阳市" province="湖南省" 430903 county="赫山区" prefecture="益阳市" province="湖南省" 430921 county="南县" prefecture="益阳市" province="湖南省" 430922 county="桃江县" prefecture="益阳市" province="湖南省" 430923 county="安化县" prefecture="益阳市" province="湖南省" 430981 county="沅江市" prefecture="益阳市" province="湖南省" 431001 county="市辖区" prefecture="郴州市" province="湖南省" 431002 county="北湖区" prefecture="郴州市" province="湖南省" 431003 county="苏仙区" prefecture="郴州市" province="湖南省" 431021 county="桂阳县" prefecture="郴州市" province="湖南省" 431022 county="宜章县" prefecture="郴州市" province="湖南省" 431023 county="永兴县" prefecture="郴州市" province="湖南省" 431024 county="嘉禾县" prefecture="郴州市" province="湖南省" 431025 county="临武县" prefecture="郴州市" province="湖南省" 431026 county="汝城县" prefecture="郴州市" province="湖南省" 431027 county="桂东县" prefecture="郴州市" province="湖南省" 431028 county="安仁县" prefecture="郴州市" province="湖南省" 431081 county="资兴市" prefecture="郴州市" province="湖南省" 431101 county="市辖区" prefecture="永州市" province="湖南省" 431102 county="零陵区" prefecture="永州市" province="湖南省" 431103 county="冷水滩区" prefecture="永州市" province="湖南省" 431121 county="祁阳县" prefecture="永州市" province="湖南省" 431122 county="东安县" prefecture="永州市" province="湖南省" 431123 county="双牌县" prefecture="永州市" province="湖南省" 431124 county="道县" prefecture="永州市" province="湖南省" 431125 county="江永县" prefecture="永州市" province="湖南省" 431126 county="宁远县" prefecture="永州市" province="湖南省" 431127 county="蓝山县" prefecture="永州市" province="湖南省" 431128 county="新田县" prefecture="永州市" province="湖南省" 431129 county="江华瑶族自治县" prefecture="永州市" province="湖南省" 431201 county="市辖区" prefecture="怀化市" province="湖南省" 431202 county="鹤城区" prefecture="怀化市" province="湖南省" 431221 county="中方县" prefecture="怀化市" province="湖南省" 431222 county="沅陵县" prefecture="怀化市" province="湖南省" 431223 county="辰溪县" prefecture="怀化市" province="湖南省" 431224 county="溆浦县" prefecture="怀化市" province="湖南省" 431225 county="会同县" prefecture="怀化市" province="湖南省" 431226 county="麻阳苗族自治县" prefecture="怀化市" province="湖南省" 431227 county="新晃侗族自治县" prefecture="怀化市" province="湖南省" 431228 county="芷江侗族自治县" prefecture="怀化市" province="湖南省" 431229 county="靖州苗族侗族自治县" prefecture="怀化市" province="湖南省" 431230 county="通道侗族自治县" prefecture="怀化市" province="湖南省" 431281 county="洪江市" prefecture="怀化市" province="湖南省" 431301 county="市辖区" prefecture="娄底市" province="湖南省" 431302 county="娄星区" prefecture="娄底市" province="湖南省" 431321 county="双峰县" prefecture="娄底市" province="湖南省" 431322 county="新化县" prefecture="娄底市" province="湖南省" 431381 county="冷水江市" prefecture="娄底市" province="湖南省" 431382 county="涟源市" prefecture="娄底市" province="湖南省" 433101 county="吉首市" prefecture="湘西土家族苗族自治州" province="湖南省" 433122 county="泸溪县" prefecture="湘西土家族苗族自治州" province="湖南省" 433123 county="凤凰县" prefecture="湘西土家族苗族自治州" province="湖南省" 433124 county="花垣县" prefecture="湘西土家族苗族自治州" province="湖南省" 433125 county="保靖县" prefecture="湘西土家族苗族自治州" province="湖南省" 433126 county="古丈县" prefecture="湘西土家族苗族自治州" province="湖南省" 433127 county="永顺县" prefecture="湘西土家族苗族自治州" province="湖南省" 433130 county="龙山县" prefecture="湘西土家族苗族自治州" province="湖南省" 440101 county="市辖区" prefecture="广州市" province="广东省" 440102 county="东山区" prefecture="广州市" province="广东省" 440103 county="荔湾区" prefecture="广州市" province="广东省" 440104 county="越秀区" prefecture="广州市" province="广东省" 440105 county="海珠区" prefecture="广州市" province="广东省" 440106 county="天河区" prefecture="广州市" province="广东省" 440107 county="芳村区" prefecture="广州市" province="广东省" 440111 county="白云区" prefecture="广州市" province="广东省" 440112 county="黄埔区" prefecture="广州市" province="广东省" 440113 county="番禺区" prefecture="广州市" province="广东省" 440114 county="花都区" prefecture="广州市" province="广东省" 440115 county="南沙区" prefecture="广州市" province="广东省" 440116 county="萝岗区" prefecture="广州市" province="广东省" 440117 county="从化区" prefecture="广州市" province="广东省" 440118 county="增城区" prefecture="广州市" province="广东省" 440183 county="增城市" prefecture="广州市" province="广东省" 440184 county="从化市" prefecture="广州市" province="广东省" 440201 county="市辖区" prefecture="韶关市" province="广东省" 440202 county="北江区" prefecture="韶关市" province="广东省" 440203 county="武江区" prefecture="韶关市" province="广东省" 440204 county="浈江区" prefecture="韶关市" province="广东省" 440205 county="曲江区" prefecture="韶关市" province="广东省" 440221 county="曲江县" prefecture="韶关市" province="广东省" 440222 county="始兴县" prefecture="韶关市" province="广东省" 440224 county="仁化县" prefecture="韶关市" province="广东省" 440229 county="翁源县" prefecture="韶关市" province="广东省" 440232 county="乳源瑶族自治县" prefecture="韶关市" province="广东省" 440233 county="新丰县" prefecture="韶关市" province="广东省" 440281 county="乐昌市" prefecture="韶关市" province="广东省" 440282 county="南雄市" prefecture="韶关市" province="广东省" 440301 county="市辖区" prefecture="深圳市" province="广东省" 440303 county="罗湖区" prefecture="深圳市" province="广东省" 440304 county="福田区" prefecture="深圳市" province="广东省" 440305 county="南山区" prefecture="深圳市" province="广东省" 440306 county="宝安区" prefecture="深圳市" province="广东省" 440307 county="龙岗区" prefecture="深圳市" province="广东省" 440308 county="盐田区" prefecture="深圳市" province="广东省" 440401 county="市辖区" prefecture="珠海市" province="广东省" 440402 county="香洲区" prefecture="珠海市" province="广东省" 440403 county="斗门区" prefecture="珠海市" province="广东省" 440404 county="金湾区" prefecture="珠海市" province="广东省" 440501 county="市辖区" prefecture="汕头市" province="广东省" 440506 county="达濠区" prefecture="汕头市" province="广东省" 440507 county="龙湖区" prefecture="汕头市" province="广东省" 440508 county="金园区" prefecture="汕头市" province="广东省" 440509 county="升平区" prefecture="汕头市" province="广东省" 440510 county="河浦区" prefecture="汕头市" province="广东省" 440511 county="金平区" prefecture="汕头市" province="广东省" 440512 county="濠江区" prefecture="汕头市" province="广东省" 440513 county="潮阳区" prefecture="汕头市" province="广东省" 440514 county="潮南区" prefecture="汕头市" province="广东省" 440515 county="澄海区" prefecture="汕头市" province="广东省" 440523 county="南澳县" prefecture="汕头市" province="广东省" 440582 county="潮阳市" prefecture="汕头市" province="广东省" 440583 county="澄海市" prefecture="汕头市" province="广东省" 440601 county="市辖区" prefecture="佛山市" province="广东省" 440604 county="禅城区" prefecture="佛山市" province="广东省" 440605 county="南海区" prefecture="佛山市" province="广东省" 440606 county="顺德区" prefecture="佛山市" province="广东省" 440607 county="三水区" prefecture="佛山市" province="广东省" 440608 county="高明区" prefecture="佛山市" province="广东省" 440701 county="市辖区" prefecture="江门市" province="广东省" 440703 county="蓬江区" prefecture="江门市" province="广东省" 440704 county="江海区" prefecture="江门市" province="广东省" 440705 county="新会区" prefecture="江门市" province="广东省" 440781 county="台山市" prefecture="江门市" province="广东省" 440783 county="开平市" prefecture="江门市" province="广东省" 440784 county="鹤山市" prefecture="江门市" province="广东省" 440785 county="恩平市" prefecture="江门市" province="广东省" 440801 county="市辖区" prefecture="湛江市" province="广东省" 440802 county="赤坎区" prefecture="湛江市" province="广东省" 440803 county="霞山区" prefecture="湛江市" province="广东省" 440804 county="坡头区" prefecture="湛江市" province="广东省" 440811 county="麻章区" prefecture="湛江市" province="广东省" 440823 county="遂溪县" prefecture="湛江市" province="广东省" 440825 county="徐闻县" prefecture="湛江市" province="广东省" 440881 county="廉江市" prefecture="湛江市" province="广东省" 440882 county="雷州市" prefecture="湛江市" province="广东省" 440883 county="吴川市" prefecture="湛江市" province="广东省" 440901 county="市辖区" prefecture="茂名市" province="广东省" 440902 county="茂南区" prefecture="茂名市" province="广东省" 440903 county="茂港区" prefecture="茂名市" province="广东省" 440904 county="电白区" prefecture="茂名市" province="广东省" 440923 county="电白县" prefecture="茂名市" province="广东省" 440981 county="高州市" prefecture="茂名市" province="广东省" 440982 county="化州市" prefecture="茂名市" province="广东省" 440983 county="信宜市" prefecture="茂名市" province="广东省" 441201 county="市辖区" prefecture="肇庆市" province="广东省" 441202 county="端州区" prefecture="肇庆市" province="广东省" 441203 county="鼎湖区" prefecture="肇庆市" province="广东省" 441223 county="广宁县" prefecture="肇庆市" province="广东省" 441224 county="怀集县" prefecture="肇庆市" province="广东省" 441225 county="封开县" prefecture="肇庆市" province="广东省" 441226 county="德庆县" prefecture="肇庆市" province="广东省" 441283 county="高要市" prefecture="肇庆市" province="广东省" 441284 county="四会市" prefecture="肇庆市" province="广东省" 441301 county="市辖区" prefecture="惠州市" province="广东省" 441302 county="惠城区" prefecture="惠州市" province="广东省" 441303 county="惠阳区" prefecture="惠州市" province="广东省" 441322 county="博罗县" prefecture="惠州市" province="广东省" 441323 county="惠东县" prefecture="惠州市" province="广东省" 441324 county="龙门县" prefecture="惠州市" province="广东省" 441381 county="惠阳市" prefecture="惠州市" province="广东省" 441401 county="市辖区" prefecture="梅州市" province="广东省" 441402 county="梅江区" prefecture="梅州市" province="广东省" 441403 county="梅县区" prefecture="梅州市" province="广东省" 441421 county="梅县" prefecture="梅州市" province="广东省" 441422 county="大埔县" prefecture="梅州市" province="广东省" 441423 county="丰顺县" prefecture="梅州市" province="广东省" 441424 county="五华县" prefecture="梅州市" province="广东省" 441426 county="平远县" prefecture="梅州市" province="广东省" 441427 county="蕉岭县" prefecture="梅州市" province="广东省" 441481 county="兴宁市" prefecture="梅州市" province="广东省" 441501 county="市辖区" prefecture="汕尾市" province="广东省" 441502 county="城区" prefecture="汕尾市" province="广东省" 441521 county="海丰县" prefecture="汕尾市" province="广东省" 441523 county="陆河县" prefecture="汕尾市" province="广东省" 441581 county="陆丰市" prefecture="汕尾市" province="广东省" 441601 county="市辖区" prefecture="河源市" province="广东省" 441602 county="源城区" prefecture="河源市" province="广东省" 441621 county="紫金县" prefecture="河源市" province="广东省" 441622 county="龙川县" prefecture="河源市" province="广东省" 441623 county="连平县" prefecture="河源市" province="广东省" 441624 county="和平县" prefecture="河源市" province="广东省" 441625 county="东源县" prefecture="河源市" province="广东省" 441701 county="市辖区" prefecture="阳江市" province="广东省" 441702 county="江城区" prefecture="阳江市" province="广东省" 441721 county="阳西县" prefecture="阳江市" province="广东省" 441723 county="阳东县" prefecture="阳江市" province="广东省" 441781 county="阳春市" prefecture="阳江市" province="广东省" 441801 county="市辖区" prefecture="清远市" province="广东省" 441802 county="清城区" prefecture="清远市" province="广东省" 441803 county="清新区" prefecture="清远市" province="广东省" 441821 county="佛冈县" prefecture="清远市" province="广东省" 441823 county="阳山县" prefecture="清远市" province="广东省" 441825 county="连山壮族瑶族自治县" prefecture="清远市" province="广东省" 441826 county="连南瑶族自治县" prefecture="清远市" province="广东省" 441827 county="清新县" prefecture="清远市" province="广东省" 441881 county="英德市" prefecture="清远市" province="广东省" 441882 county="连州市" prefecture="清远市" province="广东省" 445101 county="市辖区" prefecture="潮州市" province="广东省" 445102 county="湘桥区" prefecture="潮州市" province="广东省" 445103 county="潮安区" prefecture="潮州市" province="广东省" 445121 county="潮安县" prefecture="潮州市" province="广东省" 445122 county="饶平县" prefecture="潮州市" province="广东省" 445201 county="市辖区" prefecture="揭阳市" province="广东省" 445202 county="榕城区" prefecture="揭阳市" province="广东省" 445203 county="揭东区" prefecture="揭阳市" province="广东省" 445221 county="揭东县" prefecture="揭阳市" province="广东省" 445222 county="揭西县" prefecture="揭阳市" province="广东省" 445224 county="惠来县" prefecture="揭阳市" province="广东省" 445281 county="普宁市" prefecture="揭阳市" province="广东省" 445301 county="市辖区" prefecture="云浮市" province="广东省" 445302 county="云城区" prefecture="云浮市" province="广东省" 445303 county="云安区" prefecture="云浮市" province="广东省" 445321 county="新兴县" prefecture="云浮市" province="广东省" 445322 county="郁南县" prefecture="云浮市" province="广东省" 445323 county="云安县" prefecture="云浮市" province="广东省" 445381 county="罗定市" prefecture="云浮市" province="广东省" 450101 county="市辖区" prefecture="南宁市" province="广西壮族自治区" 450102 county="兴宁区" prefecture="南宁市" province="广西壮族自治区" 450103 county="青秀区" prefecture="南宁市" province="广西壮族自治区" 450104 county="城北区" prefecture="南宁市" province="广西壮族自治区" 450105 county="江南区" prefecture="南宁市" province="广西壮族自治区" 450106 county="永新区" prefecture="南宁市" province="广西壮族自治区" 450107 county="西乡塘区" prefecture="南宁市" province="广西壮族自治区" 450108 county="良庆区" prefecture="南宁市" province="广西壮族自治区" 450109 county="邕宁区" prefecture="南宁市" province="广西壮族自治区" 450121 county="邕宁县" prefecture="南宁市" province="广西壮族自治区" 450122 county="武鸣县" prefecture="南宁市" province="广西壮族自治区" 450123 county="隆安县" prefecture="南宁市" province="广西壮族自治区" 450124 county="马山县" prefecture="南宁市" province="广西壮族自治区" 450125 county="上林县" prefecture="南宁市" province="广西壮族自治区" 450126 county="宾阳县" prefecture="南宁市" province="广西壮族自治区" 450127 county="横县" prefecture="南宁市" province="广西壮族自治区" 450201 county="市辖区" prefecture="柳州市" province="广西壮族自治区" 450202 county="城中区" prefecture="柳州市" province="广西壮族自治区" 450203 county="鱼峰区" prefecture="柳州市" province="广西壮族自治区" 450204 county="柳南区" prefecture="柳州市" province="广西壮族自治区" 450205 county="柳北区" prefecture="柳州市" province="广西壮族自治区" 450221 county="柳江县" prefecture="柳州市" province="广西壮族自治区" 450222 county="柳城县" prefecture="柳州市" province="广西壮族自治区" 450223 county="鹿寨县" prefecture="柳州市" province="广西壮族自治区" 450224 county="融安县" prefecture="柳州市" province="广西壮族自治区" 450225 county="融水苗族自治县" prefecture="柳州市" province="广西壮族自治区" 450226 county="三江侗族自治县" prefecture="柳州市" province="广西壮族自治区" 450301 county="市辖区" prefecture="桂林市" province="广西壮族自治区" 450302 county="秀峰区" prefecture="桂林市" province="广西壮族自治区" 450303 county="叠彩区" prefecture="桂林市" province="广西壮族自治区" 450304 county="象山区" prefecture="桂林市" province="广西壮族自治区" 450305 county="七星区" prefecture="桂林市" province="广西壮族自治区" 450311 county="雁山区" prefecture="桂林市" province="广西壮族自治区" 450312 county="临桂区" prefecture="桂林市" province="广西壮族自治区" 450321 county="阳朔县" prefecture="桂林市" province="广西壮族自治区" 450322 county="临桂县" prefecture="桂林市" province="广西壮族自治区" 450323 county="灵川县" prefecture="桂林市" province="广西壮族自治区" 450324 county="全州县" prefecture="桂林市" province="广西壮族自治区" 450325 county="兴安县" prefecture="桂林市" province="广西壮族自治区" 450326 county="永福县" prefecture="桂林市" province="广西壮族自治区" 450327 county="灌阳县" prefecture="桂林市" province="广西壮族自治区" 450328 county="龙胜各族自治县" prefecture="桂林市" province="广西壮族自治区" 450329 county="资源县" prefecture="桂林市" province="广西壮族自治区" 450330 county="平乐县" prefecture="桂林市" province="广西壮族自治区" 450331 county="荔浦县" prefecture="桂林市" province="广西壮族自治区" 450332 county="恭城瑶族自治县" prefecture="桂林市" province="广西壮族自治区" 450401 county="市辖区" prefecture="梧州市" province="广西壮族自治区" 450403 county="万秀区" prefecture="梧州市" province="广西壮族自治区" 450404 county="蝶山区" prefecture="梧州市" province="广西壮族自治区" 450405 county="长洲区" prefecture="梧州市" province="广西壮族自治区" 450406 county="龙圩区" prefecture="梧州市" province="广西壮族自治区" 450411 county="市郊区" prefecture="梧州市" province="广西壮族自治区" 450421 county="苍梧县" prefecture="梧州市" province="广西壮族自治区" 450422 county="藤县" prefecture="梧州市" province="广西壮族自治区" 450423 county="蒙山县" prefecture="梧州市" province="广西壮族自治区" 450481 county="岑溪市" prefecture="梧州市" province="广西壮族自治区" 450501 county="市辖区" prefecture="北海市" province="广西壮族自治区" 450502 county="海城区" prefecture="北海市" province="广西壮族自治区" 450503 county="银海区" prefecture="北海市" province="广西壮族自治区" 450512 county="铁山港区" prefecture="北海市" province="广西壮族自治区" 450521 county="合浦县" prefecture="北海市" province="广西壮族自治区" 450601 county="市辖区" prefecture="防城港市" province="广西壮族自治区" 450602 county="港口区" prefecture="防城港市" province="广西壮族自治区" 450603 county="防城区" prefecture="防城港市" province="广西壮族自治区" 450621 county="上思县" prefecture="防城港市" province="广西壮族自治区" 450681 county="东兴市" prefecture="防城港市" province="广西壮族自治区" 450701 county="市辖区" prefecture="钦州市" province="广西壮族自治区" 450702 county="钦南区" prefecture="钦州市" province="广西壮族自治区" 450703 county="钦北区" prefecture="钦州市" province="广西壮族自治区" 450721 county="灵山县" prefecture="钦州市" province="广西壮族自治区" 450722 county="浦北县" prefecture="钦州市" province="广西壮族自治区" 450801 county="市辖区" prefecture="贵港市" province="广西壮族自治区" 450802 county="港北区" prefecture="贵港市" province="广西壮族自治区" 450803 county="港南区" prefecture="贵港市" province="广西壮族自治区" 450804 county="覃塘区" prefecture="贵港市" province="广西壮族自治区" 450821 county="平南县" prefecture="贵港市" province="广西壮族自治区" 450881 county="桂平市" prefecture="贵港市" province="广西壮族自治区" 450901 county="市辖区" prefecture="玉林市" province="广西壮族自治区" 450902 county="玉州区" prefecture="玉林市" province="广西壮族自治区" 450903 county="福绵区" prefecture="玉林市" province="广西壮族自治区" 450921 county="容县" prefecture="玉林市" province="广西壮族自治区" 450922 county="陆川县" prefecture="玉林市" province="广西壮族自治区" 450923 county="博白县" prefecture="玉林市" province="广西壮族自治区" 450924 county="兴业县" prefecture="玉林市" province="广西壮族自治区" 450981 county="北流市" prefecture="玉林市" province="广西壮族自治区" 451001 county="市辖区" prefecture="百色市" province="广西壮族自治区" 451002 county="右江区" prefecture="百色市" province="广西壮族自治区" 451021 county="田阳县" prefecture="百色市" province="广西壮族自治区" 451022 county="田东县" prefecture="百色市" province="广西壮族自治区" 451023 county="平果县" prefecture="百色市" province="广西壮族自治区" 451024 county="德保县" prefecture="百色市" province="广西壮族自治区" 451025 county="靖西县" prefecture="百色市" province="广西壮族自治区" 451026 county="那坡县" prefecture="百色市" province="广西壮族自治区" 451027 county="凌云县" prefecture="百色市" province="广西壮族自治区" 451028 county="乐业县" prefecture="百色市" province="广西壮族自治区" 451029 county="田林县" prefecture="百色市" province="广西壮族自治区" 451030 county="西林县" prefecture="百色市" province="广西壮族自治区" 451031 county="隆林各族自治县" prefecture="百色市" province="广西壮族自治区" 451101 county="市辖区" prefecture="贺州市" province="广西壮族自治区" 451102 county="八步区" prefecture="贺州市" province="广西壮族自治区" 451121 county="昭平县" prefecture="贺州市" province="广西壮族自治区" 451122 county="钟山县" prefecture="贺州市" province="广西壮族自治区" 451123 county="富川瑶族自治县" prefecture="贺州市" province="广西壮族自治区" 451201 county="市辖区" prefecture="河池市" province="广西壮族自治区" 451202 county="金城江区" prefecture="河池市" province="广西壮族自治区" 451221 county="南丹县" prefecture="河池市" province="广西壮族自治区" 451222 county="天峨县" prefecture="河池市" province="广西壮族自治区" 451223 county="凤山县" prefecture="河池市" province="广西壮族自治区" 451224 county="东兰县" prefecture="河池市" province="广西壮族自治区" 451225 county="罗城仫佬族自治县" prefecture="河池市" province="广西壮族自治区" 451226 county="环江毛南族自治县" prefecture="河池市" province="广西壮族自治区" 451227 county="巴马瑶族自治县" prefecture="河池市" province="广西壮族自治区" 451228 county="都安瑶族自治县" prefecture="河池市" province="广西壮族自治区" 451229 county="大化瑶族自治县" prefecture="河池市" province="广西壮族自治区" 451281 county="宜州市" prefecture="河池市" province="广西壮族自治区" 451301 county="市辖区" prefecture="来宾市" province="广西壮族自治区" 451302 county="兴宾区" prefecture="来宾市" province="广西壮族自治区" 451321 county="忻城县" prefecture="来宾市" province="广西壮族自治区" 451322 county="象州县" prefecture="来宾市" province="广西壮族自治区" 451323 county="武宣县" prefecture="来宾市" province="广西壮族自治区" 451324 county="金秀瑶族自治县" prefecture="来宾市" province="广西壮族自治区" 451381 county="合山市" prefecture="来宾市" province="广西壮族自治区" 451401 county="市辖区" prefecture="崇左市" province="广西壮族自治区" 451402 county="江州区" prefecture="崇左市" province="广西壮族自治区" 451421 county="扶绥县" prefecture="崇左市" province="广西壮族自治区" 451422 county="宁明县" prefecture="崇左市" province="广西壮族自治区" 451423 county="龙州县" prefecture="崇左市" province="广西壮族自治区" 451424 county="大新县" prefecture="崇左市" province="广西壮族自治区" 451425 county="天等县" prefecture="崇左市" province="广西壮族自治区" 451481 county="凭祥市" prefecture="崇左市" province="广西壮族自治区" 460101 county="市辖区" prefecture="海口市" province="海南省" 460105 county="秀英区" prefecture="海口市" province="海南省" 460106 county="龙华区" prefecture="海口市" province="海南省" 460107 county="琼山区" prefecture="海口市" province="海南省" 460108 county="美兰区" prefecture="海口市" province="海南省" 460201 county="市辖区" prefecture="三亚市" province="海南省" 460202 county="海棠区" prefecture="三亚市" province="海南省" 460203 county="吉阳区" prefecture="三亚市" province="海南省" 460204 county="天涯区" prefecture="三亚市" province="海南省" 460205 county="崖州区" prefecture="三亚市" province="海南省" 460321 county="西沙群岛" prefecture="三沙市" province="海南省" 460322 county="南沙群岛" prefecture="三沙市" province="海南省" 460323 county="中沙群岛的岛礁及其海域" prefecture="三沙市" province="海南省" 469001 county="五指山市" prefecture="省直辖县级行政区划" province="海南省" 469002 county="琼海市" prefecture="省直辖县级行政区划" province="海南省" 469003 county="儋州市" prefecture="省直辖县级行政区划" province="海南省" 469005 county="文昌市" prefecture="省直辖县级行政区划" province="海南省" 469006 county="万宁市" prefecture="省直辖县级行政区划" province="海南省" 469007 county="东方市" prefecture="省直辖县级行政区划" province="海南省" 469021 county="定安县" prefecture="省直辖县级行政区划" province="海南省" 469022 county="屯昌县" prefecture="省直辖县级行政区划" province="海南省" 469023 county="澄迈县" prefecture="省直辖县级行政区划" province="海南省" 469024 county="临高县" prefecture="省直辖县级行政区划" province="海南省" 469025 county="白沙黎族自治县" prefecture="省直辖县级行政区划" province="海南省" 469026 county="昌江黎族自治县" prefecture="省直辖县级行政区划" province="海南省" 469027 county="乐东黎族自治县" prefecture="省直辖县级行政区划" province="海南省" 469028 county="陵水黎族自治县" prefecture="省直辖县级行政区划" province="海南省" 469029 county="保亭黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省" 469030 county="琼中黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省" 469031 county="西沙群岛" prefecture="省直辖县级行政区划" province="海南省" 469032 county="南沙群岛" prefecture="省直辖县级行政区划" province="海南省" 469033 county="中沙群岛的岛礁及其海域" prefecture="省直辖县级行政区划" province="海南省" 469034 county="陵水黎族自治县" prefecture="省直辖县级行政区划" province="海南省" 469035 county="保亭黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省" 469036 county="琼中黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省" 469037 county="西沙群岛" prefecture="省直辖县级行政区划" province="海南省" 469038 county="南沙群岛" prefecture="省直辖县级行政区划" province="海南省" 469039 county="中沙群岛的岛礁及其海域" prefecture="省直辖县级行政区划" province="海南省" 500101 county="万州区" prefecture="市辖区" province="重庆市" 500102 county="涪陵区" prefecture="市辖区" province="重庆市" 500103 county="渝中区" prefecture="市辖区" province="重庆市" 500104 county="大渡口区" prefecture="市辖区" province="重庆市" 500105 county="江北区" prefecture="市辖区" province="重庆市" 500106 county="沙坪坝区" prefecture="市辖区" province="重庆市" 500107 county="九龙坡区" prefecture="市辖区" province="重庆市" 500108 county="南岸区" prefecture="市辖区" province="重庆市" 500109 county="北碚区" prefecture="市辖区" province="重庆市" 500110 county="綦江区" prefecture="市辖区" province="重庆市" 500111 county="大足区" prefecture="市辖区" province="重庆市" 500112 county="渝北区" prefecture="市辖区" province="重庆市" 500113 county="巴南区" prefecture="市辖区" province="重庆市" 500114 county="黔江区" prefecture="市辖区" province="重庆市" 500115 county="长寿区" prefecture="市辖区" province="重庆市" 500116 county="江津区" prefecture="市辖区" province="重庆市" 500117 county="合川区" prefecture="市辖区" province="重庆市" 500118 county="永川区" prefecture="市辖区" province="重庆市" 500119 county="南川区" prefecture="市辖区" province="重庆市" 500120 county="璧山区" prefecture="市辖区" province="重庆市" 500151 county="铜梁区" prefecture="市辖区" province="重庆市" 500222 county="綦江县" prefecture="县" province="重庆市" 500223 county="潼南县" prefecture="县" province="重庆市" 500224 county="铜梁县" prefecture="县" province="重庆市" 500225 county="大足县" prefecture="县" province="重庆市" 500226 county="荣昌县" prefecture="县" province="重庆市" 500227 county="璧山县" prefecture="县" province="重庆市" 500228 county="梁平县" prefecture="县" province="重庆市" 500229 county="城口县" prefecture="县" province="重庆市" 500230 county="丰都县" prefecture="县" province="重庆市" 500231 county="垫江县" prefecture="县" province="重庆市" 500232 county="武隆县" prefecture="县" province="重庆市" 500233 county="忠县" prefecture="县" province="重庆市" 500234 county="开县" prefecture="县" province="重庆市" 500235 county="云阳县" prefecture="县" province="重庆市" 500236 county="奉节县" prefecture="县" province="重庆市" 500237 county="巫山县" prefecture="县" province="重庆市" 500238 county="巫溪县" prefecture="县" province="重庆市" 500240 county="石柱土家族自治县" prefecture="县" province="重庆市" 500241 county="秀山土家族苗族自治县" prefecture="县" province="重庆市" 500242 county="酉阳土家族苗族自治县" prefecture="县" province="重庆市" 500243 county="彭水苗族土家族自治县" prefecture="县" province="重庆市" 500381 county="江津市" prefecture="市" province="重庆市" 500382 county="合川市" prefecture="市" province="重庆市" 500383 county="永川市" prefecture="市" province="重庆市" 500384 county="南川市" prefecture="市" province="重庆市" 510101 county="市辖区" prefecture="成都市" province="四川省" 510104 county="锦江区" prefecture="成都市" province="四川省" 510105 county="青羊区" prefecture="成都市" province="四川省" 510106 county="金牛区" prefecture="成都市" province="四川省" 510107 county="武侯区" prefecture="成都市" province="四川省" 510108 county="成华区" prefecture="成都市" province="四川省" 510112 county="龙泉驿区" prefecture="成都市" province="四川省" 510113 county="青白江区" prefecture="成都市" province="四川省" 510114 county="新都区" prefecture="成都市" province="四川省" 510115 county="温江区" prefecture="成都市" province="四川省" 510121 county="金堂县" prefecture="成都市" province="四川省" 510122 county="双流县" prefecture="成都市" province="四川省" 510123 county="温江县" prefecture="成都市" province="四川省" 510124 county="郫县" prefecture="成都市" province="四川省" 510129 county="大邑县" prefecture="成都市" province="四川省" 510131 county="蒲江县" prefecture="成都市" province="四川省" 510132 county="新津县" prefecture="成都市" province="四川省" 510181 county="都江堰市" prefecture="成都市" province="四川省" 510182 county="彭州市" prefecture="成都市" province="四川省" 510183 county="邛崃市" prefecture="成都市" province="四川省" 510184 county="崇州市" prefecture="成都市" province="四川省" 510301 county="市辖区" prefecture="自贡市" province="四川省" 510302 county="自流井区" prefecture="自贡市" province="四川省" 510303 county="贡井区" prefecture="自贡市" province="四川省" 510304 county="大安区" prefecture="自贡市" province="四川省" 510311 county="沿滩区" prefecture="自贡市" province="四川省" 510321 county="荣县" prefecture="自贡市" province="四川省" 510322 county="富顺县" prefecture="自贡市" province="四川省" 510401 county="市辖区" prefecture="攀枝花市" province="四川省" 510402 county="东区" prefecture="攀枝花市" province="四川省" 510403 county="西区" prefecture="攀枝花市" province="四川省" 510411 county="仁和区" prefecture="攀枝花市" province="四川省" 510421 county="米易县" prefecture="攀枝花市" province="四川省" 510422 county="盐边县" prefecture="攀枝花市" province="四川省" 510501 county="市辖区" prefecture="泸州市" province="四川省" 510502 county="江阳区" prefecture="泸州市" province="四川省" 510503 county="纳溪区" prefecture="泸州市" province="四川省" 510504 county="龙马潭区" prefecture="泸州市" province="四川省" 510521 county="泸县" prefecture="泸州市" province="四川省" 510522 county="合江县" prefecture="泸州市" province="四川省" 510524 county="叙永县" prefecture="泸州市" province="四川省" 510525 county="古蔺县" prefecture="泸州市" province="四川省" 510601 county="市辖区" prefecture="德阳市" province="四川省" 510603 county="旌阳区" prefecture="德阳市" province="四川省" 510623 county="中江县" prefecture="德阳市" province="四川省" 510626 county="罗江县" prefecture="德阳市" province="四川省" 510681 county="广汉市" prefecture="德阳市" province="四川省" 510682 county="什邡市" prefecture="德阳市" province="四川省" 510683 county="绵竹市" prefecture="德阳市" province="四川省" 510701 county="市辖区" prefecture="绵阳市" province="四川省" 510703 county="涪城区" prefecture="绵阳市" province="四川省" 510704 county="游仙区" prefecture="绵阳市" province="四川省" 510722 county="三台县" prefecture="绵阳市" province="四川省" 510723 county="盐亭县" prefecture="绵阳市" province="四川省" 510724 county="安县" prefecture="绵阳市" province="四川省" 510725 county="梓潼县" prefecture="绵阳市" province="四川省" 510726 county="北川羌族自治县" prefecture="绵阳市" province="四川省" 510727 county="平武县" prefecture="绵阳市" province="四川省" 510781 county="江油市" prefecture="绵阳市" province="四川省" 510801 county="市辖区" prefecture="广元市" province="四川省" 510802 county="利州区" prefecture="广元市" province="四川省" 510811 county="昭化区" prefecture="广元市" province="四川省" 510812 county="朝天区" prefecture="广元市" province="四川省" 510821 county="旺苍县" prefecture="广元市" province="四川省" 510822 county="青川县" prefecture="广元市" province="四川省" 510823 county="剑阁县" prefecture="广元市" province="四川省" 510824 county="苍溪县" prefecture="广元市" province="四川省" 510901 county="市辖区" prefecture="遂宁市" province="四川省" 510902 county="市中区" prefecture="遂宁市" province="四川省" 510903 county="船山区" prefecture="遂宁市" province="四川省" 510904 county="安居区" prefecture="遂宁市" province="四川省" 510921 county="蓬溪县" prefecture="遂宁市" province="四川省" 510922 county="射洪县" prefecture="遂宁市" province="四川省" 510923 county="大英县" prefecture="遂宁市" province="四川省" 511001 county="市辖区" prefecture="内江市" province="四川省" 511002 county="市中区" prefecture="内江市" province="四川省" 511011 county="东兴区" prefecture="内江市" province="四川省" 511024 county="威远县" prefecture="内江市" province="四川省" 511025 county="资中县" prefecture="内江市" province="四川省" 511028 county="隆昌县" prefecture="内江市" province="四川省" 511101 county="市辖区" prefecture="乐山市" province="四川省" 511102 county="市中区" prefecture="乐山市" province="四川省" 511111 county="沙湾区" prefecture="乐山市" province="四川省" 511112 county="五通桥区" prefecture="乐山市" province="四川省" 511113 county="金口河区" prefecture="乐山市" province="四川省" 511123 county="犍为县" prefecture="乐山市" province="四川省" 511124 county="井研县" prefecture="乐山市" province="四川省" 511126 county="夹江县" prefecture="乐山市" province="四川省" 511129 county="沐川县" prefecture="乐山市" province="四川省" 511132 county="峨边彝族自治县" prefecture="乐山市" province="四川省" 511133 county="马边彝族自治县" prefecture="乐山市" province="四川省" 511181 county="峨眉山市" prefecture="乐山市" province="四川省" 511301 county="市辖区" prefecture="南充市" province="四川省" 511302 county="顺庆区" prefecture="南充市" province="四川省" 511303 county="高坪区" prefecture="南充市" province="四川省" 511304 county="嘉陵区" prefecture="南充市" province="四川省" 511321 county="南部县" prefecture="南充市" province="四川省" 511322 county="营山县" prefecture="南充市" province="四川省" 511323 county="蓬安县" prefecture="南充市" province="四川省" 511324 county="仪陇县" prefecture="南充市" province="四川省" 511325 county="西充县" prefecture="南充市" province="四川省" 511381 county="阆中市" prefecture="南充市" province="四川省" 511401 county="市辖区" prefecture="眉山市" province="四川省" 511402 county="东坡区" prefecture="眉山市" province="四川省" 511421 county="仁寿县" prefecture="眉山市" province="四川省" 511422 county="彭山县" prefecture="眉山市" province="四川省" 511423 county="洪雅县" prefecture="眉山市" province="四川省" 511424 county="丹棱县" prefecture="眉山市" province="四川省" 511425 county="青神县" prefecture="眉山市" province="四川省" 511501 county="市辖区" prefecture="宜宾市" province="四川省" 511502 county="翠屏区" prefecture="宜宾市" province="四川省" 511503 county="南溪区" prefecture="宜宾市" province="四川省" 511521 county="宜宾县" prefecture="宜宾市" province="四川省" 511522 county="南溪县" prefecture="宜宾市" province="四川省" 511523 county="江安县" prefecture="宜宾市" province="四川省" 511524 county="长宁县" prefecture="宜宾市" province="四川省" 511525 county="高县" prefecture="宜宾市" province="四川省" 511526 county="珙县" prefecture="宜宾市" province="四川省" 511527 county="筠连县" prefecture="宜宾市" province="四川省" 511528 county="兴文县" prefecture="宜宾市" province="四川省" 511529 county="屏山县" prefecture="宜宾市" province="四川省" 511601 county="市辖区" prefecture="广安市" province="四川省" 511602 county="广安区" prefecture="广安市" province="四川省" 511603 county="前锋区" prefecture="广安市" province="四川省" 511621 county="岳池县" prefecture="广安市" province="四川省" 511622 county="武胜县" prefecture="广安市" province="四川省" 511623 county="邻水县" prefecture="广安市" province="四川省" 511681 county="华蓥市" prefecture="广安市" province="四川省" 511701 county="市辖区" prefecture="达州市" province="四川省" 511702 county="通川区" prefecture="达州市" province="四川省" 511703 county="达川区" prefecture="达州市" province="四川省" 511721 county="达县" prefecture="达州市" province="四川省" 511722 county="宣汉县" prefecture="达州市" province="四川省" 511723 county="开江县" prefecture="达州市" province="四川省" 511724 county="大竹县" prefecture="达州市" province="四川省" 511725 county="渠县" prefecture="达州市" province="四川省" 511781 county="万源市" prefecture="达州市" province="四川省" 511801 county="市辖区" prefecture="雅安市" province="四川省" 511802 county="雨城区" prefecture="雅安市" province="四川省" 511803 county="名山区" prefecture="雅安市" province="四川省" 511821 county="名山县" prefecture="雅安市" province="四川省" 511822 county="荥经县" prefecture="雅安市" province="四川省" 511823 county="汉源县" prefecture="雅安市" province="四川省" 511824 county="石棉县" prefecture="雅安市" province="四川省" 511825 county="天全县" prefecture="雅安市" province="四川省" 511826 county="芦山县" prefecture="雅安市" province="四川省" 511827 county="宝兴县" prefecture="雅安市" province="四川省" 511901 county="市辖区" prefecture="巴中市" province="四川省" 511902 county="巴州区" prefecture="巴中市" province="四川省" 511903 county="恩阳区" prefecture="巴中市" province="四川省" 511921 county="通江县" prefecture="巴中市" province="四川省" 511922 county="南江县" prefecture="巴中市" province="四川省" 511923 county="平昌县" prefecture="巴中市" province="四川省" 512001 county="市辖区" prefecture="资阳市" province="四川省" 512002 county="雁江区" prefecture="资阳市" province="四川省" 512021 county="安岳县" prefecture="资阳市" province="四川省" 512022 county="乐至县" prefecture="资阳市" province="四川省" 512081 county="简阳市" prefecture="资阳市" province="四川省" 513221 county="汶川县" prefecture="阿坝藏族羌族自治州" province="四川省" 513222 county="理县" prefecture="阿坝藏族羌族自治州" province="四川省" 513223 county="茂县" prefecture="阿坝藏族羌族自治州" province="四川省" 513224 county="松潘县" prefecture="阿坝藏族羌族自治州" province="四川省" 513225 county="九寨沟县" prefecture="阿坝藏族羌族自治州" province="四川省" 513226 county="金川县" prefecture="阿坝藏族羌族自治州" province="四川省" 513227 county="小金县" prefecture="阿坝藏族羌族自治州" province="四川省" 513228 county="黑水县" prefecture="阿坝藏族羌族自治州" province="四川省" 513229 county="马尔康县" prefecture="阿坝藏族羌族自治州" province="四川省" 513230 county="壤塘县" prefecture="阿坝藏族羌族自治州" province="四川省" 513231 county="阿坝县" prefecture="阿坝藏族羌族自治州" province="四川省" 513232 county="若尔盖县" prefecture="阿坝藏族羌族自治州" province="四川省" 513233 county="红原县" prefecture="阿坝藏族羌族自治州" province="四川省" 513321 county="康定县" prefecture="甘孜藏族自治州" province="四川省" 513322 county="泸定县" prefecture="甘孜藏族自治州" province="四川省" 513323 county="丹巴县" prefecture="甘孜藏族自治州" province="四川省" 513324 county="九龙县" prefecture="甘孜藏族自治州" province="四川省" 513325 county="雅江县" prefecture="甘孜藏族自治州" province="四川省" 513326 county="道孚县" prefecture="甘孜藏族自治州" province="四川省" 513327 county="炉霍县" prefecture="甘孜藏族自治州" province="四川省" 513328 county="甘孜县" prefecture="甘孜藏族自治州" province="四川省" 513329 county="新龙县" prefecture="甘孜藏族自治州" province="四川省" 513330 county="德格县" prefecture="甘孜藏族自治州" province="四川省" 513331 county="白玉县" prefecture="甘孜藏族自治州" province="四川省" 513332 county="石渠县" prefecture="甘孜藏族自治州" province="四川省" 513333 county="色达县" prefecture="甘孜藏族自治州" province="四川省" 513334 county="理塘县" prefecture="甘孜藏族自治州" province="四川省" 513335 county="巴塘县" prefecture="甘孜藏族自治州" province="四川省" 513336 county="乡城县" prefecture="甘孜藏族自治州" province="四川省" 513337 county="稻城县" prefecture="甘孜藏族自治州" province="四川省" 513338 county="得荣县" prefecture="甘孜藏族自治州" province="四川省" 513401 county="西昌市" prefecture="凉山彝族自治州" province="四川省" 513422 county="木里藏族自治县" prefecture="凉山彝族自治州" province="四川省" 513423 county="盐源县" prefecture="凉山彝族自治州" province="四川省" 513424 county="德昌县" prefecture="凉山彝族自治州" province="四川省" 513425 county="会理县" prefecture="凉山彝族自治州" province="四川省" 513426 county="会东县" prefecture="凉山彝族自治州" province="四川省" 513427 county="宁南县" prefecture="凉山彝族自治州" province="四川省" 513428 county="普格县" prefecture="凉山彝族自治州" province="四川省" 513429 county="布拖县" prefecture="凉山彝族自治州" province="四川省" 513430 county="金阳县" prefecture="凉山彝族自治州" province="四川省" 513431 county="昭觉县" prefecture="凉山彝族自治州" province="四川省" 513432 county="喜德县" prefecture="凉山彝族自治州" province="四川省" 513433 county="冕宁县" prefecture="凉山彝族自治州" province="四川省" 513434 county="越西县" prefecture="凉山彝族自治州" province="四川省" 513435 county="甘洛县" prefecture="凉山彝族自治州" province="四川省" 513436 county="美姑县" prefecture="凉山彝族自治州" province="四川省" 513437 county="雷波县" prefecture="凉山彝族自治州" province="四川省" 520101 county="市辖区" prefecture="贵阳市" province="贵州省" 520102 county="南明区" prefecture="贵阳市" province="贵州省" 520103 county="云岩区" prefecture="贵阳市" province="贵州省" 520111 county="花溪区" prefecture="贵阳市" province="贵州省" 520112 county="乌当区" prefecture="贵阳市" province="贵州省" 520113 county="白云区" prefecture="贵阳市" province="贵州省" 520114 county="小河区" prefecture="贵阳市" province="贵州省" 520115 county="观山湖区" prefecture="贵阳市" province="贵州省" 520121 county="开阳县" prefecture="贵阳市" province="贵州省" 520122 county="息烽县" prefecture="贵阳市" province="贵州省" 520123 county="修文县" prefecture="贵阳市" province="贵州省" 520181 county="清镇市" prefecture="贵阳市" province="贵州省" 520201 county="钟山区" prefecture="六盘水市" province="贵州省" 520203 county="六枝特区" prefecture="六盘水市" province="贵州省" 520221 county="水城县" prefecture="六盘水市" province="贵州省" 520222 county="盘县" prefecture="六盘水市" province="贵州省" 520301 county="市辖区" prefecture="遵义市" province="贵州省" 520302 county="红花岗区" prefecture="遵义市" province="贵州省" 520303 county="汇川区" prefecture="遵义市" province="贵州省" 520321 county="遵义县" prefecture="遵义市" province="贵州省" 520322 county="桐梓县" prefecture="遵义市" province="贵州省" 520323 county="绥阳县" prefecture="遵义市" province="贵州省" 520324 county="正安县" prefecture="遵义市" province="贵州省" 520325 county="道真仡佬族苗族自治县" prefecture="遵义市" province="贵州省" 520326 county="务川仡佬族苗族自治县" prefecture="遵义市" province="贵州省" 520327 county="凤冈县" prefecture="遵义市" province="贵州省" 520328 county="湄潭县" prefecture="遵义市" province="贵州省" 520329 county="余庆县" prefecture="遵义市" province="贵州省" 520330 county="习水县" prefecture="遵义市" province="贵州省" 520381 county="赤水市" prefecture="遵义市" province="贵州省" 520382 county="仁怀市" prefecture="遵义市" province="贵州省" 520401 county="市辖区" prefecture="安顺市" province="贵州省" 520402 county="西秀区" prefecture="安顺市" province="贵州省" 520421 county="平坝县" prefecture="安顺市" province="贵州省" 520422 county="普定县" prefecture="安顺市" province="贵州省" 520423 county="镇宁布依族苗族自治县" prefecture="安顺市" province="贵州省" 520424 county="关岭布依族苗族自治县" prefecture="安顺市" province="贵州省" 520425 county="紫云苗族布依族自治县" prefecture="安顺市" province="贵州省" 520501 county="市辖区" prefecture="毕节市" province="贵州省" 520502 county="七星关区" prefecture="毕节市" province="贵州省" 520521 county="大方县" prefecture="毕节市" province="贵州省" 520522 county="黔西县" prefecture="毕节市" province="贵州省" 520523 county="金沙县" prefecture="毕节市" province="贵州省" 520524 county="织金县" prefecture="毕节市" province="贵州省" 520525 county="纳雍县" prefecture="毕节市" province="贵州省" 520526 county="威宁彝族回族苗族自治县" prefecture="毕节市" province="贵州省" 520527 county="赫章县" prefecture="毕节市" province="贵州省" 520601 county="市辖区" prefecture="铜仁市" province="贵州省" 520602 county="碧江区" prefecture="铜仁市" province="贵州省" 520603 county="万山区" prefecture="铜仁市" province="贵州省" 520621 county="江口县" prefecture="铜仁市" province="贵州省" 520622 county="玉屏侗族自治县" prefecture="铜仁市" province="贵州省" 520623 county="石阡县" prefecture="铜仁市" province="贵州省" 520624 county="思南县" prefecture="铜仁市" province="贵州省" 520625 county="印江土家族苗族自治县" prefecture="铜仁市" province="贵州省" 520626 county="德江县" prefecture="铜仁市" province="贵州省" 520627 county="沿河土家族自治县" prefecture="铜仁市" province="贵州省" 520628 county="松桃苗族自治县" prefecture="铜仁市" province="贵州省" 522201 county="铜仁市" prefecture="铜仁地区" province="贵州省" 522222 county="江口县" prefecture="铜仁地区" province="贵州省" 522223 county="玉屏侗族自治县" prefecture="铜仁地区" province="贵州省" 522224 county="石阡县" prefecture="铜仁地区" province="贵州省" 522225 county="思南县" prefecture="铜仁地区" province="贵州省" 522226 county="印江土家族苗族自治县" prefecture="铜仁地区" province="贵州省" 522227 county="德江县" prefecture="铜仁地区" province="贵州省" 522228 county="沿河土家族自治县" prefecture="铜仁地区" province="贵州省" 522229 county="松桃苗族自治县" prefecture="铜仁地区" province="贵州省" 522230 county="万山特区" prefecture="铜仁地区" province="贵州省" 522301 county="兴义市" prefecture="黔西南布依族苗族自治州" province="贵州省" 522322 county="兴仁县" prefecture="黔西南布依族苗族自治州" province="贵州省" 522323 county="普安县" prefecture="黔西南布依族苗族自治州" province="贵州省" 522324 county="晴隆县" prefecture="黔西南布依族苗族自治州" province="贵州省" 522325 county="贞丰县" prefecture="黔西南布依族苗族自治州" province="贵州省" 522326 county="望谟县" prefecture="黔西南布依族苗族自治州" province="贵州省" 522327 county="册亨县" prefecture="黔西南布依族苗族自治州" province="贵州省" 522328 county="安龙县" prefecture="黔西南布依族苗族自治州" province="贵州省" 522401 county="毕节市" prefecture="毕节地区" province="贵州省" 522422 county="大方县" prefecture="毕节地区" province="贵州省" 522423 county="黔西县" prefecture="毕节地区" province="贵州省" 522424 county="金沙县" prefecture="毕节地区" province="贵州省" 522425 county="织金县" prefecture="毕节地区" province="贵州省" 522426 county="纳雍县" prefecture="毕节地区" province="贵州省" 522427 county="威宁彝族回族苗族自治县" prefecture="毕节地区" province="贵州省" 522428 county="赫章县" prefecture="毕节地区" province="贵州省" 522601 county="凯里市" prefecture="黔东南苗族侗族自治州" province="贵州省" 522622 county="黄平县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522623 county="施秉县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522624 county="三穗县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522625 county="镇远县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522626 county="岑巩县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522627 county="天柱县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522628 county="锦屏县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522629 county="剑河县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522630 county="台江县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522631 county="黎平县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522632 county="榕江县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522633 county="从江县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522634 county="雷山县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522635 county="麻江县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522636 county="丹寨县" prefecture="黔东南苗族侗族自治州" province="贵州省" 522701 county="都匀市" prefecture="黔南布依族苗族自治州" province="贵州省" 522702 county="福泉市" prefecture="黔南布依族苗族自治州" province="贵州省" 522722 county="荔波县" prefecture="黔南布依族苗族自治州" province="贵州省" 522723 county="贵定县" prefecture="黔南布依族苗族自治州" province="贵州省" 522725 county="瓮安县" prefecture="黔南布依族苗族自治州" province="贵州省" 522726 county="独山县" prefecture="黔南布依族苗族自治州" province="贵州省" 522727 county="平塘县" prefecture="黔南布依族苗族自治州" province="贵州省" 522728 county="罗甸县" prefecture="黔南布依族苗族自治州" province="贵州省" 522729 county="长顺县" prefecture="黔南布依族苗族自治州" province="贵州省" 522730 county="龙里县" prefecture="黔南布依族苗族自治州" province="贵州省" 522731 county="惠水县" prefecture="黔南布依族苗族自治州" province="贵州省" 522732 county="三都水族自治县" prefecture="黔南布依族苗族自治州" province="贵州省" 530101 county="市辖区" prefecture="昆明市" province="云南省" 530102 county="五华区" prefecture="昆明市" province="云南省" 530103 county="盘龙区" prefecture="昆明市" province="云南省" 530111 county="官渡区" prefecture="昆明市" province="云南省" 530112 county="西山区" prefecture="昆明市" province="云南省" 530113 county="东川区" prefecture="昆明市" province="云南省" 530114 county="呈贡区" prefecture="昆明市" province="云南省" 530121 county="呈贡县" prefecture="昆明市" province="云南省" 530122 county="晋宁县" prefecture="昆明市" province="云南省" 530124 county="富民县" prefecture="昆明市" province="云南省" 530125 county="宜良县" prefecture="昆明市" province="云南省" 530126 county="石林彝族自治县" prefecture="昆明市" province="云南省" 530127 county="嵩明县" prefecture="昆明市" province="云南省" 530128 county="禄劝彝族苗族自治县" prefecture="昆明市" province="云南省" 530129 county="寻甸回族彝族自治县" prefecture="昆明市" province="云南省" 530181 county="安宁市" prefecture="昆明市" province="云南省" 530301 county="市辖区" prefecture="曲靖市" province="云南省" 530302 county="麒麟区" prefecture="曲靖市" province="云南省" 530321 county="马龙县" prefecture="曲靖市" province="云南省" 530322 county="陆良县" prefecture="曲靖市" province="云南省" 530323 county="师宗县" prefecture="曲靖市" province="云南省" 530324 county="罗平县" prefecture="曲靖市" province="云南省" 530325 county="富源县" prefecture="曲靖市" province="云南省" 530326 county="会泽县" prefecture="曲靖市" province="云南省" 530328 county="沾益县" prefecture="曲靖市" province="云南省" 530381 county="宣威市" prefecture="曲靖市" province="云南省" 530401 county="市辖区" prefecture="玉溪市" province="云南省" 530402 county="红塔区" prefecture="玉溪市" province="云南省" 530421 county="江川县" prefecture="玉溪市" province="云南省" 530422 county="澄江县" prefecture="玉溪市" province="云南省" 530423 county="通海县" prefecture="玉溪市" province="云南省" 530424 county="华宁县" prefecture="玉溪市" province="云南省" 530425 county="易门县" prefecture="玉溪市" province="云南省" 530426 county="峨山彝族自治县" prefecture="玉溪市" province="云南省" 530427 county="新平彝族傣族自治县" prefecture="玉溪市" province="云南省" 530428 county="元江哈尼族彝族傣族自治县" prefecture="玉溪市" province="云南省" 530501 county="市辖区" prefecture="保山市" province="云南省" 530502 county="隆阳区" prefecture="保山市" province="云南省" 530521 county="施甸县" prefecture="保山市" province="云南省" 530522 county="腾冲县" prefecture="保山市" province="云南省" 530523 county="龙陵县" prefecture="保山市" province="云南省" 530524 county="昌宁县" prefecture="保山市" province="云南省" 530601 county="市辖区" prefecture="昭通市" province="云南省" 530602 county="昭阳区" prefecture="昭通市" province="云南省" 530621 county="鲁甸县" prefecture="昭通市" province="云南省" 530622 county="巧家县" prefecture="昭通市" province="云南省" 530623 county="盐津县" prefecture="昭通市" province="云南省" 530624 county="大关县" prefecture="昭通市" province="云南省" 530625 county="永善县" prefecture="昭通市" province="云南省" 530626 county="绥江县" prefecture="昭通市" province="云南省" 530627 county="镇雄县" prefecture="昭通市" province="云南省" 530628 county="彝良县" prefecture="昭通市" province="云南省" 530629 county="威信县" prefecture="昭通市" province="云南省" 530630 county="水富县" prefecture="昭通市" province="云南省" 530701 county="市辖区" prefecture="丽江市" province="云南省" 530702 county="古城区" prefecture="丽江市" province="云南省" 530721 county="玉龙纳西族自治县" prefecture="丽江市" province="云南省" 530722 county="永胜县" prefecture="丽江市" province="云南省" 530723 county="华坪县" prefecture="丽江市" province="云南省" 530724 county="宁蒗彝族自治县" prefecture="丽江市" province="云南省" 530801 county="市辖区" prefecture="普洱市" province="云南省" 530802 county="思茅区" prefecture="普洱市" province="云南省" 530821 county="宁洱哈尼族彝族自治县" prefecture="普洱市" province="云南省" 530822 county="墨江哈尼族自治县" prefecture="普洱市" province="云南省" 530823 county="景东彝族自治县" prefecture="普洱市" province="云南省" 530824 county="景谷傣族彝族自治县" prefecture="普洱市" province="云南省" 530825 county="镇沅彝族哈尼族拉祜族自治县" prefecture="普洱市" province="云南省" 530826 county="江城哈尼族彝族自治县" prefecture="普洱市" province="云南省" 530827 county="孟连傣族拉祜族佤族自治县" prefecture="普洱市" province="云南省" 530828 county="澜沧拉祜族自治县" prefecture="普洱市" province="云南省" 530829 county="西盟佤族自治县" prefecture="普洱市" province="云南省" 530901 county="市辖区" prefecture="临沧市" province="云南省" 530902 county="临翔区" prefecture="临沧市" province="云南省" 530921 county="凤庆县" prefecture="临沧市" province="云南省" 530922 county="云县" prefecture="临沧市" province="云南省" 530923 county="永德县" prefecture="临沧市" province="云南省" 530924 county="镇康县" prefecture="临沧市" province="云南省" 530925 county="双江拉祜族佤族布朗族傣族自治县" prefecture="临沧市" province="云南省" 530926 county="耿马傣族佤族自治县" prefecture="临沧市" province="云南省" 530927 county="沧源佤族自治县" prefecture="临沧市" province="云南省" 532301 county="楚雄市" prefecture="楚雄彝族自治州" province="云南省" 532322 county="双柏县" prefecture="楚雄彝族自治州" province="云南省" 532323 county="牟定县" prefecture="楚雄彝族自治州" province="云南省" 532324 county="南华县" prefecture="楚雄彝族自治州" province="云南省" 532325 county="姚安县" prefecture="楚雄彝族自治州" province="云南省" 532326 county="大姚县" prefecture="楚雄彝族自治州" province="云南省" 532327 county="永仁县" prefecture="楚雄彝族自治州" province="云南省" 532328 county="元谋县" prefecture="楚雄彝族自治州" province="云南省" 532329 county="武定县" prefecture="楚雄彝族自治州" province="云南省" 532331 county="禄丰县" prefecture="楚雄彝族自治州" province="云南省" 532501 county="个旧市" prefecture="红河哈尼族彝族自治州" province="云南省" 532502 county="开远市" prefecture="红河哈尼族彝族自治州" province="云南省" 532503 county="蒙自市" prefecture="红河哈尼族彝族自治州" province="云南省" 532504 county="弥勒市" prefecture="红河哈尼族彝族自治州" province="云南省" 532522 county="蒙自县" prefecture="红河哈尼族彝族自治州" province="云南省" 532523 county="屏边苗族自治县" prefecture="红河哈尼族彝族自治州" province="云南省" 532524 county="建水县" prefecture="红河哈尼族彝族自治州" province="云南省" 532525 county="石屏县" prefecture="红河哈尼族彝族自治州" province="云南省" 532526 county="弥勒县" prefecture="红河哈尼族彝族自治州" province="云南省" 532527 county="泸西县" prefecture="红河哈尼族彝族自治州" province="云南省" 532528 county="元阳县" prefecture="红河哈尼族彝族自治州" province="云南省" 532529 county="红河县" prefecture="红河哈尼族彝族自治州" province="云南省" 532530 county="金平苗族瑶族傣族自治县" prefecture="红河哈尼族彝族自治州" province="云南省" 532531 county="绿春县" prefecture="红河哈尼族彝族自治州" province="云南省" 532532 county="河口瑶族自治县" prefecture="红河哈尼族彝族自治州" province="云南省" 532601 county="文山市" prefecture="文山壮族苗族自治州" province="云南省" 532621 county="文山县" prefecture="文山壮族苗族自治州" province="云南省" 532622 county="砚山县" prefecture="文山壮族苗族自治州" province="云南省" 532623 county="西畴县" prefecture="文山壮族苗族自治州" province="云南省" 532624 county="麻栗坡县" prefecture="文山壮族苗族自治州" province="云南省" 532625 county="马关县" prefecture="文山壮族苗族自治州" province="云南省" 532626 county="丘北县" prefecture="文山壮族苗族自治州" province="云南省" 532627 county="广南县" prefecture="文山壮族苗族自治州" province="云南省" 532628 county="富宁县" prefecture="文山壮族苗族自治州" province="云南省" 532701 county="思茅市" prefecture="思茅地区" province="云南省" 532722 county="普洱哈尼族彝族自治县" prefecture="思茅地区" province="云南省" 532723 county="墨江哈尼族自治县" prefecture="思茅地区" province="云南省" 532724 county="景东彝族自治县" prefecture="思茅地区" province="云南省" 532725 county="景谷傣族彝族自治县" prefecture="思茅地区" province="云南省" 532726 county="镇沅彝族哈尼族拉祜族自治县" prefecture="思茅地区" province="云南省" 532727 county="江城哈尼族彝族自治县" prefecture="思茅地区" province="云南省" 532728 county="孟连傣族拉祜族佤族自治县" prefecture="思茅地区" province="云南省" 532729 county="澜沧拉祜族自治县" prefecture="思茅地区" province="云南省" 532730 county="西盟佤族自治县" prefecture="思茅地区" province="云南省" 532801 county="景洪市" prefecture="西双版纳傣族自治州" province="云南省" 532822 county="勐海县" prefecture="西双版纳傣族自治州" province="云南省" 532823 county="勐腊县" prefecture="西双版纳傣族自治州" province="云南省" 532901 county="大理市" prefecture="大理白族自治州" province="云南省" 532922 county="漾濞彝族自治县" prefecture="大理白族自治州" province="云南省" 532923 county="祥云县" prefecture="大理白族自治州" province="云南省" 532924 county="宾川县" prefecture="大理白族自治州" province="云南省" 532925 county="弥渡县" prefecture="大理白族自治州" province="云南省" 532926 county="南涧彝族自治县" prefecture="大理白族自治州" province="云南省" 532927 county="巍山彝族回族自治县" prefecture="大理白族自治州" province="云南省" 532928 county="永平县" prefecture="大理白族自治州" province="云南省" 532929 county="云龙县" prefecture="大理白族自治州" province="云南省" 532930 county="洱源县" prefecture="大理白族自治州" province="云南省" 532931 county="剑川县" prefecture="大理白族自治州" province="云南省" 532932 county="鹤庆县" prefecture="大理白族自治州" province="云南省" 533102 county="瑞丽市" prefecture="德宏傣族景颇族自治州" province="云南省" 533103 county="芒市" prefecture="德宏傣族景颇族自治州" province="云南省" 533122 county="梁河县" prefecture="德宏傣族景颇族自治州" province="云南省" 533123 county="盈江县" prefecture="德宏傣族景颇族自治州" province="云南省" 533124 county="陇川县" prefecture="德宏傣族景颇族自治州" province="云南省" 533321 county="泸水县" prefecture="怒江傈僳族自治州" province="云南省" 533323 county="福贡县" prefecture="怒江傈僳族自治州" province="云南省" 533324 county="贡山独龙族怒族自治县" prefecture="怒江傈僳族自治州" province="云南省" 533325 county="兰坪白族普米族自治县" prefecture="怒江傈僳族自治州" province="云南省" 533421 county="香格里拉县" prefecture="迪庆藏族自治州" province="云南省" 533422 county="德钦县" prefecture="迪庆藏族自治州" province="云南省" 533423 county="维西傈僳族自治县" prefecture="迪庆藏族自治州" province="云南省" 533521 county="临沧县" prefecture="临沧地区" province="云南省" 533522 county="凤庆县" prefecture="临沧地区" province="云南省" 533523 county="云县" prefecture="临沧地区" province="云南省" 533524 county="永德县" prefecture="临沧地区" province="云南省" 533525 county="镇康县" prefecture="临沧地区" province="云南省" 533526 county="双江拉祜族佤族布朗族傣族自治县" prefecture="临沧地区" province="云南省" 533527 county="耿马傣族佤族自治县" prefecture="临沧地区" province="云南省" 533528 county="沧源佤族自治县" prefecture="临沧地区" province="云南省" 540101 county="市辖区" prefecture="拉萨市" province="西藏自治区" 540102 county="城关区" prefecture="拉萨市" province="西藏自治区" 540121 county="林周县" prefecture="拉萨市" province="西藏自治区" 540122 county="当雄县" prefecture="拉萨市" province="西藏自治区" 540123 county="尼木县" prefecture="拉萨市" province="西藏自治区" 540124 county="曲水县" prefecture="拉萨市" province="西藏自治区" 540125 county="堆龙德庆县" prefecture="拉萨市" province="西藏自治区" 540126 county="达孜县" prefecture="拉萨市" province="西藏自治区" 540127 county="墨竹工卡县" prefecture="拉萨市" province="西藏自治区" 540202 county="桑珠孜区" prefecture="日喀则市" province="西藏自治区" 540221 county="南木林县" prefecture="日喀则市" province="西藏自治区" 540222 county="江孜县" prefecture="日喀则市" province="西藏自治区" 540223 county="定日县" prefecture="日喀则市" province="西藏自治区" 540224 county="萨迦县" prefecture="日喀则市" province="西藏自治区" 540225 county="拉孜县" prefecture="日喀则市" province="西藏自治区" 540226 county="昂仁县" prefecture="日喀则市" province="西藏自治区" 540227 county="谢通门县" prefecture="日喀则市" province="西藏自治区" 540228 county="白朗县" prefecture="日喀则市" province="西藏自治区" 540229 county="仁布县" prefecture="日喀则市" province="西藏自治区" 540230 county="康马县" prefecture="日喀则市" province="西藏自治区" 540231 county="定结县" prefecture="日喀则市" province="西藏自治区" 540232 county="仲巴县" prefecture="日喀则市" province="西藏自治区" 540233 county="亚东县" prefecture="日喀则市" province="西藏自治区" 540234 county="吉隆县" prefecture="日喀则市" province="西藏自治区" 540235 county="聂拉木县" prefecture="日喀则市" province="西藏自治区" 540236 county="萨嘎县" prefecture="日喀则市" province="西藏自治区" 540237 county="岗巴县" prefecture="日喀则市" province="西藏自治区" 542121 county="昌都县" prefecture="昌都地区" province="西藏自治区" 542122 county="江达县" prefecture="昌都地区" province="西藏自治区" 542123 county="贡觉县" prefecture="昌都地区" province="西藏自治区" 542124 county="类乌齐县" prefecture="昌都地区" province="西藏自治区" 542125 county="丁青县" prefecture="昌都地区" province="西藏自治区" 542126 county="察雅县" prefecture="昌都地区" province="西藏自治区" 542127 county="八宿县" prefecture="昌都地区" province="西藏自治区" 542128 county="左贡县" prefecture="昌都地区" province="西藏自治区" 542129 county="芒康县" prefecture="昌都地区" province="西藏自治区" 542132 county="洛隆县" prefecture="昌都地区" province="西藏自治区" 542133 county="边坝县" prefecture="昌都地区" province="西藏自治区" 542221 county="乃东县" prefecture="山南地区" province="西藏自治区" 542222 county="扎囊县" prefecture="山南地区" province="西藏自治区" 542223 county="贡嘎县" prefecture="山南地区" province="西藏自治区" 542224 county="桑日县" prefecture="山南地区" province="西藏自治区" 542225 county="琼结县" prefecture="山南地区" province="西藏自治区" 542226 county="曲松县" prefecture="山南地区" province="西藏自治区" 542227 county="措美县" prefecture="山南地区" province="西藏自治区" 542228 county="洛扎县" prefecture="山南地区" province="西藏自治区" 542229 county="加查县" prefecture="山南地区" province="西藏自治区" 542231 county="隆子县" prefecture="山南地区" province="西藏自治区" 542232 county="错那县" prefecture="山南地区" province="西藏自治区" 542233 county="浪卡子县" prefecture="山南地区" province="西藏自治区" 542301 county="日喀则市" prefecture="日喀则地区" province="西藏自治区" 542322 county="南木林县" prefecture="日喀则地区" province="西藏自治区" 542323 county="江孜县" prefecture="日喀则地区" province="西藏自治区" 542324 county="定日县" prefecture="日喀则地区" province="西藏自治区" 542325 county="萨迦县" prefecture="日喀则地区" province="西藏自治区" 542326 county="拉孜县" prefecture="日喀则地区" province="西藏自治区" 542327 county="昂仁县" prefecture="日喀则地区" province="西藏自治区" 542328 county="谢通门县" prefecture="日喀则地区" province="西藏自治区" 542329 county="白朗县" prefecture="日喀则地区" province="西藏自治区" 542330 county="仁布县" prefecture="日喀则地区" province="西藏自治区" 542331 county="康马县" prefecture="日喀则地区" province="西藏自治区" 542332 county="定结县" prefecture="日喀则地区" province="西藏自治区" 542333 county="仲巴县" prefecture="日喀则地区" province="西藏自治区" 542334 county="亚东县" prefecture="日喀则地区" province="西藏自治区" 542335 county="吉隆县" prefecture="日喀则地区" province="西藏自治区" 542336 county="聂拉木县" prefecture="日喀则地区" province="西藏自治区" 542337 county="萨嘎县" prefecture="日喀则地区" province="西藏自治区" 542338 county="岗巴县" prefecture="日喀则地区" province="西藏自治区" 542421 county="那曲县" prefecture="那曲地区" province="西藏自治区" 542422 county="嘉黎县" prefecture="那曲地区" province="西藏自治区" 542423 county="比如县" prefecture="那曲地区" province="西藏自治区" 542424 county="聂荣县" prefecture="那曲地区" province="西藏自治区" 542425 county="安多县" prefecture="那曲地区" province="西藏自治区" 542426 county="申扎县" prefecture="那曲地区" province="西藏自治区" 542427 county="索县" prefecture="那曲地区" province="西藏自治区" 542428 county="班戈县" prefecture="那曲地区" province="西藏自治区" 542429 county="巴青县" prefecture="那曲地区" province="西藏自治区" 542430 county="尼玛县" prefecture="那曲地区" province="西藏自治区" 542431 county="双湖县" prefecture="那曲地区" province="西藏自治区" 542521 county="普兰县" prefecture="阿里地区" province="西藏自治区" 542522 county="札达县" prefecture="阿里地区" province="西藏自治区" 542523 county="噶尔县" prefecture="阿里地区" province="西藏自治区" 542524 county="日土县" prefecture="阿里地区" province="西藏自治区" 542525 county="革吉县" prefecture="阿里地区" province="西藏自治区" 542526 county="改则县" prefecture="阿里地区" province="西藏自治区" 542527 county="措勤县" prefecture="阿里地区" province="西藏自治区" 542621 county="林芝县" prefecture="林芝地区" province="西藏自治区" 542622 county="工布江达县" prefecture="林芝地区" province="西藏自治区" 542623 county="米林县" prefecture="林芝地区" province="西藏自治区" 542624 county="墨脱县" prefecture="林芝地区" province="西藏自治区" 542625 county="波密县" prefecture="林芝地区" province="西藏自治区" 542626 county="察隅县" prefecture="林芝地区" province="西藏自治区" 542627 county="朗县" prefecture="林芝地区" province="西藏自治区" 610101 county="市辖区" prefecture="西安市" province="陕西省" 610102 county="新城区" prefecture="西安市" province="陕西省" 610103 county="碑林区" prefecture="西安市" province="陕西省" 610104 county="莲湖区" prefecture="西安市" province="陕西省" 610111 county="灞桥区" prefecture="西安市" province="陕西省" 610112 county="未央区" prefecture="西安市" province="陕西省" 610113 county="雁塔区" prefecture="西安市" province="陕西省" 610114 county="阎良区" prefecture="西安市" province="陕西省" 610115 county="临潼区" prefecture="西安市" province="陕西省" 610116 county="长安区" prefecture="西安市" province="陕西省" 610122 county="蓝田县" prefecture="西安市" province="陕西省" 610124 county="周至县" prefecture="西安市" province="陕西省" 610125 county="户县" prefecture="西安市" province="陕西省" 610126 county="高陵县" prefecture="西安市" province="陕西省" 610201 county="市辖区" prefecture="铜川市" province="陕西省" 610202 county="王益区" prefecture="铜川市" province="陕西省" 610203 county="印台区" prefecture="铜川市" province="陕西省" 610204 county="耀州区" prefecture="铜川市" province="陕西省" 610222 county="宜君县" prefecture="铜川市" province="陕西省" 610301 county="市辖区" prefecture="宝鸡市" province="陕西省" 610302 county="渭滨区" prefecture="宝鸡市" province="陕西省" 610303 county="金台区" prefecture="宝鸡市" province="陕西省" 610304 county="陈仓区" prefecture="宝鸡市" province="陕西省" 610321 county="宝鸡县" prefecture="宝鸡市" province="陕西省" 610322 county="凤翔县" prefecture="宝鸡市" province="陕西省" 610323 county="岐山县" prefecture="宝鸡市" province="陕西省" 610324 county="扶风县" prefecture="宝鸡市" province="陕西省" 610326 county="眉县" prefecture="宝鸡市" province="陕西省" 610327 county="陇县" prefecture="宝鸡市" province="陕西省" 610328 county="千阳县" prefecture="宝鸡市" province="陕西省" 610329 county="麟游县" prefecture="宝鸡市" province="陕西省" 610330 county="凤县" prefecture="宝鸡市" province="陕西省" 610331 county="太白县" prefecture="宝鸡市" province="陕西省" 610401 county="市辖区" prefecture="咸阳市" province="陕西省" 610402 county="秦都区" prefecture="咸阳市" province="陕西省" 610403 county="杨陵区" prefecture="咸阳市" province="陕西省" 610404 county="渭城区" prefecture="咸阳市" province="陕西省" 610422 county="三原县" prefecture="咸阳市" province="陕西省" 610423 county="泾阳县" prefecture="咸阳市" province="陕西省" 610424 county="乾县" prefecture="咸阳市" province="陕西省" 610425 county="礼泉县" prefecture="咸阳市" province="陕西省" 610426 county="永寿县" prefecture="咸阳市" province="陕西省" 610427 county="彬县" prefecture="咸阳市" province="陕西省" 610428 county="长武县" prefecture="咸阳市" province="陕西省" 610429 county="旬邑县" prefecture="咸阳市" province="陕西省" 610430 county="淳化县" prefecture="咸阳市" province="陕西省" 610431 county="武功县" prefecture="咸阳市" province="陕西省" 610481 county="兴平市" prefecture="咸阳市" province="陕西省" 610501 county="市辖区" prefecture="渭南市" province="陕西省" 610502 county="临渭区" prefecture="渭南市" province="陕西省" 610521 county="华县" prefecture="渭南市" province="陕西省" 610522 county="潼关县" prefecture="渭南市" province="陕西省" 610523 county="大荔县" prefecture="渭南市" province="陕西省" 610524 county="合阳县" prefecture="渭南市" province="陕西省" 610525 county="澄城县" prefecture="渭南市" province="陕西省" 610526 county="蒲城县" prefecture="渭南市" province="陕西省" 610527 county="白水县" prefecture="渭南市" province="陕西省" 610528 county="富平县" prefecture="渭南市" province="陕西省" 610581 county="韩城市" prefecture="渭南市" province="陕西省" 610582 county="华阴市" prefecture="渭南市" province="陕西省" 610601 county="市辖区" prefecture="延安市" province="陕西省" 610602 county="宝塔区" prefecture="延安市" province="陕西省" 610621 county="延长县" prefecture="延安市" province="陕西省" 610622 county="延川县" prefecture="延安市" province="陕西省" 610623 county="子长县" prefecture="延安市" province="陕西省" 610624 county="安塞县" prefecture="延安市" province="陕西省" 610625 county="志丹县" prefecture="延安市" province="陕西省" 610626 county="吴起县" prefecture="延安市" province="陕西省" 610627 county="甘泉县" prefecture="延安市" province="陕西省" 610628 county="富县" prefecture="延安市" province="陕西省" 610629 county="洛川县" prefecture="延安市" province="陕西省" 610630 county="宜川县" prefecture="延安市" province="陕西省" 610631 county="黄龙县" prefecture="延安市" province="陕西省" 610632 county="黄陵县" prefecture="延安市" province="陕西省" 610701 county="市辖区" prefecture="汉中市" province="陕西省" 610702 county="汉台区" prefecture="汉中市" province="陕西省" 610721 county="南郑县" prefecture="汉中市" province="陕西省" 610722 county="城固县" prefecture="汉中市" province="陕西省" 610723 county="洋县" prefecture="汉中市" province="陕西省" 610724 county="西乡县" prefecture="汉中市" province="陕西省" 610725 county="勉县" prefecture="汉中市" province="陕西省" 610726 county="宁强县" prefecture="汉中市" province="陕西省" 610727 county="略阳县" prefecture="汉中市" province="陕西省" 610728 county="镇巴县" prefecture="汉中市" province="陕西省" 610729 county="留坝县" prefecture="汉中市" province="陕西省" 610730 county="佛坪县" prefecture="汉中市" province="陕西省" 610801 county="市辖区" prefecture="榆林市" province="陕西省" 610802 county="榆阳区" prefecture="榆林市" province="陕西省" 610821 county="神木县" prefecture="榆林市" province="陕西省" 610822 county="府谷县" prefecture="榆林市" province="陕西省" 610823 county="横山县" prefecture="榆林市" province="陕西省" 610824 county="靖边县" prefecture="榆林市" province="陕西省" 610825 county="定边县" prefecture="榆林市" province="陕西省" 610826 county="绥德县" prefecture="榆林市" province="陕西省" 610827 county="米脂县" prefecture="榆林市" province="陕西省" 610828 county="佳县" prefecture="榆林市" province="陕西省" 610829 county="吴堡县" prefecture="榆林市" province="陕西省" 610830 county="清涧县" prefecture="榆林市" province="陕西省" 610831 county="子洲县" prefecture="榆林市" province="陕西省" 610901 county="市辖区" prefecture="安康市" province="陕西省" 610902 county="汉滨区" prefecture="安康市" province="陕西省" 610921 county="汉阴县" prefecture="安康市" province="陕西省" 610922 county="石泉县" prefecture="安康市" province="陕西省" 610923 county="宁陕县" prefecture="安康市" province="陕西省" 610924 county="紫阳县" prefecture="安康市" province="陕西省" 610925 county="岚皋县" prefecture="安康市" province="陕西省" 610926 county="平利县" prefecture="安康市" province="陕西省" 610927 county="镇坪县" prefecture="安康市" province="陕西省" 610928 county="旬阳县" prefecture="安康市" province="陕西省" 610929 county="白河县" prefecture="安康市" province="陕西省" 611001 county="市辖区" prefecture="商洛市" province="陕西省" 611002 county="商州区" prefecture="商洛市" province="陕西省" 611021 county="洛南县" prefecture="商洛市" province="陕西省" 611022 county="丹凤县" prefecture="商洛市" province="陕西省" 611023 county="商南县" prefecture="商洛市" province="陕西省" 611024 county="山阳县" prefecture="商洛市" province="陕西省" 611025 county="镇安县" prefecture="商洛市" province="陕西省" 611026 county="柞水县" prefecture="商洛市" province="陕西省" 620101 county="市辖区" prefecture="兰州市" province="甘肃省" 620102 county="城关区" prefecture="兰州市" province="甘肃省" 620103 county="七里河区" prefecture="兰州市" province="甘肃省" 620104 county="西固区" prefecture="兰州市" province="甘肃省" 620105 county="安宁区" prefecture="兰州市" province="甘肃省" 620111 county="红古区" prefecture="兰州市" province="甘肃省" 620121 county="永登县" prefecture="兰州市" province="甘肃省" 620122 county="皋兰县" prefecture="兰州市" province="甘肃省" 620123 county="榆中县" prefecture="兰州市" province="甘肃省" 620201 county="市辖区" prefecture="嘉峪关市" province="甘肃省" 620301 county="市辖区" prefecture="金昌市" province="甘肃省" 620302 county="金川区" prefecture="金昌市" province="甘肃省" 620321 county="永昌县" prefecture="金昌市" province="甘肃省" 620401 county="市辖区" prefecture="白银市" province="甘肃省" 620402 county="白银区" prefecture="白银市" province="甘肃省" 620403 county="平川区" prefecture="白银市" province="甘肃省" 620421 county="靖远县" prefecture="白银市" province="甘肃省" 620422 county="会宁县" prefecture="白银市" province="甘肃省" 620423 county="景泰县" prefecture="白银市" province="甘肃省" 620501 county="市辖区" prefecture="天水市" province="甘肃省" 620502 county="秦州区" prefecture="天水市" province="甘肃省" 620503 county="麦积区" prefecture="天水市" province="甘肃省" 620521 county="清水县" prefecture="天水市" province="甘肃省" 620522 county="秦安县" prefecture="天水市" province="甘肃省" 620523 county="甘谷县" prefecture="天水市" province="甘肃省" 620524 county="武山县" prefecture="天水市" province="甘肃省" 620525 county="张家川回族自治县" prefecture="天水市" province="甘肃省" 620601 county="市辖区" prefecture="武威市" province="甘肃省" 620602 county="凉州区" prefecture="武威市" province="甘肃省" 620621 county="民勤县" prefecture="武威市" province="甘肃省" 620622 county="古浪县" prefecture="武威市" province="甘肃省" 620623 county="天祝藏族自治县" prefecture="武威市" province="甘肃省" 620701 county="市辖区" prefecture="张掖市" province="甘肃省" 620702 county="甘州区" prefecture="张掖市" province="甘肃省" 620721 county="肃南裕固族自治县" prefecture="张掖市" province="甘肃省" 620722 county="民乐县" prefecture="张掖市" province="甘肃省" 620723 county="临泽县" prefecture="张掖市" province="甘肃省" 620724 county="高台县" prefecture="张掖市" province="甘肃省" 620725 county="山丹县" prefecture="张掖市" province="甘肃省" 620801 county="市辖区" prefecture="平凉市" province="甘肃省" 620802 county="崆峒区" prefecture="平凉市" province="甘肃省" 620821 county="泾川县" prefecture="平凉市" province="甘肃省" 620822 county="灵台县" prefecture="平凉市" province="甘肃省" 620823 county="崇信县" prefecture="平凉市" province="甘肃省" 620824 county="华亭县" prefecture="平凉市" province="甘肃省" 620825 county="庄浪县" prefecture="平凉市" province="甘肃省" 620826 county="静宁县" prefecture="平凉市" province="甘肃省" 620901 county="市辖区" prefecture="酒泉市" province="甘肃省" 620902 county="肃州区" prefecture="酒泉市" province="甘肃省" 620921 county="金塔县" prefecture="酒泉市" province="甘肃省" 620922 county="瓜州县" prefecture="酒泉市" province="甘肃省" 620923 county="肃北蒙古族自治县" prefecture="酒泉市" province="甘肃省" 620924 county="阿克塞哈萨克族自治县" prefecture="酒泉市" province="甘肃省" 620981 county="玉门市" prefecture="酒泉市" province="甘肃省" 620982 county="敦煌市" prefecture="酒泉市" province="甘肃省" 621001 county="市辖区" prefecture="庆阳市" province="甘肃省" 621002 county="西峰区" prefecture="庆阳市" province="甘肃省" 621021 county="庆城县" prefecture="庆阳市" province="甘肃省" 621022 county="环县" prefecture="庆阳市" province="甘肃省" 621023 county="华池县" prefecture="庆阳市" province="甘肃省" 621024 county="合水县" prefecture="庆阳市" province="甘肃省" 621025 county="正宁县" prefecture="庆阳市" province="甘肃省" 621026 county="宁县" prefecture="庆阳市" province="甘肃省" 621027 county="镇原县" prefecture="庆阳市" province="甘肃省" 621101 county="市辖区" prefecture="定西市" province="甘肃省" 621102 county="安定区" prefecture="定西市" province="甘肃省" 621121 county="通渭县" prefecture="定西市" province="甘肃省" 621122 county="陇西县" prefecture="定西市" province="甘肃省" 621123 county="渭源县" prefecture="定西市" province="甘肃省" 621124 county="临洮县" prefecture="定西市" province="甘肃省" 621125 county="漳县" prefecture="定西市" province="甘肃省" 621126 county="岷县" prefecture="定西市" province="甘肃省" 621201 county="市辖区" prefecture="陇南市" province="甘肃省" 621202 county="武都区" prefecture="陇南市" province="甘肃省" 621221 county="成县" prefecture="陇南市" province="甘肃省" 621222 county="文县" prefecture="陇南市" province="甘肃省" 621223 county="宕昌县" prefecture="陇南市" province="甘肃省" 621224 county="康县" prefecture="陇南市" province="甘肃省" 621225 county="西和县" prefecture="陇南市" province="甘肃省" 621226 county="礼县" prefecture="陇南市" province="甘肃省" 621227 county="徽县" prefecture="陇南市" province="甘肃省" 621228 county="两当县" prefecture="陇南市" province="甘肃省" 622421 county="定西县" prefecture="定西地区" province="甘肃省" 622424 county="通渭县" prefecture="定西地区" province="甘肃省" 622425 county="陇西县" prefecture="定西地区" province="甘肃省" 622426 county="渭源县" prefecture="定西地区" province="甘肃省" 622427 county="临洮县" prefecture="定西地区" province="甘肃省" 622428 county="漳县" prefecture="定西地区" province="甘肃省" 622429 county="岷县" prefecture="定西地区" province="甘肃省" 622621 county="武都县" prefecture="陇南地区" province="甘肃省" 622623 county="宕昌县" prefecture="陇南地区" province="甘肃省" 622624 county="成县" prefecture="陇南地区" province="甘肃省" 622625 county="康县" prefecture="陇南地区" province="甘肃省" 622626 county="文县" prefecture="陇南地区" province="甘肃省" 622627 county="西和县" prefecture="陇南地区" province="甘肃省" 622628 county="礼县" prefecture="陇南地区" province="甘肃省" 622629 county="两当县" prefecture="陇南地区" province="甘肃省" 622630 county="徽县" prefecture="陇南地区" province="甘肃省" 622901 county="临夏市" prefecture="临夏回族自治州" province="甘肃省" 622921 county="临夏县" prefecture="临夏回族自治州" province="甘肃省" 622922 county="康乐县" prefecture="临夏回族自治州" province="甘肃省" 622923 county="永靖县" prefecture="临夏回族自治州" province="甘肃省" 622924 county="广河县" prefecture="临夏回族自治州" province="甘肃省" 622925 county="和政县" prefecture="临夏回族自治州" province="甘肃省" 622926 county="东乡族自治县" prefecture="临夏回族自治州" province="甘肃省" 622927 county="积石山保安族东乡族撒拉族自治县" prefecture="临夏回族自治州" province="甘肃省" 623001 county="合作市" prefecture="甘南藏族自治州" province="甘肃省" 623021 county="临潭县" prefecture="甘南藏族自治州" province="甘肃省" 623022 county="卓尼县" prefecture="甘南藏族自治州" province="甘肃省" 623023 county="舟曲县" prefecture="甘南藏族自治州" province="甘肃省" 623024 county="迭部县" prefecture="甘南藏族自治州" province="甘肃省" 623025 county="玛曲县" prefecture="甘南藏族自治州" province="甘肃省" 623026 county="碌曲县" prefecture="甘南藏族自治州" province="甘肃省" 623027 county="夏河县" prefecture="甘南藏族自治州" province="甘肃省" 630101 county="市辖区" prefecture="西宁市" province="青海省" 630102 county="城东区" prefecture="西宁市" province="青海省" 630103 county="城中区" prefecture="西宁市" province="青海省" 630104 county="城西区" prefecture="西宁市" province="青海省" 630105 county="城北区" prefecture="西宁市" province="青海省" 630121 county="大通回族土族自治县" prefecture="西宁市" province="青海省" 630122 county="湟中县" prefecture="西宁市" province="青海省" 630123 county="湟源县" prefecture="西宁市" province="青海省" 630202 county="乐都区" prefecture="海东市" province="青海省" 630221 county="平安县" prefecture="海东市" province="青海省" 630222 county="民和回族土族自治县" prefecture="海东市" province="青海省" 630223 county="互助土族自治县" prefecture="海东市" province="青海省" 630224 county="化隆回族自治县" prefecture="海东市" province="青海省" 630225 county="循化撒拉族自治县" prefecture="海东市" province="青海省" 632121 county="平安县" prefecture="海东地区" province="青海省" 632122 county="民和回族土族自治县" prefecture="海东地区" province="青海省" 632123 county="乐都县" prefecture="海东地区" province="青海省" 632126 county="互助土族自治县" prefecture="海东地区" province="青海省" 632127 county="化隆回族自治县" prefecture="海东地区" province="青海省" 632128 county="循化撒拉族自治县" prefecture="海东地区" province="青海省" 632221 county="门源回族自治县" prefecture="海北藏族自治州" province="青海省" 632222 county="祁连县" prefecture="海北藏族自治州" province="青海省" 632223 county="海晏县" prefecture="海北藏族自治州" province="青海省" 632224 county="刚察县" prefecture="海北藏族自治州" province="青海省" 632321 county="同仁县" prefecture="黄南藏族自治州" province="青海省" 632322 county="尖扎县" prefecture="黄南藏族自治州" province="青海省" 632323 county="泽库县" prefecture="黄南藏族自治州" province="青海省" 632324 county="河南蒙古族自治县" prefecture="黄南藏族自治州" province="青海省" 632521 county="共和县" prefecture="海南藏族自治州" province="青海省" 632522 county="同德县" prefecture="海南藏族自治州" province="青海省" 632523 county="贵德县" prefecture="海南藏族自治州" province="青海省" 632524 county="兴海县" prefecture="海南藏族自治州" province="青海省" 632525 county="贵南县" prefecture="海南藏族自治州" province="青海省" 632621 county="玛沁县" prefecture="果洛藏族自治州" province="青海省" 632622 county="班玛县" prefecture="果洛藏族自治州" province="青海省" 632623 county="甘德县" prefecture="果洛藏族自治州" province="青海省" 632624 county="达日县" prefecture="果洛藏族自治州" province="青海省" 632625 county="久治县" prefecture="果洛藏族自治州" province="青海省" 632626 county="玛多县" prefecture="果洛藏族自治州" province="青海省" 632701 county="玉树市" prefecture="玉树藏族自治州" province="青海省" 632721 county="玉树县" prefecture="玉树藏族自治州" province="青海省" 632722 county="杂多县" prefecture="玉树藏族自治州" province="青海省" 632723 county="称多县" prefecture="玉树藏族自治州" province="青海省" 632724 county="治多县" prefecture="玉树藏族自治州" province="青海省" 632725 county="囊谦县" prefecture="玉树藏族自治州" province="青海省" 632726 county="曲麻莱县" prefecture="玉树藏族自治州" province="青海省" 632801 county="格尔木市" prefecture="海西蒙古族藏族自治州" province="青海省" 632802 county="德令哈市" prefecture="海西蒙古族藏族自治州" province="青海省" 632821 county="乌兰县" prefecture="海西蒙古族藏族自治州" province="青海省" 632822 county="都兰县" prefecture="海西蒙古族藏族自治州" province="青海省" 632823 county="天峻县" prefecture="海西蒙古族藏族自治州" province="青海省" 640101 county="市辖区" prefecture="银川市" province="宁夏回族自治区" 640104 county="兴庆区" prefecture="银川市" province="宁夏回族自治区" 640105 county="西夏区" prefecture="银川市" province="宁夏回族自治区" 640106 county="金凤区" prefecture="银川市" province="宁夏回族自治区" 640121 county="永宁县" prefecture="银川市" province="宁夏回族自治区" 640122 county="贺兰县" prefecture="银川市" province="宁夏回族自治区" 640181 county="灵武市" prefecture="银川市" province="宁夏回族自治区" 640201 county="市辖区" prefecture="石嘴山市" province="宁夏回族自治区" 640202 county="大武口区" prefecture="石嘴山市" province="宁夏回族自治区" 640203 county="石嘴山区" prefecture="石嘴山市" province="宁夏回族自治区" 640205 county="惠农区" prefecture="石嘴山市" province="宁夏回族自治区" 640221 county="平罗县" prefecture="石嘴山市" province="宁夏回族自治区" 640222 county="陶乐县" prefecture="石嘴山市" province="宁夏回族自治区" 640223 county="惠农县" prefecture="石嘴山市" province="宁夏回族自治区" 640301 county="市辖区" prefecture="吴忠市" province="宁夏回族自治区" 640302 county="利通区" prefecture="吴忠市" province="宁夏回族自治区" 640303 county="红寺堡区" prefecture="吴忠市" province="宁夏回族自治区" 640321 county="中卫县" prefecture="吴忠市" province="宁夏回族自治区" 640322 county="中宁县" prefecture="吴忠市" province="宁夏回族自治区" 640323 county="盐池县" prefecture="吴忠市" province="宁夏回族自治区" 640324 county="同心县" prefecture="吴忠市" province="宁夏回族自治区" 640381 county="青铜峡市" prefecture="吴忠市" province="宁夏回族自治区" 640401 county="市辖区" prefecture="固原市" province="宁夏回族自治区" 640402 county="原州区" prefecture="固原市" province="宁夏回族自治区" 640421 county="海原县" prefecture="固原市" province="宁夏回族自治区" 640422 county="西吉县" prefecture="固原市" province="宁夏回族自治区" 640423 county="隆德县" prefecture="固原市" province="宁夏回族自治区" 640424 county="泾源县" prefecture="固原市" province="宁夏回族自治区" 640425 county="彭阳县" prefecture="固原市" province="宁夏回族自治区" 640501 county="市辖区" prefecture="中卫市" province="宁夏回族自治区" 640502 county="沙坡头区" prefecture="中卫市" province="宁夏回族自治区" 640521 county="中宁县" prefecture="中卫市" province="宁夏回族自治区" 640522 county="海原县" prefecture="中卫市" province="宁夏回族自治区" 650101 county="市辖区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650102 county="天山区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650103 county="沙依巴克区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650104 county="新市区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650105 county="水磨沟区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650106 county="头屯河区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650107 county="达坂城区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650108 county="东山区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650109 county="米东区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650121 county="乌鲁木齐县" prefecture="乌鲁木齐市" province="新疆维吾尔自治区" 650201 county="市辖区" prefecture="克拉玛依市" province="新疆维吾尔自治区" 650202 county="独山子区" prefecture="克拉玛依市" province="新疆维吾尔自治区" 650203 county="克拉玛依区" prefecture="克拉玛依市" province="新疆维吾尔自治区" 650204 county="白碱滩区" prefecture="克拉玛依市" province="新疆维吾尔自治区" 650205 county="乌尔禾区" prefecture="克拉玛依市" province="新疆维吾尔自治区" 652101 county="吐鲁番市" prefecture="吐鲁番地区" province="新疆维吾尔自治区" 652122 county="鄯善县" prefecture="吐鲁番地区" province="新疆维吾尔自治区" 652123 county="托克逊县" prefecture="吐鲁番地区" province="新疆维吾尔自治区" 652201 county="哈密市" prefecture="哈密地区" province="新疆维吾尔自治区" 652222 county="巴里坤哈萨克自治县" prefecture="哈密地区" province="新疆维吾尔自治区" 652223 county="伊吾县" prefecture="哈密地区" province="新疆维吾尔自治区" 652301 county="昌吉市" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652302 county="阜康市" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652303 county="米泉市" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652323 county="呼图壁县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652324 county="玛纳斯县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652325 county="奇台县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652327 county="吉木萨尔县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652328 county="木垒哈萨克自治县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区" 652701 county="博乐市" prefecture="博尔塔拉蒙古自治州" province="新疆维吾尔自治区" 652702 county="阿拉山口市" prefecture="博尔塔拉蒙古自治州" province="新疆维吾尔自治区" 652722 county="精河县" prefecture="博尔塔拉蒙古自治州" province="新疆维吾尔自治区" 652723 county="温泉县" prefecture="博尔塔拉蒙古自治州" province="新疆维吾尔自治区" 652801 county="库尔勒市" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652822 county="轮台县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652823 county="尉犁县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652824 county="若羌县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652825 county="且末县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652826 county="焉耆回族自治县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652827 county="和静县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652828 county="和硕县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652829 county="博湖县" prefecture="巴音郭楞蒙古自治州" province="新疆维吾尔自治区" 652901 county="阿克苏市" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652922 county="温宿县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652923 county="库车县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652924 county="沙雅县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652925 county="新和县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652926 county="拜城县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652927 county="乌什县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652928 county="阿瓦提县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 652929 county="柯坪县" prefecture="阿克苏地区" province="新疆维吾尔自治区" 653001 county="阿图什市" prefecture="克孜勒苏柯尔克孜自治州" province="新疆维吾尔自治区" 653022 county="阿克陶县" prefecture="克孜勒苏柯尔克孜自治州" province="新疆维吾尔自治区" 653023 county="阿合奇县" prefecture="克孜勒苏柯尔克孜自治州" province="新疆维吾尔自治区" 653024 county="乌恰县" prefecture="克孜勒苏柯尔克孜自治州" province="新疆维吾尔自治区" 653101 county="喀什市" prefecture="喀什地区" province="新疆维吾尔自治区" 653121 county="疏附县" prefecture="喀什地区" province="新疆维吾尔自治区" 653122 county="疏勒县" prefecture="喀什地区" province="新疆维吾尔自治区" 653123 county="英吉沙县" prefecture="喀什地区" province="新疆维吾尔自治区" 653124 county="泽普县" prefecture="喀什地区" province="新疆维吾尔自治区" 653125 county="莎车县" prefecture="喀什地区" province="新疆维吾尔自治区" 653126 county="叶城县" prefecture="喀什地区" province="新疆维吾尔自治区" 653127 county="麦盖提县" prefecture="喀什地区" province="新疆维吾尔自治区" 653128 county="岳普湖县" prefecture="喀什地区" province="新疆维吾尔自治区" 653129 county="伽师县" prefecture="喀什地区" province="新疆维吾尔自治区" 653130 county="巴楚县" prefecture="喀什地区" province="新疆维吾尔自治区" 653131 county="塔什库尔干塔吉克自治县" prefecture="喀什地区" province="新疆维吾尔自治区" 653201 county="和田市" prefecture="和田地区" province="新疆维吾尔自治区" 653221 county="和田县" prefecture="和田地区" province="新疆维吾尔自治区" 653222 county="墨玉县" prefecture="和田地区" province="新疆维吾尔自治区" 653223 county="皮山县" prefecture="和田地区" province="新疆维吾尔自治区" 653224 county="洛浦县" prefecture="和田地区" province="新疆维吾尔自治区" 653225 county="策勒县" prefecture="和田地区" province="新疆维吾尔自治区" 653226 county="于田县" prefecture="和田地区" province="新疆维吾尔自治区" 653227 county="民丰县" prefecture="和田地区" province="新疆维吾尔自治区" 654002 county="伊宁市" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654003 county="奎屯市" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654021 county="伊宁县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654022 county="察布查尔锡伯自治县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654023 county="霍城县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654024 county="巩留县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654025 county="新源县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654026 county="昭苏县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654027 county="特克斯县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654028 county="尼勒克县" prefecture="伊犁哈萨克自治州" province="新疆维吾尔自治区" 654201 county="塔城市" prefecture="塔城地区" province="新疆维吾尔自治区" 654202 county="乌苏市" prefecture="塔城地区" province="新疆维吾尔自治区" 654221 county="额敏县" prefecture="塔城地区" province="新疆维吾尔自治区" 654223 county="沙湾县" prefecture="塔城地区" province="新疆维吾尔自治区" 654224 county="托里县" prefecture="塔城地区" province="新疆维吾尔自治区" 654225 county="裕民县" prefecture="塔城地区" province="新疆维吾尔自治区" 654226 county="和布克赛尔蒙古自治县" prefecture="塔城地区" province="新疆维吾尔自治区" 654301 county="阿勒泰市" prefecture="阿勒泰地区" province="新疆维吾尔自治区" 654321 county="布尔津县" prefecture="阿勒泰地区" province="新疆维吾尔自治区" 654322 county="富蕴县" prefecture="阿勒泰地区" province="新疆维吾尔自治区" 654323 county="福海县" prefecture="阿勒泰地区" province="新疆维吾尔自治区" 654324 county="哈巴河县" prefecture="阿勒泰地区" province="新疆维吾尔自治区" 654325 county="青河县" prefecture="阿勒泰地区" province="新疆维吾尔自治区" 654326 county="吉木乃县" prefecture="阿勒泰地区" province="新疆维吾尔自治区" 659001 county="石河子市" prefecture="自治区直辖县级行政区划" province="新疆维吾尔自治区" 659002 county="阿拉尔市" prefecture="自治区直辖县级行政区划" province="新疆维吾尔自治区" 659003 county="图木舒克市" prefecture="自治区直辖县级行政区划" province="新疆维吾尔自治区" 659004 county="五家渠市" prefecture="自治区直辖县级行政区划" province="新疆维吾尔自治区" python-stdnum-1.8.1/stdnum/cn/ric.py0000644000000000000000000000670613223166520017362 0ustar rootroot00000000000000# ric.py - functions for handling Chinese Resident Identity Card Number # # Copyright (C) 2014 Jiangge Zhang # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """RIC No. (Chinese Resident Identity Card Number). The RIC No. is the unique identifier for issued to China (PRC) residents. The number consist of 18 digits in four sections. The first 6 digits refers to the resident's location, followed by 8 digits represeting the resident's birth day in the form YYYY-MM-DD. The next 3 digits is the order code which is the code used to disambiguate people with the same date of birth and address code. Men are assigned to odd numbers, women assigned to even numbers. The final digit is the checksum. >>> validate('360426199101010071') '360426199101010071' """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number).upper().strip() def get_birth_date(number): """Split the date parts from the number and return the birth date. Note that in some cases it may return the registration date instead of the birth date and it may be a century off.""" number = compact(number) year = int(number[6:10]) month = int(number[10:12]) day = int(number[12:14]) try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def get_birth_place(number): """Use the number to look up the place of birth of the person.""" from stdnum import numdb number = compact(number) results = numdb.get('cn/loc').info(number[:6])[0][1] if not results: raise InvalidComponent() return results def calc_check_digit(number): """Calculate the check digit. The number passed should have the check digit included.""" checksum = (1 - 2 * int(number[:-1], 13)) % 11 return 'X' if checksum == 10 else str(checksum) def validate(number): """Check if the number is a valid RIC number. This checks the length, formatting and birth date and place.""" number = compact(number) if len(number) != 18: raise InvalidLength() if not number[:-1].isdigit(): raise InvalidFormat() if not number[-1].isdigit() and number[-1] != 'X': raise InvalidFormat() if number[-1] != calc_check_digit(number): raise InvalidChecksum() get_birth_date(number) get_birth_place(number) return number def is_valid(number): """Check if the number is a valid RIC number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" return compact(number) python-stdnum-1.8.1/stdnum/iban.dat0000644000000000000000000000612213223166520017226 0ustar rootroot00000000000000# generated from swift_standards_infopaper_ibanregistry_1.txt, # downloaded from https://www.swift.com/node/11971 AD country="Andorra" bban="4!n4!n12!c" AE country="United Arab Emirates (The)" bban="3!n16!n" AL country="Albania" bban="8!n16!c" AT country="Austria" bban="5!n11!n" AZ country="Azerbaijan" bban="4!a20!c" BA country="Bosnia and Herzegovina" bban="3!n3!n8!n2!n" BE country="Belgium" bban="3!n7!n2!n" BG country="Bulgaria" bban="4!a4!n2!n8!c" BH country="Bahrain" bban="4!a14!c" BR country="Brazil" bban="8!n5!n10!n1!a1!c" BY country="Republic of Belarus" bban="4!c4!n16!c" CH country="Switzerland" bban="5!n12!c" CR country="Costa Rica" bban="4!n14!n" CY country="Cyprus" bban="3!n5!n16!c" CZ country="Czechia" bban="4!n6!n10!n" DE country="Germany" bban="8!n10!n" DK country="Denmark" bban="4!n9!n1!n" DO country="Dominican Republic" bban="4!c20!n" EE country="Estonia" bban="2!n2!n11!n1!n" ES country="Spain" bban="4!n4!n1!n1!n10!n" FI country="Finland" bban="3!n11!n" FO country="Faroe Islands" bban="4!n9!n1!n" FR country="France" bban="5!n5!n11!c2!n" GB country="United Kingdom" bban="4!a6!n8!n" GE country="Georgia" bban="2!a16!n" GI country="Gibraltar" bban="4!a15!c" GL country="Greenland" bban="4!n9!n1!n" GR country="Greece" bban="3!n4!n16!c" GT country="Guatemala" bban="4!c20!c" HR country="Croatia" bban="7!n10!n" HU country="Hungary" bban="3!n4!n1!n15!n1!n" IE country="Ireland" bban="4!a6!n8!n" IL country="Israel" bban="3!n3!n13!n" IQ country="Iraq" bban="4!a3!n12!n" IS country="Iceland" bban="4!n2!n6!n10!n" IT country="Italy" bban="1!a5!n5!n12!c" JO country="Jordan" bban="4!a4!n18!c" KW country="Kuwait" bban="4!a22!c" KZ country="Kazakhstan" bban="3!n13!c" LB country="Lebanon" bban="4!n20!c" LC country="Saint Lucia" bban="4!a24!c" LI country="Liechtenstein" bban="5!n12!c" LT country="Lithuania" bban="5!n11!n" LU country="Luxembourg" bban="3!n13!c" LV country="Latvia" bban="4!a13!c" MC country="Monaco" bban="5!n5!n11!c2!n" MD country="Moldova" bban="2!c18!c" ME country="Montenegro" bban="3!n13!n2!n" MK country="Macedonia" bban="3!n10!c2!n" MR country="Mauritania" bban="5!n5!n11!n2!n" MT country="Malta" bban="4!a5!n18!c" MU country="Mauritius" bban="4!a2!n2!n12!n3!n3!a" NL country="Netherlands (The)" bban="4!a10!n" NO country="Norway" bban="4!n6!n1!n" PK country="Pakistan" bban="4!a16!c" PL country="Poland" bban="8!n16!n" PS country="Palestine, State of" bban="4!a21!c" PT country="Portugal" bban="4!n4!n11!n2!n" QA country="Qatar" bban="4!a21!c" RO country="Romania" bban="4!a16!c" RS country="Serbia" bban="3!n13!n2!n" SA country="Saudi Arabia" bban="2!n18!c" SC country="Seychelles" bban="4!a2!n2!n16!n3!a" SE country="Sweden" bban="3!n16!n1!n" SI country="Slovenia" bban="5!n8!n2!n" SK country="Slovakia" bban="4!n6!n10!n" SM country="San Marino" bban="1!a5!n5!n12!c" ST country="Sao Tome and Principe" bban="4!n4!n11!n2!n" SV country="El Salvador" bban="4!a20!n" TL country="Timor-Leste" bban="3!n14!n2!n" TN country="Tunisia" bban="2!n3!n13!n2!n" TR country="Turkey" bban="5!n1!n16!c" UA country="Ukraine" bban="6!n19!c" VG country="Virgin Islands" bban="4!a16!n" XK country="Kosovo" bban="4!n10!n2!n" python-stdnum-1.8.1/stdnum/cusip.py0000644000000000000000000000545313223166520017326 0ustar rootroot00000000000000# cusip.py - functions for handling CUSIP numbers # # Copyright (C) 2015-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CUSIP number (financial security identification number). CUSIP (Committee on Uniform Securities Identification Procedures) numbers are used to identify financial securities. CUSIP numbers are a nine-character alphanumeric code where the first six characters identify the issuer, followed by two digits that identify and a check digit. More information: * https://en.wikipedia.org/wiki/CUSIP * https://www.cusip.com/ >>> validate('DUS0421C5') 'DUS0421C5' >>> validate('DUS0421CN') Traceback (most recent call last): ... InvalidChecksum: ... >>> to_isin('91324PAE2') 'US91324PAE25' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip().upper() # O and I are not valid but are accounted for in the check digit calculation _alphabet = '0123456789ABCDEFGH JKLMN PQRSTUVWXYZ*@#' def calc_check_digit(number): """Calculate the check digits for the number.""" # convert to numeric first, then sum individual digits number = ''.join( str((1, 2)[i % 2] * _alphabet.index(n)) for i, n in enumerate(number)) return str((10 - sum(int(n) for n in number)) % 10) def validate(number): """Check if the number provided is valid. This checks the length and check digit.""" number = compact(number) if not all(x in _alphabet for x in number): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is valid. This checks the length and check digit.""" try: return bool(validate(number)) except ValidationError: return False def to_isin(number): """Convert the number to an ISIN.""" from stdnum import isin return isin.from_natid('US', number) python-stdnum-1.8.1/stdnum/ismn.py0000644000000000000000000001061213223166521017143 0ustar rootroot00000000000000# ismn.py - functions for handling ISMNs # # Copyright (C) 2010-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ISMN (International Standard Music Number). The ISMN (International Standard Music Number) is used to identify sheet music. This module handles both numbers in the 10-digit 13-digit format. >>> validate('979-0-3452-4680-5') '9790345246805' >>> validate('9790060115615') '9790060115615' >>> ismn_type(' M-2306-7118-7') 'ISMN10' >>> validate('9790060115614') Traceback (most recent call last): ... InvalidChecksum: ... >>> compact(' 979-0-3452-4680-5') '9790345246805' >>> format('9790060115615') '979-0-060-11561-5' >>> format('M230671187') '979-0-2306-7118-7' >>> to_ismn13('M230671187') '9790230671187' """ from stdnum import ean from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the ISMN to the minimal representation. This strips the number of any valid ISMN separators and removes surrounding whitespace.""" return clean(number, ' -.').strip().upper() def validate(number): """Check if the number provided is a valid ISMN (either a legacy 10-digit one or a 13-digit one). This checks the length and the check bit but does not check if the publisher is known.""" number = compact(number) if len(number) == 10: if number[0] != 'M': raise InvalidFormat() ean.validate('9790' + number[1:]) elif len(number) == 13: if not number.startswith('9790'): raise InvalidComponent() ean.validate(number) else: raise InvalidLength() return number def ismn_type(number): """Check the type of ISMN number passed and return 'ISMN13', 'ISMN10' or None (for invalid).""" try: number = validate(number) except ValidationError: return None if len(number) == 10: return 'ISMN10' else: # len(number) == 13: return 'ISMN13' def is_valid(number): """Check if the number provided is a valid ISMN (either a legacy 10-digit one or a 13-digit one). This checks the length and the check bit but does not check if the publisher is known.""" try: return bool(validate(number)) except ValidationError: return False def to_ismn13(number): """Convert the number to ISMN13 (EAN) format.""" number = number.strip() min_number = compact(number) if len(min_number) == 13: return number # nothing to do, already 13 digit format # add prefix and strip the M if ' ' in number: return '979 0' + number[1:] elif '-' in number: return '979-0' + number[1:] else: return '9790' + number[1:] # these are the ranges allocated to publisher codes _ranges = ( (3, '000', '099'), (4, '1000', '3999'), (5, '40000', '69999'), (6, '700000', '899999'), (7, '9000000', '9999999')) def split(number): """Split the specified ISMN into a bookland prefix (979), an ISMN prefix (0), a publisher element (3 to 7 digits), an item element (2 to 6 digits) and a check digit.""" # clean up number number = to_ismn13(compact(number)) # find the correct range and split the number for length, low, high in _ranges: # pragma: no branch (all ranges covered) if low <= number[4:4 + length] <= high: return (number[:3], number[3], number[4:4 + length], number[4 + length:-1], number[-1]) def format(number, separator='-'): """Reformat the number to the standard presentation format with the prefixes, the publisher element, the item element and the check-digit separated by the specified separator. The number is converted to the 13-digit format silently.""" return separator.join(x for x in split(number) if x) python-stdnum-1.8.1/stdnum/ee/0000755000000000000000000000000013224171743016217 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ee/kmkr.py0000644000000000000000000000426213223166520017535 0ustar rootroot00000000000000# kmkr.py - functions for handling Estonian VAT numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """KMKR (Käibemaksukohuslase, Estonian VAT number). >>> compact('EE 100 931 558') '100931558' >>> validate('100594102') '100594102' >>> validate('100594103') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' ').upper().strip() if number.startswith('EE'): number = number[2:] return number def checksum(number): """Calculate the checksum.""" weights = (3, 7, 1, 3, 7, 1, 3, 7, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 10 def validate(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ee/ik.py0000644000000000000000000000656013223166520017177 0ustar rootroot00000000000000# ik.py - functions for handling Estonian Personal ID numbers (IK) # coding: utf-8 # # Copyright (C) 2015 Tomas Karasek # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Isikukood (Estonian Personcal ID number). The number consists of 11 digits: the first indicates the gender and century the person was born in, the following 6 digits the birth date, followed by a 3 digit serial and a check digit. >>> validate('36805280109') '36805280109' >>> validate('36805280108') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> get_birth_date('36805280109') datetime.date(1968, 5, 28) """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def get_birth_date(number): """Split the date parts from the number and return the birth date.""" number = compact(number) if number[0] in '12': century = 1800 elif number[0] in '34': century = 1900 elif number[0] in '56': century = 2000 elif number[0] in '78': century = 2100 else: raise InvalidComponent() year = century + int(number[1:3]) month = int(number[3:5]) day = int(number[5:7]) try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def get_gender(number): """Get the person's birth gender ('M' or 'F').""" number = compact(number) if number[0] in '1357': return 'M' elif number[0] in '2468': return 'F' else: raise InvalidComponent() def calc_check_digit(number): """Calculate the check digit.""" check = sum(((i % 9) + 1) * int(n) for i, n in enumerate(number[:-1])) % 11 if check == 10: check = sum((((i + 2) % 9) + 1) * int(n) for i, n in enumerate(number[:-1])) % 11 return str(check % 10) def validate(number): """Check if the number provided is valid. This checks the length, formatting, embedded date and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 11: raise InvalidLength() get_birth_date(number) if number[-1] != calc_check_digit(number): raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is valid. This checks the length, formatting, embedded date and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ee/__init__.py0000644000000000000000000000164313156325246020337 0ustar rootroot00000000000000# __init__.py - collection of Estonian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Estonian numbers.""" # provide vat as an alias from stdnum.ee import kmkr as vat python-stdnum-1.8.1/stdnum/ee/registrikood.py0000644000000000000000000000513713223166520021300 0ustar rootroot00000000000000# registrikood.py - functions for handling the Estonian Registrikood # coding: utf-8 # # Copyright (C) 2017 Holvi Payment Services # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Registrikood (Estonian organisation registration code). All organisations are assigned a unique tax identification code from the commercial register, from the state register or from the non-profit associations and foundations register. The code consists of 8 digits. Commercial company numbers start with a 1, schools and government numbers with a 7, non-profit organisations with an 8 and foundations with a 9. The number uses the same check digit algorithm as the Isikukood although that fact is undocumented. More information: * https://ariregister.rik.ee/ * https://mtr.mkm.ee/ >>> validate('12345678') '12345678' >>> validate('12345679') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('32345674') Traceback (most recent call last): ... InvalidComponent: ... """ from stdnum.ee.ik import calc_check_digit from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def validate(number): """Check if the number provided is valid. This checks the length and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 8: raise InvalidLength() if number[0] not in '1789': raise InvalidComponent() if number[-1] != calc_check_digit(number): raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is valid. This checks the length and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ru/0000755000000000000000000000000013224171744016255 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ru/inn.py0000644000000000000000000000577113223166521017421 0ustar rootroot00000000000000# inn.py - functions for handling Russian VAT numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ИНН (Идентификационный номер налогоплательщика, Russian tax identifier). The Indentifikatzionny nomer nalogoplatel'shchika is a Russian tax identification number that consists 10 digits for companies and 12 digits for persons. >>> validate('123456789047') '123456789047' >>> validate('1234567894') '1234567894' >>> validate('123456789037') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('1234567895') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def calc_company_check_digit(number): """Calculate the check digit for the 10-digit ИНН for organisations.""" weights = (2, 4, 10, 3, 5, 9, 4, 6, 8) return str(sum(weights[i] * int(n) for i, n in enumerate(number[:9])) % 11 % 10) def calc_personal_check_digits(number): """Calculate the check digits for the 12-digit personal ИНН.""" weights = (7, 2, 4, 10, 3, 5, 9, 4, 6, 8) d1 = str(sum(weights[i] * int(n) for i, n in enumerate(number[:10])) % 11 % 10) weights = (3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8) d2 = str(sum(weights[i] * int(n) for i, n in enumerate(number[:10] + d1)) % 11 % 10) return d1 + d2 def validate(number): """Check if the number is a valid ИНН. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) == 10: if calc_company_check_digit(number) != number[-1]: raise InvalidChecksum() elif len(number) == 12: # persons if calc_personal_check_digits(number) != number[-2:]: raise InvalidChecksum() else: raise InvalidLength() return number def is_valid(number): """Check if the number is a valid ИНН.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ru/__init__.py0000644000000000000000000000154413156325252020371 0ustar rootroot00000000000000# __init__.py - collection of Russian numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Russian numbers.""" python-stdnum-1.8.1/stdnum/mc/0000755000000000000000000000000013224171743016225 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/mc/tva.py0000644000000000000000000000370013223166521017366 0ustar rootroot00000000000000# tva.py - functions for handling Monacan TVA numbers # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """n° TVA (taxe sur la valeur ajoutée, Monacan VAT number). For VAT purposes Monaco is treated as territory of France. The number is also validated the same as the French TVA, except that it is not based on a French SIREN. >>> compact('53 0000 04605') 'FR53000004605' >>> validate('53 0000 04605') 'FR53000004605' >>> validate('FR 61 954 506 077') # French numbers are invalid Traceback (most recent call last): ... InvalidComponent: ... """ from stdnum.exceptions import * from stdnum.fr import tva def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return 'FR' + tva.compact(number) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = tva.validate(number) if number[2:5] != '000': raise InvalidComponent() return 'FR' + number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/mc/__init__.py0000644000000000000000000000164013223166521020334 0ustar rootroot00000000000000# __init__.py - collection of Monacan numbers # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Monacan numbers.""" # provide vat as an alias from stdnum.mc import tva as vat python-stdnum-1.8.1/stdnum/gr/0000755000000000000000000000000013224171743016236 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/gr/__init__.py0000644000000000000000000000154013156325250020345 0ustar rootroot00000000000000# __init__.py - collection of Greek numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Greek numbers.""" python-stdnum-1.8.1/stdnum/gr/vat.py0000644000000000000000000000462213223166520017402 0ustar rootroot00000000000000# vat.py - functions for handling Greek VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number). The FPA is a 9-digit number with a simple checksum. >>> compact('GR 23456783') '023456783' >>> validate('EL 094259216 ') '094259216' >>> validate('EL 123456781') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -./:').upper().strip() if number.startswith('EL') or number.startswith('GR'): number = number[2:] if len(number) == 8: number = '0' + number # old format had 8 digits return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" checksum = 0 for n in number: checksum = checksum * 2 + int(n) return str(checksum * 2 % 11 % 10) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/__init__.py0000644000000000000000000000272013224171624017736 0ustar rootroot00000000000000# __init__.py - main module # coding: utf-8 # # Copyright (C) 2010-2018 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Parse, validate and reformat standard numbers and codes. This library offers functions for parsing, validating and reformatting standard numbers and codes in various formats. All modules implement a common interface: >>> from stdnum import isbn >>> isbn.validate('978-9024538270') '9789024538270' >>> isbn.validate('978-9024538271') Traceback (most recent call last): ... InvalidChecksum: ... Apart from the validate() function, many modules provide extra parsing, validation, formatting or conversion functions. """ from stdnum.util import get_cc_module __all__ = ('get_cc_module', '__version__') # the version number of the library __version__ = '1.8.1' python-stdnum-1.8.1/stdnum/imo.py0000644000000000000000000000523213223166520016762 0ustar rootroot00000000000000# imo.py - functions for handling IMO numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """IMO number (International Maritime Organization number). A number used to uniquely identify ships (the hull) for purposes of registering owners and management companies. The ship identification number consists of a six-digit sequentially assigned number and a check digit. The number is usually prefixed with "IMO". Note that there seem to be a large number of ships with an IMO that does not have a valid check digit or even have a different length. >>> validate('IMO 9319466') '9319466' >>> validate('IMO 8814275') '8814275' >>> validate('8814274') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('8814275') 'IMO 8814275' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' ').upper().strip() if number.startswith('IMO'): number = number[3:] return number def calc_check_digit(number): """Calculate the check digits for the number.""" return str(sum(int(n) * (7 - i) for i, n in enumerate(number[:6])) % 10) def validate(number): """Check if the number provided is valid. This checks the length and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 7: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is valid. This checks the length and check digit.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" return 'IMO ' + compact(number) python-stdnum-1.8.1/stdnum/numdb.py0000644000000000000000000001473313223166521017312 0ustar rootroot00000000000000# numdb.py - module for handling hierarchically organised numbers # # Copyright (C) 2010-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Query structured number format files with number properties. This module contains functions for reading and querying a database that stores numbers that use a hierarchical format (e.g. ISBN, IBAN, phone numbers, etc). To read a database from a file: >>> with open('tests/numdb-test.dat', 'r') as f: ... dbfile = read(f) To split a number: >>> dbfile.split('01006') ['0', '100', '6'] >>> dbfile.split('902006') ['90', '20', '06'] >>> dbfile.split('909856') ['90', '985', '6'] To split the number and get properties for each part: >>> dbfile.info('01006') == [ ... ('0', {'prop1': 'foo'}), ... ('100', {'prop2': 'bar'}), ... ('6', {}), ... ] True >>> dbfile.info('02006') == [ ... ('0', {'prop1': 'foo'}), ... ('200', {'prop2': 'bar', 'prop3': 'baz'}), ... ('6', {}), ... ] True >>> dbfile.info('03456') == [ ... ('0', {'prop1': 'foo'}), ... ('345', {'prop2': 'bar', 'prop3': 'baz'}), ... ('6', {}), ... ] True >>> dbfile.info('902006') == [ ... ('90', {'prop1': 'booz'}), ... ('20', {'prop2': 'foo'}), ... ('06', {}), ... ] True >>> dbfile.info('909856') == [ ... ('90', {'prop1': 'booz'}), ... ('985', {'prop2': 'fooz'}), ... ('6', {}), ... ] True >>> dbfile.info('9889') == [ ... ('98', {'prop1': 'booz'}), ... ('89', {'prop2': 'foo'}), ... ] True >>> dbfile.info('633322') == [ ... ('6', {'prop1': 'boo'}), ... ('333', {'prop2': 'bar', 'prop3': 'baz', 'prop4': 'bla'}), ... ('22', {}), ... ] True """ import re from pkg_resources import resource_stream _line_re = re.compile( r'^(?P *)' r'(?P([^-,\s]+(-[^-,\s]+)?)(,[^-,\s]+(-[^-,\s]+)?)*)\s*' r'(?P.*)$') _prop_re = re.compile( r'(?P[0-9a-zA-Z-_]+)="(?P[^"]*)"') # this is a cache of open databases _open_databases = {} # the prefixes attribute of NumDB is structured as follows: # prefixes = [ # [ length, low, high, props, children ] # ... # ] # where children is a prefixes structure in its own right # (there is no expected ordering within the list) class NumDB(object): """Number database.""" def __init__(self): """Construct an empty database.""" self.prefixes = [] @staticmethod def _merge(results): """Merge the provided list of possible results into a single result list (this is a generator).""" # expand the results to all have the same length ml = max(len(x) for x in results) results = [x + (ml - len(x)) * [None] for x in results] # go over each part for parts in zip(*results): # regroup parts into parts list and properties list partlist, proplist = list(zip(*(x for x in parts if x))) part = min(partlist, key=len) props = {} for p in proplist: props.update(p) yield part, props @staticmethod def _find(number, prefixes): """Lookup the specified number in the list of prefixes, this will return basically what info() should return but works recursively.""" if not number: return [] results = [] if prefixes: for length, low, high, props, children in prefixes: if low <= number[:length] <= high and len(number) >= length: results.append([(number[:length], props)] + NumDB._find(number[length:], children)) # not-found fallback if not results: return [(number, {})] # merge the results into a single result return list(NumDB._merge(results)) def info(self, number): """Split the provided number in components and associate properties with each component. This returns a tuple of tuples. Each tuple consists of a string (a part of the number) and a dict of properties. """ return NumDB._find(number, self.prefixes) def split(self, number): """Split the provided number in components. This returns a tuple with the number of components identified.""" return [part for part, props in self.info(number)] def _parse(fp): """Read lines of text from the file pointer and generate indent, length, low, high, properties tuples.""" for line in fp: # ignore comments if line[0] == '#' or line.strip() == '': continue # pragma: no cover (optimisation takes it out) # any other line should parse match = _line_re.search(line) indent = len(match.group('indent')) ranges = match.group('ranges') props = dict(_prop_re.findall(match.group('props'))) for rnge in ranges.split(','): if '-' in rnge: low, high = rnge.split('-') else: low, high = rnge, rnge yield indent, len(low), low, high, props def read(fp): """Return a new database with the data read from the specified file.""" last_indent = 0 db = NumDB() stack = {0: db.prefixes} for indent, length, low, high, props in _parse(fp): if indent > last_indent: # populate the children field of the last indent stack[last_indent][-1][4] = [] stack[indent] = stack[last_indent][-1][4] stack[indent].append([length, low, high, props, None]) last_indent = indent return db def get(name): """Open a database with the specified name to perform queries on.""" if name not in _open_databases: import codecs reader = codecs.getreader('utf-8') with reader(resource_stream(__name__, name + '.dat')) as fp: _open_databases[name] = read(fp) return _open_databases[name] python-stdnum-1.8.1/stdnum/issn.py0000644000000000000000000000604713223166521017160 0ustar rootroot00000000000000# issn.py - functions for handling ISSNs # # Copyright (C) 2010-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ISSN (International Standard Serial Number). The ISSN (International Standard Serial Number) is the standard code to identify periodical publications (e.g. magazines). An ISSN has 8 digits and is formatted in two pairs of 4 digits separated by a hyphen. The last digit is a check digit and may be 0-9 or X (similar to ISBN-10). More information: * https://en.wikipedia.org/wiki/International_Standard_Serial_Number * http://www.issn.org/ >>> validate('0024-9319') '00249319' >>> validate('0032147X') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('003214712') Traceback (most recent call last): ... InvalidLength: ... >>> compact('0032-1478') '00321478' >>> format('00249319') '0024-9319' >>> to_ean('0264-3596') '9770264359008' """ from stdnum import ean from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the ISSN to the minimal representation. This strips the number of any valid ISSN separators and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def calc_check_digit(number): """Calculate the ISSN check digit for 10-digit numbers. The number passed should not have the check bit included.""" check = (11 - sum((8 - i) * int(n) for i, n in enumerate(number))) % 11 return 'X' if check == 10 else str(check) def validate(number): """Check if the number is a valid ISSN. This checks the length and whether the check digit is correct.""" number = compact(number) if not number[:-1].isdigit(): raise InvalidFormat() if len(number) != 8: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid ISSN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:4] + '-' + number[4:] def to_ean(number, issue_code='00'): """Convert the number to EAN-13 format.""" number = '977' + validate(number)[:-1] + issue_code return number + ean.calc_check_digit(number) python-stdnum-1.8.1/stdnum/es/0000755000000000000000000000000013224171743016235 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/es/iban.py0000644000000000000000000000467613223166520017531 0ustar rootroot00000000000000# iban.py - functions for handling Spanish IBANs # coding: utf-8 # # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Spanish IBAN (International Bank Account Number). The IBAN is used to identify bank accounts across national borders. The Spanish IBAN is built up of the IBAN prefix (ES) and check digits, followed by the 20 digit CCC (Código Cuenta Corriente). >>> validate('ES77 1234-1234-16 1234567890') 'ES7712341234161234567890' >>> to_ccc('ES77 1234-1234-16 1234567890') '12341234161234567890' >>> format('ES771234-1234-16 1234567890') 'ES77 1234 1234 1612 3456 7890' >>> validate('GR1601101050000010547023795') # different country Traceback (most recent call last): ... InvalidComponent: ... >>> validate('ES12 1234-1234-16 1234567890') # invalid IBAN check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('ES15 1234-1234-17 1234567890') # invalid CCC check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum import iban from stdnum.es import ccc from stdnum.exceptions import * __all__ = ['compact', 'format', 'to_ccc', 'validate', 'is_valid'] compact = iban.compact format = iban.format def to_ccc(number): """Return the CCC (Código Cuenta Corriente) part of the number.""" number = compact(number) if not number.startswith('ES'): raise InvalidComponent() return number[4:] def validate(number): """Check if the number provided is a valid Spanish IBAN.""" number = iban.validate(number, check_country=False) ccc.validate(to_ccc(number)) return number def is_valid(number): """Check if the number provided is a valid Spanish IBAN.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/es/referenciacatastral.py0000644000000000000000000001034713223166520022612 0ustar rootroot00000000000000# referenciacatastral.py - functions for handling Spanish real state ids # coding: utf-8 # # Copyright (C) 2016 David García Garzón # Copyright (C) 2016-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Referencia Catastral (Spanish real estate property id) The cadastral reference code is an identifier for real estate in Spain. It is issued by Dirección General del Catastro (General Directorate of Land Registry) of the Ministerio de Hacienda (Tresury Ministry). It has 20 digits and contains numbers and letters including the Spanish Ñ. The number consists of 14 digits for the parcel, 4 for identifying properties within the parcel and 2 check digits. The parcel digits are structured differently for urban, non-urban or special (infrastructure) cases. More information: * http://www.catastro.meh.es/esp/referencia_catastral_1.asp (Spanish) * http://www.catastro.meh.es/documentos/05042010_P.pdf (Spanish) * https://es.wikipedia.org/wiki/Catastro#Referencia_catastral >>> validate('7837301-VG8173B-0001 TT') # Lanteira town hall '7837301VG8173B0001TT' >>> validate('783301 VG8173B 0001 TT') # missing digit Traceback (most recent call last): ... InvalidLength: ... >>> validate('7837301/VG8173B 0001 TT') # not alphanumeric Traceback (most recent call last): ... InvalidFormat: ... >>> validate('7837301 VG8173B 0001 NN') # bad check digits Traceback (most recent call last): ... InvalidChecksum: ... >>> format('4A08169P03PRAT0001LR') # BCN Airport '4A08169 P03PRAT 0001 LR' """ from stdnum.exceptions import * from stdnum.util import clean alphabet = u'ABCDEFGHIJKLMNÑOPQRSTUVWXYZ0123456789' def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join([ number[:7], number[7:14], number[14:18], number[18:]]) # The check digit implementation is based on the Javascript # implementation by Vicente Sancho that can be found at # http://trellat.es/validar-la-referencia-catastral-en-javascript/ def _check_digit(number): """Calculate a single check digit on the provided part of the number.""" weights = (13, 15, 12, 5, 4, 17, 9, 21, 3, 7, 1) s = sum(w * (int(n) if n.isdigit() else alphabet.find(n) + 1) for w, n in zip(weights, number)) return 'MQWERTYUIOPASDFGHJKLBZX'[s % 23] def _force_unicode(number): """Convert the number to unicode.""" if not hasattr(number, 'isnumeric'): # pragma: no cover (Python 2 code) number = number.decode('utf-8') return number def calc_check_digits(number): """Calculate the check digits for the number.""" number = _force_unicode(compact(number)) return ( _check_digit(number[0:7] + number[14:18]) + _check_digit(number[7:14] + number[14:18])) def validate(number): """Check if the number is a valid Cadastral Reference. This checks the length, formatting and check digits.""" number = compact(number) n = _force_unicode(number) if not all(c in alphabet for c in n): raise InvalidFormat() if len(n) != 20: raise InvalidLength() if calc_check_digits(n) != n[18:]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid Cadastral Reference.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/es/nie.py0000644000000000000000000000461013223166520017357 0ustar rootroot00000000000000# nie.py - functions for handling Spanish foreigner identity codes # coding: utf-8 # # Copyright (C) 2012-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIE (Número de Identificación de Extranjeros, Spanish foreigner number). The NIE is an identification number for foreigners. It is a 9 digit number where the first digit is either X, Y or Z and last digit is a checksum letter. >>> validate('x-2482300w') 'X2482300W' >>> validate('x-2482300a') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('X2482300') # digit missing Traceback (most recent call last): ... InvalidLength: ... """ from stdnum.es import dni from stdnum.exceptions import * __all__ = ['compact', 'calc_check_digit', 'validate', 'is_valid'] # use the same compact function as DNI compact = dni.compact def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" # replace XYZ with 012 number = str('XYZ'.index(number[0])) + number[1:] return dni.calc_check_digit(number) def validate(number): """Check if the number provided is a valid NIE. This checks the length, formatting and check digit.""" number = compact(number) if not number[1:-1].isdigit() or number[:1] not in 'XYZ': raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid NIE. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/es/__init__.py0000644000000000000000000000164013156325246020352 0ustar rootroot00000000000000# __init__.py - collection of Spanish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Spanish numbers.""" # provide vat as an alias from stdnum.es import nif as vat python-stdnum-1.8.1/stdnum/es/nif.py0000644000000000000000000000527713223166520017372 0ustar rootroot00000000000000# nif.py - functions for handling Spanish NIF (VAT) numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIF (Número de Identificación Fiscal, Spanish VAT number). The Spanish VAT number is a 9-digit number where either the first, last digits or both can be letters. The number is either a DNI (Documento nacional de identidad, for Spaniards), a NIE (Número de Identificación de Extranjeros, for foreigners) or a CIF (Certificado de Identificación Fiscal, for legal entities and others). >>> compact('ES B-58378431') 'B58378431' >>> validate('B64717838') 'B64717838' >>> validate('B64717839') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('54362315K') # resident '54362315K' >>> validate('X-5253868-R') # foreign person 'X5253868R' """ from stdnum.es import cif, dni, nie from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('ES'): number = number[2:] return number def validate(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number[1:-1].isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if number[0].isdigit(): # natural resident dni.validate(number) elif number[0] in 'XYZ': # foreign natural person nie.validate(number) else: # otherwise it has to be a valid CIF cif.validate(number) return number def is_valid(number): """Check if the number provided is a valid VAT number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/es/ccc.py0000644000000000000000000000774513223166520017350 0ustar rootroot00000000000000# ccc.py - functions for handling Spanish CCC bank account code # coding: utf-8 # # Copyright (C) 2016 David García Garzón # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CCC (Código Cuenta Corriente, Spanish Bank Account Code) CCC code is the country-specific part in Spanish IBAN codes. In order to fully validate an Spanish IBAN you have to validate as well the country specific part as a valid CCC. It was used for home banking transactions until February 1st 2014 when IBAN codes started to be used as an account ID. The CCC has 20 digits, all being numbers: EEEE OOOO DD NNNNNNNNNN * EEEE: banking entity * OOOO: office * DD: check digits * NNNNN NNNNN: account identifier This module does not check if the bank code to exist. Existing bank codes are published on the 'Registro de Entidades' by 'Banco de España' (Spanish Central Bank). More information: * https://es.wikipedia.org/wiki/Código_cuenta_cliente * http://www.bde.es/bde/es/secciones/servicios/Particulares_y_e/Registros_de_Ent/ >>> validate('1234-1234-16 1234567890') '12341234161234567890' >>> validate('134-1234-16 1234567890') # wrong length Traceback (most recent call last): ... InvalidLength: ... >>> validate('12X4-1234-16 1234567890') # non numbers Traceback (most recent call last): ... InvalidFormat: ... >>> validate('1234-1234-00 1234567890') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... >>> format('12341234161234567890') '1234 1234 16 12345 67890' >>> to_iban('21000418450200051331') 'ES2121000418450200051331' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join([ number[0:4], number[4:8], number[8:10], number[10:15], number[15:20], ]) def _calc_check_digit(number): """Calculate a single check digit on the provided part of the number.""" check = sum(int(n) * 2 ** i for i, n in enumerate(number)) % 11 return str(check if check < 2 else 11 - check) def calc_check_digits(number): """Calculate the check digits for the number. The supplied number should have check digits included but are ignored.""" number = compact(number) return ( _calc_check_digit('00' + number[:8]) + _calc_check_digit(number[10:])) def validate(number): """Check if the number provided is a valid CCC.""" number = compact(number) if len(number) != 20: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if number[8:10] != calc_check_digits(number): raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid CCC.""" try: return bool(validate(number)) except ValidationError: return False def to_iban(number): """Convert the number to an IBAN.""" from stdnum import iban separator = ' ' if ' ' in number else '' return separator.join(( 'ES' + iban.calc_check_digits('ES00' + number), number)) python-stdnum-1.8.1/stdnum/es/dni.py0000644000000000000000000000473313223166520017364 0ustar rootroot00000000000000# dni.py - functions for handling Spanish personal identity codes # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """DNI (Documento nacional de identidad, Spanish personal identity codes). The DNI is a 9 digit number used to identify Spanish citizens. The last digit is a checksum letter. Foreign nationals, since 2010 are issued an NIE (Número de Identificación de Extranjeros, Foreigner's Identity Number) instead. >>> validate('54362315-K') '54362315K' >>> validate('54362315Z') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('54362315') # digit missing Traceback (most recent call last): ... InvalidLength: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').upper().strip() def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" return 'TRWAGMYFPDXBNJZSQVHLCKE'[int(number) % 23] def validate(number): """Check if the number provided is a valid DNI number. This checks the length, formatting and check digit.""" number = compact(number) if not number[:-1].isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid DNI number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/es/cif.py0000644000000000000000000000721213223166520017346 0ustar rootroot00000000000000# cif.py - functions for handling Spanish fiscal numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CIF (Certificado de Identificación Fiscal, Spanish company tax number). The CIF is a tax identification number for legal entities. It has 9 digits where the first digit is a letter (denoting the type of entity) and the last is a check digit (which may also be a letter). >>> validate('J99216582') 'J99216582' >>> validate('J99216583') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('J992165831') # too long Traceback (most recent call last): ... InvalidLength: ... >>> validate('M-1234567-L') 'M1234567L' >>> validate('O-1234567-L') # invalid first character Traceback (most recent call last): ... InvalidFormat: ... >>> split('A13 585 625') ('A', '13', '58562', '5') """ from stdnum import luhn from stdnum.es import dni from stdnum.exceptions import * __all__ = ['compact', 'validate', 'is_valid', 'split'] # use the same compact function as DNI compact = dni.compact def calc_check_digits(number): """Calculate the check digits for the specified number. The number passed should not have the check digit included. This function returns both the number and character check digit candidates.""" check = luhn.calc_check_digit(number[1:]) return check + 'JABCDEFGHI'[int(check)] def validate(number): """Check if the number provided is a valid DNI number. This checks the length, formatting and check digit.""" number = compact(number) if not number[1:-1].isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if number[0] in 'KLM': # K: Spanish younger than 14 year old # L: Spanish living outside Spain without DNI # M: granted the tax to foreigners who have no NIE # these use the old checkdigit algorithm (the DNI one) if number[-1] != dni.calc_check_digit(number[1:-1]): raise InvalidChecksum() elif number[0] in 'ABCDEFGHJNPQRSUVW': # there seems to be conflicting information on which organisation types # should have which type of check digit (alphabetic or numeric) so # we support either here if number[-1] not in calc_check_digits(number[:-1]): raise InvalidChecksum() else: # anything else is invalid raise InvalidFormat() return number def is_valid(number): """Check if the number provided is a valid DNI number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False def split(number): """Split the provided number into a letter to define the type of organisation, two digits that specify a province, a 5 digit sequence number within the province and a check digit.""" number = compact(number) return number[0], number[1:3], number[3:8], number[8:] python-stdnum-1.8.1/stdnum/es/cups.py0000644000000000000000000000707313223166520017564 0ustar rootroot00000000000000# cups.py - functions for handling Spanish CUPS code # coding: utf-8 # # Copyright (C) 2016 David García Garzón # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CUPS (Código Unificado de Punto de Suministro, Supply Point Unified Code) CUPS codes are used in Spain as unique identifier for energy supply points. They are used both for electricity and pipelined gas. The format is set by the Energy Ministry, and individual codes are issued by each local distribution company. The number consist or 20 or 22 digits and is built up as follows: * LL: (letters) country (always 'ES' since it is a national code) * DDDD: (numbers) distribution company code (numeric) * CCCC CCCC CCCC: identifier within the distribution company (numeric) * EE: (letters) check digits * N: (number) border point sequence * T: (letter) kind of border point More information: * https://es.wikipedia.org/wiki/Código_Unificado_de_Punto_de_Suministro >>> validate('ES 1234-123456789012-JY') 'ES1234123456789012JY' >>> validate('ES 1234-123456789012-JY 1T') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('ES 1234-123456789012-XY 1F') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('ES1234123456789012JY1F') 'ES 1234 1234 5678 9012 JY 1F' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join(( number[:2], number[2:6], number[6:10], number[10:14], number[14:18], number[18:20], number[20:], )).strip() def calc_check_digits(number): """Calculate the check digits for the number.""" alphabet = 'TRWAGMYFPDXBNJZSQVHLCKE' check0, check1 = divmod(int(number[2:18]) % 529, 23) return alphabet[check0] + alphabet[check1] def validate(number): """Check if the number provided is a valid CUPS. This checks length, formatting and check digits.""" number = compact(number) if len(number) not in (20, 22): raise InvalidLength() if number[:2] != 'ES': raise InvalidComponent() if not number[2:18].isdigit(): raise InvalidFormat() if number[20:]: pnumber, ptype = number[20:] if not pnumber.isdigit(): raise InvalidFormat() if ptype not in 'FPRCXYZ': raise InvalidFormat() if calc_check_digits(number) != number[18:20]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid CUPS.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/co/0000755000000000000000000000000013224171743016227 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/co/__init__.py0000644000000000000000000000171513156325246020347 0ustar rootroot00000000000000# __init__.py - collection of Colombian numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Colombian numbers.""" # provide vat and rut as an alias from stdnum.co import nit as vat from stdnum.co import nit as rut python-stdnum-1.8.1/stdnum/co/nit.py0000644000000000000000000000506713223166520017377 0ustar rootroot00000000000000# nit.py - functions for handling Colombian identity codes # coding: utf-8 # # Copyright (C) 2008-2011 Cédric Krier # Copyright (C) 2008-2011 B2CK # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIT (Número De Identificación Tributaria, Colombian identity code). This number, also referred to as RUT (Registro Unico Tributario) is the Colombian business tax number. >>> validate('213.123.432-1') '2131234321' >>> validate('2131234325') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('2131234321') '213.123.432-1' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips surrounding whitespace and separation dash.""" return clean(number, '.,- ').upper().strip() def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" weights = (3, 7, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 59, 67, 71) s = sum(w * int(n) for w, n in zip(weights, reversed(number))) % 11 return '01987654321'[s] def validate(number): """Check if the number is a valid NIT. This checks the length, formatting and check digit.""" number = compact(number) if not 8 <= len(number) <= 16: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid NIT.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return '.'.join( number[i - 3:i] for i in reversed(range(-1, -len(number), -3)) ) + '-' + number[-1] python-stdnum-1.8.1/stdnum/al/0000755000000000000000000000000013224171743016222 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/al/__init__.py0000644000000000000000000000164313156325246020342 0ustar rootroot00000000000000# __init__.py - collection of Albanian numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Albanian numbers.""" # provide vat as an alias from stdnum.al import nipt as vat python-stdnum-1.8.1/stdnum/al/nipt.py0000644000000000000000000000444413223166517017556 0ustar rootroot00000000000000# nipt.py - functions for handling Albanian VAT numbers # coding: utf-8 # # Copyright (C) 2008-2011 Cédric Krier # Copyright (C) 2008-2011 B2CK # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT number). The Albanian NIPT is a 10-digit number with the first and last character being letters. >>> validate('AL J 91402501 L') 'J91402501L' >>> validate('K22218003V') 'K22218003V' >>> validate('(AL) J 91402501') Traceback (most recent call last): ... InvalidLength: ... >>> validate('Z 22218003 V') Traceback (most recent call last): ... InvalidFormat: ... """ import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching number _nipt_re = re.compile(r'^[JKL][0-9]{8}[A-Z]$') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' ').upper().strip() if number.startswith('AL'): number = number[2:] if number.startswith('(AL)'): number = number[4:] return number def validate(number): """Check if the number is a valid VAT number. This checks the length and formatting.""" number = compact(number) if len(number) != 10: raise InvalidLength() if not _nipt_re.match(number): raise InvalidFormat() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/in_/0000755000000000000000000000000013224171743016373 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/in_/pan.py0000644000000000000000000000703313223166520017522 0ustar rootroot00000000000000# pan.py - functions for handling Indian Permanent Account number (PAN) # # Copyright (C) 2017 Srikanth Lakshmanan # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PAN (Permanent Account Number, Indian income tax identifier). The Permanent Account Number (PAN) is a 10 digit alphanumeric identifier for Indian individuals, families and corporates for income tax purposes. The number is built up of 5 characters, 4 numbers and 1 character. The fourth character indicates the type of holder of the number and the last character is computed by an undocumented checksum algorithm. More information: * https://en.wikipedia.org/wiki/Permanent_account_number >>> validate('ACUPA7085R') 'ACUPA7085R' >>> validate('234123412347') Traceback (most recent call last): ... InvalidLength: ... >>> validate('ABMPA32111') # check digit should be a letter Traceback (most recent call last): ... InvalidFormat: ... >>> validate('ABMXA3211G') # invalid type of holder Traceback (most recent call last): ... InvalidComponent: ... >>> mask('AAPPV8261K') 'AAPPVXXXXK' >>> info('AAPPV8261K')['card_holder_type'] 'Individual' """ import re from stdnum.exceptions import * from stdnum.util import clean _pan_re = re.compile(r'^[A-Z]{3}[ABCFGHLJPTK][A-Z]\d{4}[A-Z]$') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').upper().strip() def validate(number): """Check if the number provided is a valid PAN. This checks the length and formatting.""" number = compact(number) if len(number) != 10: raise InvalidLength() if not (number[:5].isalpha() and number[5:-1].isdigit() and number[-1].isalpha()): raise InvalidFormat() info(number) # used to check 4th digit return number def is_valid(number): """Check if the number provided is a valid PAN. This checks the length and formatting.""" try: return bool(validate(number)) except ValidationError: return False _card_holder_types = { 'A': 'Association of Persons (AOP)', 'B': 'Body of Individuals (BOI)', 'C': 'Company', 'F': 'Firm', 'G': 'Government', 'H': 'HUF (Hindu Undivided Family)', 'L': 'Local Authority', 'J': 'Artificial Juridical Person', 'P': 'Individual', 'T': 'Trust (AOP)', 'K': 'Krish (Trust Krish)', } def info(number): """Provide information that can be decoded from the PAN.""" number = compact(number) card_holder_type = _card_holder_types.get(number[3]) if not card_holder_type: raise InvalidComponent() return { 'card_holder_type': card_holder_type, 'initial': number[4], } def mask(number): """Mask the PAN as per CBDT masking standard.""" number = compact(number) return number[:5] + 'XXXX' + number[-1:] python-stdnum-1.8.1/stdnum/in_/__init__.py0000644000000000000000000000154713223166520020507 0ustar rootroot00000000000000# __init__.py - collection of Indian numbers # coding: utf-8 # # Copyright (C) 2017 Srikanth Lakshmanan # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Indian numbers.""" python-stdnum-1.8.1/stdnum/in_/aadhaar.py0000644000000000000000000000561213223166520020326 0ustar rootroot00000000000000# aadhaar.py - functions for handling Indian Aadhaar numbers # # Copyright (C) 2017 Srikanth L # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Aadhaar (Indian digital resident personal identity number) Aadhaar is a 12 digit unique identity number issued to all Indian residents. The number is assigned by the Unique Identification Authority of India (UIDAI). More information: * https://en.wikipedia.org/wiki/Aadhaar >>> validate('234123412346') '234123412346' >>> validate('234123412347') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('123412341234') # number should not start with 0 or 1 Traceback (most recent call last): ... InvalidFormat: ... >>> validate('643343121') Traceback (most recent call last): ... InvalidLength: ... >>> format('234123412346') '2341 2341 2346' >>> mask('234123412346') 'XXXX XXXX 2346' """ import re from stdnum import verhoeff from stdnum.exceptions import * from stdnum.util import clean aadhaar_re = re.compile(r'^[2-9][0-9]{11}$') """Regular expression used to check syntax of Aadhaar numbers.""" def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def validate(number): """Check if the number provided is a valid Aadhaar number. This checks the length, formatting and check digit.""" number = compact(number) if len(number) != 12: raise InvalidLength() if not aadhaar_re.match(number): raise InvalidFormat() verhoeff.validate(number) return number def is_valid(number): """Check if the number provided is a valid Aadhaar number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[:4], number[4:8], number[8:])) def mask(number): """Masks the first 8 digits as per MeitY guidelines for securing identity information and Sensitive personal data.""" number = compact(number) return 'XXXX XXXX ' + number[-4:] python-stdnum-1.8.1/stdnum/isan.py0000644000000000000000000001371013223166520017130 0ustar rootroot00000000000000# isan.py - functions for handling International Standard Audiovisual Numbers # (ISANs) # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ISAN (International Standard Audiovisual Number). The ISAN (International Standard Audiovisual Number) is used to identify audiovisual works. The number is hexadecimal and can consists of at least a root identifier, and an episode or part. After that an optional check digit, optional version and optionally another check digit can be provided. The check digits are validated using the ISO 7064 Mod 37, 36 algorithm. >>> validate('000000018947000000000000') '000000018947000000000000' >>> compact('0000-0000-D07A-0090-Q-0000-0000-X') '00000000D07A009000000000' >>> validate('0000-0001-8CFA-0000-I-0000-0000-K') '000000018CFA0000I00000000K' >>> validate('0000-0001-8CFA-0000-A-0000-0000-K') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('000000018947000000000000') '0000-0001-8947-0000-8-0000-0000-D' >>> to_urn('00000000D07A009000000000') 'URN:ISAN:0000-0000-D07A-0090-Q-0000-0000-X' >>> to_xml('1881-66C7-3420-6541-Y-9F3A-0245-O') '' """ from stdnum.exceptions import * from stdnum.iso7064 import mod_37_36 from stdnum.util import clean def split(number): """Split the number into a root, an episode or part, a check digit a version and another check digit. If any of the parts are missing an empty string is returned.""" number = clean(number, ' -').strip().upper() if len(number) == 17 or len(number) == 26: return number[0:12], number[12:16], number[16], number[17:25], number[25:] elif len(number) > 16: return number[0:12], number[12:16], '', number[16:24], number[24:] else: return number[0:12], number[12:16], number[16:], '', '' def compact(number, strip_check_digits=True): """Convert the ISAN to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace. The check digits are removed by default.""" number = list(split(number)) if strip_check_digits: number[2] = number[4] = '' return ''.join(number) def validate(number, strip_check_digits=False, add_check_digits=False): """Check if the number provided is a valid ISAN. If check digits are present in the number they are validated. If strip_check_digits is True any existing check digits will be removed (after checking). If add_check_digits is True the check digit will be added if they are not present yet.""" (root, episode, check1, version, check2) = split(number) # check digits used for x in root + episode + version: if x not in '0123456789ABCDEF': raise InvalidFormat() # check length of all components if len(root) != 12 or len(episode) != 4 or len(check1) not in (0, 1) or \ len(version) not in (0, 8) or len(check1) not in (0, 1): raise InvalidLength() # allow removing check digits if strip_check_digits: check1 = check2 = '' # check check digits if check1: mod_37_36.validate(root + episode + check1) if check2: mod_37_36.validate(root + episode + version + check2) # add check digits if add_check_digits and not check1: check1 = mod_37_36.calc_check_digit(root + episode) if add_check_digits and not check2 and version: check2 = mod_37_36.calc_check_digit(root + episode + version) return root + episode + check1 + version + check2 def is_valid(number): """Check if the number provided is a valid ISAN. If check digits are present in the number they are validated.""" try: return bool(validate(number)) except ValidationError: return False def format(number, separator='-', strip_check_digits=False, add_check_digits=True): """Reformat the number to the standard presentation format. If add_check_digits is True the check digit will be added if they are not present yet. If both strip_check_digits and add_check_digits are True the check digits will be recalculated.""" (root, episode, check1, version, check2) = split(number) if strip_check_digits: check1 = check2 = '' if add_check_digits and not check1: check1 = mod_37_36.calc_check_digit(root + episode) if add_check_digits and not check2 and version: check2 = mod_37_36.calc_check_digit(root + episode + version) number = [root[i:i + 4] for i in range(0, 12, 4)] + [episode] if check1: number.append(check1) if version: number.extend((version[0:4], version[4:])) if check2: number.append(check2) return separator.join(number) def to_binary(number): """Convert the number to its binary representation (without the check digits).""" from binascii import a2b_hex return a2b_hex(compact(number, strip_check_digits=True)) def to_xml(number): """Return the XML form of the ISAN as a string.""" number = format(number, strip_check_digits=True, add_check_digits=False) return '' % ( number[0:14], number[15:19], number[20:]) def to_urn(number): """Return the URN representation of the ISAN.""" return 'URN:ISAN:' + format(number, add_check_digits=True) python-stdnum-1.8.1/stdnum/bg/0000755000000000000000000000000013224171743016216 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/bg/egn.py0000644000000000000000000000631713223166517017352 0ustar rootroot00000000000000# egn.py - functions for handling Bulgarian national identification numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """EGN (ЕГН, Единен граждански номер, Bulgarian personal identity codes). It is a 10-digit number of which the first 6 digits denote the person's birth date, the next three digits represent a birth order number from which the person's gender can be determined and the last digit is a check digit. >>> compact('752316 926 3') '7523169263' >>> validate('8032056031') '8032056031' >>> get_birth_date('7542011030') datetime.date(2075, 2, 1) >>> validate('7552A10004') # invalid digit Traceback (most recent call last): ... InvalidFormat: ... >>> validate('8019010008') # invalid date Traceback (most recent call last): ... InvalidComponent: ... """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -.').upper().strip() def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" weights = (2, 4, 8, 5, 10, 9, 7, 3, 6) return str(sum(w * int(n) for w, n in zip(weights, number)) % 11 % 10) def get_birth_date(number): """Split the date parts from the number and return the birth date.""" year = int(number[0:2]) + 1900 month = int(number[2:4]) day = int(number[4:6]) if month > 40: year += 100 month -= 40 elif month > 20: year -= 100 month -= 20 try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def validate(number): """Check if the number is a valid national identification number. This checks the length, formatting, embedded date and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() # check if birth date is valid get_birth_date(number) # TODO: check that the birth date is not in the future # check the check digit if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid national identification number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/bg/__init__.py0000644000000000000000000000155013156325246020333 0ustar rootroot00000000000000# __init__.py - collection of Bulgarian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Bulgarian numbers.""" python-stdnum-1.8.1/stdnum/bg/pnf.py0000644000000000000000000000466113223166517017364 0ustar rootroot00000000000000# pnf.py - functions for handling Bulgarian personal number of a foreigner # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner). The personal number of a foreigner is a 10-digit number where the last digit is the result of a weighted checksum. >>> validate('7111 042 925') '7111042925' >>> validate('7111042922') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('71110A2922') # invalid digit Traceback (most recent call last): ... InvalidFormat: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -.').upper().strip() def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" weights = (21, 19, 17, 13, 11, 9, 7, 3, 1) return str(sum(w * int(n) for w, n in zip(weights, number)) % 10) def validate(number): """Check if the number is a valid national identification number. This checks the length, formatting, embedded date and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid national identification number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/bg/vat.py0000644000000000000000000000632213223166517017367 0ustar rootroot00000000000000# vat.py - functions for handling Bulgarian VAT numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VAT (Идентификационен номер по ДДС, Bulgarian VAT number). The Bulgarian VAT (Данък върху добавената стойност) number is either 9 (for legal entities) or 10 digits (for physical persons, foreigners and others) long. Each type of number has its own check digit algorithm. >>> compact('BG 175 074 752') '175074752' >>> validate('175074752') '175074752' >>> validate('175074751') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.bg import egn, pnf from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').upper().strip() if number.startswith('BG'): number = number[2:] return number def calc_check_digit_legal(number): """Calculate the check digit for legal entities. The number passed should not have the check digit included.""" check = sum((i + 1) * int(n) for i, n in enumerate(number)) % 11 if check == 10: check = sum((i + 3) * int(n) for i, n in enumerate(number)) % 11 return str(check % 10) def calc_check_digit_other(number): """Calculate the check digit for others. The number passed should not have the check digit included.""" weights = (4, 3, 2, 7, 6, 5, 4, 3, 2) return str((11 - sum(w * int(n) for w, n in zip(weights, number))) % 11) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) == 9: # 9 digit numbers are for legal entities if number[-1] != calc_check_digit_legal(number[:-1]): raise InvalidChecksum() elif len(number) == 10: # 10 digit numbers are for physical persons, foreigners and others if not egn.is_valid(number) and not pnf.is_valid(number) and \ number[-1] != calc_check_digit_other(number[:-1]): raise InvalidChecksum() else: raise InvalidLength() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/fi/0000755000000000000000000000000013224171743016224 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/fi/veronumero.py0000644000000000000000000000447213223166520021002 0ustar rootroot00000000000000# veronumero.py - functions for handling Finnish individual tax numbers # coding: utf-8 # # Copyright (C) 2017 Holvi Payment Services Oy # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ Veronumero (Finnish individual tax number). The Veronumero an individual tax number that is assigned to workers in the construction industry in Finland. The number is separate from the HETU and is a 12 digit number without any embedded information such as birth dates. More information: * https://www.vero.fi/en/detailed-guidance/guidance/48791/individual_tax_numbers__instructions_fo/ * https://prosentti.vero.fi/Veronumerorekisteri/Tarkistus/VeronumeronTarkistus.aspx >>> validate('123456789123') '123456789123' >>> validate('12345678912A') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('123456789') Traceback (most recent call last): ... InvalidLength: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the Veronumero to the minimal representation. This strips surrounding whitespace and removes separators.""" return clean(number, ' ').strip() def validate(number): """Check if the number is a valid tax number. This checks the length and formatting.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 12: raise InvalidLength() # there is no known check digit validation return number def is_valid(number): """Check if the number is a valid tax number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/fi/hetu.py0000644000000000000000000000670013223166520017542 0ustar rootroot00000000000000# hetu.py - functions for handling Finnish personal identity codes # coding: utf-8 # # Copyright (C) 2011 Jussi Judin # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """HETU (Henkilötunnus, Finnish personal identity code). Module for handling Finnish personal identity codes (HETU, Henkilötunnus). See http://www.vaestorekisterikeskus.fi/default.aspx?id=45 for checksum calculation details and http://tarkistusmerkit.teppovuori.fi/tarkmerk.htm#hetu1 for historical details. >>> validate('131052-308T') '131052-308T' >>> validate('131052-308U') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('310252-308Y') Traceback (most recent call last): ... InvalidComponent: ... >>> compact('131052a308t') '131052A308T' """ import datetime import re from stdnum.exceptions import * from stdnum.util import clean _century_codes = { '+': 1800, '-': 1900, 'A': 2000, } # Finnish personal identity codes are composed of date part, century # indicating sign, individual number and control character. # ddmmyyciiiC _hetu_re = re.compile(r'^(?P[0123]\d)(?P[01]\d)(?P\d\d)' r'(?P[-+A])(?P\d\d\d)' r'(?P[0-9ABCDEFHJKLMNPRSTUVWXY])$') def compact(number): """Convert the HETU to the minimal representation. This strips surrounding whitespace and converts it to upper case.""" return clean(number, '').upper().strip() def _calc_checksum(number): return '0123456789ABCDEFHJKLMNPRSTUVWXY'[int(number) % 31] def validate(number): """Check if the number is a valid HETU. It checks the format, whether a valid date is given and whether the check digit is correct.""" number = compact(number) match = _hetu_re.search(number) if not match: raise InvalidFormat() day = int(match.group('day')) month = int(match.group('month')) year = int(match.group('year')) century = _century_codes[match.group('century')] individual = int(match.group('individual')) # check if birth date is valid try: datetime.date(century + year, month, day) except ValueError: raise InvalidComponent() # for historical reasons individual IDs start from 002 if individual < 2: raise InvalidComponent() checkable_number = '%02d%02d%02d%03d' % (day, month, year, individual) if match.group('control') != _calc_checksum(checkable_number): raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid HETU.""" try: return bool(validate(number)) except ValidationError: return False # This is here just for completeness as there are no different length forms # of Finnish personal identity codes: format = compact python-stdnum-1.8.1/stdnum/fi/ytunnus.py0000644000000000000000000000367013223166520020325 0ustar rootroot00000000000000# ytunnus.py - functions for handling Finnish business identifiers (y-tunnus) # coding: utf-8 # # Copyright (C) 2015 Holvi Payment Services Oy # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Y-tunnus (Finnish business identifier). The number is an 8-digit code with a weighted checksum. >>> validate('2077474-0') '20774740' >>> validate('2077474-1') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> format('2077474-0') '2077474-0' """ from stdnum.exceptions import * from stdnum.fi import alv def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return alv.compact(number) def validate(number): """Check if the number is a valid business identifier. This checks the length, formatting and check digit.""" return alv.validate(number) def is_valid(number): """Check if the number is a valid business identifier.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:7] + '-' + number[7:] python-stdnum-1.8.1/stdnum/fi/__init__.py0000644000000000000000000000176513223166520020342 0ustar rootroot00000000000000# __init__.py - collection of Finnish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Finnish numbers.""" # provide vat as an alias from stdnum.fi import alv as vat from stdnum.fi import hetu as personalid from stdnum.fi import ytunnus as businessid python-stdnum-1.8.1/stdnum/fi/associationid.py0000644000000000000000000000535613223166520021434 0ustar rootroot00000000000000# associationid.py - functions for handling Finnish association registry id # coding: utf-8 # # Copyright (C) 2015 Holvi Payment Services Oy # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Finnish Association Identifier. The number consists of 1 to 6 digits that are normally separated with a dot in groups of 0-3 and 0-3 numbers. E.g. 123.123, 12.123, 1.123, 123 or 1. >>> validate('123.123') '123123' >>> validate('1123') '1123' >>> validate('123123123') Traceback (most recent call last): ... InvalidLength: The number has an invalid length. >>> validate('12df') Traceback (most recent call last): ... InvalidFormat: The number has an invalid format. >>> format('123') '123' >>> format('1234') '1.234' """ from stdnum.exceptions import * from stdnum.util import clean # a collection of all registered numbers with 2 or less digits _lownumbers = set(( 1, 6, 7, 9, 12, 14, 15, 16, 18, 22, 23, 24, 27, 28, 29, 35, 36, 38, 40, 41, 42, 43, 45, 46, 50, 52, 55, 58, 60, 64, 65, 68, 72, 75, 76, 77, 78, 83, 84, 85, 89, 92)) def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -._+').strip() def validate(number): """Check if the number is a valid Finnish association register number. This checks the length and format.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) < 1 or len(number) > 6: raise InvalidLength() if len(number) < 3 and int(number) not in _lownumbers: raise InvalidComponent() return number def is_valid(number): """Check if the number is a valid association register number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) if len(number) <= 3: return number else: return number[:-3] + '.' + number[-3:] python-stdnum-1.8.1/stdnum/fi/alv.py0000644000000000000000000000416713223166520017364 0ustar rootroot00000000000000# vat.py - functions for handling Finnish VAT numbers # coding: utf-8 # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ALV nro (Arvonlisäveronumero, Finnish VAT number). The number is an 8-digit code with a weighted checksum. >>> validate('FI 20774740') '20774740' >>> validate('FI 20774741') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('FI'): number = number[2:] return number def checksum(number): """Calculate the checksum.""" weights = (7, 9, 10, 5, 8, 4, 2, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 8: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/util.py0000644000000000000000000001770413223203676017166 0ustar rootroot00000000000000# util.py - common utility functions # coding: utf-8 # # Copyright (C) 2012-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Common utility functions for other stdnum modules. This module is meant for internal use by stdnum modules and is not guaranteed to remain stable and as such not part of the public API of stdnum. """ import pkgutil import pydoc import re import sys import unicodedata import warnings from stdnum.exceptions import * _strip_doctest_re = re.compile(r'^>>> .*\Z', re.DOTALL | re.MULTILINE) def _mk_char_map(mapping): """Transform a dictionary with comma separated uniode chracter names to tuples with unicode characters as key.""" for key, value in mapping.items(): for char in key.split(','): try: yield (unicodedata.lookup(char), value) except KeyError: # pragma: no cover (does not happen on Python3) pass # build mapping of Unicode characters to equivalent ASCII characters _char_map = dict(_mk_char_map({ 'HYPHEN-MINUS,ARMENIAN HYPHEN,HEBREW PUNCTUATION MAQAF,HYPHEN,' 'NON-BREAKING HYPHEN,FIGURE DASH,EN DASH,EM DASH,HORIZONTAL BAR,' 'SMALL HYPHEN-MINUS,FULLWIDTH HYPHEN-MINUS,MONGOLIAN NIRUGU,OVERLINE,' 'HYPHEN BULLET,MACRON,MODIFIER LETTER MINUS SIGN,FULLWIDTH MACRON,' 'OGHAM SPACE MARK,SUPERSCRIPT MINUS,SUBSCRIPT MINUS,MINUS SIGN,' 'HORIZONTAL LINE EXTENSION,HORIZONTAL SCAN LINE-1,HORIZONTAL SCAN LINE-3,' 'HORIZONTAL SCAN LINE-7,HORIZONTAL SCAN LINE-9,STRAIGHTNESS': '-', 'ASTERISK,ARABIC FIVE POINTED STAR,SYRIAC HARKLEAN ASTERISCUS,' 'FLOWER PUNCTUATION MARK,VAI FULL STOP,SMALL ASTERISK,FULLWIDTH ASTERISK,' 'ASTERISK OPERATOR,STAR OPERATOR,HEAVY ASTERISK,LOW ASTERISK,' 'OPEN CENTRE ASTERISK,EIGHT SPOKED ASTERISK,SIXTEEN POINTED ASTERISK,' 'TEARDROP-SPOKED ASTERISK,OPEN CENTRE TEARDROP-SPOKED ASTERISK,' 'HEAVY TEARDROP-SPOKED ASTERISK,EIGHT TEARDROP-SPOKED PROPELLER ASTERISK,' 'HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK,' 'ARABIC FIVE POINTED STAR': '*', 'COMMA,ARABIC COMMA,SINGLE LOW-9 QUOTATION MARK,IDEOGRAPHIC COMMA,' 'ARABIC DECIMAL SEPARATOR,ARABIC THOUSANDS SEPARATOR,PRIME,RAISED COMMA,' 'PRESENTATION FORM FOR VERTICAL COMMA,SMALL COMMA,' 'SMALL IDEOGRAPHIC COMMA,FULLWIDTH COMMA,CEDILLA': ',', 'FULL STOP,MIDDLE DOT,GREEK ANO TELEIA,ARABIC FULL STOP,' 'IDEOGRAPHIC FULL STOP,SYRIAC SUPRALINEAR FULL STOP,' 'SYRIAC SUBLINEAR FULL STOP,SAMARITAN PUNCTUATION NEQUDAA,' 'TIBETAN MARK INTERSYLLABIC TSHEG,TIBETAN MARK DELIMITER TSHEG BSTAR,' 'RUNIC SINGLE PUNCTUATION,BULLET,ONE DOT LEADER,HYPHENATION POINT,' 'WORD SEPARATOR MIDDLE DOT,RAISED DOT,KATAKANA MIDDLE DOT,' 'SMALL FULL STOP,FULLWIDTH FULL STOP,HALFWIDTH KATAKANA MIDDLE DOT,' 'AEGEAN WORD SEPARATOR DOT,PHOENICIAN WORD SEPARATOR,' 'KHAROSHTHI PUNCTUATION DOT,DOT ABOVE,ARABIC SYMBOL DOT ABOVE,' 'ARABIC SYMBOL DOT BELOW,BULLET OPERATOR,DOT OPERATOR': '.', 'SOLIDUS,SAMARITAN PUNCTUATION ARKAANU,FULLWIDTH SOLIDUS,DIVISION SLASH,' 'MATHEMATICAL RISING DIAGONAL,BIG SOLIDUS,FRACTION SLASH': '/', 'COLON,ETHIOPIC WORDSPACE,RUNIC MULTIPLE PUNCTUATION,MONGOLIAN COLON,' 'PRESENTATION FORM FOR VERTICAL COLON,FULLWIDTH COLON,' 'PRESENTATION FORM FOR VERTICAL TWO DOT LEADER,SMALL COLON': ':', 'SPACE,NO-BREAK SPACE,EN QUAD,EM QUAD,EN SPACE,EM SPACE,' 'THREE-PER-EM SPACE,FOUR-PER-EM SPACE,SIX-PER-EM SPACE,FIGURE SPACE,' 'PUNCTUATION SPACE,THIN SPACE,HAIR SPACE,NARROW NO-BREAK SPACE,' 'MEDIUM MATHEMATICAL SPACE,IDEOGRAPHIC SPACE': ' ', })) def _clean_chars(number): """Replace various Unicode characters with their ASCII counterpart.""" return ''.join(_char_map.get(x, x) for x in number) def clean(number, deletechars=''): """Remove the specified characters from the supplied number. >>> clean('123-456:78 9', ' -:') '123456789' >>> clean('1–2—3―4') '1-2-3-4' """ try: number = ''.join(x for x in number) except Exception: raise InvalidFormat() if sys.version < '3' and isinstance(number, str): # pragma: no cover (Python 2 specific code) try: number = _clean_chars(number.decode()).encode() except UnicodeError: try: number = _clean_chars(number.decode('utf-8')).encode('utf-8') except UnicodeError: pass else: # pragma: no cover (Python 3 specific code) number = _clean_chars(number) return ''.join(x for x in number if x not in deletechars) def get_number_modules(base='stdnum'): """Yield all the number validation modules under the specified module.""" __import__(base) module = sys.modules[base] # we ignore deprecation warnings from transitional modules with warnings.catch_warnings(): warnings.filterwarnings('ignore', category=DeprecationWarning, module=r'stdnum\..*') for _loader, name, _is_pkg in pkgutil.walk_packages( module.__path__, module.__name__ + '.'): __import__(name) module = sys.modules[name] if hasattr(module, 'validate') and module.__name__ == name: yield module def get_module_name(module): """Return the short description of the number.""" return pydoc.splitdoc(pydoc.getdoc(module))[0].strip('.') def get_module_description(module): """Return a description of the number.""" doc = pydoc.splitdoc(pydoc.getdoc(module))[1] # remove the doctests return _strip_doctest_re.sub('', doc).strip() def get_cc_module(cc, name): """Find the country-specific named module.""" cc = cc.lower() # add suffix for python reserved words if cc in ('in', 'is', 'if'): cc += '_' try: mod = __import__('stdnum.%s' % cc, globals(), locals(), [str(name)]) return getattr(mod, name, None) except ImportError: return # this is a cache of SOAP clients _soap_clients = {} def get_soap_client(wsdlurl): # pragma: no cover (not part of normal test suite) """Get a SOAP client for performing requests. The client is cached.""" # this function isn't automatically tested because the functions using # it are not automatically tested if wsdlurl not in _soap_clients: # try zeep first try: from zeep import CachingClient client = CachingClient(wsdlurl).service except ImportError: # fall back to non-caching zeep client try: from zeep import Client client = Client(wsdlurl).service except ImportError: # other implementations require passing the proxy config try: from urllib import getproxies except ImportError: from urllib.request import getproxies # fall back to suds try: from suds.client import Client client = Client(wsdlurl, proxy=getproxies()).service except ImportError: # use pysimplesoap as last resort from pysimplesoap.client import SoapClient client = SoapClient(wsdl=wsdlurl, proxy=getproxies()) _soap_clients[wsdlurl] = client return _soap_clients[wsdlurl] python-stdnum-1.8.1/stdnum/bic.py0000644000000000000000000000473513223166517016750 0ustar rootroot00000000000000# bic.py - functions for handling ISO 9362 Business identifier codes # # Copyright (C) 2015 Lifealike Ltd # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """BIC (ISO 9362 Business identifier codes). An ISO 9362 identifier (also: BIC, BEI, or SWIFT code) uniquely identifies an institution. They are commonly used to route financial transactions. The code consists of a 4 letter institution code, a 2 letter country code, and a 2 character location code, optionally followed by a three character branch code. >>> validate('AGRIFRPP882') 'AGRIFRPP882' >>> validate('AGRIFRPP') 'AGRIFRPP' >>> validate('AGRIFRPP8') Traceback (most recent call last): ... InvalidLength: .. >>> validate('AGRIF2PP') # country code can't contain digits Traceback (most recent call last): ... InvalidFormat: .. >>> format('agriFRPP') # conventionally caps 'AGRIFRPP' """ import re from stdnum.exceptions import * from stdnum.util import clean _bic_re = re.compile(r'^[A-Z]{6}[0-9A-Z]{2}([0-9A-Z]{3})?$') def compact(number): """Convert the number to the minimal representation. This strips the number of any surrounding whitespace.""" return clean(number).strip().upper() def validate(number): """Check if the number is a valid routing number. This checks the length and characters in each position.""" number = compact(number) if len(number) not in (8, 11): raise InvalidLength() match = _bic_re.search(number) if not match: raise InvalidFormat() return number def is_valid(number): """Check if the number provided is a valid BIC.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" return compact(number) python-stdnum-1.8.1/stdnum/iso6346.py0000644000000000000000000000620513223166521017315 0ustar rootroot00000000000000# iso6346.py - functions for handling ISO 6346 # # Copyright (C) 2014 Openlabs Technologies & Consulting (P) Limited # Copyright (C) 2014-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ISO 6346 (International standard for container identification) ISO 6346 is an international standard covering the coding, identification and marking of intermodal (shipping) containers used within containerized intermodal freight transport. The standard establishes a visual identification system for every container that includes a unique serial number (with check digit), the owner, a country code, a size, type and equipment category as well as any operational marks. The standard is managed by the International Container Bureau (BIC). More information: * https://en.wikipedia.org/wiki/ISO_6346 >>> validate('csqu3054383') 'CSQU3054383' >>> validate('CSQU3054384') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('tasu117 000 0') 'TASU 117000 0' """ import re from stdnum.exceptions import InvalidChecksum, InvalidFormat, InvalidLength, \ ValidationError from stdnum.util import clean _iso6346_re = re.compile(r'^\w{3}(U|J|Z|R)\d{7}$') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip().upper() def calc_check_digit(number): """Calculate check digit and return it for the 10 digit owner code and serial number.""" number = compact(number) alphabet = '0123456789A BCDEFGHIJK LMNOPQRSTU VWXYZ' return str(sum( alphabet.index(n) * pow(2, i) for i, n in enumerate(number)) % 11 % 10) def validate(number): """Validate the given number (unicode) for conformity to ISO 6346.""" number = compact(number) if len(number) != 11: raise InvalidLength() if not _iso6346_re.match(number): raise InvalidFormat() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check whether the number conforms to the standard ISO6346. Unlike the validate function, this will not raise ValidationError(s).""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[:4], number[4:-1], number[-1:])) python-stdnum-1.8.1/stdnum/do/0000755000000000000000000000000013224171743016230 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/do/rnc.py0000644000000000000000000001457513223166520017374 0ustar rootroot00000000000000# rnc.py - functions for handling Dominican Republic tax registration # coding: utf-8 # # Copyright (C) 2015-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # Development of this functionality was funded by iterativo | http://iterativo.do """RNC (Registro Nacional del Contribuyente, Dominican Republic tax number). The RNC is the Dominican Republic taxpayer registration number for institutions. The number consists of 9 digits. >>> validate('1-01-85004-3') '101850043' >>> validate('1018A0043') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('101850042') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('131246796') '1-31-24679-6' """ import json from stdnum.exceptions import * from stdnum.util import clean, get_soap_client # list of RNCs that do not match the checksum but are nonetheless valid whitelist = set(''' 101581601 101582245 101595422 101595785 10233317 131188691 401007374 501341601 501378067 501620371 501651319 501651823 501651845 501651926 501656006 501658167 501670785 501676936 501680158 504654542 504680029 504681442 505038691 '''.split()) dgii_wsdl = 'http://www.dgii.gov.do/wsMovilDGII/WSMovilDGII.asmx?WSDL' """The WSDL URL of DGII validation service.""" def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def calc_check_digit(number): """Calculate the check digit.""" weights = (7, 9, 8, 6, 5, 4, 3, 2) check = sum(w * int(n) for w, n in zip(weights, number)) % 11 return str((10 - check) % 9 + 1) def validate(number): """Check if the number provided is a valid RNC.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if number in whitelist: return number if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid RNC.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return '-'.join((number[:1], number[1:3], number[3:-1], number[-1])) def _convert_result(result): # pragma: no cover """Translate SOAP result entries into dicts.""" translation = { 'RGE_RUC': 'rnc', 'RGE_NOMBRE': 'name', 'NOMBRE_COMERCIAL': 'commercial_name', 'CATEGORIA': 'category', 'REGIMEN_PAGOS': 'payment_regime', 'ESTATUS': 'status', 'RNUM': 'result_number', } return dict( (translation.get(key, key), value) for key, value in json.loads(result.replace('\t', '\\t')).items()) def check_dgii(number): # pragma: no cover """Lookup the number using the DGII online web service. This uses the validation service run by the the Dirección General de Impuestos Internos, the Dominican Republic tax department to lookup registration information for the number. Returns a dict with the following structure:: { 'rnc': '123456789', # The requested number 'name': 'The registered name', 'commercial_name': 'An additional commercial name', 'status': '2', # 1: inactive, 2: active 'category': '0', # always 0? 'payment_regime': '2', # 1: N/D, 2: NORMAL, 3: PST } Will return none if the number is invalid or unknown.""" # this function isn't automatically tested because it would require # network access for the tests and unnecessarily load the online service number = compact(number) client = get_soap_client(dgii_wsdl) result = '%s' % client.GetContribuyentes( value=number, patronBusqueda=0, # search type: 0=by number, 1=by name inicioFilas=1, # start result (1-based) filaFilas=1, # end result IMEI='') if result == '0': return return _convert_result(result) def search_dgii(keyword, end_at=10, start_at=1): # pragma: no cover """Search the DGII online web service using the keyword. This uses the validation service run by the the Dirección General de Impuestos Internos, the Dominican Republic tax department to search the registration information using the keyword. The number of entries returned can be tuned with the `end_at` and `start_at` arguments. Returns a list of dicts with the following structure:: [ { 'rnc': '123456789', # The found number 'name': 'The registered name', 'commercial_name': 'An additional commercial name', 'status': '2', # 1: inactive, 2: active 'category': '0', # always 0? 'payment_regime': '2', # 1: N/D, 2: NORMAL, 3: PST 'result_number': '1', # index of the result }, ... ] Will return an empty list if the number is invalid or unknown.""" # this function isn't automatically tested because it would require # network access for the tests and unnecessarily load the online service client = get_soap_client(dgii_wsdl) results = '%s' % client.GetContribuyentes( value=keyword, patronBusqueda=1, # search type: 0=by number, 1=by name inicioFilas=start_at, # start result (1-based) filaFilas=end_at, # end result IMEI='') if results == '0': return [] return [_convert_result(result) for result in results.split('@@@')] python-stdnum-1.8.1/stdnum/do/__init__.py0000644000000000000000000000163413156325246020350 0ustar rootroot00000000000000# __init__.py - collection of Dominican Republic numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Dominican Republic numbers.""" from stdnum.do import rnc as vat python-stdnum-1.8.1/stdnum/do/cedula.py0000644000000000000000000002215213223166520020035 0ustar rootroot00000000000000# cedula.py - functions for handling Dominican Republic national identifier # # Copyright (C) 2015-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Cedula (Dominican Republic national identification number). A cedula is is an 11-digit number issues by the Dominican Republic government to citizens or residents for identification purposes. >>> validate('00113918205') '00113918205' >>> validate('00113918204') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('0011391820A') Traceback (most recent call last): ... InvalidFormat: ... >>> format('22400022111') '224-0002211-1' """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean # list of Cedulas that do not match the checksum but are nonetheless valid whitelist = set(''' 00000021249 00000031417 00000035692 00000045342 00000058035 00000065377 00000078587 00000111941 00000126295 00000129963 00000140874 00000144491 00000155482 00000195576 00000236621 00000292212 00000302347 00000404655 00000547495 00000564933 00000669773 00000719400 00001965804 00004110056 00006747587 00010130085 00010628559 00077584000 00100000169 00100012146 00100013114 00100016495 00100053841 00100061611 00100061945 00100074627 00100083860 00100101767 00100126468 00100145737 00100165504 00100169706 00100172940 00100174666 00100181057 00100228718 00100231017 00100238382 00100239662 00100255349 00100288143 00100288929 00100322649 00100336027 00100350928 00100378440 00100384268 00100384523 00100415853 00100430989 00100523399 00100524531 00100530588 00100531007 00100587320 00100590683 00100593378 00100622461 00100664086 00100709215 00100728113 00100729795 00100756082 00100759932 00101118022 00101166065 00101234090 00101527366 00101541404 00101621981 00101659661 00101684656 00101686299 00101821735 00101961125 00102025201 00102398239 00102577448 00102630192 00103266558 00103436936 00103443802 00103754365 00103766231 00103822440 00103983004 00104486903 00104532086 00104662561 00104727362 00104785104 00104862525 00104966313 00105263314 00105328185 00105512386 00105530894 00105606543 00105832408 00106190966 00106284933 00106418989 00106442522 00106479922 00106916538 00107045499 00107075090 00107184305 00107445493 00107602067 00107665688 00107687383 00107691942 00108113363 00108132448 00108184024 00108264871 00108286792 00108384121 00108413431 00108497822 00108784684 00108796883 00108940225 00109183462 00109229090 00109402756 00109785951 00109987435 00110047715 00110071113 00110111536 00110490843 00110578459 00110646203 00111014782 00111150559 00113453700 00114272360 00114532330 00114532355 00114687216 00115039795 00115343847 00116256005 00116448241 00116508511 00117582001 00119161853 00121344165 00121581750 00121581800 00129737056 00130610001 00131257003 00133987848 00134588056 00142864013 00143072001 00144435001 00146965001 00147485003 00149657590 00155144906 00160405001 00161884001 00162906003 00163540003 00163549012 00163709018 00166457056 00166533003 00167311001 00170009162 00170115579 00171404771 00174729003 00174940001 00181880003 00184129003 00189213001 00189405093 00190002567 00196714003 00200021994 00200028716 00200040516 00200063601 00200123640 00200291381 00200409772 00200435544 00200969260 00201023001 00202110760 00202744522 00207327056 00208430205 00208832003 00218507031 00222017001 00235482001 00236245013 00241997013 00246160013 00261011013 00270764013 00274652001 00278005023 00289931003 00291431001 00291549003 00297018001 00298109001 00299724003 00300001538 00300011700 00300013835 00300015531 00300017875 00300019575 00300020806 00300025568 00300040413 00300052890 00300169535 00300244009 00300636564 00301200901 00305535206 00345425001 00352861001 00356533003 00362684023 00376023023 00388338093 00400001552 00400001614 00400012957 00400189811 00409169001 00425759001 00435518003 00475916056 00481106001 00481595003 00493593003 00500335596 00516077003 00520207699 00524571001 00539342005 00540077717 00544657001 00561269169 00572030001 00574599001 00599408003 00633126023 00644236001 00648496171 00651322001 00686904003 00701067521 00720758056 00731054054 00741721056 00757398001 00800106971 00848583056 00857630012 0094662667 00971815056 01000005580 01000250733 01000268998 01000728704 01000855890 01038813907 01094560111 01100014261 01100620962 01103552230 01133025660 01154421047 01200004166 01200008613 01200011252 01200014133 01200027863 01200033420 01200038298 01200771767 01300001142 01300005424 01300020331 01400000282 01400074875 01600009531 01600019983 01600026316 01600027894 01650257001 01700052445 01700200811 01800022457 01800058439 01800527104 01810035037 02038569001 02100061022 02300003061 02300023225 02300031758 02300037618 02300047220 02300052220 02300054193 02300062066 02300085158 02400229955 02500045676 02600036132 02600094954 02700029905 02755972001 02800000129 02800021761 02800025877 02800029588 02831146001 03000411295 03100001162 03100018730 03100034839 03100083297 03100109611 03100156525 03100195659 03100231390 03100232921 03100277078 03100304632 03100332296 03100398552 03100442457 03100486248 03100488033 03100620176 03100654224 03100668294 03100673050 03100771674 03100789636 03100831768 03100963776 03100984652 03101014877 03101070888 03101105802 03101162278 03101409196 03101456639 03101477254 03101577963 03101713684 03101977306 03102342076 03102399233 03102678700 03102805428 03102828522 03102936385 03103202719 03103315310 03103317617 03103749672 03104354892 03107049671 03108309308 03111670001 03121982479 03131503831 03170483480 03200023002 03200066940 03300023841 03400058730 03400157849 03401709701 03500037890 03600046116 03600127038 03600180637 03700663589 03800032522 03807240010 03852380001 03900069856 03900192284 04022130495 04200012900 04400002002 04400627868 04600198229 04700004024 04700020933 04700027064 04700061076 04700070460 04700074827 04700211635 04700221469 04700728184 04701174268 04800019561 04800034846 04800046910 04800956889 04801245892 04900009932 04900011690 04900013913 04900014592 04900026260 04900028443 04900448230 04902549001 04941042001 05100085656 05300013029 05300013204 05300123494 05400016031 05400021759 05400022042 05400028496 05400033166 05400034790 05400037495 05400038776 05400040523 05400047674 05400048248 05400049237 05400049834 05400050196 05400050304 05400052300 05400053627 05400054156 05400055485 05400055770 05400057300 05400057684 05400058964 05400059956 05400060743 05400062459 05400065376 05400067703 05400072273 05400076481 05400216948 05400878578 05500003079 05500006796 05500008806 05500012039 05500014375 05500017761 05500021118 05500022399 05500023407 05500024135 05500024190 05500027749 05500028350 05500032681 05500173451 05500303477 05600037761 05600038251 05600038964 05600051191 05600063115 05600166034 05600267737 05600553831 05700004693 05700064077 05700071202 05900072869 05900105969 06100007818 06100009131 06100011935 06100013662 06100016486 06100017058 06337850001 06400007916 06400011981 06400014372 06400069279 06486186001 06500162568 06800008448 06800245196 06843739551 06900069184 07000007872 07100018031 07100063262 0710208838 07400001254 07401860112 07600000691 07700009346 07800000968 07800002361 08000213172 08016809001 08100002398 08400068380 08498619001 08800002823 08800003986 08800005068 08900001310 08900004344 08900004849 08900005064 08952698001 09000117963 09000169133 09010011235 09022066011 09200533048 09300006239 09300035357 09400022178 09421581768 09500001177 09500003211 09500008222 09700003030 09700179110 09900017864 10061805811 10100178199 10201116357 10462157001 10491297001 10621581792 10983439110 11700000658 12019831001 12300074628 21000000000 22321581834 22721581818 40200401324 40200452735 40200639953 40200700675 58005174058 90001200901 '''.split()) def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def validate(number): """Check if the number provided is a valid cedula.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if number in whitelist: return number if len(number) != 11: raise InvalidLength() return luhn.validate(number) def is_valid(number): """Check if the number provided is a valid cedula.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return '-'.join((number[:3], number[3:-1], number[-1])) python-stdnum-1.8.1/stdnum/do/ncf.py0000644000000000000000000001055013223166520017345 0ustar rootroot00000000000000# ncf.py - functions for handling Dominican Republic invoice numbers # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # Development of this functionality was funded by iterativo | http://iterativo.do """NCF (Números de Comprobante Fiscal, Dominican Republic receipt number). The NCF is used to number invoices and other documents for the purposes of tax filing. The number is 19 digits long and consists of a letter (A or P) to indicate that the number was assigned by the taxpayer or the DGIT, followed a 2-digit business unit number, a 3-digit location number, a 3-digit mechanism identifier, a 2-digit document type and a 8-digit serial number. More information: * https://www.dgii.gov.do/et/nivelContribuyentes/Presentaciones%20contribuyentes/Número%20de%20Comprobantes%20Fiscales%20(NCF).pdf >>> validate('A020010210100000005') 'A020010210100000005' >>> validate('Z020010210100000005') Traceback (most recent call last): ... InvalidFormat: ... """ import json from stdnum.exceptions import * from stdnum.util import clean, get_soap_client def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip().upper() # The following document types are known: # 01 invoices for fiscal declaration (or tax reporting) # 02 invoices for final consumer # 03 debit note # 04 credit note (refunds) # 11 informal supplier invoices (purchases) # 12 single income record # 13 minor expenses invoices (purchases) # 14 invoices for special customers (tourists, free zones) # 15 invoices for the government def validate(number): """Check if the number provided is a valid NCF.""" number = compact(number) if len(number) != 19: raise InvalidLength() if number[0] not in 'AP' or not number[1:].isdigit(): raise InvalidFormat() if number[9:11] not in ( '01', '02', '03', '04', '11', '12', '13', '14', '15'): raise InvalidComponent() return number def is_valid(number): """Check if the number provided is a valid NCF.""" try: return bool(validate(number)) except ValidationError: return False def _convert_result(result): # pragma: no cover """Translate SOAP result entries into dictionaries.""" translation = { 'NOMBRE': 'name', 'COMPROBANTE': 'proof', 'ES_VALIDO': 'is_valid', 'MENSAJE_VALIDACION': 'validation_message', 'RNC': 'rnc', 'NCF': 'ncf', } return dict( (translation.get(key, key), value) for key, value in json.loads(result.replace('\t', '\\t')).items()) def check_dgii(rnc, ncf): # pragma: no cover """Validate the RNC, NCF combination on using the DGII online web service. This uses the validation service run by the the Dirección General de Impuestos Internos, the Dominican Republic tax department to check whether the combination of RNC and NCF is valid. Returns a dict with the following structure:: { 'name': 'The registered name', 'proof': 'Source of the information', 'is_valid': '1', 'validation_message': '', 'rnc': '123456789', 'ncf': 'A020010210100000005' } Will return None if the number is invalid or unknown.""" from stdnum.do.rnc import compact as rnc_compact from stdnum.do.rnc import dgii_wsdl rnc = rnc_compact(rnc) ncf = compact(ncf) client = get_soap_client(dgii_wsdl) result = client.GetNCF( RNC=rnc, NCF=ncf, IMEI='') if result == '0': return return _convert_result(result) python-stdnum-1.8.1/stdnum/is_/0000755000000000000000000000000013224171743016400 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/is_/kennitala.py0000644000000000000000000000711313223166520020716 0ustar rootroot00000000000000# kennitala.py - functions for handling Icelandic identity codes # coding: utf-8 # # Copyright (C) 2015 Tuomas Toivonen # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Kennitala (Icelandic personal and organisation identity code). Module for handling Icelandic personal and organisation identity codes (kennitala). >>> validate('450401-3150') # organisation '4504013150' >>> validate('120174-3399') # individual '1201743399' >>> validate('530575-0299') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('320174-3399') Traceback (most recent call last): ... InvalidComponent: ... >>> format('1201743399') '120174-3399' """ import datetime import re from stdnum.exceptions import * from stdnum.util import clean # Icelandic personal and organisation identity codes are composed of # date part, a dash, two random digits, a checksum, and a century # indicator where '9' for 1900-1999 and '0' for 2000 and beyond. For # organisations instead of birth date, the registration date is used, # and number 4 is added to the first digit. _kennitala_re = re.compile( r'^(?P[01234567]\d)(?P[01]\d)(?P\d\d)' r'(?P\d\d)(?P\d)' r'(?P[09])$') def compact(number): """Convert the kennitala to the minimal representation. This strips surrounding whitespace and separation dash, and converts it to upper case.""" return clean(number, '-').upper().strip() def checksum(number): """Calculate the checksum.""" weights = (3, 2, 7, 6, 5, 4, 3, 2, 1, 0) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def validate(number): """Check if the number provided is a valid kennitala. It checks the format, whether a valid date is given and whether the check digit is correct.""" number = compact(number) match = _kennitala_re.search(number) if not match: raise InvalidFormat() day = int(match.group('day')) month = int(match.group('month')) year = int(match.group('year')) if match.group('century') == '9': year += 1900 else: year += 2000 # check if birth date or registration data is valid try: if day >= 40: # organisation datetime.date(year, month, day - 40) else: # individual datetime.date(year, month, day) except ValueError: raise InvalidComponent() # validate the checksum if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid HETU. It checks the format, whether a valid date is given and whether the check digit is correct.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:6] + '-' + number[6:] python-stdnum-1.8.1/stdnum/is_/__init__.py0000644000000000000000000000164613156325250020516 0ustar rootroot00000000000000# __init__.py - collection of Icelandic numbers # coding: utf-8 # # Copyright (C) 2015 Tuomas Toivonen # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Icelandic numbers.""" # provide vat as an alias from stdnum.is_ import vsk as vat python-stdnum-1.8.1/stdnum/is_/vsk.py0000644000000000000000000000365413223166520017561 0ustar rootroot00000000000000# vsk.py - functions for handling Icelandic VAT numbers # coding: utf-8 # # Copyright (C) 2015 Tuomas Toivonen # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VSK number (Virðisaukaskattsnúmer, Icelandic VAT number). The Icelandic VAT number is five or six digits. >>> validate('IS 00621') '00621' >>> validate('IS 0062199') Traceback (most recent call last): ... InvalidLength: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' ').upper().strip() if number.startswith('IS'): number = number[2:] return number def validate(number): """Check if the number provided is a valid VAT number. This checks the length and formatting.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) not in (5, 6): raise InvalidLength() return number def is_valid(number): """Check if the number provided is a valid VAT number. This checks the length and formatting.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/pt/0000755000000000000000000000000013224171744016252 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/pt/__init__.py0000644000000000000000000000164613156325252020371 0ustar rootroot00000000000000# __init__.py - collection of Portuguese numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Portuguese numbers.""" # provide vat as an alias from stdnum.pt import nif as vat python-stdnum-1.8.1/stdnum/pt/nif.py0000644000000000000000000000455613223166521017406 0ustar rootroot00000000000000# nif.py - functions for handling Portuguese VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIF (Número de identificação fiscal, Portuguese VAT number). The NIF (Número de identificação fiscal, NIPC, Número de Identificação de Pessoa Colectiva) is used for VAT purposes. It is a 9-digit number with a simple checksum. >>> validate('PT 501 964 843') '501964843' >>> validate('PT 501 964 842') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').upper().strip() if number.startswith('PT'): number = number[2:] return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" s = sum((9 - i) * int(n) for i, n in enumerate(number)) return str((11 - s) % 11 % 10) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or number[0] == '0': raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/isin.py0000644000000000000000000001213413223166521017140 0ustar rootroot00000000000000# isin.py - functions for handling ISIN numbers # # Copyright (C) 2015-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ISIN (International Securities Identification Number). The ISIN is a 12-character alpha-numerical code specified in ISO 6166 used to identify exchange listed securities such as bonds, commercial paper, stocks and warrants. The number is formed of a two-letter country code, a nine character national security identifier and a single check digit. This module does not currently separately validate the embedded national security identifier part (e.g. when it is a CUSIP). More information: * https://en.wikipedia.org/wiki/International_Securities_Identification_Number >>> validate('US0378331005') 'US0378331005' >>> validate('US0378331003') Traceback (most recent call last): ... InvalidChecksum: ... >>> from_natid('gb', 'BYXJL75') 'GB00BYXJL758' """ from stdnum.exceptions import * from stdnum.util import clean # all valid ISO 3166-1 alpha-2 country codes _iso_3116_1_country_codes = [ 'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW'] # the special XS country code is for international securities # substitute agencies can allocate an ISIN starting with XA (CUSIP Global # Services), XB (NSD Russia), XC (WM Datenservice Germany) or XD (SIX # Telekurs). _country_codes = set(_iso_3116_1_country_codes + [ 'XS', 'EU', 'XA', 'XB', 'XC', 'XD']) # the letters allowed in an ISIN _alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip().upper() def calc_check_digit(number): """Calculate the check digits for the number.""" # convert to numeric first, then double some, then sum individual digits number = ''.join(str(_alphabet.index(n)) for n in number) number = ''.join( str((2, 1)[i % 2] * int(n)) for i, n in enumerate(reversed(number))) return str((10 - sum(int(n) for n in number)) % 10) def validate(number): """Check if the number provided is valid. This checks the length and check digit.""" number = compact(number) if not all(x in _alphabet for x in number): raise InvalidFormat() if len(number) != 12: raise InvalidLength() if number[:2] not in _country_codes: raise InvalidComponent() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is valid. This checks the length and check digit.""" try: return bool(validate(number)) except ValidationError: return False def from_natid(country_code, number): """Generate an ISIN from a national security identifier.""" number = compact(number) number = country_code.upper() + (9 - len(number)) * '0' + number return number + calc_check_digit(number) python-stdnum-1.8.1/stdnum/ch/0000755000000000000000000000000013224171743016220 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ch/ssn.py0000644000000000000000000000510613223166520017373 0ustar rootroot00000000000000# ssn.py - functions for handling Swiss social security numbers # # Copyright (C) 2014 Denis Krienbuehl # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Swiss social security number ("Sozialversicherungsnummer"). Also known as "Neue AHV Nummer". The Swiss Sozialversicherungsnummer is used to identify individuals for taxation and pension purposes. The number is validated using EAN-13, though dashes are substituted for dots. More information: * https://en.wikipedia.org/wiki/National_identification_number#Switzerland * https://de.wikipedia.org/wiki/Sozialversicherungsnummer#Versichertennummer >>> validate('7569217076985') '7569217076985' >>> validate('756.9217.0769.85') '7569217076985' >>> validate('756.9217.0769.84') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('123.4567.8910.19') Traceback (most recent call last): ... InvalidComponent: ... >>> format('7569217076985') '756.9217.0769.85' """ from stdnum import ean from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' .').strip() def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return '.'.join((number[:3], number[3:7], number[7:11], number[11:])) def validate(number): """Check if the number is a valid Swiss Sozialversicherungsnummer.""" number = compact(number) if len(number) != 13: raise InvalidLength() if not number.startswith('756'): raise InvalidComponent() return ean.validate(number) def is_valid(number): """Check if the number is a valid Swiss Sozialversicherungsnummer.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ch/uid.py0000644000000000000000000000552513223166520017356 0ustar rootroot00000000000000# uid.py - functions for handling Swiss business identifiers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """UID (Unternehmens-Identifikationsnummer, Swiss business identifier). The Swiss UID is used to uniquely identify businesses for taxation purposes. The number consists of a fixed "CHE" prefix, followed by 9 digits that are protected with a simple checksum. This module only supports the "new" format that was introduced in 2011 which completely replaced the "old" 6-digit format in 2014. More information: * https://www.uid.admin.ch/ * https://de.wikipedia.org/wiki/Unternehmens-Identifikationsnummer >>> validate('CHE-100.155.212') 'CHE100155212' >>> validate('CHE-100.155.213') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('CHE100155212') 'CHE-100.155.212' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips surrounding whitespace and separators.""" return clean(number, ' -.').strip().upper() def calc_check_digit(number): """Calculate the check digit for organisations. The number passed should not have the check digit included.""" weights = (5, 4, 3, 2, 7, 6, 5, 4) s = sum(w * int(n) for w, n in zip(weights, number)) return str((11 - s) % 11) def validate(number): """Check if the number is a valid UID. This checks the length, formatting and check digit.""" number = compact(number) if len(number) != 12: raise InvalidLength() if not number.startswith('CHE'): raise InvalidComponent() if not number[3:].isdigit(): raise InvalidFormat() if number[-1] != calc_check_digit(number[3:-1]): raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid UID.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:3] + '-' + '.'.join( number[i:i + 3] for i in range(3, len(number), 3)) python-stdnum-1.8.1/stdnum/ch/__init__.py0000644000000000000000000000154213156325246020336 0ustar rootroot00000000000000# __init__.py - collection of Swiss numbers # coding: utf-8 # # Copyright (C) 2014 Denis Krienbuehl # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Swiss numbers.""" python-stdnum-1.8.1/stdnum/ch/vat.py0000644000000000000000000000503713223166520017365 0ustar rootroot00000000000000# vat.py - functions for handling Swiss VAT numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number). The Swiss VAT number is based on the UID but is followed by either "MWST" (Mehrwertsteuer, the German abbreviation for VAT), "TVA" (Taxe sur la valeur ajoutée in French), "IVA" (Imposta sul valore aggiunto in Italian) or "TPV" (Taglia sin la plivalur in Romanian). This module only supports the "new" format that was introduced in 2011 which completely replaced the "old" 6-digit format in 2014. More information: * https://www.ch.ch/en/value-added-tax-number-und-business-identification-number/ * https://www.uid.admin.ch/ >>> validate('CHE-107.787.577 IVA') 'CHE107787577IVA' >>> validate('CHE-107.787.578 IVA') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('CHE107787577IVA') 'CHE-107.787.577 IVA' """ from stdnum.ch import uid from stdnum.exceptions import * def compact(number): """Convert the number to the minimal representation. This strips surrounding whitespace and separators.""" return uid.compact(number) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if len(number) not in (15, 16): raise InvalidLength() uid.validate(number[:12]) if number[12:] not in ('MWST', 'TVA', 'IVA', 'TPV'): raise InvalidComponent() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return uid.format(number[:12]) + ' ' + number[12:] python-stdnum-1.8.1/stdnum/iso7064/0000755000000000000000000000000013224171743016741 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/iso7064/mod_37_2.py0000644000000000000000000000474713223166521020635 0ustar rootroot00000000000000# mod_37_2.py - functions for performing the ISO 7064 Mod 37, 2 algorithm # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The ISO 7064 Mod 37, 2 algorithm. The Mod 37, 2 checksum can be used for alphanumeric numbers and the check digit may also be numeric, a letter or '*'. >>> calc_check_digit('G123489654321') 'Y' >>> validate('G123489654321Y') 'G123489654321Y' >>> checksum('G123489654321Y') 1 By changing the alphabet this can be turned into any Mod x, 2 algorithm. For example Mod 11, 2: >>> calc_check_digit('079', alphabet='0123456789X') 'X' >>> validate('079X', alphabet='0123456789X') '079X' >>> checksum('079X', alphabet='0123456789X') 1 """ from stdnum.exceptions import * def checksum(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*'): """Calculate the checksum. A valid number should have a checksum of 1.""" modulus = len(alphabet) check = 0 for n in number: check = (2 * check + alphabet.index(n)) % modulus return check def calc_check_digit(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*'): """Calculate the extra digit that should be appended to the number to make it a valid number.""" modulus = len(alphabet) return alphabet[(1 - 2 * checksum(number, alphabet)) % modulus] def validate(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*'): """Check whether the check digit is valid.""" try: valid = checksum(number, alphabet) == 1 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*'): """Check whether the check digit is valid.""" try: return bool(validate(number, alphabet)) except ValidationError: return False python-stdnum-1.8.1/stdnum/iso7064/mod_37_36.py0000644000000000000000000000503513223166521020713 0ustar rootroot00000000000000# mod_37_36.py - functions for performing the ISO 7064 Mod 37, 36 algorithm # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The ISO 7064 Mod 37, 36 algorithm. The Mod 37, 36 algorithm uses an alphanumeric check digit and the number itself may also contain letters. >>> checksum('A12425GABC1234002M') 1 >>> calc_check_digit('A12425GABC1234002') 'M' >>> validate('A12425GABC1234002M') 'A12425GABC1234002M' By changing the alphabet this can be turned into any Mod x+1, x algorithm. For example Mod 11, 10: >>> calc_check_digit('00200667308', alphabet='0123456789') '5' >>> validate('002006673085', alphabet='0123456789') '002006673085' """ from stdnum.exceptions import * def checksum(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): """Calculate the checksum. A valid number should have a checksum of 1.""" modulus = len(alphabet) check = modulus // 2 for n in number: check = (((check or modulus) * 2) % (modulus + 1) + alphabet.index(n)) % modulus return check def calc_check_digit(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): """Calculate the extra digit that should be appended to the number to make it a valid number.""" modulus = len(alphabet) return alphabet[(1 - ((checksum(number, alphabet) or modulus) * 2) % (modulus + 1)) % modulus] def validate(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): """Check whether the check digit is valid.""" try: valid = checksum(number, alphabet) == 1 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): """Check whether the check digit is valid.""" try: return bool(validate(number, alphabet)) except ValidationError: return False python-stdnum-1.8.1/stdnum/iso7064/__init__.py0000644000000000000000000000252313156325251021053 0ustar rootroot00000000000000# __init__.py - functions for performing the ISO 7064 algorithms # # Copyright (C) 2010, 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of the ISO 7064 algorithms. This package provides a number of modules for calculation and verification of numbers using one of the ISO 7064 algorithms. Note that these functions were not implemented using the ISO text itself because the text is not available for free. These functions were implemented based on information on the algorithms found online and some reverse engineering. If anyone can provide a legal copy of the ISO/IEC 7064 standard these functions can be validated and perhaps improved. """ python-stdnum-1.8.1/stdnum/iso7064/mod_11_10.py0000644000000000000000000000410313223166521020666 0ustar rootroot00000000000000# mod_11_10.py - functions for performing the ISO 7064 Mod 11, 10 algorithm # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The ISO 7064 Mod 11, 10 algorithm. The Mod 11, 10 algorithm uses a number of calculations modulo 11 and 10 to determine a checksum. For a module that can do generic Mod x+1, x calculations see the :mod:`stdnum.iso7064.mod_37_36` module. >>> calc_check_digit('79462') '3' >>> validate('794623') '794623' >>> calc_check_digit('00200667308') '5' >>> validate('002006673085') '002006673085' """ from stdnum.exceptions import * def checksum(number): """Calculate the checksum. A valid number should have a checksum of 1.""" check = 5 for n in number: check = (((check or 10) * 2) % 11 + int(n)) % 10 return check def calc_check_digit(number): """Calculate the extra digit that should be appended to the number to make it a valid number.""" return str((1 - ((checksum(number) or 10) * 2) % 11) % 10) def validate(number): """Check whether the check digit is valid.""" try: valid = checksum(number) == 1 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number): """Check whether the check digit is valid.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/iso7064/mod_97_10.py0000644000000000000000000000442013223166521020706 0ustar rootroot00000000000000# mod_97_10.py - functions for performing the ISO 7064 Mod 97, 10 algorithm # # Copyright (C) 2010-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The ISO 7064 Mod 97, 10 algorithm. The Mod 97, 10 algorithm evaluates the whole number as an integer which is valid if the number modulo 97 is 1. As such it has two check digits. >>> calc_check_digits('99991234567890121414') '90' >>> validate('9999123456789012141490') '9999123456789012141490' >>> calc_check_digits('4354111611551114') '31' >>> validate('08686001256515001121751') '08686001256515001121751' >>> calc_check_digits('22181321402534321446701611') '35' """ from stdnum.exceptions import * def _to_base10(number): """Prepare the number to its base10 representation.""" try: return ''.join( str(int(x, 36)) for x in number) except Exception: raise InvalidFormat() def checksum(number): """Calculate the checksum. A valid number should have a checksum of 1.""" return int(_to_base10(number)) % 97 def calc_check_digits(number): """Calculate the extra digits that should be appended to the number to make it a valid number.""" return '%02d' % ((98 - 100 * checksum(number)) % 97) def validate(number): """Check whether the check digit is valid.""" try: valid = checksum(number) == 1 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number): """Check whether the check digit is valid.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/iso7064/mod_11_2.py0000644000000000000000000000413713223166521020616 0ustar rootroot00000000000000# mod_11_2.py - functions for performing the ISO 7064 Mod 11, 2 algorithm # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The ISO 7064 Mod 11, 2 algorithm. The Mod 11, 2 algorithm is a simple module 11 checksum where the check digit can be an X to make the number valid. For a module that can do generic Mod x, 2 calculations see the :mod:`stdnum.iso7064.mod_37_2` module. >>> calc_check_digit('0794') '0' >>> validate('07940') '07940' >>> calc_check_digit('079') 'X' >>> validate('079X') '079X' >>> checksum('079X') 1 """ from stdnum.exceptions import * def checksum(number): """Calculate the checksum. A valid number should have a checksum of 1.""" check = 0 for n in number: check = (2 * check + int(10 if n == 'X' else n)) % 11 return check def calc_check_digit(number): """Calculate the extra digit that should be appended to the number to make it a valid number.""" c = (1 - 2 * checksum(number)) % 11 return 'X' if c == 10 else str(c) def validate(number): """Check whether the check digit is valid.""" try: valid = checksum(number) == 1 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number): """Check whether the check digit is valid.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/br/0000755000000000000000000000000013224171743016231 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/br/cnpj.py0000644000000000000000000000547213223166517017547 0ustar rootroot00000000000000# cnpj.py - functions for handling CNPJ numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CNPJ (Cadastro Nacional da Pessoa Jurídica, Brazillian company identifier). Numbers from the national register of legal entities have 14 digits. The first 8 digits identify the company, the following 4 digits identify a business unit and the last 2 digits are check digits. >>> validate('16.727.230/0001-97') '16727230000197' >>> validate('16.727.230.0001-98') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('16.727.230/0001=97') # invalid delimiter Traceback (most recent call last): ... InvalidFormat: ... >>> format('16727230000197') '16.727.230/0001-97' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -./').strip() def calc_check_digits(number): """Calculate the check digits for the number.""" d1 = (11 - sum(((3 - i) % 8 + 2) * int(n) for i, n in enumerate(number[:12]))) % 11 % 10 d2 = (11 - sum(((4 - i) % 8 + 2) * int(n) for i, n in enumerate(number[:12])) - 2 * d1) % 11 % 10 return '%d%d' % (d1, d2) def validate(number): """Check if the number is a valid CNPJ. This checks the length and whether the check digits are correct.""" number = compact(number) if not number.isdigit() or int(number) <= 0: raise InvalidFormat() if len(number) != 14: raise InvalidLength() if calc_check_digits(number) != number[-2:]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid CNPJ.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return (number[0:2] + '.' + number[2:5] + '.' + number[5:8] + '/' + number[8:12] + '-' + number[12:]) python-stdnum-1.8.1/stdnum/br/__init__.py0000644000000000000000000000155213156325246020350 0ustar rootroot00000000000000# __init__.py - collection of Brazillian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Brazillian numbers.""" python-stdnum-1.8.1/stdnum/br/cpf.py0000644000000000000000000000537013223166517017362 0ustar rootroot00000000000000# cpf.py - functions for handling CPF numbers # coding: utf-8 # # Copyright (C) 2011-2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CPF (Cadastro de Pessoas Físicas, Brazillian national identifier). The Cadastro de Pessoas Físicas is the Brazilian identification number assigned to individuals for tax purposes. The number consists of 11 digits and includes two check digits. More information: * https://en.wikipedia.org/wiki/Cadastro_de_Pessoas_Físicas >>> validate('390.533.447-05') '39053344705' >>> validate('231.002.999-00') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('390.533.447=0') # invalid delimiter Traceback (most recent call last): ... InvalidFormat: ... >>> format('23100299900') '231.002.999-00' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -.').strip() def _calc_check_digits(number): """Calculate the check digits for the number.""" d1 = sum((10 - i) * int(number[i]) for i in range(9)) d1 = (11 - d1) % 11 % 10 d2 = sum((11 - i) * int(number[i]) for i in range(9)) + 2 * d1 d2 = (11 - d2) % 11 % 10 return '%d%d' % (d1, d2) def validate(number): """Check if the number is a valid CPF. This checks the length and whether the check digit is correct.""" number = compact(number) if not number.isdigit() or int(number) <= 0: raise InvalidFormat() if len(number) != 11: raise InvalidLength() if _calc_check_digits(number) != number[-2:]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid CPF.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:3] + '.' + number[3:6] + '.' + number[6:-2] + '-' + number[-2:] python-stdnum-1.8.1/stdnum/eu/0000755000000000000000000000000013224171743016237 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/eu/nace.dat0000644000000000000000000020273213223166520017641 0ustar rootroot00000000000000# generated from NACE_REV2_20180101_131838.xml, downloaded from # http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=ACT_OTH_CLS_DLD&StrNom=NACE_REV2&StrFormat=XML&StrLanguageCode=EN # NACE_REV2: Statistical Classification of Economic Activities in the European Community, Rev. 2 (2008) A label="AGRICULTURE, FORESTRY AND FISHING" isic="A" 01 section="A" label="Crop and animal production, hunting and related service activities" isic="01" 1 label="Growing of non-perennial crops" isic="011" 1 label="Growing of cereals (except rice), leguminous crops and oil seeds" isic="0111" 2 label="Growing of rice" isic="0112" 3 label="Growing of vegetables and melons, roots and tubers" isic="0113" 4 label="Growing of sugar cane" isic="0114" 5 label="Growing of tobacco" isic="0115" 6 label="Growing of fibre crops" isic="0116" 9 label="Growing of other non-perennial crops" isic="0119" 2 label="Growing of perennial crops" isic="012" 1 label="Growing of grapes" isic="0121" 2 label="Growing of tropical and subtropical fruits" isic="0122" 3 label="Growing of citrus fruits" isic="0123" 4 label="Growing of pome fruits and stone fruits" isic="0124" 5 label="Growing of other tree and bush fruits and nuts" isic="0125" 6 label="Growing of oleaginous fruits" isic="0126" 7 label="Growing of beverage crops" isic="0127" 8 label="Growing of spices, aromatic, drug and pharmaceutical crops" isic="0128" 9 label="Growing of other perennial crops" isic="0129" 3 label="Plant propagation" isic="013" 0 label="Plant propagation" isic="0130" 4 label="Animal production" isic="014" 1 label="Raising of dairy cattle" isic="0141" 2 label="Raising of other cattle and buffaloes" isic="0141" 3 label="Raising of horses and other equines" isic="0142" 4 label="Raising of camels and camelids" isic="0143" 5 label="Raising of sheep and goats" isic="0144" 6 label="Raising of swine/pigs" isic="0145" 7 label="Raising of poultry" isic="0146" 9 label="Raising of other animals" isic="0149" 5 label="Mixed farming" isic="015" 0 label="Mixed farming" isic="0150" 6 label="Support activities to agriculture and post-harvest crop activities" isic="016" 1 label="Support activities for crop production" isic="0161" 2 label="Support activities for animal production" isic="0162" 3 label="Post-harvest crop activities" isic="0163" 4 label="Seed processing for propagation" isic="0164" 7 label="Hunting, trapping and related service activities" isic="017" 0 label="Hunting, trapping and related service activities" isic="0170" 02 section="A" label="Forestry and logging" isic="02" 1 label="Silviculture and other forestry activities" isic="021" 0 label="Silviculture and other forestry activities" isic="0210" 2 label="Logging" isic="022" 0 label="Logging" isic="0220" 3 label="Gathering of wild growing non-wood products" isic="023" 0 label="Gathering of wild growing non-wood products" isic="0230" 4 label="Support services to forestry" isic="024" 0 label="Support services to forestry" isic="0240" 03 section="A" label="Fishing and aquaculture" isic="03" 1 label="Fishing" isic="031" 1 label="Marine fishing" isic="0311" 2 label="Freshwater fishing" isic="0312" 2 label="Aquaculture" isic="032" 1 label="Marine aquaculture" isic="0321" 2 label="Freshwater aquaculture" isic="0322" B label="MINING AND QUARRYING" isic="B" 05 section="B" label="Mining of coal and lignite" isic="05" 1 label="Mining of hard coal" isic="051" 0 label="Mining of hard coal" isic="0510" 2 label="Mining of lignite" isic="052" 0 label="Mining of lignite" isic="0520" 06 section="B" label="Extraction of crude petroleum and natural gas" isic="06" 1 label="Extraction of crude petroleum" isic="061" 0 label="Extraction of crude petroleum" isic="0610" 2 label="Extraction of natural gas" isic="062" 0 label="Extraction of natural gas" isic="0620" 07 section="B" label="Mining of metal ores" isic="07" 1 label="Mining of iron ores" isic="071" 0 label="Mining of iron ores" isic="0710" 2 label="Mining of non-ferrous metal ores" isic="072" 1 label="Mining of uranium and thorium ores" isic="0721" 9 label="Mining of other non-ferrous metal ores" isic="0729" 08 section="B" label="Other mining and quarrying" isic="08" 1 label="Quarrying of stone, sand and clay" isic="081" 1 label="Quarrying of ornamental and building stone, limestone, gypsum, chalk and slate" isic="0810" 2 label="Operation of gravel and sand pits; mining of clays and kaolin" isic="0810" 9 label="Mining and quarrying n.e.c." isic="089" 1 label="Mining of chemical and fertiliser minerals" isic="0891" 2 label="Extraction of peat" isic="0892" 3 label="Extraction of salt" isic="0893" 9 label="Other mining and quarrying n.e.c." isic="0899" 09 section="B" label="Mining support service activities" isic="09" 1 label="Support activities for petroleum and natural gas extraction" isic="091" 0 label="Support activities for petroleum and natural gas extraction" isic="0910" 9 label="Support activities for other mining and quarrying" isic="099" 0 label="Support activities for other mining and quarrying" isic="0990" C label="MANUFACTURING" isic="C" 10 section="C" label="Manufacture of food products" isic="10" 1 label="Processing and preserving of meat and production of meat products" isic="101" 1 label="Processing and preserving of meat" isic="1010" 2 label="Processing and preserving of poultry meat" isic="1010" 3 label="Production of meat and poultry meat products" isic="1010" 2 label="Processing and preserving of fish, crustaceans and molluscs" isic="102" 0 label="Processing and preserving of fish, crustaceans and molluscs" isic="1020" 3 label="Processing and preserving of fruit and vegetables" isic="103" 1 label="Processing and preserving of potatoes" isic="1030" 2 label="Manufacture of fruit and vegetable juice" isic="1030" 9 label="Other processing and preserving of fruit and vegetables" isic="1030" 4 label="Manufacture of vegetable and animal oils and fats" isic="104" 1 label="Manufacture of oils and fats" isic="1040" 2 label="Manufacture of margarine and similar edible fats" isic="1040" 5 label="Manufacture of dairy products" isic="105" 1 label="Operation of dairies and cheese making" isic="1050" 2 label="Manufacture of ice cream" isic="1050" 6 label="Manufacture of grain mill products, starches and starch products" isic="106" 1 label="Manufacture of grain mill products" isic="1061" 2 label="Manufacture of starches and starch products" isic="1062" 7 label="Manufacture of bakery and farinaceous products" isic="107" 1 label="Manufacture of bread; manufacture of fresh pastry goods and cakes" isic="1071" 2 label="Manufacture of rusks and biscuits; manufacture of preserved pastry goods and cakes" isic="1071" 3 label="Manufacture of macaroni, noodles, couscous and similar farinaceous products" isic="1074" 8 label="Manufacture of other food products" isic="107" 1 label="Manufacture of sugar" isic="1072" 2 label="Manufacture of cocoa, chocolate and sugar confectionery" isic="1073" 3 label="Processing of tea and coffee" isic="1079" 4 label="Manufacture of condiments and seasonings" isic="1079" 5 label="Manufacture of prepared meals and dishes" isic="1075" 6 label="Manufacture of homogenised food preparations and dietetic food" isic="1079" 9 label="Manufacture of other food products n.e.c." isic="1079" 9 label="Manufacture of prepared animal feeds" isic="108" 1 label="Manufacture of prepared feeds for farm animals" isic="1080" 2 label="Manufacture of prepared pet foods" isic="1080" 11 section="C" label="Manufacture of beverages" isic="11" 0 label="Manufacture of beverages" isic="110" 1 label="Distilling, rectifying and blending of spirits" isic="1101" 2 label="Manufacture of wine from grape" isic="1102" 3 label="Manufacture of cider and other fruit wines" isic="1102" 4 label="Manufacture of other non-distilled fermented beverages" isic="1102" 5 label="Manufacture of beer" isic="1103" 6 label="Manufacture of malt" isic="1103" 7 label="Manufacture of soft drinks; production of mineral waters and other bottled waters" isic="1104" 12 section="C" label="Manufacture of tobacco products" isic="12" 0 label="Manufacture of tobacco products" isic="120" 0 label="Manufacture of tobacco products" isic="1200" 13 section="C" label="Manufacture of textiles" isic="13" 1 label="Preparation and spinning of textile fibres" isic="131" 0 label="Preparation and spinning of textile fibres" isic="1311" 2 label="Weaving of textiles" isic="131" 0 label="Weaving of textiles" isic="1312" 3 label="Finishing of textiles" isic="131" 0 label="Finishing of textiles" isic="1313" 9 label="Manufacture of other textiles" isic="139" 1 label="Manufacture of knitted and crocheted fabrics" isic="1391" 2 label="Manufacture of made-up textile articles, except apparel" isic="1392" 3 label="Manufacture of carpets and rugs" isic="1393" 4 label="Manufacture of cordage, rope, twine and netting" isic="1394" 5 label="Manufacture of non-wovens and articles made from non-wovens, except apparel" isic="1399" 6 label="Manufacture of other technical and industrial textiles" isic="1399" 9 label="Manufacture of other textiles n.e.c." isic="1399" 14 section="C" label="Manufacture of wearing apparel" isic="14" 1 label="Manufacture of wearing apparel, except fur apparel" isic="141" 1 label="Manufacture of leather clothes" isic="1410" 2 label="Manufacture of workwear" isic="1410" 3 label="Manufacture of other outerwear" isic="1410" 4 label="Manufacture of underwear" isic="1410" 9 label="Manufacture of other wearing apparel and accessories" isic="1410" 2 label="Manufacture of articles of fur" isic="142" 0 label="Manufacture of articles of fur" isic="1420" 3 label="Manufacture of knitted and crocheted apparel" isic="143" 1 label="Manufacture of knitted and crocheted hosiery" isic="1430" 9 label="Manufacture of other knitted and crocheted apparel" isic="1430" 15 section="C" label="Manufacture of leather and related products" isic="15" 1 label="Tanning and dressing of leather; manufacture of luggage, handbags, saddlery and harness; dressing and dyeing of fur" isic="151" 1 label="Tanning and dressing of leather; dressing and dyeing of fur" isic="1511" 2 label="Manufacture of luggage, handbags and the like, saddlery and harness" isic="1512" 2 label="Manufacture of footwear" isic="152" 0 label="Manufacture of footwear" isic="1520" 16 section="C" label="Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials" isic="16" 1 label="Sawmilling and planing of wood" isic="161" 0 label="Sawmilling and planing of wood" isic="1610" 2 label="Manufacture of products of wood, cork, straw and plaiting materials" isic="162" 1 label="Manufacture of veneer sheets and wood-based panels" isic="1621" 2 label="Manufacture of assembled parquet floors" isic="1622" 3 label="Manufacture of other builders' carpentry and joinery" isic="1622" 4 label="Manufacture of wooden containers" isic="1623" 9 label="Manufacture of other products of wood; manufacture of articles of cork, straw and plaiting materials" isic="1629" 17 section="C" label="Manufacture of paper and paper products" isic="17" 1 label="Manufacture of pulp, paper and paperboard" isic="170" 1 label="Manufacture of pulp" isic="1701" 2 label="Manufacture of paper and paperboard" isic="1701" 2 label="Manufacture of articles of paper and paperboard " isic="170" 1 label="Manufacture of corrugated paper and paperboard and of containers of paper and paperboard" isic="1702" 2 label="Manufacture of household and sanitary goods and of toilet requisites" isic="1709" 3 label="Manufacture of paper stationery" isic="1709" 4 label="Manufacture of wallpaper" isic="1709" 9 label="Manufacture of other articles of paper and paperboard" isic="1709" 18 section="C" label="Printing and reproduction of recorded media" isic="18" 1 label="Printing and service activities related to printing" isic="181" 1 label="Printing of newspapers" isic="1811" 2 label="Other printing" isic="1811" 3 label="Pre-press and pre-media services" isic="1812" 4 label="Binding and related services" isic="1812" 2 label="Reproduction of recorded media" isic="182" 0 label="Reproduction of recorded media" isic="1820" 19 section="C" label="Manufacture of coke and refined petroleum products" isic="19" 1 label="Manufacture of coke oven products" isic="191" 0 label="Manufacture of coke oven products" isic="1910" 2 label="Manufacture of refined petroleum products" isic="192" 0 label="Manufacture of refined petroleum products" isic="1920" 20 section="C" label="Manufacture of chemicals and chemical products" isic="20" 1 label="Manufacture of basic chemicals, fertilisers and nitrogen compounds, plastics and synthetic rubber in primary forms" isic="201" 1 label="Manufacture of industrial gases" isic="2011" 2 label="Manufacture of dyes and pigments" isic="2011" 3 label="Manufacture of other inorganic basic chemicals" isic="2011" 4 label="Manufacture of other organic basic chemicals" isic="2011" 5 label="Manufacture of fertilisers and nitrogen compounds" isic="2012" 6 label="Manufacture of plastics in primary forms" isic="2013" 7 label="Manufacture of synthetic rubber in primary forms" isic="2013" 2 label="Manufacture of pesticides and other agrochemical products" isic="202" 0 label="Manufacture of pesticides and other agrochemical products" isic="2021" 3 label="Manufacture of paints, varnishes and similar coatings, printing ink and mastics" isic="202" 0 label="Manufacture of paints, varnishes and similar coatings, printing ink and mastics" isic="2022" 4 label="Manufacture of soap and detergents, cleaning and polishing preparations, perfumes and toilet preparations" isic="202" 1 label="Manufacture of soap and detergents, cleaning and polishing preparations" isic="2023" 2 label="Manufacture of perfumes and toilet preparations" isic="2023" 5 label="Manufacture of other chemical products" isic="202" 1 label="Manufacture of explosives" isic="2029" 2 label="Manufacture of glues" isic="2029" 3 label="Manufacture of essential oils" isic="2029" 9 label="Manufacture of other chemical products n.e.c." isic="2029" 6 label="Manufacture of man-made fibres" isic="203" 0 label="Manufacture of man-made fibres" isic="2030" 21 section="C" label="Manufacture of basic pharmaceutical products and pharmaceutical preparations" isic="21" 1 label="Manufacture of basic pharmaceutical products" isic="210" 0 label="Manufacture of basic pharmaceutical products" isic="2100" 2 label="Manufacture of pharmaceutical preparations" isic="210" 0 label="Manufacture of pharmaceutical preparations" isic="2100" 22 section="C" label="Manufacture of rubber and plastic products" isic="22" 1 label="Manufacture of rubber products" isic="221" 1 label="Manufacture of rubber tyres and tubes; retreading and rebuilding of rubber tyres" isic="2211" 9 label="Manufacture of other rubber products" isic="2219" 2 label="Manufacture of plastic products" isic="222" 1 label="Manufacture of plastic plates, sheets, tubes and profiles" isic="2220" 2 label="Manufacture of plastic packing goods" isic="2220" 3 label="Manufacture of builders’ ware of plastic" isic="2220" 9 label="Manufacture of other plastic products" isic="2220" 23 section="C" label="Manufacture of other non-metallic mineral products" isic="23" 1 label="Manufacture of glass and glass products" isic="231" 1 label="Manufacture of flat glass" isic="2310" 2 label="Shaping and processing of flat glass" isic="2310" 3 label="Manufacture of hollow glass" isic="2310" 4 label="Manufacture of glass fibres" isic="2310" 9 label="Manufacture and processing of other glass, including technical glassware" isic="2310" 2 label="Manufacture of refractory products" isic="239" 0 label="Manufacture of refractory products" isic="2391" 3 label="Manufacture of clay building materials" isic="239" 1 label="Manufacture of ceramic tiles and flags" isic="2392" 2 label="Manufacture of bricks, tiles and construction products, in baked clay" isic="2392" 4 label="Manufacture of other porcelain and ceramic products" isic="239" 1 label="Manufacture of ceramic household and ornamental articles" isic="2393" 2 label="Manufacture of ceramic sanitary fixtures" isic="2393" 3 label="Manufacture of ceramic insulators and insulating fittings" isic="2393" 4 label="Manufacture of other technical ceramic products" isic="2393" 9 label="Manufacture of other ceramic products" isic="2393" 5 label="Manufacture of cement, lime and plaster" isic="239" 1 label="Manufacture of cement" isic="2394" 2 label="Manufacture of lime and plaster" isic="2394" 6 label="Manufacture of articles of concrete, cement and plaster" isic="239" 1 label="Manufacture of concrete products for construction purposes" isic="2395" 2 label="Manufacture of plaster products for construction purposes" isic="2395" 3 label="Manufacture of ready-mixed concrete" isic="2395" 4 label="Manufacture of mortars" isic="2395" 5 label="Manufacture of fibre cement" isic="2395" 9 label="Manufacture of other articles of concrete, plaster and cement" isic="2395" 7 label="Cutting, shaping and finishing of stone" isic="239" 0 label="Cutting, shaping and finishing of stone" isic="2396" 9 label="Manufacture of abrasive products and non-metallic mineral products n.e.c." isic="239" 1 label="Production of abrasive products" isic="2399" 9 label="Manufacture of other non-metallic mineral products n.e.c." isic="2399" 24 section="C" label="Manufacture of basic metals" isic="24" 1 label="Manufacture of basic iron and steel and of ferro-alloys" isic="241" 0 label="Manufacture of basic iron and steel and of ferro-alloys " isic="2410" 2 label="Manufacture of tubes, pipes, hollow profiles and related fittings, of steel" isic="241" 0 label="Manufacture of tubes, pipes, hollow profiles and related fittings, of steel" isic="2410" 3 label="Manufacture of other products of first processing of steel" isic="241" 1 label="Cold drawing of bars" isic="2410" 2 label="Cold rolling of narrow strip" isic="2410" 3 label="Cold forming or folding" isic="2410" 4 label="Cold drawing of wire" isic="2410" 4 label="Manufacture of basic precious and other non-ferrous metals" isic="242" 1 label="Precious metals production" isic="2420" 2 label="Aluminium production" isic="2420" 3 label="Lead, zinc and tin production" isic="2420" 4 label="Copper production" isic="2420" 5 label="Other non-ferrous metal production" isic="2420" 6 label="Processing of nuclear fuel " isic="2420" 5 label="Casting of metals" isic="243" 1 label="Casting of iron" isic="2431" 2 label="Casting of steel" isic="2431" 3 label="Casting of light metals" isic="2432" 4 label="Casting of other non-ferrous metals" isic="2432" 25 section="C" label="Manufacture of fabricated metal products, except machinery and equipment" isic="25" 1 label="Manufacture of structural metal products" isic="251" 1 label="Manufacture of metal structures and parts of structures" isic="2511" 2 label="Manufacture of doors and windows of metal" isic="2511" 2 label="Manufacture of tanks, reservoirs and containers of metal" isic="251" 1 label="Manufacture of central heating radiators and boilers" isic="2512" 9 label="Manufacture of other tanks, reservoirs and containers of metal" isic="2512" 3 label="Manufacture of steam generators, except central heating hot water boilers" isic="251" 0 label="Manufacture of steam generators, except central heating hot water boilers" isic="2513" 4 label="Manufacture of weapons and ammunition" isic="252" 0 label="Manufacture of weapons and ammunition" isic="2520" 5 label="Forging, pressing, stamping and roll-forming of metal; powder metallurgy" isic="259" 0 label="Forging, pressing, stamping and roll-forming of metal; powder metallurgy" isic="2591" 6 label="Treatment and coating of metals; machining" isic="259" 1 label="Treatment and coating of metals" isic="2592" 2 label="Machining" isic="2592" 7 label="Manufacture of cutlery, tools and general hardware" isic="259" 1 label="Manufacture of cutlery" isic="2593" 2 label="Manufacture of locks and hinges" isic="2593" 3 label="Manufacture of tools" isic="2593" 9 label="Manufacture of other fabricated metal products" isic="259" 1 label="Manufacture of steel drums and similar containers" isic="2599" 2 label="Manufacture of light metal packaging " isic="2599" 3 label="Manufacture of wire products, chain and springs" isic="2599" 4 label="Manufacture of fasteners and screw machine products" isic="2599" 9 label="Manufacture of other fabricated metal products n.e.c." isic="2599" 26 section="C" label="Manufacture of computer, electronic and optical products" isic="26" 1 label="Manufacture of electronic components and boards" isic="261" 1 label="Manufacture of electronic components" isic="2610" 2 label="Manufacture of loaded electronic boards" isic="2610" 2 label="Manufacture of computers and peripheral equipment" isic="262" 0 label="Manufacture of computers and peripheral equipment" isic="2620" 3 label="Manufacture of communication equipment" isic="263" 0 label="Manufacture of communication equipment" isic="2630" 4 label="Manufacture of consumer electronics" isic="264" 0 label="Manufacture of consumer electronics" isic="2640" 5 label="Manufacture of instruments and appliances for measuring, testing and navigation; watches and clocks" isic="265" 1 label="Manufacture of instruments and appliances for measuring, testing and navigation" isic="2651" 2 label="Manufacture of watches and clocks" isic="2652" 6 label="Manufacture of irradiation, electromedical and electrotherapeutic equipment" isic="266" 0 label="Manufacture of irradiation, electromedical and electrotherapeutic equipment" isic="2660" 7 label="Manufacture of optical instruments and photographic equipment" isic="267" 0 label="Manufacture of optical instruments and photographic equipment" isic="2670" 8 label="Manufacture of magnetic and optical media" isic="268" 0 label="Manufacture of magnetic and optical media" isic="2680" 27 section="C" label="Manufacture of electrical equipment" isic="27" 1 label="Manufacture of electric motors, generators, transformers and electricity distribution and control apparatus" isic="271" 1 label="Manufacture of electric motors, generators and transformers" isic="2710" 2 label="Manufacture of electricity distribution and control apparatus" isic="2710" 2 label="Manufacture of batteries and accumulators" isic="272" 0 label="Manufacture of batteries and accumulators" isic="2720" 3 label="Manufacture of wiring and wiring devices" isic="273" 1 label="Manufacture of fibre optic cables" isic="2731" 2 label="Manufacture of other electronic and electric wires and cables" isic="2732" 3 label="Manufacture of wiring devices" isic="2733" 4 label="Manufacture of electric lighting equipment" isic="274" 0 label="Manufacture of electric lighting equipment" isic="2740" 5 label="Manufacture of domestic appliances" isic="275" 1 label="Manufacture of electric domestic appliances" isic="2750" 2 label="Manufacture of non-electric domestic appliances" isic="2750" 9 label="Manufacture of other electrical equipment" isic="279" 0 label="Manufacture of other electrical equipment" isic="2790" 28 section="C" label="Manufacture of machinery and equipment n.e.c." isic="28" 1 label="Manufacture of general-purpose machinery" isic="281" 1 label="Manufacture of engines and turbines, except aircraft, vehicle and cycle engines" isic="2811" 2 label="Manufacture of fluid power equipment" isic="2812" 3 label="Manufacture of other pumps and compressors" isic="2813" 4 label="Manufacture of other taps and valves" isic="2813" 5 label="Manufacture of bearings, gears, gearing and driving elements" isic="2814" 2 label="Manufacture of other general-purpose machinery" isic="281" 1 label="Manufacture of ovens, furnaces and furnace burners" isic="2815" 2 label="Manufacture of lifting and handling equipment" isic="2816" 3 label="Manufacture of office machinery and equipment (except computers and peripheral equipment)" isic="2817" 4 label="Manufacture of power-driven hand tools" isic="2818" 5 label="Manufacture of non-domestic cooling and ventilation equipment" isic="2819" 9 label="Manufacture of other general-purpose machinery n.e.c." isic="2819" 3 label="Manufacture of agricultural and forestry machinery" isic="282" 0 label="Manufacture of agricultural and forestry machinery" isic="2821" 4 label="Manufacture of metal forming machinery and machine tools" isic="282" 1 label="Manufacture of metal forming machinery" isic="2822" 9 label="Manufacture of other machine tools" isic="2822" 9 label="Manufacture of other special-purpose machinery" isic="282" 1 label="Manufacture of machinery for metallurgy" isic="2823" 2 label="Manufacture of machinery for mining, quarrying and construction" isic="2824" 3 label="Manufacture of machinery for food, beverage and tobacco processing" isic="2825" 4 label="Manufacture of machinery for textile, apparel and leather production" isic="2826" 5 label="Manufacture of machinery for paper and paperboard production" isic="2829" 6 label="Manufacture of plastics and rubber machinery" isic="2829" 9 label="Manufacture of other special-purpose machinery n.e.c." isic="2829" 29 section="C" label="Manufacture of motor vehicles, trailers and semi-trailers" isic="29" 1 label="Manufacture of motor vehicles" isic="291" 0 label="Manufacture of motor vehicles" isic="2910" 2 label="Manufacture of bodies (coachwork) for motor vehicles; manufacture of trailers and semi-trailers" isic="292" 0 label="Manufacture of bodies (coachwork) for motor vehicles; manufacture of trailers and semi-trailers" isic="2920" 3 label="Manufacture of parts and accessories for motor vehicles" isic="293" 1 label="Manufacture of electrical and electronic equipment for motor vehicles" isic="2930" 2 label="Manufacture of other parts and accessories for motor vehicles" isic="2930" 30 section="C" label="Manufacture of other transport equipment" isic="30" 1 label="Building of ships and boats" isic="301" 1 label="Building of ships and floating structures" isic="3011" 2 label="Building of pleasure and sporting boats" isic="3012" 2 label="Manufacture of railway locomotives and rolling stock" isic="302" 0 label="Manufacture of railway locomotives and rolling stock" isic="3020" 3 label="Manufacture of air and spacecraft and related machinery" isic="303" 0 label="Manufacture of air and spacecraft and related machinery" isic="3030" 4 label="Manufacture of military fighting vehicles" isic="304" 0 label="Manufacture of military fighting vehicles" isic="3040" 9 label="Manufacture of transport equipment n.e.c." isic="309" 1 label="Manufacture of motorcycles" isic="3091" 2 label="Manufacture of bicycles and invalid carriages" isic="3092" 9 label="Manufacture of other transport equipment n.e.c." isic="3099" 31 section="C" label="Manufacture of furniture" isic="31" 0 label="Manufacture of furniture" isic="310" 1 label="Manufacture of office and shop furniture" isic="3100" 2 label="Manufacture of kitchen furniture" isic="3100" 3 label="Manufacture of mattresses" isic="3100" 9 label="Manufacture of other furniture" isic="3100" 32 section="C" label="Other manufacturing" isic="32" 1 label="Manufacture of jewellery, bijouterie and related articles" isic="321" 1 label="Striking of coins" isic="3211" 2 label="Manufacture of jewellery and related articles" isic="3211" 3 label="Manufacture of imitation jewellery and related articles" isic="3212" 2 label="Manufacture of musical instruments" isic="322" 0 label="Manufacture of musical instruments" isic="3220" 3 label="Manufacture of sports goods" isic="323" 0 label="Manufacture of sports goods" isic="3230" 4 label="Manufacture of games and toys" isic="324" 0 label="Manufacture of games and toys" isic="3240" 5 label="Manufacture of medical and dental instruments and supplies" isic="325" 0 label="Manufacture of medical and dental instruments and supplies" isic="3250" 9 label="Manufacturing n.e.c." isic="329" 1 label="Manufacture of brooms and brushes" isic="3290" 9 label="Other manufacturing n.e.c. " isic="3290" 33 section="C" label="Repair and installation of machinery and equipment" isic="33" 1 label="Repair of fabricated metal products, machinery and equipment" isic="331" 1 label="Repair of fabricated metal products" isic="3311" 2 label="Repair of machinery" isic="3312" 3 label="Repair of electronic and optical equipment" isic="3313" 4 label="Repair of electrical equipment" isic="3314" 5 label="Repair and maintenance of ships and boats" isic="3315" 6 label="Repair and maintenance of aircraft and spacecraft" isic="3315" 7 label="Repair and maintenance of other transport equipment" isic="3315" 9 label="Repair of other equipment" isic="3319" 2 label="Installation of industrial machinery and equipment" isic="332" 0 label="Installation of industrial machinery and equipment" isic="3320" D label="ELECTRICITY, GAS, STEAM AND AIR CONDITIONING SUPPLY" isic="D" 35 section="D" label="Electricity, gas, steam and air conditioning supply" isic="35" 1 label="Electric power generation, transmission and distribution" isic="351" 1 label="Production of electricity" isic="3510" 2 label="Transmission of electricity" isic="3510" 3 label="Distribution of electricity" isic="3510" 4 label="Trade of electricity" isic="3510" 2 label="Manufacture of gas; distribution of gaseous fuels through mains" isic="352" 1 label="Manufacture of gas" isic="3520" 2 label="Distribution of gaseous fuels through mains" isic="3520" 3 label="Trade of gas through mains" isic="3520" 3 label="Steam and air conditioning supply" isic="353" 0 label="Steam and air conditioning supply" isic="3530" E label="WATER SUPPLY; SEWERAGE, WASTE MANAGEMENT AND REMEDIATION ACTIVITIES" isic="E" 36 section="E" label="Water collection, treatment and supply" isic="36" 0 label="Water collection, treatment and supply" isic="360" 0 label="Water collection, treatment and supply" isic="3600" 37 section="E" label="Sewerage" isic="37" 0 label="Sewerage" isic="370" 0 label="Sewerage" isic="3700" 38 section="E" label="Waste collection, treatment and disposal activities; materials recovery" isic="38" 1 label="Waste collection" isic="381" 1 label="Collection of non-hazardous waste" isic="3811" 2 label="Collection of hazardous waste" isic="3812" 2 label="Waste treatment and disposal" isic="382" 1 label="Treatment and disposal of non-hazardous waste" isic="3821" 2 label="Treatment and disposal of hazardous waste" isic="3822" 3 label="Materials recovery" isic="383" 1 label="Dismantling of wrecks" isic="3830" 2 label="Recovery of sorted materials" isic="3830" 39 section="E" label="Remediation activities and other waste management services" isic="39" 0 label="Remediation activities and other waste management services" isic="390" 0 label="Remediation activities and other waste management services" isic="3900" F label="CONSTRUCTION" isic="F" 41 section="F" label="Construction of buildings" isic="41" 1 label="Development of building projects" isic="410" 0 label="Development of building projects" isic="4100" 2 label="Construction of residential and non-residential buildings" isic="410" 0 label="Construction of residential and non-residential buildings" isic="4100" 42 section="F" label="Civil engineering" isic="42" 1 label="Construction of roads and railways" isic="421" 1 label="Construction of roads and motorways" isic="4210" 2 label="Construction of railways and underground railways" isic="4210" 3 label="Construction of bridges and tunnels" isic="4210" 2 label="Construction of utility projects" isic="422" 1 label="Construction of utility projects for fluids" isic="4220" 2 label="Construction of utility projects for electricity and telecommunications" isic="4220" 9 label="Construction of other civil engineering projects" isic="429" 1 label="Construction of water projects" isic="4290" 9 label="Construction of other civil engineering projects n.e.c." isic="4290" 43 section="F" label="Specialised construction activities" isic="43" 1 label="Demolition and site preparation" isic="431" 1 label="Demolition" isic="4311" 2 label="Site preparation" isic="4312" 3 label="Test drilling and boring" isic="4312" 2 label="Electrical, plumbing and other construction installation activities" isic="432" 1 label="Electrical installation" isic="4321" 2 label="Plumbing, heat and air-conditioning installation" isic="4322" 9 label="Other construction installation" isic="4329" 3 label="Building completion and finishing" isic="433" 1 label="Plastering" isic="4330" 2 label="Joinery installation" isic="4330" 3 label="Floor and wall covering" isic="4330" 4 label="Painting and glazing" isic="4330" 9 label="Other building completion and finishing" isic="4330" 9 label="Other specialised construction activities" isic="439" 1 label="Roofing activities" isic="4390" 9 label="Other specialised construction activities n.e.c." isic="4390" G label="WHOLESALE AND RETAIL TRADE; REPAIR OF MOTOR VEHICLES AND MOTORCYCLES" isic="G" 45 section="G" label="Wholesale and retail trade and repair of motor vehicles and motorcycles" isic="45" 1 label="Sale of motor vehicles" isic="451" 1 label="Sale of cars and light motor vehicles" isic="4510" 9 label="Sale of other motor vehicles" isic="4510" 2 label="Maintenance and repair of motor vehicles" isic="452" 0 label="Maintenance and repair of motor vehicles" isic="4520" 3 label="Sale of motor vehicle parts and accessories" isic="453" 1 label="Wholesale trade of motor vehicle parts and accessories" isic="4530" 2 label="Retail trade of motor vehicle parts and accessories" isic="4530" 4 label="Sale, maintenance and repair of motorcycles and related parts and accessories" isic="454" 0 label="Sale, maintenance and repair of motorcycles and related parts and accessories" isic="4540" 46 section="G" label="Wholesale trade, except of motor vehicles and motorcycles" isic="46" 1 label="Wholesale on a fee or contract basis" isic="461" 1 label="Agents involved in the sale of agricultural raw materials, live animals, textile raw materials and semi-finished goods" isic="4610" 2 label="Agents involved in the sale of fuels, ores, metals and industrial chemicals" isic="4610" 3 label="Agents involved in the sale of timber and building materials" isic="4610" 4 label="Agents involved in the sale of machinery, industrial equipment, ships and aircraft" isic="4610" 5 label="Agents involved in the sale of furniture, household goods, hardware and ironmongery" isic="4610" 6 label="Agents involved in the sale of textiles, clothing, fur, footwear and leather goods" isic="4610" 7 label="Agents involved in the sale of food, beverages and tobacco" isic="4610" 8 label="Agents specialised in the sale of other particular products" isic="4610" 9 label="Agents involved in the sale of a variety of goods" isic="4610" 2 label="Wholesale of agricultural raw materials and live animals" isic="462" 1 label="Wholesale of grain, unmanufactured tobacco, seeds and animal feeds" isic="4620" 2 label="Wholesale of flowers and plants" isic="4620" 3 label="Wholesale of live animals" isic="4620" 4 label="Wholesale of hides, skins and leather" isic="4620" 3 label="Wholesale of food, beverages and tobacco" isic="463" 1 label="Wholesale of fruit and vegetables" isic="4630" 2 label="Wholesale of meat and meat products" isic="4630" 3 label="Wholesale of dairy products, eggs and edible oils and fats" isic="4630" 4 label="Wholesale of beverages" isic="4630" 5 label="Wholesale of tobacco products" isic="4630" 6 label="Wholesale of sugar and chocolate and sugar confectionery" isic="4630" 7 label="Wholesale of coffee, tea, cocoa and spices" isic="4630" 8 label="Wholesale of other food, including fish, crustaceans and molluscs" isic="4630" 9 label="Non-specialised wholesale of food, beverages and tobacco" isic="4630" 4 label="Wholesale of household goods" isic="464" 1 label="Wholesale of textiles" isic="4641" 2 label="Wholesale of clothing and footwear" isic="4641" 3 label="Wholesale of electrical household appliances" isic="4649" 4 label="Wholesale of china and glassware and cleaning materials" isic="4649" 5 label="Wholesale of perfume and cosmetics" isic="4649" 6 label="Wholesale of pharmaceutical goods" isic="4649" 7 label="Wholesale of furniture, carpets and lighting equipment" isic="4649" 8 label="Wholesale of watches and jewellery" isic="4649" 9 label="Wholesale of other household goods" isic="4649" 5 label="Wholesale of information and communication equipment" isic="465" 1 label="Wholesale of computers, computer peripheral equipment and software" isic="4651" 2 label="Wholesale of electronic and telecommunications equipment and parts" isic="4652" 6 label="Wholesale of other machinery, equipment and supplies" isic="466" 1 label="Wholesale of agricultural machinery, equipment and supplies" isic="4653" 2 label="Wholesale of machine tools" isic="4659" 3 label="Wholesale of mining, construction and civil engineering machinery" isic="4659" 4 label="Wholesale of machinery for the textile industry and of sewing and knitting machines" isic="4659" 5 label="Wholesale of office furniture" isic="4659" 6 label="Wholesale of other office machinery and equipment" isic="4659" 9 label="Wholesale of other machinery and equipment" isic="4659" 7 label="Other specialised wholesale" isic="466" 1 label="Wholesale of solid, liquid and gaseous fuels and related products" isic="4661" 2 label="Wholesale of metals and metal ores" isic="4662" 3 label="Wholesale of wood, construction materials and sanitary equipment" isic="4663" 4 label="Wholesale of hardware, plumbing and heating equipment and supplies" isic="4663" 5 label="Wholesale of chemical products" isic="4669" 6 label="Wholesale of other intermediate products" isic="4669" 7 label="Wholesale of waste and scrap" isic="4669" 9 label="Non-specialised wholesale trade" isic="469" 0 label="Non-specialised wholesale trade" isic="4690" 47 section="G" label="Retail trade, except of motor vehicles and motorcycles" isic="47" 1 label="Retail sale in non-specialised stores" isic="471" 1 label="Retail sale in non-specialised stores with food, beverages or tobacco predominating" isic="4711" 9 label="Other retail sale in non-specialised stores" isic="4719" 2 label="Retail sale of food, beverages and tobacco in specialised stores" isic="472" 1 label="Retail sale of fruit and vegetables in specialised stores" isic="4721" 2 label="Retail sale of meat and meat products in specialised stores" isic="4721" 3 label="Retail sale of fish, crustaceans and molluscs in specialised stores" isic="4721" 4 label="Retail sale of bread, cakes, flour confectionery and sugar confectionery in specialised stores" isic="4721" 5 label="Retail sale of beverages in specialised stores" isic="4722" 6 label="Retail sale of tobacco products in specialised stores" isic="4723" 9 label="Other retail sale of food in specialised stores" isic="4721" 3 label="Retail sale of automotive fuel in specialised stores" isic="473" 0 label="Retail sale of automotive fuel in specialised stores" isic="4730" 4 label="Retail sale of information and communication equipment in specialised stores" isic="474" 1 label="Retail sale of computers, peripheral units and software in specialised stores" isic="4741" 2 label="Retail sale of telecommunications equipment in specialised stores" isic="4741" 3 label="Retail sale of audio and video equipment in specialised stores" isic="4742" 5 label="Retail sale of other household equipment in specialised stores" isic="475" 1 label="Retail sale of textiles in specialised stores" isic="4751" 2 label="Retail sale of hardware, paints and glass in specialised stores" isic="4752" 3 label="Retail sale of carpets, rugs, wall and floor coverings in specialised stores" isic="4753" 4 label="Retail sale of electrical household appliances in specialised stores" isic="4759" 9 label="Retail sale of furniture, lighting equipment and other household articles in specialised stores" isic="4759" 6 label="Retail sale of cultural and recreation goods in specialised stores" isic="476" 1 label="Retail sale of books in specialised stores" isic="4761" 2 label="Retail sale of newspapers and stationery in specialised stores" isic="4761" 3 label="Retail sale of music and video recordings in specialised stores" isic="4762" 4 label="Retail sale of sporting equipment in specialised stores" isic="4763" 5 label="Retail sale of games and toys in specialised stores" isic="4764" 7 label="Retail sale of other goods in specialised stores" isic="477" 1 label="Retail sale of clothing in specialised stores" isic="4771" 2 label="Retail sale of footwear and leather goods in specialised stores" isic="4771" 3 label="Dispensing chemist in specialised stores" isic="4772" 4 label="Retail sale of medical and orthopaedic goods in specialised stores" isic="4772" 5 label="Retail sale of cosmetic and toilet articles in specialised stores" isic="4772" 6 label="Retail sale of flowers, plants, seeds, fertilisers, pet animals and pet food in specialised stores" isic="4773" 7 label="Retail sale of watches and jewellery in specialised stores" isic="4773" 8 label="Other retail sale of new goods in specialised stores" isic="4773" 9 label="Retail sale of second-hand goods in stores" isic="4774" 8 label="Retail sale via stalls and markets" isic="478" 1 label="Retail sale via stalls and markets of food, beverages and tobacco products" isic="4781" 2 label="Retail sale via stalls and markets of textiles, clothing and footwear" isic="4782" 9 label="Retail sale via stalls and markets of other goods" isic="4789" 9 label="Retail trade not in stores, stalls or markets" isic="479" 1 label="Retail sale via mail order houses or via Internet" isic="4791" 9 label="Other retail sale not in stores, stalls or markets" isic="4799" H label="TRANSPORTATION AND STORAGE" isic="H" 49 section="H" label="Land transport and transport via pipelines" isic="49" 1 label="Passenger rail transport, interurban" isic="491" 0 label="Passenger rail transport, interurban" isic="4911" 2 label="Freight rail transport" isic="491" 0 label="Freight rail transport" isic="4912" 3 label="Other passenger land transport " isic="492" 1 label="Urban and suburban passenger land transport" isic="4921" 2 label="Taxi operation" isic="4922" 9 label="Other passenger land transport n.e.c." isic="4922" 4 label="Freight transport by road and removal services" isic="492" 1 label="Freight transport by road" isic="4923" 2 label="Removal services" isic="4923" 5 label="Transport via pipeline" isic="493" 0 label="Transport via pipeline" isic="4930" 50 section="H" label="Water transport" isic="50" 1 label="Sea and coastal passenger water transport" isic="501" 0 label="Sea and coastal passenger water transport" isic="5011" 2 label="Sea and coastal freight water transport" isic="501" 0 label="Sea and coastal freight water transport" isic="5012" 3 label="Inland passenger water transport" isic="502" 0 label="Inland passenger water transport" isic="5021" 4 label="Inland freight water transport" isic="502" 0 label="Inland freight water transport" isic="5022" 51 section="H" label="Air transport" isic="51" 1 label="Passenger air transport" isic="511" 0 label="Passenger air transport" isic="5110" 2 label="Freight air transport and space transport" isic="512" 1 label="Freight air transport" isic="5120" 2 label="Space transport" isic="5120" 52 section="H" label="Warehousing and support activities for transportation" isic="52" 1 label="Warehousing and storage" isic="521" 0 label="Warehousing and storage" isic="5210" 2 label="Support activities for transportation" isic="522" 1 label="Service activities incidental to land transportation" isic="5221" 2 label="Service activities incidental to water transportation" isic="5222" 3 label="Service activities incidental to air transportation" isic="5223" 4 label="Cargo handling" isic="5224" 9 label="Other transportation support activities " isic="5229" 53 section="H" label="Postal and courier activities" isic="53" 1 label="Postal activities under universal service obligation" isic="531" 0 label="Postal activities under universal service obligation" isic="5310" 2 label="Other postal and courier activities" isic="532" 0 label="Other postal and courier activities" isic="5320" I label="ACCOMMODATION AND FOOD SERVICE ACTIVITIES" isic="I" 55 section="I" label="Accommodation" isic="55" 1 label="Hotels and similar accommodation" isic="551" 0 label="Hotels and similar accommodation" isic="5510" 2 label="Holiday and other short-stay accommodation" isic="551" 0 label="Holiday and other short-stay accommodation" isic="5510" 3 label="Camping grounds, recreational vehicle parks and trailer parks" isic="552" 0 label="Camping grounds, recreational vehicle parks and trailer parks" isic="5520" 9 label="Other accommodation" isic="559" 0 label="Other accommodation" isic="5590" 56 section="I" label="Food and beverage service activities" isic="56" 1 label="Restaurants and mobile food service activities" isic="561" 0 label="Restaurants and mobile food service activities" isic="5610" 2 label="Event catering and other food service activities" isic="562" 1 label="Event catering activities" isic="5621" 9 label="Other food service activities" isic="5629" 3 label="Beverage serving activities" isic="563" 0 label="Beverage serving activities" isic="5630" J label="INFORMATION AND COMMUNICATION" isic="J" 58 section="J" label="Publishing activities" isic="58" 1 label="Publishing of books, periodicals and other publishing activities" isic="581" 1 label="Book publishing" isic="5811" 2 label="Publishing of directories and mailing lists" isic="5812" 3 label="Publishing of newspapers" isic="5813" 4 label="Publishing of journals and periodicals" isic="5813" 9 label="Other publishing activities" isic="5819" 2 label="Software publishing" isic="582" 1 label="Publishing of computer games" isic="5820" 9 label="Other software publishing" isic="5820" 59 section="J" label="Motion picture, video and television programme production, sound recording and music publishing activities" isic="59" 1 label="Motion picture, video and television programme activities" isic="591" 1 label="Motion picture, video and television programme production activities" isic="5911" 2 label="Motion picture, video and television programme post-production activities" isic="5912" 3 label="Motion picture, video and television programme distribution activities" isic="5913" 4 label="Motion picture projection activities" isic="5914" 2 label="Sound recording and music publishing activities" isic="592" 0 label="Sound recording and music publishing activities" isic="5920" 60 section="J" label="Programming and broadcasting activities" isic="60" 1 label="Radio broadcasting" isic="601" 0 label="Radio broadcasting" isic="6010" 2 label="Television programming and broadcasting activities" isic="602" 0 label="Television programming and broadcasting activities" isic="6020" 61 section="J" label="Telecommunications" isic="61" 1 label="Wired telecommunications activities" isic="611" 0 label="Wired telecommunications activities" isic="6110" 2 label="Wireless telecommunications activities" isic="612" 0 label="Wireless telecommunications activities" isic="6120" 3 label="Satellite telecommunications activities" isic="613" 0 label="Satellite telecommunications activities" isic="6130" 9 label="Other telecommunications activities" isic="619" 0 label="Other telecommunications activities" isic="6190" 62 section="J" label="Computer programming, consultancy and related activities" isic="62" 0 label="Computer programming, consultancy and related activities" isic="620" 1 label="Computer programming activities" isic="6201" 2 label="Computer consultancy activities" isic="6202" 3 label="Computer facilities management activities" isic="6202" 9 label="Other information technology and computer service activities" isic="6209" 63 section="J" label="Information service activities" isic="63" 1 label="Data processing, hosting and related activities; web portals" isic="631" 1 label="Data processing, hosting and related activities" isic="6311" 2 label="Web portals" isic="6312" 9 label="Other information service activities" isic="639" 1 label="News agency activities" isic="6391" 9 label="Other information service activities n.e.c." isic="6399" K label="FINANCIAL AND INSURANCE ACTIVITIES" isic="K" 64 section="K" label="Financial service activities, except insurance and pension funding" isic="64" 1 label="Monetary intermediation" isic="641" 1 label="Central banking" isic="6411" 9 label="Other monetary intermediation" isic="6419" 2 label="Activities of holding companies" isic="642" 0 label="Activities of holding companies" isic="6420" 3 label="Trusts, funds and similar financial entities" isic="643" 0 label="Trusts, funds and similar financial entities" isic="6430" 9 label="Other financial service activities, except insurance and pension funding" isic="649" 1 label="Financial leasing" isic="6491" 2 label="Other credit granting" isic="6492" 9 label="Other financial service activities, except insurance and pension funding n.e.c." isic="6499" 65 section="K" label="Insurance, reinsurance and pension funding, except compulsory social security" isic="65" 1 label="Insurance" isic="651" 1 label="Life insurance" isic="6511" 2 label="Non-life insurance" isic="6512" 2 label="Reinsurance" isic="652" 0 label="Reinsurance" isic="6520" 3 label="Pension funding" isic="653" 0 label="Pension funding" isic="6530" 66 section="K" label="Activities auxiliary to financial services and insurance activities" isic="66" 1 label="Activities auxiliary to financial services, except insurance and pension funding" isic="661" 1 label="Administration of financial markets" isic="6611" 2 label="Security and commodity contracts brokerage" isic="6612" 9 label="Other activities auxiliary to financial services, except insurance and pension funding" isic="6619" 2 label="Activities auxiliary to insurance and pension funding" isic="662" 1 label="Risk and damage evaluation" isic="6621" 2 label="Activities of insurance agents and brokers" isic="6622" 9 label="Other activities auxiliary to insurance and pension funding" isic="6629" 3 label="Fund management activities" isic="663" 0 label="Fund management activities" isic="6630" L label="REAL ESTATE ACTIVITIES" isic="L" 68 section="L" label="Real estate activities" isic="68" 1 label="Buying and selling of own real estate" isic="681" 0 label="Buying and selling of own real estate" isic="6810" 2 label="Rental and operating of own or leased real estate" isic="681" 0 label="Rental and operating of own or leased real estate" isic="6810" 3 label="Real estate activities on a fee or contract basis" isic="682" 1 label="Real estate agencies" isic="6820" 2 label="Management of real estate on a fee or contract basis" isic="6820" M label="PROFESSIONAL, SCIENTIFIC AND TECHNICAL ACTIVITIES" isic="M" 69 section="M" label="Legal and accounting activities" isic="69" 1 label="Legal activities" isic="691" 0 label="Legal activities" isic="6910" 2 label="Accounting, bookkeeping and auditing activities; tax consultancy" isic="692" 0 label="Accounting, bookkeeping and auditing activities; tax consultancy" isic="6920" 70 section="M" label="Activities of head offices; management consultancy activities" isic="70" 1 label="Activities of head offices" isic="701" 0 label="Activities of head offices" isic="7010" 2 label="Management consultancy activities" isic="702" 1 label="Public relations and communication activities" isic="7020" 2 label="Business and other management consultancy activities" isic="7020" 71 section="M" label="Architectural and engineering activities; technical testing and analysis" isic="71" 1 label="Architectural and engineering activities and related technical consultancy" isic="711" 1 label="Architectural activities " isic="7110" 2 label="Engineering activities and related technical consultancy" isic="7110" 2 label="Technical testing and analysis" isic="712" 0 label="Technical testing and analysis" isic="7120" 72 section="M" label="Scientific research and development " isic="72" 1 label="Research and experimental development on natural sciences and engineering" isic="721" 1 label="Research and experimental development on biotechnology" isic="7210" 9 label="Other research and experimental development on natural sciences and engineering" isic="7210" 2 label="Research and experimental development on social sciences and humanities" isic="722" 0 label="Research and experimental development on social sciences and humanities" isic="7220" 73 section="M" label="Advertising and market research" isic="73" 1 label="Advertising" isic="731" 1 label="Advertising agencies" isic="7310" 2 label="Media representation" isic="7310" 2 label="Market research and public opinion polling" isic="732" 0 label="Market research and public opinion polling" isic="7320" 74 section="M" label="Other professional, scientific and technical activities" isic="74" 1 label="Specialised design activities" isic="741" 0 label="Specialised design activities" isic="7410" 2 label="Photographic activities" isic="742" 0 label="Photographic activities" isic="7420" 3 label="Translation and interpretation activities" isic="749" 0 label="Translation and interpretation activities" isic="7490" 9 label="Other professional, scientific and technical activities n.e.c." isic="749" 0 label="Other professional, scientific and technical activities n.e.c." isic="7490" 75 section="M" label="Veterinary activities" isic="75" 0 label="Veterinary activities" isic="750" 0 label="Veterinary activities" isic="7500" N label="ADMINISTRATIVE AND SUPPORT SERVICE ACTIVITIES" isic="N" 77 section="N" label="Rental and leasing activities" isic="77" 1 label="Rental and leasing of motor vehicles" isic="771" 1 label="Rental and leasing of cars and light motor vehicles" isic="7710" 2 label="Rental and leasing of trucks" isic="7710" 2 label="Rental and leasing of personal and household goods" isic="772" 1 label="Rental and leasing of recreational and sports goods" isic="7721" 2 label="Rental of video tapes and disks" isic="7722" 9 label="Rental and leasing of other personal and household goods" isic="7729" 3 label="Rental and leasing of other machinery, equipment and tangible goods" isic="773" 1 label="Rental and leasing of agricultural machinery and equipment" isic="7730" 2 label="Rental and leasing of construction and civil engineering machinery and equipment" isic="7730" 3 label="Rental and leasing of office machinery and equipment (including computers)" isic="7730" 4 label="Rental and leasing of water transport equipment" isic="7730" 5 label="Rental and leasing of air transport equipment" isic="7730" 9 label="Rental and leasing of other machinery, equipment and tangible goods n.e.c." isic="7730" 4 label="Leasing of intellectual property and similar products, except copyrighted works" isic="774" 0 label="Leasing of intellectual property and similar products, except copyrighted works" isic="7740" 78 section="N" label="Employment activities" isic="78" 1 label="Activities of employment placement agencies" isic="781" 0 label="Activities of employment placement agencies" isic="7810" 2 label="Temporary employment agency activities" isic="782" 0 label="Temporary employment agency activities" isic="7820" 3 label="Other human resources provision" isic="783" 0 label="Other human resources provision" isic="7830" 79 section="N" label="Travel agency, tour operator and other reservation service and related activities" isic="79" 1 label="Travel agency and tour operator activities" isic="791" 1 label="Travel agency activities" isic="7911" 2 label="Tour operator activities" isic="7912" 9 label="Other reservation service and related activities" isic="799" 0 label="Other reservation service and related activities" isic="7990" 80 section="N" label="Security and investigation activities" isic="80" 1 label="Private security activities" isic="801" 0 label="Private security activities" isic="8010" 2 label="Security systems service activities" isic="802" 0 label="Security systems service activities" isic="8020" 3 label="Investigation activities" isic="803" 0 label="Investigation activities" isic="8030" 81 section="N" label="Services to buildings and landscape activities" isic="81" 1 label="Combined facilities support activities" isic="811" 0 label="Combined facilities support activities" isic="8110" 2 label="Cleaning activities" isic="812" 1 label="General cleaning of buildings" isic="8121" 2 label="Other building and industrial cleaning activities" isic="8129" 9 label="Other cleaning activities" isic="8129" 3 label="Landscape service activities" isic="813" 0 label="Landscape service activities" isic="8130" 82 section="N" label="Office administrative, office support and other business support activities" isic="82" 1 label="Office administrative and support activities" isic="821" 1 label="Combined office administrative service activities" isic="8211" 9 label="Photocopying, document preparation and other specialised office support activities" isic="8219" 2 label="Activities of call centres" isic="822" 0 label="Activities of call centres" isic="8220" 3 label="Organisation of conventions and trade shows" isic="823" 0 label="Organisation of conventions and trade shows" isic="8230" 9 label="Business support service activities n.e.c." isic="829" 1 label="Activities of collection agencies and credit bureaus" isic="8291" 2 label="Packaging activities" isic="8292" 9 label="Other business support service activities n.e.c." isic="8299" O label="PUBLIC ADMINISTRATION AND DEFENCE; COMPULSORY SOCIAL SECURITY" isic="O" 84 section="O" label="Public administration and defence; compulsory social security" isic="84" 1 label="Administration of the State and the economic and social policy of the community" isic="841" 1 label="General public administration activities" isic="8411" 2 label="Regulation of the activities of providing health care, education, cultural services and other social services, excluding social security" isic="8412" 3 label="Regulation of and contribution to more efficient operation of businesses" isic="8413" 2 label="Provision of services to the community as a whole" isic="842" 1 label="Foreign affairs" isic="8421" 2 label="Defence activities" isic="8422" 3 label="Justice and judicial activities" isic="8423" 4 label="Public order and safety activities" isic="8423" 5 label="Fire service activities" isic="8423" 3 label="Compulsory social security activities" isic="843" 0 label="Compulsory social security activities" isic="8430" P label="EDUCATION" isic="P" 85 section="P" label="Education" isic="85" 1 label="Pre-primary education" isic="851" 0 label="Pre-primary education " isic="8510" 2 label="Primary education" isic="851" 0 label="Primary education " isic="8510" 3 label="Secondary education" isic="852" 1 label="General secondary education " isic="8521" 2 label="Technical and vocational secondary education " isic="8522" 4 label="Higher education" isic="853" 1 label="Post-secondary non-tertiary education" isic="8530" 2 label="Tertiary education" isic="8530" 5 label="Other education" isic="854" 1 label="Sports and recreation education" isic="8541" 2 label="Cultural education" isic="8542" 3 label="Driving school activities" isic="8549" 9 label="Other education n.e.c." isic="8549" 6 label="Educational support activities" isic="855" 0 label="Educational support activities" isic="8550" Q label="HUMAN HEALTH AND SOCIAL WORK ACTIVITIES" isic="Q" 86 section="Q" label="Human health activities" isic="86" 1 label="Hospital activities" isic="861" 0 label="Hospital activities" isic="8610" 2 label="Medical and dental practice activities" isic="862" 1 label="General medical practice activities" isic="8620" 2 label="Specialist medical practice activities" isic="8620" 3 label="Dental practice activities" isic="8620" 9 label="Other human health activities" isic="869" 0 label="Other human health activities" isic="8690" 87 section="Q" label="Residential care activities" isic="87" 1 label="Residential nursing care activities" isic="871" 0 label="Residential nursing care activities" isic="8710" 2 label="Residential care activities for mental retardation, mental health and substance abuse" isic="872" 0 label="Residential care activities for mental retardation, mental health and substance abuse" isic="8720" 3 label="Residential care activities for the elderly and disabled" isic="873" 0 label="Residential care activities for the elderly and disabled" isic="8730" 9 label="Other residential care activities" isic="879" 0 label="Other residential care activities" isic="8790" 88 section="Q" label="Social work activities without accommodation" isic="88" 1 label="Social work activities without accommodation for the elderly and disabled" isic="881" 0 label="Social work activities without accommodation for the elderly and disabled" isic="8810" 9 label="Other social work activities without accommodation" isic="889" 1 label="Child day-care activities" isic="8890" 9 label="Other social work activities without accommodation n.e.c." isic="8890" R label="ARTS, ENTERTAINMENT AND RECREATION" isic="R" 90 section="R" label="Creative, arts and entertainment activities" isic="90" 0 label="Creative, arts and entertainment activities" isic="900" 1 label="Performing arts" isic="9000" 2 label="Support activities to performing arts" isic="9000" 3 label="Artistic creation" isic="9000" 4 label="Operation of arts facilities" isic="9000" 91 section="R" label="Libraries, archives, museums and other cultural activities" isic="91" 0 label="Libraries, archives, museums and other cultural activities" isic="910" 1 label="Library and archives activities" isic="9101" 2 label="Museums activities" isic="9102" 3 label="Operation of historical sites and buildings and similar visitor attractions" isic="9102" 4 label="Botanical and zoological gardens and nature reserves activities" isic="9103" 92 section="R" label="Gambling and betting activities" isic="92" 0 label="Gambling and betting activities" isic="920" 0 label="Gambling and betting activities" isic="9200" 93 section="R" label="Sports activities and amusement and recreation activities" isic="93" 1 label="Sports activities" isic="931" 1 label="Operation of sports facilities" isic="9311" 2 label="Activities of sports clubs" isic="9312" 3 label="Fitness facilities" isic="9311" 9 label="Other sports activities" isic="9319" 2 label="Amusement and recreation activities" isic="932" 1 label="Activities of amusement parks and theme parks" isic="9321" 9 label="Other amusement and recreation activities" isic="9329" S label="OTHER SERVICE ACTIVITIES" isic="S" 94 section="S" label="Activities of membership organisations" isic="94" 1 label="Activities of business, employers and professional membership organisations" isic="941" 1 label="Activities of business and employers membership organisations" isic="9411" 2 label="Activities of professional membership organisations" isic="9412" 2 label="Activities of trade unions" isic="942" 0 label="Activities of trade unions" isic="9420" 9 label="Activities of other membership organisations" isic="949" 1 label="Activities of religious organisations" isic="9491" 2 label="Activities of political organisations" isic="9492" 9 label="Activities of other membership organisations n.e.c." isic="9499" 95 section="S" label="Repair of computers and personal and household goods" isic="95" 1 label="Repair of computers and communication equipment" isic="951" 1 label="Repair of computers and peripheral equipment" isic="9511" 2 label="Repair of communication equipment" isic="9512" 2 label="Repair of personal and household goods" isic="952" 1 label="Repair of consumer electronics" isic="9521" 2 label="Repair of household appliances and home and garden equipment" isic="9522" 3 label="Repair of footwear and leather goods" isic="9523" 4 label="Repair of furniture and home furnishings" isic="9524" 5 label="Repair of watches, clocks and jewellery" isic="9529" 9 label="Repair of other personal and household goods" isic="9529" 96 section="S" label="Other personal service activities" isic="96" 0 label="Other personal service activities" isic="960" 1 label="Washing and (dry-)cleaning of textile and fur products" isic="9601" 2 label="Hairdressing and other beauty treatment" isic="9602" 3 label="Funeral and related activities" isic="9603" 4 label="Physical well-being activities" isic="9609" 9 label="Other personal service activities n.e.c." isic="9609" T label="ACTIVITIES OF HOUSEHOLDS AS EMPLOYERS; UNDIFFERENTIATED GOODS- AND SERVICES-PRODUCING ACTIVITIES OF HOUSEHOLDS FOR OWN USE" isic="T" 97 section="T" label="Activities of households as employers of domestic personnel" isic="97" 0 label="Activities of households as employers of domestic personnel" isic="970" 0 label="Activities of households as employers of domestic personnel" isic="9700" 98 section="T" label="Undifferentiated goods- and services-producing activities of private households for own use" isic="98" 1 label="Undifferentiated goods-producing activities of private households for own use" isic="981" 0 label="Undifferentiated goods-producing activities of private households for own use" isic="9810" 2 label="Undifferentiated service-producing activities of private households for own use" isic="982" 0 label="Undifferentiated service-producing activities of private households for own use" isic="9820" U label="ACTIVITIES OF EXTRATERRITORIAL ORGANISATIONS AND BODIES" isic="U" 99 section="U" label="Activities of extraterritorial organisations and bodies" isic="99" 0 label="Activities of extraterritorial organisations and bodies" isic="990" 0 label="Activities of extraterritorial organisations and bodies" isic="9900" python-stdnum-1.8.1/stdnum/eu/banknote.py0000644000000000000000000000436013223166520020411 0ustar rootroot00000000000000# banknote.py - functions for handling Euro banknote serial numbers # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Euro banknote serial numbers. The serial number consists of one letter and 11 digits, or two letters and 10 digits for the new series banknotes. More information: * https://en.wikipedia.org/wiki/Euro_banknotes#Serial_number >>> validate('P36007033744') 'P36007033744' >>> validate('P36007033743') Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').upper().strip() def checksum(number): """Calculate the checksum over the number.""" # replace letters by their ASCII number return sum(int(x) if x.isdigit() else ord(x) for x in number) % 9 def validate(number): """Check if the number is a valid banknote serial number.""" number = compact(number) if not number[:2].isalnum() or not number[2:].isdigit(): raise InvalidFormat() if len(number) != 12: raise InvalidLength() if number[0] not in 'BCDEFGHJLMNPRSTUVWXYZ': raise InvalidComponent() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid banknote serial number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/eu/eic.py0000644000000000000000000000536313223166520017354 0ustar rootroot00000000000000# eic.py - functions for handling EU EIC numbers # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """EIC (European Energy Identification Code). The EIC (Energy Identification Code) a 16 character code used in Europe to uniquely identify entities and objects in the electricity and gas sector. The number uses letters, digits and the minus sign. The first 2 character identify the issuing office, 1 character for the object type, 12 digits for the object and 1 check character. More information: * https://en.wikipedia.org/wiki/Energy_Identification_Code * http://www.eiccodes.eu/ >>> validate('22XWATTPLUS----G') '22XWATTPLUS----G' >>> validate('22XWATTPLUS----X') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('23X--130302DLGW-') # check digit cannot be minus Traceback (most recent call last): ... InvalidFormat: ... """ from stdnum.exceptions import * from stdnum.util import clean _alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-' def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding white space.""" return clean(number, ' ').strip() def calc_check_digit(number): """Calculate the check digit for the number.""" number = compact(number) s = sum((16 - i) * _alphabet.index(n) for i, n in enumerate(number[:15])) return _alphabet[36 - ((s - 1) % 37)] def validate(number): """Check if the number is valid. This checks the length, format and check digit.""" number = compact(number) if not all(x in _alphabet for x in number): raise InvalidFormat() if len(number) != 16: raise InvalidLength() if number[-1] == '-': raise InvalidFormat() if number[-1] != calc_check_digit(number): raise InvalidChecksum() return number def is_valid(number): """Check if the number is valid. This checks the length, format and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/eu/nace.py0000644000000000000000000000670613223166520017524 0ustar rootroot00000000000000# nace.py - functions for handling EU NACE classification # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NACE (classification for businesses in the European Union). The NACE (nomenclature statistique des activités économiques dans la Communauté européenne) is a 4-level (and up to 4 digit) code for classifying economic activities. It is the European implementation of the UN classification ISIC. The first 4 digits are the same in all EU countries while additional levels and digits may be vary between countries. This module validates the numbers according to revision 2 and based on the registry as published by the EC. More information: * https://en.wikipedia.org/wiki/Statistical_Classification_of_Economic_Activities_in_the_European_Community * http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_NOM_DTL&StrNom=NACE_REV2&StrLanguageCode=EN&IntPcKey=&StrLayoutCode=HIERARCHIC >>> validate('A') 'A' >>> validate('62.01') '6201' >>> str(label('62.01')) 'Computer programming activities' >>> validate('62.05') Traceback (most recent call last): ... InvalidComponent: ... >>> validate('62059') # does not validate country-specific numbers Traceback (most recent call last): ... InvalidLength: ... >>> format('6201') '62.01' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '.').strip() def info(number): """Lookup information about the specified NACE. This returns a dict.""" number = compact(number) from stdnum import numdb info = dict() for _n, i in numdb.get('eu/nace').info(number): if not i: raise InvalidComponent() info.update(i) return info def label(number): """Lookup the category label for the number.""" return info(number)['label'] def validate(number): """Check if the number is a valid NACE. This checks the format and searches the registry to see if it exists.""" number = compact(number) if len(number) > 4: raise InvalidLength() elif len(number) == 1: if not number.isalpha(): raise InvalidFormat() else: if not number.isdigit(): raise InvalidFormat() info(number) return number def is_valid(number): """Check if the number is a valid NACE. This checks the format and searches the registry to see if it exists.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" return '.'.join((number[:2], number[2:])).strip('.') python-stdnum-1.8.1/stdnum/eu/at_02.py0000644000000000000000000000610313223166520017512 0ustar rootroot00000000000000# at_02.py - functions for handling AT-02 (SEPA Creditor identifier) # # Copyright (C) 2014-2016 Sergi Almacellas Abellana # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """SEPA Identifier of the Creditor (AT-02). This identifier is indicated in the ISO 20022 data element `Creditor Scheme Identification`. The creditor can be a legal entity, or an association that is not a legal entity, or a person. The first two digits contain the ISO country code, the next two are check digits for the ISO 7064 Mod 97, 10 checksum, the next tree contain the Creditor Business Code (or `ZZZ` if no business code used) and the remainder contains the country-specific identifier. >>> validate('ES 23 ZZZ 47690558N') 'ES23ZZZ47690558N' >>> validate('ES2300047690558N') 'ES2300047690558N' >>> compact('ES++()+23ZZZ4//7690558N') 'ES23ZZZ47690558N' >>> calc_check_digits('ESXXZZZ47690558N') '23' """ from stdnum.exceptions import * from stdnum.iso7064 import mod_97_10 from stdnum.util import clean # the valid characters we have _alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' def compact(number): """Convert the AT-02 number to the minimal representation. This strips the number of any valid separators and removes invalid characters.""" return clean(number, ' -/?:().m\'+"').strip().upper() def _to_base10(number): """Prepare the number to its base10 representation so it can be checked with the ISO 7064 Mod 97, 10 algorithm. That means excluding positions 5 to 7 and moving the first four digits to the end.""" return ''.join(str(_alphabet.index(x)) for x in number[7:] + number[:4]) def validate(number): """Check if the number provided is a valid AT-02.""" number = compact(number) try: test_number = _to_base10(number) except Exception: raise InvalidFormat() # ensure that checksum is valid mod_97_10.validate(test_number) return number def is_valid(number): """Check if the number provided is a valid AT-02.""" try: return bool(validate(number)) except ValidationError: return False def calc_check_digits(number): """Calculate the check digits that should be put in the number to make it valid. Check digits in the supplied number are ignored.""" number = compact(number) # replace check digits with placeholders number = ''.join((number[:2], '00', number[4:])) return mod_97_10.calc_check_digits(_to_base10(number)[:-2]) python-stdnum-1.8.1/stdnum/eu/__init__.py0000644000000000000000000000156213156325247020360 0ustar rootroot00000000000000# __init__.py - collection of European Union numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of European Union numbers.""" python-stdnum-1.8.1/stdnum/eu/vat.py0000644000000000000000000001201613223166520017377 0ustar rootroot00000000000000# vat.py - functions for handling European VAT numbers # coding: utf-8 # # Copyright (C) 2012-2016 Arthur de Jong # Copyright (C) 2015 Lionel Elie Mamane # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VAT (European Union VAT number). The European Union VAT number consists of a 2 letter country code (ISO 3166-1, except Greece which uses EL) followed by a number that is allocated per country. The exact format of the numbers varies per country and a country-specific check is performed on the number using the VAT module that is relevant for that country. >>> compact('ATU 57194903') 'ATU57194903' >>> validate('BE697449992') 'BE0697449992' >>> validate('FR 61 954 506 077') 'FR61954506077' >>> guess_country('00449544B01') ['nl'] """ from stdnum.exceptions import * from stdnum.util import clean, get_cc_module, get_soap_client country_codes = set([ 'at', 'be', 'bg', 'cy', 'cz', 'de', 'dk', 'ee', 'es', 'fi', 'fr', 'gb', 'gr', 'hr', 'hu', 'ie', 'it', 'lt', 'lu', 'lv', 'mt', 'nl', 'pl', 'pt', 'ro', 'se', 'si', 'sk', ]) """The collection of country codes that are queried. Greece is listed with a country code of gr while for VAT purposes el is used instead.""" _country_modules = dict() vies_wsdl = 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl' """The WSDL URL of the VAT Information Exchange System (VIES).""" def _get_cc_module(cc): """Get the VAT number module based on the country code.""" # Greece uses a "wrong" country code cc = cc.lower() if cc == 'el': cc = 'gr' if cc not in country_codes: return if cc not in _country_modules: _country_modules[cc] = get_cc_module(cc, 'vat') return _country_modules[cc] def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, '').upper().strip() module = _get_cc_module(number[:2]) if not module: raise InvalidComponent() return number[:2] + module.compact(number[2:]) def validate(number): """Check if the number is a valid VAT number. This performs the country-specific check for the number.""" number = clean(number, '').upper().strip() module = _get_cc_module(number[:2]) if not module: raise InvalidComponent() return number[:2] + module.validate(number[2:]) def is_valid(number): """Check if the number is a valid VAT number. This performs the country-specific check for the number.""" try: return bool(validate(number)) except ValidationError: return False def guess_country(number): """Guess the country code based on the number. This checks the number against each of the validation routines and returns the list of countries for which it is valid. This returns lower case codes and returns gr (not el) for Greece.""" return [cc for cc in country_codes if _get_cc_module(cc).is_valid(number)] def check_vies(number): # pragma: no cover (not part of normal test suite) """Query the online European Commission VAT Information Exchange System (VIES) for validity of the provided number. Note that the service has usage limitations (see the VIES website for details). This returns a dict-like object.""" # this function isn't automatically tested because it would require # network access for the tests and unnecessarily load the VIES website number = compact(number) client = get_soap_client(vies_wsdl) return client.checkVat(number[:2], number[2:]) def check_vies_approx(number, requester): # pragma: no cover """Query the online European Commission VAT Information Exchange System (VIES) for validity of the provided number, providing a validity certificate as proof. You will need to give your own VAT number for this to work. Note that the service has usage limitations (see the VIES website for details). This returns a dict-like object.""" # this function isn't automatically tested because it would require # network access for the tests and unnecessarily load the VIES website number = compact(number) requester = compact(requester) client = get_soap_client(vies_wsdl) return client.checkVatApprox( countryCode=number[:2], vatNumber=number[2:], requesterCountryCode=requester[:2], requesterVatNumber=requester[2:]) python-stdnum-1.8.1/stdnum/us/0000755000000000000000000000000013224171744016256 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/us/ein.py0000644000000000000000000000544413223166521017406 0ustar rootroot00000000000000# ein.py - functions for handling EINs # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """EIN (U.S. Employer Identification Number). The Employer Identification Number, also known as Federal Employer Identification Number (FEIN), is used to identify a business entity in the United States. It is issued to anyone that has to pay withholding taxes on employees. >>> validate('91-1144442') '911144442' >>> get_campus('04-2103594') == 'Brookhaven' True >>> validate('911-14-4442') # dash in the wrong place Traceback (most recent call last): ... InvalidFormat: ... >>> validate('07-1144442') # wrong prefix Traceback (most recent call last): ... InvalidComponent: ... >>> format('042103594') '04-2103594' >>> format('123') # unknown formatting is left alone '123' """ import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching EINs _ein_re = re.compile(r'^(?P[0-9]{2})-?(?P[0-9]{7})$') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '-').strip() def get_campus(number): """Determine the Campus or other location that issued the EIN.""" from stdnum import numdb number = compact(number) results = numdb.get('us/ein').info(number)[0][1] if not results: raise InvalidComponent() return results['campus'] def validate(number): """Check if the number is a valid EIN. This checks the length, groups and formatting if it is present.""" match = _ein_re.search(clean(number, '').strip()) if not match: raise InvalidFormat() get_campus(number) # raises exception for unknown campus return compact(number) def is_valid(number): """Check if the number is a valid EIN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" if len(number) == 9: number = number[:2] + '-' + number[2:] return number python-stdnum-1.8.1/stdnum/us/tin.py0000644000000000000000000000555013223166521017423 0ustar rootroot00000000000000# tin.py - functions for handling TINs # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """TIN (U.S. Taxpayer Identification Number). The Taxpayer Identification Number is used used for tax purposes in the United States. A TIN may be: * a Social Security Number (SSN) * an Individual Taxpayer Identification Number (ITIN) * an Employer Identification Number (EIN) * a Preparer Tax Identification Number (PTIN) * an Adoption Taxpayer Identification Number (ATIN) >>> compact('123-45-6789') '123456789' >>> validate('123-45-6789') '123456789' >>> validate('07-3456789') Traceback (most recent call last): ... InvalidFormat: ... >>> guess_type('536-90-4399') ['ssn', 'atin'] >>> guess_type('04-2103594') ['ein'] >>> guess_type('042103594') ['ssn', 'ein', 'atin'] >>> format('042103594') '042-10-3594' >>> format('123-456') # invalid numbers are not reformatted '123-456' """ from stdnum.exceptions import * from stdnum.us import atin, ein, itin, ptin, ssn from stdnum.util import clean _tin_modules = (ssn, itin, ein, ptin, atin) def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '-').strip() def validate(number): """Check if the number is a valid TIN. This searches for the proper sub-type and validates using that.""" for mod in _tin_modules: try: return mod.validate(number) except ValidationError: pass # try next module # fallback raise InvalidFormat() def is_valid(number): """Check if the number is a valid TIN.""" try: return bool(validate(number)) except ValidationError: return False def guess_type(number): """Return a list of possible TIN types for which this number is valid..""" return [mod.__name__.rsplit('.', 1)[-1] for mod in _tin_modules if mod.is_valid(number)] def format(number): """Reformat the number to the standard presentation format.""" for mod in _tin_modules: if mod.is_valid(number) and hasattr(mod, 'format'): return mod.format(number) return number python-stdnum-1.8.1/stdnum/us/rtn.py0000644000000000000000000000501313223166521017426 0ustar rootroot00000000000000# rtn.py - functions for handling banking routing transit numbers # # Copyright (C) 2014 Lifealike Ltd # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """RTN (Routing transport number). The routing transport number is a nine digit number used in the US banking system for processing deposits between banks. The last digit is a checksum. >>> calc_check_digit('11100002') '5' >>> validate('111000025') '111000025' >>> validate('11100002') # Not nine digits Traceback (most recent call last): ... InvalidLength: .. >>> validate('11100002B') # Not all numeric Traceback (most recent call last): ... InvalidFormat: .. >>> validate('112000025') # bad checksum Traceback (most recent call last): ... InvalidChecksum: .. """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any surrounding whitespace.""" number = clean(number).strip() return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" digits = [int(c) for c in number] checksum = ( 7 * (digits[0] + digits[3] + digits[6]) + 3 * (digits[1] + digits[4] + digits[7]) + 9 * (digits[2] + digits[5]) ) % 10 return str(checksum) def validate(number): """Check if the number is a valid routing number. This checks the length and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid RTN.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/us/ssn.py0000644000000000000000000000733713223166521017441 0ustar rootroot00000000000000# ssn.py - functions for handling SSNs # # Copyright (C) 2011-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """SSN (U.S. Social Security Number). The Social Security Number is used to identify individuals for taxation purposes. It is a 9-digit number that consists of a 3-digit area number, a 2-digit group number and a 4-digit serial number. The number does not use a check digit. Some validation options are available but with the introduction of Social Security Number Randomization it is no longer possible to validate using the High Group History List. Some areas, groups and ranges can be blacklisted though. There are several on-line verification facilities available, either for Employers or at a fee but validation requires more information than just the number (e.g. name, date of birth, etc). Another means of validation is the Death Master File which can be ordered on DVD. More information: * https://en.wikipedia.org/wiki/Social_Security_number * https://www.ssa.gov/employer/verifySSN.htm * https://en.wikipedia.org/wiki/Death_Master_File >>> validate('536-90-4399') '536904399' >>> validate('1112-23333') # dash in the wrong place Traceback (most recent call last): ... InvalidFormat: ... >>> validate('666-00-0000') # invalid area Traceback (most recent call last): ... InvalidComponent: ... >>> validate('078-05-1120') # blacklisted entry Traceback (most recent call last): ... InvalidComponent: ... >>> compact('1234-56-789') '123456789' >>> format('111223333') '111-22-3333' """ import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching SSN _ssn_re = re.compile( r'^(?P[0-9]{3})-?(?P[0-9]{2})-?(?P[0-9]{4})$') # blacklist of SSNs _ssn_blacklist = set(('078-05-1120', '457-55-5462', '219-09-9999')) def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '-').strip() def validate(number): """Check if the number is a valid SSN. This checks the length, groups and formatting if it is present.""" match = _ssn_re.search(clean(number, '').strip()) if not match: raise InvalidFormat() area = match.group('area') group = match.group('group') serial = match.group('serial') # check for all-0 or some unused areas # (9xx also won't be issued which includes the advertising range) if area == '000' or area == '666' or area[0] == '9' or \ group == '00' or serial == '0000': raise InvalidComponent() # check blacklists if format(number) in _ssn_blacklist: raise InvalidComponent() return compact(number) def is_valid(number): """Check if the number is a valid SSN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" if len(number) == 9: number = number[:3] + '-' + number[3:5] + '-' + number[5:] return number python-stdnum-1.8.1/stdnum/us/ein.dat0000644000000000000000000000121013223166521017511 0ustar rootroot00000000000000# manually converted from the IRS website # https://www.irs.gov/businesses/small-businesses-self-employed/how-eins-are-assigned-and-valid-ein-prefixes 01,02,03,04,05,06,11,13,14,16,21,22,23,25,34,51,52,54,55,56,57,58,59,65 campus="Brookhaven" 10,12 campus="Andover" 15,24 campus="Fresno" 20,26,27,45,46,47,81 campus="Internet" 30,32,35,36,37,38,61 campus="Cincinnati" 31 campus="Small Business Administration (SBA)" 33,39,41,42,43,46,48,62,63,64,66,68,71,72,73,74,75,76,77,82,83,84,85,86,87,88,91,92,93,98,99 campus="Philadelphia" 40,44 campus="Kansas City" 50,53 campus="Austin" 60,67 campus="Atlanta" 80,90 campus="Ogden" 94,95 campus="Memphis" python-stdnum-1.8.1/stdnum/us/ptin.py0000644000000000000000000000402313223166521017575 0ustar rootroot00000000000000# ptin.py - functions for handling PTINs # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PTIN (U.S. Preparer Tax Identification Number). A Preparer Tax Identification Number (PTIN) is United States identification number for tax return preparers. It is an eight-digit number prefixed with a capital P. >>> validate('P-00634642') 'P00634642' >>> validate('P01594846') 'P01594846' >>> validate('00634642') # missing P Traceback (most recent call last): ... InvalidFormat: ... """ import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching PTINs _ptin_re = re.compile(r'^P[0-9]{8}$') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '-').strip() def validate(number): """Check if the number is a valid PTIN. This checks the length, groups and formatting if it is present.""" number = compact(number).upper() if not _ptin_re.search(number): raise InvalidFormat() # sadly, no more information on PTIN number validation was found return number def is_valid(number): """Check if the number is a valid ATIN.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/us/__init__.py0000644000000000000000000000156013156325252020370 0ustar rootroot00000000000000# __init__.py - collection of United States numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of United States numbers.""" python-stdnum-1.8.1/stdnum/us/atin.py0000644000000000000000000000454113223166521017563 0ustar rootroot00000000000000# atin.py - functions for handling ATINs # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ATIN (U.S. Adoption Taxpayer Identification Number). An Adoption Taxpayer Identification Number (ATIN) is a temporary nine-digit number issued by the United States IRS for a child for whom the adopting parents cannot obtain a Social Security Number. >>> validate('123-45-6789') '123456789' >>> validate('1234-56789') # dash in the wrong place Traceback (most recent call last): ... InvalidFormat: ... >>> format('123456789') '123-45-6789' >>> format('123') # unknown formatting is left alone '123' """ import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching ATINs _atin_re = re.compile(r'^[0-9]{3}-?[0-9]{2}-?[0-9]{4}$') def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '-').strip() def validate(number): """Check if the number is a valid ATIN. This checks the length and formatting if it is present.""" match = _atin_re.search(clean(number, '').strip()) if not match: raise InvalidFormat() # sadly, no more information on ATIN number validation was found return compact(number) def is_valid(number): """Check if the number is a valid ATIN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" if len(number) == 9: number = number[:3] + '-' + number[3:5] + '-' + number[5:] return number python-stdnum-1.8.1/stdnum/us/itin.py0000644000000000000000000000571613223166521017600 0ustar rootroot00000000000000# itin.py - functions for handling ITINs # # Copyright (C) 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ITIN (U.S. Individual Taxpayer Identification Number). The Individual Taxpayer Identification Number is issued by the United States IRS to individuals who are required to have a taxpayer identification number but who are not eligible to obtain a Social Security Number. It is a nine-digit number that begins with the number 9 and the fourth and fifth digit are expected to be in a certain range. >>> validate('912-90-3456') '912903456' >>> validate('9129-03456') # dash in the wrong place Traceback (most recent call last): ... InvalidFormat: ... >>> validate('123-45-6789') # wrong start digit Traceback (most recent call last): ... InvalidComponent: ... >>> validate('912-93-4567') # wrong group Traceback (most recent call last): ... InvalidComponent: ... >>> compact('1234-56-789') '123456789' >>> format('111223333') '111-22-3333' >>> format('123') # unknown formatting is left alone '123' """ import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching ITINs _itin_re = re.compile(r'^(?P[0-9]{3})-?(?P[0-9]{2})-?[0-9]{4}$') # allowed group digits _allowed_groups = set((str(x) for x in range(70, 100) if x not in (89, 93))) def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '-').strip() def validate(number): """Check if the number is a valid ITIN. This checks the length, groups and formatting if it is present.""" match = _itin_re.search(clean(number, '').strip()) if not match: raise InvalidFormat() area = match.group('area') group = match.group('group') if area[0] != '9' or group not in _allowed_groups: raise InvalidComponent() return compact(number) def is_valid(number): """Check if the number is a valid ITIN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" if len(number) == 9: number = number[:3] + '-' + number[3:5] + '-' + number[5:] return number python-stdnum-1.8.1/stdnum/grid.py0000644000000000000000000000462413223166520017127 0ustar rootroot00000000000000# grid.py - functions for handling Global Release Identifier (GRid) numbers # # Copyright (C) 2010, 2011, 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """GRid (Global Release Identifier). The Global Release Identifier is used to identify releases of digital sound recordings and uses the ISO 7064 Mod 37, 36 algorithm to verify the correctness of the number. >>> validate('A12425GABC1234002M') 'A12425GABC1234002M' >>> validate('Grid: A1-2425G-ABC1234002-M') 'A12425GABC1234002M' >>> validate('A1-2425G-ABC1234002-Q') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> compact('A1-2425G-ABC1234002-M') 'A12425GABC1234002M' >>> format('A12425GABC1234002M') 'A1-2425G-ABC1234002-M' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the GRid to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').strip().upper() if number.startswith('GRID:'): number = number[5:] return number def validate(number): """Check if the number is a valid GRid.""" from stdnum.iso7064 import mod_37_36 number = compact(number) if len(number) != 18: raise InvalidLength() return mod_37_36.validate(number) def is_valid(number): """Check if the number is a valid GRid.""" try: return bool(validate(number)) except ValidationError: return False def format(number, separator='-'): """Reformat the number to the standard presentation format.""" number = compact(number) number = (number[0:2], number[2:7], number[7:17], number[17:]) return separator.join(x for x in number if x) python-stdnum-1.8.1/stdnum/pl/0000755000000000000000000000000013224171744016242 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/pl/pesel.py0000644000000000000000000000677713223166521017741 0ustar rootroot00000000000000# pesel.py - functions for handling Polish national identification numbers # coding: utf-8 # # Copyright (C) 2015 Dariusz Choruzy # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """PESEL (Polish national identification number). The Powszechny Elektroniczny System Ewidencji Ludności (PESEL, Universal Electronic System for Registration of the Population) is a 11-digit Polish national identification number. The number consists of the date of birth, a serial number, the person's gender and a check digit. >>> validate('44051401359') '44051401359' >>> validate('44051401358') # incorrect check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('02381307589') # invalid birth date Traceback (most recent call last): ... InvalidComponent: ... >>> get_birth_date('02122401358') datetime.date(1902, 12, 24) >>> get_gender('02122401358') 'M' >>> get_birth_date('02211307589') datetime.date(2002, 1, 13) >>> get_gender('02211307589') 'F' """ import datetime from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').upper().strip() def get_birth_date(number): """Split the date parts from the number and return the birth date.""" number = compact(number) year = int(number[0:2]) month = int(number[2:4]) day = int(number[4:6]) year += { 0: 1900, 1: 2000, 2: 2100, 3: 2200, 4: 1800, }[month // 20] month = month % 20 try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def get_gender(number): """Get the person's birth gender ('M' or 'F').""" number = compact(number) if number[9] in '02468': # even return 'F' else: # odd: 13579 return 'M' def calc_check_digit(number): """Calculate the check digit for organisations. The number passed should not have the check digit included.""" weights = (1, 3, 7, 9, 1, 3, 7, 9, 1, 3) check = sum(w * int(n) for w, n in zip(weights, number)) return str((10 - check) % 10) def validate(number): """Check if the number is a valid national identification number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 11: raise InvalidLength() if number[-1] != calc_check_digit(number[:-1]): raise InvalidChecksum() get_birth_date(number) return number def is_valid(number): """Check if the number is a valid national identification number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/pl/regon.py0000644000000000000000000000604713223166521017731 0ustar rootroot00000000000000# pesel.py - functions for handling REGON numbers # coding: utf-8 # # Copyright (C) 2015 Dariusz Choruzy # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """REGON (Rejestr Gospodarki Narodowej, Polish register of economic units). The REGON (Rejestr Gospodarki Narodowej) is a statistical identification number for businesses. National entities are assigned a 9-digit number, while local units append 5 digits to form a 14-digit number. More information: * http://bip.stat.gov.pl/en/regon/ * http://www.stat.gov.pl/bip/regon_ENG_HTML.htm * https://wyszukiwarkaregon.stat.gov.pl/appBIR/index.aspx >>> validate('192598184') '192598184' >>> validate('123456785') '123456785' >>> validate('192598183') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('12345678512347') '12345678512347' >>> validate('12345678612342') # first check digit invalid Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('12345678512348') # last check digit invalid Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').upper().strip() def calc_check_digit(number): """Calculate the check digit for organisations. The number passed should not have the check digit included.""" if len(number) == 8: weights = (8, 9, 2, 3, 4, 5, 6, 7) else: weights = (2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8) check = sum(w * int(n) for w, n in zip(weights, number)) return str(check % 11 % 10) def validate(number): """Check if the number is a valid REGON number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) not in (9, 14): raise InvalidLength() if number[-1] != calc_check_digit(number[:-1]): raise InvalidChecksum() if len(number) == 14 and number[8] != calc_check_digit(number[:8]): raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid REGON number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/pl/nip.py0000644000000000000000000000463313223166521017404 0ustar rootroot00000000000000# nip.py - functions for handling Polish VAT numbers # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIP (Numer Identyfikacji Podatkowej, Polish VAT number). The NIP (Numer Identyfikacji Podatkowej) number consists of 10 digit with a straightforward weighted checksum. >>> validate('PL 8567346215') '8567346215' >>> validate('PL 8567346216') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... >>> format('PL 8567346215') '856-734-62-15' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('PL'): number = number[2:] return number def checksum(number): """Calculate the checksum.""" weights = (6, 5, 7, 2, 3, 4, 5, 6, 7, -1) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return '-'.join((number[0:3], number[3:6], number[6:8], number[8:])) python-stdnum-1.8.1/stdnum/pl/__init__.py0000644000000000000000000000163613156325252020360 0ustar rootroot00000000000000# __init__.py - collection of Polish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Polish numbers.""" # provide vat as an alias from stdnum.pl import nip as vat python-stdnum-1.8.1/stdnum/isbn.py0000644000000000000000000001604713223166520017137 0ustar rootroot00000000000000# isbn.py - functions for handling ISBNs # # Copyright (C) 2010-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ISBN (International Standard Book Number). The ISBN is the International Standard Book Number, used to identify publications. An ISBN is used to identify books. Numbers can either have 10 digits (in ISBN-10 format) or 13 digits (in ISBN-13, EAN compatible format). An ISBN has the following components: * 3-digit (only in ISBN-13) Bookland code * 1 to 5-digit group identifier (identifies country or language) * 1 to 7-digit publisher code * 1 to 8-digit item number (identifies the book) * a check digit More information: * https://en.wikipedia.org/wiki/International_Standard_Book_Number * https://www.isbn-international.org/range_file_generation This module also offers functions for converting to ISBN-13 and formatting based on how the number should be split into a bookland code, group identifier, publisher code, item number and check digit. >>> validate('978-9024538270') '9789024538270' >>> validate('978-9024538271') Traceback (most recent call last): ... InvalidChecksum: ... >>> compact('1-85798-218-5') '1857982185' >>> format('9780471117094') '978-0-471-11709-4' >>> format('1857982185') '1-85798-218-5' >>> isbn_type('1-85798-218-5') 'ISBN10' >>> isbn_type('978-0-471-11709-4') 'ISBN13' >>> to_isbn13('1-85798-218-5') '978-1-85798-218-3' >>> to_isbn10('978-1-85798-218-3') '1-85798-218-5' """ from stdnum import ean from stdnum.exceptions import * from stdnum.util import clean def compact(number, convert=False): """Convert the ISBN to the minimal representation. This strips the number of any valid ISBN separators and removes surrounding whitespace. If the covert parameter is True the number is also converted to ISBN-13 format.""" number = clean(number, ' -').strip().upper() if len(number) == 9: number = '0' + number if convert: return to_isbn13(number) return number def _calc_isbn10_check_digit(number): """Calculate the ISBN check digit for 10-digit numbers. The number passed should not have the check bit included.""" check = sum((i + 1) * int(n) for i, n in enumerate(number)) % 11 return 'X' if check == 10 else str(check) def validate(number, convert=False): """Check if the number provided is a valid ISBN (either a legacy 10-digit one or a 13-digit one). This checks the length and the check bit but does not check if the group and publisher are valid (use split() for that).""" number = compact(number, convert=False) if not number[:-1].isdigit(): raise InvalidFormat() if len(number) == 10: if _calc_isbn10_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() elif len(number) == 13: ean.validate(number) if number[:3] not in ('978', '979'): raise InvalidComponent() else: raise InvalidLength() if convert: number = to_isbn13(number) return number def isbn_type(number): """Check the passed number and return 'ISBN13', 'ISBN10' or None (for invalid) for checking the type of number passed.""" try: number = validate(number, convert=False) except ValidationError: return None if len(number) == 10: return 'ISBN10' else: # len(number) == 13: return 'ISBN13' def is_valid(number): """Check if the number provided is a valid ISBN (either a legacy 10-digit one or a 13-digit one). This checks the length and the check bit but does not check if the group and publisher are valid (use split() for that).""" try: return bool(validate(number)) except ValidationError: return False def to_isbn13(number): """Convert the number to ISBN-13 format.""" number = number.strip() min_number = clean(number, ' -') if len(min_number) == 13: return number # nothing to do, already ISBN-13 if len(min_number) == 9: number = '0' + number # convert from 9 to 10 digits # put new check digit in place number = number[:-1] + ean.calc_check_digit('978' + min_number[:-1]) # add prefix if ' ' in number: return '978 ' + number elif '-' in number: return '978-' + number else: return '978' + number def to_isbn10(number): """Convert the number to ISBN-10 format.""" number = number.strip() min_number = compact(number, convert=False) if len(min_number) == 10: return number # nothing to do, already ISBN-10 elif isbn_type(min_number) != 'ISBN13': raise InvalidFormat('Not a valid ISBN13.') elif not number.startswith('978'): raise InvalidComponent('Does not use 978 Bookland prefix.') # strip EAN prefix number = number[3:-1].strip().strip('-') digit = _calc_isbn10_check_digit(min_number[3:-1]) # append the new check digit if ' ' in number: return number + ' ' + digit elif '-' in number: return number + '-' + digit else: return number + digit def split(number, convert=False): """Split the specified ISBN into an EAN.UCC prefix, a group prefix, a registrant, an item number and a check-digit. If the number is in ISBN-10 format the returned EAN.UCC prefix is '978'. If the covert parameter is True the number is converted to ISBN-13 format first.""" from stdnum import numdb # clean up number number = compact(number, convert) # get Bookland prefix if any delprefix = False if len(number) == 10: number = '978' + number delprefix = True # split the number result = numdb.get('isbn').split(number[:-1]) itemnr = result.pop() if result else '' prefix = result.pop(0) if result else '' group = result.pop(0) if result else '' publisher = result.pop(0) if result else '' # return results return ('' if delprefix else prefix, group, publisher, itemnr, number[-1]) def format(number, separator='-', convert=False): """Reformat the number to the standard presentation format with the EAN.UCC prefix (if any), the group prefix, the registrant, the item number and the check-digit separated (if possible) by the specified separator. Passing an empty separator should equal compact() though this is less efficient. If the covert parameter is True the number is converted to ISBN-13 format first.""" return separator.join(x for x in split(number, convert) if x) python-stdnum-1.8.1/stdnum/imsi.py0000644000000000000000000000565513223166520017150 0ustar rootroot00000000000000# imsi.py - functions for handling International Mobile Subscriber Identity # (IMSI) numbers # # Copyright (C) 2011-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """IMSI (International Mobile Subscriber Identity). The IMSI (International Mobile Subscriber Identity) is used to identify mobile phone users (the SIM). >>> validate('429011234567890') '429011234567890' >>> validate('439011234567890') # unknown MCC Traceback (most recent call last): ... InvalidComponent: ... >>> split('429011234567890') ('429', '01', '1234567890') >>> split('310150123456789') ('310', '150', '123456789') >>> info('460001234567890')['mcc'] '460' >>> str(info('460001234567890')['country']) 'China' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the IMSI number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip().upper() def split(number): """Split the specified IMSI into a Mobile Country Code (MCC), a Mobile Network Code (MNC), a Mobile Station Identification Number (MSIN).""" from stdnum import numdb # clean up number number = compact(number) # split the number return tuple(numdb.get('imsi').split(number)) def validate(number): """Check if the number provided is a valid IMSI.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) not in (14, 15): raise InvalidLength() if len(split(number)) != 3: raise InvalidComponent() return number def info(number): """Return a dictionary of data about the supplied number.""" from stdnum import numdb # clean up number number = compact(number) # split the number info = dict(number=number) mcc_info, mnc_info, msin_info = numdb.get('imsi').info(number) info['mcc'] = mcc_info[0] info.update(mcc_info[1]) info['mnc'] = mnc_info[0] info.update(mnc_info[1]) info['msin'] = msin_info[0] info.update(msin_info[1]) return info def is_valid(number): """Check if the number provided is a valid IMSI.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ean.py0000644000000000000000000000457013223166520016745 0ustar rootroot00000000000000# ean.py - functions for handling EANs # # Copyright (C) 2011-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """EAN (International Article Number). Module for handling EAN (International Article Number) codes. This module handles numbers EAN-13, EAN-8 and UPC (12-digit) format. >>> validate('73513537') '73513537' >>> validate('978-0-471-11709-4') # EAN-13 format '9780471117094' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the EAN to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').strip() def calc_check_digit(number): """Calculate the EAN check digit for 13-digit numbers. The number passed should not have the check bit included.""" return str((10 - sum((3, 1)[i % 2] * int(n) for i, n in enumerate(reversed(number)))) % 10) def validate(number): """Check if the number provided is a valid EAN-13. This checks the length and the check bit but does not check whether a known GS1 Prefix and company identifier are referenced.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) not in (13, 12, 8): raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid EAN-13. This checks the length and the check bit but does not check whether a known GS1 Prefix and company identifier are referenced.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/fr/0000755000000000000000000000000013224171743016235 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/fr/siren.py0000644000000000000000000000513713223166520017731 0ustar rootroot00000000000000# siren.py - functions for handling French SIREN numbers # coding: utf-8 # # Copyright (C) 2012-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """SIREN (a French company identification number). The SIREN (Système d'Identification du Répertoire des Entreprises) is a 9 digit number used to identify French companies. The Luhn checksum is used to validate the numbers. >>> compact('552 008 443') '552008443' >>> validate('404833048') '404833048' >>> validate('404833047') Traceback (most recent call last): ... InvalidChecksum: ... >>> to_tva('443 121 975') '46 443 121 975' """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean # An online validation function is available but it does not provide an # automated entry point, has usage restrictions and seems to require # attribution to the service for any results used. # https://avis-situation-sirene.insee.fr/ def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' .').strip() def validate(number): """Check if the number provided is a valid SIREN. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() luhn.validate(number) return number def is_valid(number): """Check if the number provided is a valid SIREN.""" try: return bool(validate(number)) except ValidationError: return False def to_tva(number): """Return a TVA that prepends the two extra check digits to the SIREN.""" # note that this always returns numeric check digits # it is unclean when the alphabetic ones are used return '%02d%s%s' % ( int(compact(number) + '12') % 97, ' ' if ' ' in number else '', number) python-stdnum-1.8.1/stdnum/fr/tva.py0000644000000000000000000000654413223166520017406 0ustar rootroot00000000000000# tva.py - functions for handling French TVA numbers # coding: utf-8 # # Copyright (C) 2012-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """n° TVA (taxe sur la valeur ajoutée, French VAT number). The n° TVA (Numéro d'identification à la taxe sur la valeur ajoutée) is the SIREN (Système d’Identification du Répertoire des Entreprises) prefixed by two digits. In old style numbers the two digits are numeric, with new style numbers at least one is a alphabetic. >>> compact('Fr 40 303 265 045') '40303265045' >>> validate('23334175221') '23334175221' >>> validate('84 323 140 391') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('K7399859412') # new-style number 'K7399859412' >>> validate('4Z123456782') # new-style number starting with digit '4Z123456782' >>> validate('IO334175221') # the letters cannot by I or O Traceback (most recent call last): ... InvalidFormat: ... """ from stdnum.exceptions import * from stdnum.fr import siren from stdnum.util import clean # the valid characters for the first two digits (O and I are missing) _alphabet = '0123456789ABCDEFGHJKLMNPQRSTUVWXYZ' def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').upper().strip() if number.startswith('FR'): number = number[2:] return number def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not all(x in _alphabet for x in number[:2]): raise InvalidFormat() if not number[2:].isdigit(): raise InvalidFormat() if len(number) != 11: raise InvalidLength() if number[2:5] != '000': # numbers from Monaco are valid TVA but not SIREN siren.validate(number[2:]) if number.isdigit(): # all-numeric digits if int(number[:2]) != (int(number[2:] + '12') % 97): raise InvalidChecksum() else: # one of the first two digits isn't a number if number[0].isdigit(): check = ( _alphabet.index(number[0]) * 24 + _alphabet.index(number[1]) - 10) else: check = ( _alphabet.index(number[0]) * 34 + _alphabet.index(number[1]) - 100) if (int(number[2:]) + 1 + check // 11) % 11 != (check % 11): raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/fr/siret.py0000644000000000000000000000607313223166520017737 0ustar rootroot00000000000000# siret.py - functions for handling French SIRET numbers # coding: utf-8 # # Copyright (C) 2016 Yoann Aubineau # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """SIRET (a French company establishment identification number). The SIRET (Système d'Identification du Répertoire des ETablissements) is a 14 digit number used to identify French companies' establishments and facilities. The Luhn checksum is used to validate the numbers. >>> validate('73282932000074') '73282932000074' >>> validate('73282932000079') Traceback (most recent call last): ... InvalidChecksum: ... >>> to_siren('732 829 320 00074') '732 829 320' >>> to_siren('73282932000074') '732829320' >>> to_tva('732 829 320 00074') '44 732 829 320' >>> to_tva('73282932000074') '44732829320' >>> format('73282932000074') '732 829 320 00074' """ from stdnum import luhn from stdnum.exceptions import * from stdnum.fr import siren from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' .').strip() def validate(number): """Check if the number is a valid SIRET. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 14: raise InvalidLength() luhn.validate(number) siren.validate(number[:9]) return number def is_valid(number): """Check if the number is a valid SIRET.""" try: return bool(validate(number)) except ValidationError: return False def to_siren(number): """Convert the SIRET number to a SIREN number. The SIREN number is the 9 first digits of the SIRET number. """ _siren = [] digit_count = 0 for char in number: if digit_count < 9: _siren.append(char) if char.isdigit(): digit_count += 1 return ''.join(_siren) def to_tva(number): """Convert the SIRET number to a TVA number. The TVA number is built from the SIREN number, prepended by two extra error checking digits. """ return siren.to_tva(to_siren(number)) def format(number, separator=' '): """Reformat the number to the standard presentation format.""" number = compact(number) return separator.join((number[0:3], number[3:6], number[6:9], number[9:])) python-stdnum-1.8.1/stdnum/fr/nir.py0000644000000000000000000000741713223166520017404 0ustar rootroot00000000000000# nir.py - functions for handling French NIR numbers # coding: utf-8 # # Copyright (C) 2016 Dimitri Papadopoulos # Copyright (C) 2016-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIR (French personal identification number). The NIR (Numero d'Inscription au Repertoire national d'identification des personnes physiques) is used to identify persons in France. It is popularly known as the "social security number" and sometimes referred to as an INSEE number. All persons born in France are registered in the Repertoire national d'identification des personnes physiques (RNIPP) and assigned a NIR. The number consists of 15 digits: the first digit indicates the gender, followed by 2 digits for the year or birth, 2 for the month of birth, 5 for the location of birth (COG), 3 for a serial and 2 check digits. More information: * https://www.insee.fr/en/metadonnees/definition/c1409 * https://en.wikipedia.org/wiki/INSEE_code * http://resoo.org/docs/_docs/regles-numero-insee.pdf * https://fr.wikipedia.org/wiki/Numéro_de_sécurité_sociale_en_France * http://xml.insee.fr/schema/nir.html >>> validate('2 95 10 99 126 111 93') '295109912611193' >>> validate('295109912611199') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('253072B07300470') '253072B07300470' >>> validate('253072A07300443') '253072A07300443' >>> validate('253072C07300443') Traceback (most recent call last): ... InvalidFormat: ... >>> validate('6546546546546703') Traceback (most recent call last): ... InvalidLength: ... >>> format('295109912611193') '2 95 10 99 126 111 93' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' .').strip().upper() def calc_check_digits(number): """Calculate the check digits for the number.""" department = number[5:7] if department == '2A': number = number[:5] + '19' + number[7:] elif department == '2B': number = number[:5] + '18' + number[7:] return '%02d' % (97 - (int(number[:13]) % 97)) def validate(number): """Check if the number provided is valid. This checks the length and check digits.""" number = compact(number) if not number[:5].isdigit() or not number[7:].isdigit(): raise InvalidFormat() if not number[5:7].isdigit() and number[5:7] not in ('2A', '2B'): raise InvalidFormat() if len(number) != 15: raise InvalidLength() if calc_check_digits(number) != number[13:]: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is valid.""" try: return bool(validate(number)) except ValidationError: return False def format(number, separator=' '): """Reformat the number to the standard presentation format.""" number = compact(number) return separator.join(( number[:1], number[1:3], number[3:5], number[5:7], number[7:10], number[10:13], number[13:])) python-stdnum-1.8.1/stdnum/fr/__init__.py0000644000000000000000000000163613156325247020360 0ustar rootroot00000000000000# __init__.py - collection of French numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of French numbers.""" # provide vat as an alias from stdnum.fr import tva as vat python-stdnum-1.8.1/stdnum/fr/nif.py0000644000000000000000000000471013223166520017361 0ustar rootroot00000000000000# nif.py - functions for handling French tax identification numbers # coding: utf-8 # # Copyright (C) 2016 Dimitri Papadopoulos # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """NIF (Numéro d'Immatriculation Fiscale, French tax identification number). The NIF (Numéro d'Immatriculation Fiscale, Numéro d'Identité Fiscale or Numéro d'Identification Fiscale) also known as numéro fiscal de référence or SPI (Simplification des Procédures d'Identification) is a 13-digit number issued by the French tax authorities to people for tax reporting purposes. More information: * https://ec.europa.eu/taxation_customs/tin/tinByCountry.html * https://fr.wikipedia.org/wiki/Numéro_d%27Immatriculation_Fiscale#France >>> validate('0701987765432') '0701987765432' >>> validate('070198776543') Traceback (most recent call last): ... InvalidLength: ... >>> format('0701987765432') '07 01 987 765 432' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def validate(number): """Check if the number provided is a valid NIF.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 13: raise InvalidLength() return number def is_valid(number): """Check if the number provided is a valid NIF.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return ' '.join((number[:2], number[2:4], number[4:7], number[7:10], number[10:])) python-stdnum-1.8.1/stdnum/sk/0000755000000000000000000000000013224171744016244 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/sk/dph.py0000644000000000000000000000461713223166521017375 0ustar rootroot00000000000000# vat.py - functions for handling Slovak VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number). The IČ DPH (Identifikačné číslo pre daň z pridanej hodnoty) is a 10-digit number used for VAT purposes. It has a straightforward checksum. >>> validate('SK 202 274 96 19') '2022749619' >>> validate('SK 202 274 96 18') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.sk import rc from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('SK'): number = number[2:] return number def checksum(number): """Calculate the checksum.""" return int(number) % 11 def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 10: raise InvalidLength() # it is unclear whether the RČ can be used as a valid VAT number if rc.is_valid(number): return number if number[0] == '0' or int(number[2]) not in (2, 3, 4, 7, 8, 9): raise InvalidFormat() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/sk/rc.py0000644000000000000000000000355713223166521017230 0ustar rootroot00000000000000# rc.py - functions for handling Slovak birth numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """RČ (Rodné číslo, the Slovak birth number). The birth number (RČ, Rodné číslo) is the Slovak national identifier. The number can be 9 or 10 digits long. Numbers given out after January 1st 1954 should have 10 digits. The number includes the birth date of the person and their gender. This number is identical to the Czech counterpart. >>> validate('710319/2745') '7103192745' >>> validate('991231123') '991231123' >>> validate('7103192746') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('1103492745') # invalid date Traceback (most recent call last): ... InvalidComponent: ... >>> validate('590312/123') # 9 digit number in 1959 Traceback (most recent call last): ... InvalidLength: ... >>> format('7103192745') '710319/2745' """ # since this number is essentially the same as the Czech counterpart # (until 1993 the Czech Republic and Slovakia were one country) from stdnum.cz.rc import compact, format, is_valid, validate __all__ = ['compact', 'validate', 'is_valid', 'format'] python-stdnum-1.8.1/stdnum/sk/__init__.py0000644000000000000000000000163613156325252020362 0ustar rootroot00000000000000# __init__.py - collection of Slovak numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Slovak numbers.""" # provide vat as an alias from stdnum.sk import dph as vat python-stdnum-1.8.1/stdnum/lu/0000755000000000000000000000000013224171743016246 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/lu/tva.py0000644000000000000000000000437513223166521017420 0ustar rootroot00000000000000# tva.py - functions for handling Luxembourgian VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """TVA (taxe sur la valeur ajoutée, Luxembourgian VAT number). The n° TVA (Numéro d'identification à la taxe sur la valeur ajoutée) is used for tax purposes in Luxembourg. The number consists of 8 digits of which the last two are check digits. >>> validate('LU 150 274 42') '15027442' >>> validate('150 274 43') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' :.-').upper().strip() if number.startswith('LU'): number = number[2:] return number def calc_check_digits(number): """Calculate the check digits for the number.""" return '%02d' % (int(number) % 89) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 8: raise InvalidLength() if calc_check_digits(number[:6]) != number[-2:]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/lu/__init__.py0000644000000000000000000000165413156325251020364 0ustar rootroot00000000000000# __init__.py - collection of Luxembourgian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Luxembourgian numbers.""" # provide vat as an alias from stdnum.lu import tva as vat python-stdnum-1.8.1/stdnum/it/0000755000000000000000000000000013224171743016242 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/it/iva.py0000644000000000000000000000460513223166521017375 0ustar rootroot00000000000000# iva.py - functions for handling Italian VAT numbers # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Partita IVA (Italian VAT number). The Partita IVA (Imposta sul valore aggiunto) consists of 11 digits. The first 7 digits are a company identifier, the next 3 refer to the province of residence and the last is a check digit. The fiscal code for individuals is not accepted as valid code for intracommunity VAT related operations so it is ignored here. >>> validate('IT 00743110157') '00743110157' >>> validate('00743110158') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -:').upper().strip() if number.startswith('IT'): number = number[2:] return number def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or int(number[0:7]) == 0: raise InvalidFormat() if len(number) != 11: raise InvalidLength() # check the province of residence if not('001' <= number[7:10] <= '100') and \ number[7:10] not in ('120', '121', '888', '999'): raise InvalidComponent() luhn.validate(number) return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/it/__init__.py0000644000000000000000000000164013156325251020353 0ustar rootroot00000000000000# __init__.py - collection of Italian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Italian numbers.""" # provide vat as an alias from stdnum.it import iva as vat python-stdnum-1.8.1/stdnum/it/codicefiscale.py0000644000000000000000000001213013223166521021363 0ustar rootroot00000000000000# codicefiscale.py - library for Italian fiscal code # # This file is based on code from pycodicefiscale, a Python library for # working with Italian fiscal code numbers officially known as Italy's # Codice Fiscale. # https://github.com/baxeico/pycodicefiscale # # Copyright (C) 2009-2013 Emanuele Rocca # Copyright (C) 2014 Augusto Destrero # Copyright (C) 2014 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Codice Fiscale (Italian tax code for individuals). The Codice Fiscale is an alphanumeric code of 16 characters used to identify individuals residing in Italy. The number consists of three characters derived from the person's last name, three from the person's first name, five that hold information on the person's gender and birth date, four that represent the person's place of birth and one check digit. >>> validate('RCCMNL83S18D969H') 'RCCMNL83S18D969H' >>> validate('RCCMNL83S18D969') Traceback (most recent call last): ... InvalidLength: ... >>> calc_check_digit('RCCMNL83S18D969') 'H' """ import datetime import re from stdnum.exceptions import * from stdnum.util import clean # regular expression for matching fiscal codes _code_re = re.compile( r'^[A-Z]{6}' r'[0-9LMNPQRSTUV]{2}[ABCDEHLMPRST]{1}[0-9LMNPQRSTUV]{2}' r'[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1}$') # encoding of birth day and year values (usually numeric but some letters # may be substituted on clashes) _date_digits = dict((x, n) for n, x in enumerate('0123456789')) _date_digits.update(dict((x, n) for n, x in enumerate('LMNPQRSTUV'))) # encoding of month values (A = January, etc.) _month_digits = dict((x, n) for n, x in enumerate('ABCDEHLMPRST')) # values of characters in even positions for checksum calculation _even_values = dict((x, n) for n, x in enumerate('0123456789')) _even_values.update( dict((x, n) for n, x in enumerate('ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) # values of characters in odd positions for checksum calculation values = [1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 2, 4, 18, 20, 11, 3, 6, 8, 12, 14, 16, 10, 22, 25, 24, 23] _odd_values = dict((x, values[n]) for n, x in enumerate('0123456789')) _odd_values.update( dict((x, values[n]) for n, x in enumerate('ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) del values def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip().upper() def calc_check_digit(number): """Compute the control code for the given number. The passed number should be the first 15 characters of a fiscal code.""" code = sum(_odd_values[x] if n % 2 == 0 else _even_values[x] for n, x in enumerate(number)) return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[code % 26] def get_birth_date(number, minyear=1920): """Get the birth date from the person's fiscal code. Only the last two digits of the year are stored in the number. The dates will be returned in the range from minyear to minyear + 100. >>> get_birth_date('RCCMNL83S18D969H') datetime.date(1983, 11, 18) >>> get_birth_date('RCCMNL83S18D969H', minyear=1990) datetime.date(2083, 11, 18) """ number = compact(number) day = (_date_digits[number[9]] * 10 + _date_digits[number[10]]) % 40 month = _month_digits[number[8]] + 1 year = _date_digits[number[6]] * 10 + _date_digits[number[7]] # find four-digit year year += (minyear // 100) * 100 if year < minyear: year += 100 try: return datetime.date(year, month, day) except ValueError: raise InvalidComponent() def get_gender(number): """Get the gender of the person's fiscal code. >>> get_gender('RCCMNL83S18D969H') 'M' >>> get_gender('CNTCHR83T41D969D') 'F' """ number = compact(number) return 'M' if int(number[9:11]) < 32 else 'F' def validate(number): """Check if the given fiscal code is valid. This checks the length and whether the check digit is correct.""" number = compact(number) if len(number) != 16: raise InvalidLength() if not _code_re.match(number): raise InvalidFormat() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() # check if birth date is valid get_birth_date(number) return number def is_valid(number): """Check if the given fiscal code is valid.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/damm.py0000644000000000000000000000632313223166520017116 0ustar rootroot00000000000000# damm.py - functions for performing the Damm checksum algorithm # # Copyright (C) 2016-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """The Damm algorithm. The Damm algorithm is a check digit algorithm that should detect all single-digit errors and all adjacent transposition errors. Based on anti-symmetric quasigroup of order 10 it uses a substitution table. This implementation uses the table from Wikipedia by default but a custom table can be provided. More information: * https://en.wikipedia.org/wiki/Damm_algorithm >>> validate('572') Traceback (most recent call last): ... InvalidChecksum: ... >>> calc_check_digit('572') '4' >>> validate('5724') '5724' >>> table = ( ... (0, 2, 3, 4, 5, 6, 7, 8, 9, 1), ... (2, 0, 4, 1, 7, 9, 5, 3, 8, 6), ... (3, 7, 0, 5, 2, 8, 1, 6, 4, 9), ... (4, 1, 8, 0, 6, 3, 9, 2, 7, 5), ... (5, 6, 2, 9, 0, 7, 4, 1, 3, 8), ... (6, 9, 7, 3, 1, 0, 8, 5, 2, 4), ... (7, 5, 1, 8, 4, 2, 0, 9, 6, 3), ... (8, 4, 6, 2, 9, 5, 3, 0, 1, 7), ... (9, 8, 5, 7, 3, 1, 6, 4, 0, 2), ... (1, 3, 9, 6, 8, 4, 2, 7, 5, 0)) >>> checksum('816', table=table) 9 """ from stdnum.exceptions import * _operation_table = ( (0, 3, 1, 7, 5, 9, 8, 6, 4, 2), (7, 0, 9, 2, 1, 5, 4, 8, 6, 3), (4, 2, 0, 6, 8, 7, 1, 3, 5, 9), (1, 7, 5, 0, 9, 8, 3, 4, 2, 6), (6, 1, 2, 3, 0, 4, 5, 9, 7, 8), (3, 6, 7, 4, 2, 0, 9, 5, 8, 1), (5, 8, 6, 9, 7, 2, 0, 1, 3, 4), (8, 9, 4, 5, 3, 6, 2, 0, 1, 7), (9, 4, 3, 8, 6, 1, 7, 2, 0, 5), (2, 5, 8, 1, 4, 3, 6, 7, 9, 0)) def checksum(number, table=None): """Calculate the Damm checksum over the provided number. The checksum is returned as an integer value and should be 0 when valid.""" table = table or _operation_table i = 0 for n in str(number): i = table[i][int(n)] return i def validate(number, table=None): """Check if the number provided passes the Damm algorithm.""" if not bool(number): raise InvalidFormat() try: valid = checksum(number, table=table) == 0 except Exception: raise InvalidFormat() if not valid: raise InvalidChecksum() return number def is_valid(number, table=None): """Check if the number provided passes the Damm algorithm.""" try: return bool(validate(number, table=table)) except ValidationError: return False def calc_check_digit(number, table=None): """Calculate the extra digit that should be appended to the number to make it a valid number.""" return str(checksum(number, table=table)) python-stdnum-1.8.1/stdnum/mt/0000755000000000000000000000000013224171743016246 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/mt/__init__.py0000644000000000000000000000154413156325252020363 0ustar rootroot00000000000000# __init__.py - collection of Maltese numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Maltese numbers.""" python-stdnum-1.8.1/stdnum/mt/vat.py0000644000000000000000000000420313223166521017406 0ustar rootroot00000000000000# vat.py - functions for handling Maltese VAT numbers # # Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """VAT (Maltese VAT number). The Maltese VAT registration number contains 8 digits and uses a simple weigted checksum. >>> validate('MT 1167-9112') '11679112' >>> validate('1167-9113') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('MT'): number = number[2:] return number def checksum(number): """Calculate the checksum.""" weights = (3, 4, 6, 7, 8, 9, 10, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 37 def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or number[0] == '0': raise InvalidFormat() if len(number) != 8: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/cl/0000755000000000000000000000000013224171743016224 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/cl/rut.py0000644000000000000000000000543113223166520017407 0ustar rootroot00000000000000# rut.py - functions for handling Chile RUT/RUN numbers # coding: utf-8 # # Copyright (C) 2008-2011 Cédric Krier # Copyright (C) 2008-2011 B2CK # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """RUT (Rol Único Tributario, Chilean national tax number). The RUT, the Chilean national tax number is the same as the RUN (Rol Único Nacional) the Chilean national identification number. The number consists of 8 digits, followed by a check digit. >>> validate('76086428-5') '760864285' >>> validate('CL 12531909-2') '125319092' >>> validate('12531909-3') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('76086A28-5') Traceback (most recent call last): ... InvalidFormat: ... >>> format('125319092') '12.531.909-2' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -.').upper().strip() if number.startswith('CL'): number = number[2:] return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" s = sum(int(n) * (4 + (5 - i) % 6) for i, n in enumerate(number[::-1])) return '0123456789K'[s % 11] def validate(number): """Check if the number is a valid RUT. This checks the length, formatting and check digit.""" number = compact(number) if len(number) not in (8, 9): raise InvalidLength() if not number[:-1].isdigit(): raise InvalidFormat() if number[-1] != calc_check_digit(number[:-1]): raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid RUT.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return (number[:-7] + '.' + number[-7:-4] + '.' + number[-4:-1] + '-' + number[-1]) python-stdnum-1.8.1/stdnum/cl/__init__.py0000644000000000000000000000171113156325246020340 0ustar rootroot00000000000000# __init__.py - collection of Chilean numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Chilean numbers.""" # provide vat and run as an alias from stdnum.cl import rut as vat from stdnum.cl import rut as run python-stdnum-1.8.1/stdnum/si/0000755000000000000000000000000013224171744016242 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/si/__init__.py0000644000000000000000000000164413156325252020357 0ustar rootroot00000000000000# __init__.py - collection of Slovenian numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Slovenian numbers.""" # provide vat as an alias from stdnum.si import ddv as vat python-stdnum-1.8.1/stdnum/si/ddv.py0000644000000000000000000000466413223166521017377 0ustar rootroot00000000000000# ddv.py - functions for handling Slovenian VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """ID za DDV (Davčna številka, Slovenian VAT number). The DDV number (Davčna številka) is used for VAT (DDV, Davek na dodano vrednost) purposes and consist of 8 digits of which the last is a check digit. >>> validate('SI 5022 3054') '50223054' >>> validate('SI 50223055') # invalid check digits Traceback (most recent call last): ... InvalidChecksum: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' -').upper().strip() if number.startswith('SI'): number = number[2:] return number def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" check = (11 - sum((8 - i) * int(n) for i, n in enumerate(number)) % 11) # this results in a two-digit check digit for 11 which should be wrong return '0' if check == 10 else str(check) def validate(number): """Check if the number is a valid VAT number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit() or number.startswith('0'): raise InvalidFormat() if len(number) != 8: raise InvalidLength() if calc_check_digit(number[:-1]) != number[-1]: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid VAT number.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ca/0000755000000000000000000000000013224171743016211 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ca/sin.py0000644000000000000000000000465113223166520017356 0ustar rootroot00000000000000# sin.py - functions for handling Canadian Social Insurance Numbers (SINs) # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """SIN (Canadian Social Insurance Number). The Social Insurance Number (SIN) is a 9-digit identifier issued to individuals for various government programs. SINs that begin with a 9 are issued to temporary workers who are neither Canadian citizens nor permanent residents. More information: * https://www.canada.ca/en/employment-social-development/services/sin.html * https://en.wikipedia.org/wiki/Social_Insurance_Number >>> validate('123-456-782') '123456782' >>> validate('999-999-999') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('12345678Z') Traceback (most recent call last): ... InvalidFormat: ... >>> format('123456782') '123-456-782' """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '- ').strip() def validate(number): """Check if the number is a valid SIN. This checks the length, formatting and check digit.""" number = compact(number) if len(number) != 9: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() return luhn.validate(number) def is_valid(number): """Check if the number is a valid SIN.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return '-'.join((number[0:3], number[3:6], number[6:])) python-stdnum-1.8.1/stdnum/ca/__init__.py0000644000000000000000000000154613223166517020332 0ustar rootroot00000000000000# __init__.py - collection of Canadian numbers # coding: utf-8 # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Canadian numbers.""" python-stdnum-1.8.1/stdnum/ca/bn.py0000644000000000000000000000502113223166517017162 0ustar rootroot00000000000000# bn.py - functions for handling Canadian Business Numbers (BNs) # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """BN (Canadian Business Number). A Business Number (BN) is a 9-digit identification number for businesses issued by the Canada Revenue Agency for tax purposes. The 9-digit number can be followed by two letters (program identifier) and 4 digits (reference number) to form a program account (or BN15). More information: * https://www.canada.ca/en/services/taxes/business-number.html * https://www.ic.gc.ca/app/scr/cc/CorporationsCanada/fdrlCrpSrch.html?locale=en_CA/ >>> validate('12302 6635') '123026635' >>> validate('12302 6635 RC 0001') '123026635RC0001' >>> validate('123456783') Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('12345678Z') Traceback (most recent call last): ... InvalidFormat: ... """ from stdnum import luhn from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, '- ').strip() def validate(number): """Check if the number is a valid BN or BN15. This checks the length, formatting and check digit.""" number = compact(number) if len(number) not in (9, 15): raise InvalidLength() if not number[:9].isdigit(): raise InvalidFormat() luhn.validate(number[:9]) if len(number) == 15: if number[9:11] not in ('RC', 'RM', 'RP', 'RT'): raise InvalidComponent() if not number[11:].isdigit(): raise InvalidFormat() return number def is_valid(number): """Check if the number is a valid BN or BN15.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ec/0000755000000000000000000000000013224171743016215 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/ec/ruc.py0000644000000000000000000000613513223166520017361 0ustar rootroot00000000000000# ruc.py - functions for handling Ecuadorian fiscal numbers # coding: utf-8 # # Copyright (C) 2014 Jonathan Finlay # Copyright (C) 2014-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """RUC (Registro Único de Contribuyentes, Ecuadorian company tax number). The RUC is a tax identification number for legal entities. It has 13 digits where the third digit is a number denoting the type of entity. >>> validate('1792060346-001') '1792060346001' >>> validate('1763154690001') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('179206034601') # too short Traceback (most recent call last): ... InvalidLength: ... """ from stdnum.ec import ci from stdnum.exceptions import * __all__ = ['compact', 'validate', 'is_valid'] # use the same compact function as CI compact = ci.compact def _checksum(number, weights): """Calculate a checksum over the number given the weights.""" return sum(w * int(n) for w, n in zip(weights, number)) % 11 def validate(number): """Check if the number provided is a valid RUC number. This checks the length, formatting, check digit and check sum.""" number = compact(number) if len(number) != 13: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if number[:2] < '01' or number[:2] > '24': raise InvalidComponent() # invalid province code if number[2] < '6': # 0..5 = natural RUC: CI plus establishment number if number[-3:] == '000': raise InvalidComponent() # establishment number wrong ci.validate(number[:10]) elif number[2] == '6': # 6 = public RUC if number[-4:] == '0000': raise InvalidComponent() # establishment number wrong if _checksum(number[:9], (3, 2, 7, 6, 5, 4, 3, 2, 1)) != 0: raise InvalidChecksum() elif number[2] == '9': # 9 = juridical RUC if number[-3:] == '000': raise InvalidComponent() # establishment number wrong if _checksum(number[:10], (4, 3, 2, 7, 6, 5, 4, 3, 2, 1)) != 0: raise InvalidChecksum() else: raise InvalidComponent() # third digit wrong return number def is_valid(number): """Check if the number provided is a valid RUC number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/ec/__init__.py0000644000000000000000000000164713156325246020341 0ustar rootroot00000000000000# __init__.py - collection of Ecuadorian numbers # coding: utf-8 # # Copyright (C) 2014 Jonathan Finlay # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Ecuadorian numbers.""" # provide vat as an alias from stdnum.ec import ruc as vat python-stdnum-1.8.1/stdnum/ec/ci.py0000644000000000000000000000501113223166520017153 0ustar rootroot00000000000000# ci.py - functions for handling Ecuadorian personal identity codes # coding: utf-8 # # Copyright (C) 2014 Jonathan Finlay # Copyright (C) 2014-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """CI (Cédula de identidad, Ecuadorian personal identity code). The CI is a 10 digit number used to identify Ecuadorian citizens. >>> validate('171430710-3') '1714307103' >>> validate('1714307104') # invalid check digit Traceback (most recent call last): ... InvalidChecksum: ... >>> validate('171430710') # digit missing Traceback (most recent call last): ... InvalidLength: ... """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' -').upper().strip() def _checksum(number): """Calculate a checksum over the number.""" fold = lambda x: x - 9 if x > 9 else x return sum(fold((2, 1)[i % 2] * int(n)) for i, n in enumerate(number)) % 10 def validate(number): """Check if the number provided is a valid CI number. This checks the length, formatting and check digit.""" number = compact(number) if len(number) != 10: raise InvalidLength() if not number.isdigit(): raise InvalidFormat() if number[:2] < '01' or number[:2] > '24': raise InvalidComponent() # invalid province code if number[2] > '5': raise InvalidComponent() # third digit wrong if _checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number provided is a valid CI number. This checks the length, formatting and check digit.""" try: return bool(validate(number)) except ValidationError: return False python-stdnum-1.8.1/stdnum/no/0000755000000000000000000000000013224171743016242 5ustar rootroot00000000000000python-stdnum-1.8.1/stdnum/no/mva.py0000644000000000000000000000431313223166521017375 0ustar rootroot00000000000000# mva.py - functions for handling Norwegian VAT numbers # coding: utf-8 # # Copyright (C) 2015 Tuomas Toivonen # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """MVA (Merverdiavgift, Norwegian VAT number). The VAT number is the standard Norwegian organisation number (Organisasjonsnummer) with 'MVA' as suffix. >>> validate('NO 995 525 828 MVA') '995525828MVA' >>> validate('NO 995 525 829 MVA') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('995525828MVA') 'NO 995 525 828 MVA' """ from stdnum.exceptions import * from stdnum.no import orgnr from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" number = clean(number, ' ').upper().strip() if number.startswith('NO'): number = number[2:] return number def validate(number): """Check if the number is a valid MVA number. This checks the length, formatting and check digit.""" number = compact(number) if not number.endswith('MVA'): raise InvalidFormat() orgnr.validate(number[:-3]) return number def is_valid(number): """Check if the number is a valid MVA number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return 'NO ' + orgnr.format(number[:9]) + ' ' + number[9:] python-stdnum-1.8.1/stdnum/no/__init__.py0000644000000000000000000000164513156325252020361 0ustar rootroot00000000000000# __init__.py - collection of Norwegian numbers # coding: utf-8 # # Copyright (C) 2015 Tuomas Toivonen # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Collection of Norwegian numbers.""" # provide vat as an alias from stdnum.no import mva as vat python-stdnum-1.8.1/stdnum/no/orgnr.py0000644000000000000000000000455613223166521017752 0ustar rootroot00000000000000# orgnr.py - functions for handling Norwegian organisation numbers # coding: utf-8 # # Copyright (C) 2014 Tomas Thor Jonsson # Copyright (C) 2015 Tuomas Toivonen # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA """Orgnr (Organisasjonsnummer, Norwegian organisation number). The Organisasjonsnummer is a 9-digit number with a straightforward check mechanism. >>> validate('988 077 917') '988077917' >>> validate('988 077 918') Traceback (most recent call last): ... InvalidChecksum: ... >>> format('988077917') '988 077 917' """ from stdnum.exceptions import * from stdnum.util import clean def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" return clean(number, ' ').strip() def checksum(number): """Calculate the checksum.""" weights = (3, 2, 7, 6, 5, 4, 3, 2, 1) return sum(w * int(n) for w, n in zip(weights, number)) % 11 def validate(number): """Check if the number is a valid organisation number. This checks the length, formatting and check digit.""" number = compact(number) if not number.isdigit(): raise InvalidFormat() if len(number) != 9: raise InvalidLength() if checksum(number) != 0: raise InvalidChecksum() return number def is_valid(number): """Check if the number is a valid organisation number.""" try: return bool(validate(number)) except ValidationError: return False def format(number): """Reformat the number to the standard presentation format.""" number = compact(number) return number[:3] + ' ' + number[3:6] + ' ' + number[6:] python-stdnum-1.8.1/online_check/0000755000000000000000000000000013224171743016735 5ustar rootroot00000000000000python-stdnum-1.8.1/online_check/stdnum.wsgi0000755000000000000000000000765113223166517021160 0ustar rootroot00000000000000# stdnum.wsgi - simple WSGI application to check numbers # # Copyright (C) 2017 Arthur de Jong. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA import cgi import json import os import re import sys import inspect sys.stdout = sys.stderr sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'python-stdnum')) from stdnum.util import ( get_number_modules, get_module_name, get_module_description) _template = None def get_conversions(module, number): """Return the possible conversions for the number.""" for name, func in inspect.getmembers(module, inspect.isfunction): if name.startswith('to_'): args, varargs, varkw, defaults = inspect.getargspec(func) if defaults: args = args[:-len(defaults)] if args == ['number']: try: conversion = func(number) if conversion != number: yield (name[3:], conversion) except Exception: pass def info(module, number): """Return information about the number.""" compactfn = getattr(module, 'compact', lambda x: x) formatfn = getattr(module, 'format', compactfn) return dict( number=formatfn(number), compact=compactfn(number), valid=module.is_valid(number), module=module.__name__.split('.', 1)[1], name=get_module_name(module), description=get_module_description(module), conversions=dict(get_conversions(module, number))) def format(data): description = cgi.escape(data['description']).replace('\n\n', '
    \n') description = re.sub( r'^[*] (.*)$', r'
    • \1
    ', description, flags=re.MULTILINE) description = re.sub( r'\b((https?|ftp)://[^\s<]*[-\w+&@#/%=~_|])', r'\1', description, flags=re.IGNORECASE + re.UNICODE) for name, conversion in data.get('conversions', {}).items(): description += '\n
    %s: %s' % ( cgi.escape(name), cgi.escape(conversion)) return '
  • %s: %s

    %s

  • ' % ( cgi.escape(data['number']), cgi.escape(data['name']), description) def application(environ, start_response): # read template if needed global _template if not _template: basedir = os.path.join( environ['DOCUMENT_ROOT'], os.path.dirname(environ['SCRIPT_NAME']).strip('/')) _template = open(os.path.join(basedir, 'template.html'), 'r').read() is_ajax = environ.get( 'HTTP_X_REQUESTED_WITH', '').lower() == 'xmlhttprequest' parameters = cgi.parse_qs(environ.get('QUERY_STRING', '')) results = [] number = '' if 'number' in parameters: number = parameters['number'][0] results = [ info(module, number) for module in get_number_modules() if module.is_valid(number)] if 'HTTP_X_REQUESTED_WITH' in environ: start_response('200 OK', [('Content-Type', 'application/json')]) return [json.dumps(results, indent=2, sort_keys=True)] start_response('200 OK', [('Content-Type', 'text/html')]) return _template % dict( value=cgi.escape(number, True), results='\n'.join(format(data) for data in results)) python-stdnum-1.8.1/online_check/check.js0000644000000000000000000000772713223166517020367 0ustar rootroot00000000000000/* # check.js - simple application to check numbers # # Copyright (C) 2017 Arthur de Jong. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA */ $( document ).ready(function() { function format(value) { return $("
    ").text(value).html().replace( /\n\n/g, "
    \n" ).replace( /^[*] (.*)$/gm, "
    • $1
    " ).replace( /(\b(https?|ftp):\/\/[^\s<]*[-\w+&@#/%=~_|])/ig, "$1" ) } function updateresults(field, results) { // build HTML to present var h = ["
      "]; $.each(results, function(index, result) { h.push( "
    • ", $("
      ").text(result["number"]).html(), ": ", $("
      ").text(result["name"]).html(), "", "

      ", format(result["description"]), $.map(result["conversions"], function(value, key){ return [ "
      ", $("

      ").text(key).html(), ": ", $("
      ").text(value).html()].join('') }).join(''), "

    • ") }); h.push("
    "); // replace the results div $("#" + $(field).attr("id") + "_results").slideUp("quick", function() { $(this).html(h.join("")); $(this).slideDown("quick"); }); } function checkfield(field) { var value = field.val(); // only trigger update if value changed from previous validation if (value != field.data("oldvalue")) { field.data("oldvalue", value); $.get('', {"number": value}, function(data) { window.history.pushState({"value": value, "data": data}, $(document).find("title").text(), "?number=" + encodeURIComponent(value)); updateresults(field, data); }); } } // update results based on history navigation window.onpopstate = function(e) { var field = $(".stdnum_check"); if (e.state) { var value = e.state.value; var data = e.state.data; field.val(value) field.data("oldvalue", value); updateresults(field, data); } else { field.val("") field.data("oldvalue", ""); updateresults(field, []); } }; // trigger a check when user stopped typing $(".stdnum_check").on("input propertychange", function (event) { if (window.event && event.type == "propertychange" && event.propertyName != "value") return; var field = $(this); window.clearTimeout($(this).data("timeout")); $(this).data("timeout", setTimeout(function () { checkfield(field); }, 2000)); }); // trigger a check when losing focus $(".stdnum_check").on("blur", function() { window.clearTimeout($(this).data("timeout")); checkfield($(this)); }); // prevent enter from submitting the form $(".stdnum_check").keydown(function(event) { if(event.keyCode == 13) { event.preventDefault(); checkfield($(this)); return false; } }); // hide the submit button $(".stdnum_hide").hide(); // focus the text field $(".stdnum_check").focus(); // save current state var value = $(".stdnum_check").val(); $(".stdnum_check").data("oldvalue", value); $.get('', {number: value}, function(data) { window.history.replaceState({"value": value, "data": data}, $(document).find("title").text(), "?number=" + encodeURIComponent(value)); }) }); python-stdnum-1.8.1/online_check/template.html0000644000000000000000000000124213223166517021437 0ustar rootroot00000000000000 python-stdnum: check numbers