python-iso4217: fast currency data package for Python
This python package automatically updates its own currency data using github actions and immediately release new version of package with updates. So it's super fast and at the same time always contains fresh data.
Installation
Pip
pip install python-iso4217
Poetry
poetry add python-iso4217
Usage
from iso4217 import find_currency, iter_currency
# Filters that could be applied:
# * currency_name
# * alphabetical_code
# * entity
# * decimal_places
# * numeric_code
# * withdrawal_date
# The filters correspond to attributes of `Currency` class
# accept arbitrary filters as key/value pairs
currency = find_currency(currency_name="usd")
# if currency was not found, the lib will immediately raise CurrencyNotFoundError
defunct_currency = find_currency(currency_name="abc123")
# You need generator to lazy iter currencies? Ok
for c in iter_currency():
# do something
Advanced
Work with pydantic
import inspect
from iso4217 import Currency as _Currency, find_currency
from pydantic import BaseModel, root_validator, StrictInt
class Currency(BaseModel, _Currency):
__root__: StrictInt
@root_validator(skip_on_failure=True)
def humanize(cls, values):
currency_numeric_code: int = values.get("__root__")
# inspect.getfullargspec(_Currency.__init__) will contain `self`, so we cut it off
orig_currency_cls_dunder_init_arg_names = inspect.getfullargspec(_Currency.__init__).args[1:]
currency = find_currency(numeric_code=currency_numeric_code)
return {
k: getattr(currency, k, None)
for k in orig_currency_cls_dunder_init_arg_names
}
Metadata
Release files for python-iso4217 0.0.8
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 | |
|---|---|---|---|---|
| python_iso4217-0.0.8.tar.gz | 13.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_iso4217-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.9 kB
Release files / python_iso4217-0.0.8.tar.gz
| Download URL | python_iso4217-0.0.8.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdbb5cb5cc183182e97c9e110483e66b84abafbabbd0b91d8d1c64333f144a7e
|
|
BLAKE2b-256 checksum How to use checksums |
c1ba323d961b3ef95b8c8e289dbee97b4c983ae4a92c189da7b9bea9462f65aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / python_iso4217-0.0.8-py3-none-any.whl
| Download URL | python_iso4217-0.0.8-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9df8257537eeb551587ba91f575e424c77d95e82a3a808fe7fb8356c7e4e0e9c
|
|
BLAKE2b-256 checksum How to use checksums |
4f971916f2d68d336fe47e1b9ac19032cd006eb550a777d34c3b16442d23b74d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for python-iso4217 0.0.8
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.