Skip to main content

Convert IDs into human-readable labels.

Project description

ID Translation

Convert IDs to human-readable labels.


PyPI - Version PyPI - Python Version Tests Codecov Read the Docs PyPI - License


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

Supported types

  • Supported ID types: int, string, and UUID. Optional heuristics for UUID-like strings.
  • Supports translation of built-in collections: list, dict, set, tuple.
  • Supports translation of pandas types, including pandas.MultiIndex types.
  • Optional and user-extensible integration of data types, such as polars, pyarrow, 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

MIT

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

id_translation-1.2.0.tar.gz (117.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

id_translation-1.2.0-py3-none-any.whl (157.4 kB view details)

Uploaded Python 3

File details

Details for the file id_translation-1.2.0.tar.gz.

File metadata

  • Download URL: id_translation-1.2.0.tar.gz
  • Upload date:
  • Size: 117.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for id_translation-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e0c2bdc0cb15b68775e0e6ea856be107c3541efdb3e3bf8c0977965b622bb5df
MD5 a2827a883a616295ed1ee0f3fe21bb19
BLAKE2b-256 37622aa8751a047fad8b9f142fe0bfbb26fa97512c6feea6489f9fc38568fecd

See more details on using hashes here.

Provenance

The following attestation bundles were made for id_translation-1.2.0.tar.gz:

Publisher: release.yml on rsundqvist/id-translation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file id_translation-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: id_translation-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 157.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for id_translation-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c0e3c369046980c72daff8a5f8a250c9ec2e2a0630782f7bf0c5527df445afa
MD5 b7d094a1bb466aa0b209dea555da5f00
BLAKE2b-256 40f5f2f463f04cbcee4d0caa48cc0ad95a2edab1a5a2e0c64fa8cce4f6062cce

See more details on using hashes here.

Provenance

The following attestation bundles were made for id_translation-1.2.0-py3-none-any.whl:

Publisher: release.yml on rsundqvist/id-translation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page