Convert IDs into human-readable labels.
Project description
ID Translation
Convert IDs to human-readable labels.
Country IDs translated using the standard id:name
-format. Click here for source.
What is it?
A package suite for translating integer IDs typically found in databases. Translation is highly configurable and tested for multiple different SQL dialects and schema naming paradigms. This is configurable using TOML, allowing power users to specify shared configurations that "just work" for other users; see the snippet below.
from id_translation import Translator
translator = Translator.load_persistent_instance("/mnt/companyInc/id-translation/config.toml")
print(
"The first employee at Company Inc was:",
translator.translate(1, names="employee_id"),
)
Highlighted Features
- Support for
int
andstring
IDs or a collection thereof, with automatic name and ID extraction. - Translation of pandas types, including
pandas.Index
types. - Intuitive Format strings, with support for optional elements.
- Powerful automated Name-to-source and Format placeholder mapping.
- Prebuilt fetchers for SQL and file-system sources.
- Configure using TOML, support for persistent instances stored on disk.
Installation
The package is published through the Python Package Index (PyPI). Source code is available on GitHub: https://github.com/rsundqvist/id-translation
pip install -U id-translation
This is the preferred method to install id-translation
, as it will always install the
most recent stable release.
If you don't have pip installed, this Python installation guide can guide you through the process.
License
Documentation
Hosted on Read the Docs: https://id-translation.readthedocs.io
Contributing
All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. To get started, see the Contributing Guide and Code of Conduct.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for id_translation-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88f61820fdc59bf06e18df4d13c922212167c6adc78e8a175d1deffc9f5ccc87 |
|
MD5 | 0de4dc427b3570ee2a076ea936fce62f |
|
BLAKE2b-256 | 08063b761efb0f6b02bc416659934a9b227497cde16c99b4bf0baa40c73e4390 |