diff options
Diffstat (limited to 'stdnum')
-rw-r--r-- | stdnum/ch/uid.py | 7 | ||||
-rw-r--r-- | stdnum/ch/vat.py | 7 | ||||
-rw-r--r-- | stdnum/cusip.py | 5 | ||||
-rw-r--r-- | stdnum/dk/cpr.py | 7 | ||||
-rw-r--r-- | stdnum/iban.py | 5 | ||||
-rw-r--r-- | stdnum/imei.py | 3 | ||||
-rw-r--r-- | stdnum/isbn.py | 5 | ||||
-rw-r--r-- | stdnum/isil.py | 7 | ||||
-rw-r--r-- | stdnum/isin.py | 3 | ||||
-rw-r--r-- | stdnum/issn.py | 5 | ||||
-rw-r--r-- | stdnum/mx/rfc.py | 10 | ||||
-rw-r--r-- | stdnum/nl/bsn.py | 9 | ||||
-rw-r--r-- | stdnum/nl/onderwijsnummer.py | 4 | ||||
-rw-r--r-- | stdnum/pl/regon.py | 9 | ||||
-rw-r--r-- | stdnum/tr/tckimlik.py | 7 | ||||
-rw-r--r-- | stdnum/us/ssn.py | 7 | ||||
-rw-r--r-- | stdnum/verhoeff.py | 5 |
17 files changed, 63 insertions, 42 deletions
diff --git a/stdnum/ch/uid.py b/stdnum/ch/uid.py index 6622f50..62800bc 100644 --- a/stdnum/ch/uid.py +++ b/stdnum/ch/uid.py @@ -27,9 +27,10 @@ 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 is available at: - https://www.uid.admin.ch/ - https://de.wikipedia.org/wiki/Unternehmens-Identifikationsnummer +More information: + +* https://www.uid.admin.ch/ +* https://de.wikipedia.org/wiki/Unternehmens-Identifikationsnummer >>> validate('CHE-100.155.212') 'CHE100155212' diff --git a/stdnum/ch/vat.py b/stdnum/ch/vat.py index a61c49e..6e32ea7 100644 --- a/stdnum/ch/vat.py +++ b/stdnum/ch/vat.py @@ -28,9 +28,10 @@ ajoutée in French), "IVA" (Imposta sul valore aggiunto in Italian) or "TPV" This module only supports the "new" format that was introduced in 2011 which completely replaced the "old" 6-digit format in 2014. -More information is available at: - https://www.ch.ch/en/value-added-tax-number-und-business-identification-number/ - https://www.uid.admin.ch/ +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' diff --git a/stdnum/cusip.py b/stdnum/cusip.py index acd27d1..f685880 100644 --- a/stdnum/cusip.py +++ b/stdnum/cusip.py @@ -25,8 +25,9 @@ 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/ + +* https://en.wikipedia.org/wiki/CUSIP +* https://www.cusip.com/ >>> validate('DUS0421C5') 'DUS0421C5' diff --git a/stdnum/dk/cpr.py b/stdnum/dk/cpr.py index bdbbbb9..2566c64 100644 --- a/stdnum/dk/cpr.py +++ b/stdnum/dk/cpr.py @@ -31,9 +31,10 @@ 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/ + +* https://en.wikipedia.org/wiki/Personal_identification_number_(Denmark) +* https://da.wikipedia.org/wiki/CPR-nummer +* https://cpr.dk/ >>> validate('211062-5629') '2110625629' diff --git a/stdnum/iban.py b/stdnum/iban.py index ff33cdd..ae01a02 100644 --- a/stdnum/iban.py +++ b/stdnum/iban.py @@ -28,8 +28,9 @@ Some countries may also use checksum algorithms within their number but this is currently not checked by this number. 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 + +* 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' diff --git a/stdnum/imei.py b/stdnum/imei.py index 8c0c1a0..f030071 100644 --- a/stdnum/imei.py +++ b/stdnum/imei.py @@ -25,7 +25,8 @@ 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 + +* https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity >>> validate('35686800-004141-20') '3568680000414120' diff --git a/stdnum/isbn.py b/stdnum/isbn.py index 6b9233b..b511c4c 100644 --- a/stdnum/isbn.py +++ b/stdnum/isbn.py @@ -31,8 +31,9 @@ An ISBN has the following components: * a check digit More information: - https://en.wikipedia.org/wiki/International_Standard_Book_Number - https://www.isbn-international.org/range_file_generation + +* 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 diff --git a/stdnum/isil.py b/stdnum/isil.py index 219e89e..30dea53 100644 --- a/stdnum/isil.py +++ b/stdnum/isil.py @@ -38,9 +38,10 @@ 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/ - http://www.iso.org/iso/catalogue_detail?csnumber=57332 + +* https://en.wikipedia.org/wiki/ISBT_128 +* http://biblstandard.dk/isil/ +* http://www.iso.org/iso/catalogue_detail?csnumber=57332 >>> validate('IT-RM0267') 'IT-RM0267' diff --git a/stdnum/isin.py b/stdnum/isin.py index c6e93d5..135326a 100644 --- a/stdnum/isin.py +++ b/stdnum/isin.py @@ -28,7 +28,8 @@ 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 + +* https://en.wikipedia.org/wiki/International_Securities_Identification_Number >>> validate('US0378331005') 'US0378331005' diff --git a/stdnum/issn.py b/stdnum/issn.py index 8be1f2c..4fa113d 100644 --- a/stdnum/issn.py +++ b/stdnum/issn.py @@ -27,8 +27,9 @@ 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/ + +* https://en.wikipedia.org/wiki/International_Standard_Serial_Number +* http://www.issn.org/ >>> validate('0024-9319') '00249319' diff --git a/stdnum/mx/rfc.py b/stdnum/mx/rfc.py index 2e47238..10da251 100644 --- a/stdnum/mx/rfc.py +++ b/stdnum/mx/rfc.py @@ -35,12 +35,14 @@ 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 can be found at: - 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) +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/ + +* https://portalsat.plataforma.sat.gob.mx/ConsultaRFC/ >>> validate('GODE 561231 GR8') # personal number 'GODE561231GR8' diff --git a/stdnum/nl/bsn.py b/stdnum/nl/bsn.py index 280cc9b..c9e6f57 100644 --- a/stdnum/nl/bsn.py +++ b/stdnum/nl/bsn.py @@ -24,9 +24,10 @@ 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/ + +* https://en.wikipedia.org/wiki/National_identification_number#Netherlands +* https://nl.wikipedia.org/wiki/Burgerservicenummer +* http://www.burgerservicenummer.nl/ >>> validate('1112.22.333') '111222333' @@ -56,7 +57,7 @@ def compact(number): def checksum(number): """Calculate the checksum over the number. A valid number should have - a check digit of 0.""" + a checksum of 0.""" return (sum((9 - i) * int(n) for i, n in enumerate(number[:-1])) - int(number[-1])) % 11 diff --git a/stdnum/nl/onderwijsnummer.py b/stdnum/nl/onderwijsnummer.py index 0fbb3fc..b8d32c4 100644 --- a/stdnum/nl/onderwijsnummer.py +++ b/stdnum/nl/onderwijsnummer.py @@ -23,6 +23,10 @@ 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') diff --git a/stdnum/pl/regon.py b/stdnum/pl/regon.py index ac8cffb..82af03a 100644 --- a/stdnum/pl/regon.py +++ b/stdnum/pl/regon.py @@ -25,10 +25,11 @@ 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 can be found at: - 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 +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' diff --git a/stdnum/tr/tckimlik.py b/stdnum/tr/tckimlik.py index a465cf3..4083229 100644 --- a/stdnum/tr/tckimlik.py +++ b/stdnum/tr/tckimlik.py @@ -24,9 +24,10 @@ 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 can be found at: - https://en.wikipedia.org/wiki/Turkish_Identification_Number - https://tckimlik.nvi.gov.tr/ +More information: + +* https://en.wikipedia.org/wiki/Turkish_Identification_Number +* https://tckimlik.nvi.gov.tr/ >>> validate('17291716060') '17291716060' diff --git a/stdnum/us/ssn.py b/stdnum/us/ssn.py index d4058bf..d08bd9a 100644 --- a/stdnum/us/ssn.py +++ b/stdnum/us/ssn.py @@ -35,9 +35,10 @@ 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 + +* 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' diff --git a/stdnum/verhoeff.py b/stdnum/verhoeff.py index 5d6fb15..02559d3 100644 --- a/stdnum/verhoeff.py +++ b/stdnum/verhoeff.py @@ -24,8 +24,9 @@ The Verhoeff algorithm is a checksum algorithm that should catch most common 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 + +* 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 |