Convert IDs into human-readable labels.
Project description
Convert IDs to human-readable labels.
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 regular users. See the example snippet below.
from id_translation import Translator
def get_singleton() -> Translator:
"""Returns pre-built Translator instance."""
return Translator.load_persistent_instance(
"/company/translation/config.toml",
extra_fetchers=["/company/translation/customer-database-config.toml"],
# Singleton is updated by a CRON job; regular users don't have write access.
max_age=None, # None = never update
)
A function to create Translator instances that "just work".
Highlighted Features
- A highly configurable translation format strings.
- Powerful automated Name-to-source and format placeholder mapping, backed by the RiCS library.
- 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.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 073360595ee9ea358ddc5f0e9b9c4f1774fe5d23f6747c2e59415d50ee92d0ea |
|
MD5 | e402a2a0ba066d1b3b6497d2a495271f |
|
BLAKE2b-256 | ad9abe0a6a9ddc08a3f65e172e8b44b8314623556e11c5e00db7002fa2253afa |