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 IDs typically found in databases. Translation is highly configurable and tested for multiple different SQL dialects and schema naming paradigms. The included TOML configuration format as well as the support functions make it easy to create and share working configurations with anyone who needs them.
Getting started
The fastest way to get started with id-translation is the 🍪id-translation-project Cookiecutter template. It is
designed to allow power users to quickly specify shared configurations that "just work" for other users; see the example
below.
# Generated by: cookiecutter https://github.com/rsundqvist/id-translation-project.git
from big_corporation_inc.id_translation import translate
print(
"The first employee at Big Corporation Inc. was:",
translate(1, names="employee_id"),
)
The template generates an installable {your-namespace}.id_translation module, with functions such as the one used
above. Check out the demo project
(and its 📚generated documentation) to get a preview of what Your
generated project might look like, or continue to the next section for a brief feature overview.
Highlighted Features
- Convenient interface: Translator.translate().
- Intuitive Format strings (e.g.
'{id}:{name}'), including full Format Specification Mini-Language support. Extensions for optional keys. - Fetchers for SQL and local or remote file-system sources.
- Powerful Name-to-source and Placeholder-to-column mapping and name extraction.
- Configurable using TOML - see the 🍪id-translation-project Cookiecutter template.
Supported types
- Supported ID types:
int,string, andUUID. Optional heuristics for UUID-like strings. - Supports translation of built-in collections:
list,dict,set,tuple. - Supports translation of pandas types, including
pandas.MultiIndextypes. - Optional and user-extensible integration of data types, such as polars and dask.
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.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file id_translation-1.0.1.tar.gz.
File metadata
- Download URL: id_translation-1.0.1.tar.gz
- Upload date:
- Size: 112.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3ea6c3677bab0cdad025a12f6ef5ff7b6aede23555782862eb8b06b1d2259e0
|
|
| MD5 |
93b1b1e5f0dbec015ed45c14088d3be1
|
|
| BLAKE2b-256 |
a9b5fc6f1131859942851fcfce4654b56471ae883ab763c0458ba33375c0889f
|
Provenance
The following attestation bundles were made for id_translation-1.0.1.tar.gz:
Publisher:
release.yml on rsundqvist/id-translation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
id_translation-1.0.1.tar.gz -
Subject digest:
b3ea6c3677bab0cdad025a12f6ef5ff7b6aede23555782862eb8b06b1d2259e0 - Sigstore transparency entry: 725368229
- Sigstore integration time:
-
Permalink:
rsundqvist/id-translation@f60268c4f5d607bba9400d4cb6910e9acedad228 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/rsundqvist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f60268c4f5d607bba9400d4cb6910e9acedad228 -
Trigger Event:
push
-
Statement type:
File details
Details for the file id_translation-1.0.1-py3-none-any.whl.
File metadata
- Download URL: id_translation-1.0.1-py3-none-any.whl
- Upload date:
- Size: 148.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f128eea6122d8fce7c6fbcf8673dd358c93db788f53e321cc00ba767f0f41634
|
|
| MD5 |
1a030d4fe494d3ff1361e52f95761999
|
|
| BLAKE2b-256 |
1c3171b5caed64dc727f89269f507b732922a9d7ffac970155e0095b90e405c3
|
Provenance
The following attestation bundles were made for id_translation-1.0.1-py3-none-any.whl:
Publisher:
release.yml on rsundqvist/id-translation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
id_translation-1.0.1-py3-none-any.whl -
Subject digest:
f128eea6122d8fce7c6fbcf8673dd358c93db788f53e321cc00ba767f0f41634 - Sigstore transparency entry: 725368233
- Sigstore integration time:
-
Permalink:
rsundqvist/id-translation@f60268c4f5d607bba9400d4cb6910e9acedad228 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/rsundqvist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f60268c4f5d607bba9400d4cb6910e9acedad228 -
Trigger Event:
push
-
Statement type: