localflavor
This package is a derivative of django-localflavor and a work in progress. This package does not depend on Django, and currently only contains postal codes validators, lists of country states and provinces and calling (dial in) codes.
Installation
pip install localflavor
Example usage
Postal code validation
>>> from localflavor.generic.validators import validate_country_postcode
>>> validate_country_postcode('1000AA', 'NL')
'1000 AA'
>>> validate_country_postcode('0888', 'US')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "../localflavor/generic/validators.py", line 453, in validate_country_postcode
return validator.clean(value)
File "../localflavor/base.py", line 71, in clean
value = super(RegexValidator, self).clean(value)
File "../localflavor/base.py", line 48, in clean
raise ValidationError(self.error_messages['invalid'])
localflavor.exceptions.ValidationError: Enter a valid ZIP code in the format XXXXX or XXXXX-XXXX.
Calling codes
>>> from localflavor.generic.countries.calling_codes import CALLING_CODES
>>> CALLING_CODES.get('US')
'+1'
>>> CALLING_CODES.get('RU')
'+7'
>>> CALLING_CODES.get('NL')
'+31'
Metadata
Release files for localflavor 1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| localflavor-1.9.tar.gz | 79.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| localflavor-1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 203.3 kB
Release files / localflavor-1.9.tar.gz
| Download URL | localflavor-1.9.tar.gz |
|---|---|
| Size | 79.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b051be69c778d02754be4a1c447d73107d80330e261e2eb77e17780e41e49272
|
|
BLAKE2b-256 checksum How to use checksums |
631267fa0d311578aa90d4ba60bf8a567cc8b375b728589120a8a9e9aadc7048
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.12
|
Release files / localflavor-1.9-py3-none-any.whl
| Download URL | localflavor-1.9-py3-none-any.whl |
|---|---|
| Size | 123.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02820a541d5fd0317265b7bacbc6a30a19492decc97205620545e4ae8eb8689c
|
|
BLAKE2b-256 checksum How to use checksums |
64b335a6dfefcf4dd005c356dbdc783afbfa2d3d89441c3b4894ce593fd70b7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.12
|
Security for localflavor 1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.