Poli-enum
Several dead-simple political python Enums: pip install poli-enum.
Python 3.6+ supported.
Enums
Continent
Continent codes from Data hub.
from poli_enum.continent import Continent
Continent.EU.value == 'Europe'
Country
Country codes as ISO 3166-1 alpha 2, taken from iso-3616-1 commit 8e31d749b9ce331cfa50c280a29b04ae2d805b7e.
from poli_enum.country import Country
Country.ES.value == 'Spain'
Subdivision
Subdivision country codes from ISO 3166-2. Taken from GEFEG.
from poli_enum.subdivision import Subdivision
catalonia = Subdivision['ES-CA']
You can check whether a subdivision is part of a country:
from poli_enum.country import Country
from poli_enum.subdivision import Subdivision
Subdivision['US-FL'] in Country.US == True
Currency
Currency codes as for ISO 4217 and currency symbols as for xe.com.
from poli_enum.currency import Currency
Currency.EUR.value == 34
You can get the currency symbol:
from poli_enum.currency import Currency
Currency.EUR.symbol == '€'
Currency.PHP.symbol == '₱'
f'Cost: 54{Currency.EUR:s}' == 'Cost: 54€'
Symbol
from poli_enum.currency import Symbol
Symbol.GBP.value == '£'
Layouts
Keyboard layout codes. From Debian 9 /usr/share/X11/xkb/rules/evdev.lst.
from poli_enum.layout import Layout
Layout.US.value == 'English (US)'
Layout.BRAI.value == 'Braille'
Testing
git clone this project.
Execute python setup.py test in the project folder.
Contributing
Is a missing or wrong code? Say it in the issues! Feel free to contribute.
Metadata
Release files for poli-enum 1.0.1
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 | Actions |
|---|---|---|---|---|
| poli-enum-1.0.1.tar.gz | 20.8 kB | Without provenance | Details for poli-enum-1.0.1.tar.gz |
Release files / poli-enum-1.0.1.tar.gz
| Download URL | poli-enum-1.0.1.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f8155db8ae3cec398244d30984fbb0546b7c9c8172bd9971dd09dfd5d898d21
|
|
BLAKE2b-256 checksum How to use checksums |
2620d3735322b4d743df0e4199c9ccff6c077da2d391f6f64dcdf4b299a4cfcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|
Security for poli-enum 1.0.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.