id-translation


Nameid-translation JSON
Version 0.12.2 PyPI version JSON
download
home_pagehttps://github.com/rsundqvist/id-translation
SummaryConvert IDs into human-readable labels.
upload_time2024-10-16 21:59:00
maintainerNone
docs_urlNone
authorRichard Sundqvist
requires_python<4,>=3.11
licenseNone
keywords id-translation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # ID Translation <!-- omit in toc -->
**_Convert IDs to human-readable labels._**

-----------------

[![PyPI - Version](https://img.shields.io/pypi/v/id-translation.svg)](https://pypi.python.org/pypi/id-translation)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/id-translation.svg)](https://pypi.python.org/pypi/id-translation)
[![Tests](https://github.com/rsundqvist/id-translation/workflows/tests/badge.svg)](https://github.com/rsundqvist/id-translation/actions?workflow=tests)
[![Codecov](https://codecov.io/gh/rsundqvist/id-translation/branch/master/graph/badge.svg)](https://codecov.io/gh/rsundqvist/id-translation)
[![Read the Docs](https://readthedocs.org/projects/id-translation/badge/)](https://id-translation.readthedocs.io/)
[![PyPI - License](https://img.shields.io/pypi/l/id-translation.svg)](https://pypi.python.org/pypi/id-translation)

<div align="center">
  <img src="https://github.com/rsundqvist/id-translation/raw/master/docs/_images/covid-europe-mplcyberpunk-theme.png"><br>
</div>

Country IDs translated using the standard `id:name`-format. Click [here][ecdc] for source.

[ecdc]: https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-covid-19-cases-worldwide

## 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.

# Cookiecutter template project
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.

```python
from big_corporation_inc.id_translation import translate
print(
  "The first employee at Big Corporation Inc. was:", 
  translate(1, names="employee_id"),
)
```

Check out this [demo project](https://github.com/rsundqvist/id-translation-project/tree/master/demo/bci-id-translation)
(and its 📚[generated documentation](https://rsundqvist.github.io/id-translation-project/)) to get a preview of what 
Your generated project might look like, or continue to the next section for a brief feature overview.

[id-translation-project]: https://github.com/rsundqvist/id-translation-project/

# 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.

[Format strings]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.offline.html#id_translation.offline.Format
[Format Specification Mini-Language]: https://docs.python.org/3/library/string.html#formatspec
[SQL]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.fetching.html#id_translation.fetching.SqlFetcher
[file-system]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.fetching.html#id_translation.fetching.PandasFetcher
[Name-to-source]: https://id-translation.readthedocs.io/en/stable/documentation/translation-primer.html#name-to-source-mapping
[Placeholder-to-column]: https://id-translation.readthedocs.io/en/stable/documentation/translation-primer.html#placeholder-mapping
[TOML]: https://id-translation.readthedocs.io/en/stable/documentation/translator-config.html
[cached instances]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.Translator.load_persistent_instance.html
[Translator.translate()]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.Translator.translate.html

## 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][pandas-translation], including `pandas.MultiIndex` types.
- Optional and [user-extensible] integration of data types, such as [polars] and [dask].

[pandas-translation]: https://id-translation.readthedocs.io/en/stable/documentation/examples/notebooks/cookbook/pandas-index.html
[user-extensible]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.dio.html#id_translation.dio.register_io
[polars]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.dio.integration.polars.html
[dask]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.dio.integration.dask.html

# Installation
The package is published through the [Python Package Index (PyPI)]. Source code
is available on GitHub: https://github.com/rsundqvist/id-translation

```sh
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](LICENSE.md)

# 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](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md).

[Python Package Index (PyPI)]: https://pypi.org/project/id-translation


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rsundqvist/id-translation",
    "name": "id-translation",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.11",
    "maintainer_email": null,
    "keywords": "id-translation",
    "author": "Richard Sundqvist",
    "author_email": "richard.sundqvist@live.se",
    "download_url": "https://files.pythonhosted.org/packages/80/a4/e6a330c205f61e5622049238c359729f6cb1cd009be14078c3b35e36e0ea/id_translation-0.12.2.tar.gz",
    "platform": null,
    "description": "# ID Translation <!-- omit in toc -->\n**_Convert IDs to human-readable labels._**\n\n-----------------\n\n[![PyPI - Version](https://img.shields.io/pypi/v/id-translation.svg)](https://pypi.python.org/pypi/id-translation)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/id-translation.svg)](https://pypi.python.org/pypi/id-translation)\n[![Tests](https://github.com/rsundqvist/id-translation/workflows/tests/badge.svg)](https://github.com/rsundqvist/id-translation/actions?workflow=tests)\n[![Codecov](https://codecov.io/gh/rsundqvist/id-translation/branch/master/graph/badge.svg)](https://codecov.io/gh/rsundqvist/id-translation)\n[![Read the Docs](https://readthedocs.org/projects/id-translation/badge/)](https://id-translation.readthedocs.io/)\n[![PyPI - License](https://img.shields.io/pypi/l/id-translation.svg)](https://pypi.python.org/pypi/id-translation)\n\n<div align=\"center\">\n  <img src=\"https://github.com/rsundqvist/id-translation/raw/master/docs/_images/covid-europe-mplcyberpunk-theme.png\"><br>\n</div>\n\nCountry IDs translated using the standard `id:name`-format. Click [here][ecdc] for source.\n\n[ecdc]: https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-covid-19-cases-worldwide\n\n## What is it?\nA package suite for translating IDs typically found in databases. Translation is highly configurable and tested for \nmultiple different SQL dialects and schema naming paradigms. The included TOML configuration format as well as the\nsupport functions make it easy to create and share working configurations with anyone who needs them.\n\n# Cookiecutter template project\nThe fastest way to get started with `id-translation` is the \ud83c\udf6a[id-translation-project] Cookiecutter template. It is\ndesigned to allow power users to quickly specify shared configurations that \"just work\" for other users; see the example\nbelow.\n\n```python\nfrom big_corporation_inc.id_translation import translate\nprint(\n  \"The first employee at Big Corporation Inc. was:\", \n  translate(1, names=\"employee_id\"),\n)\n```\n\nCheck out this [demo project](https://github.com/rsundqvist/id-translation-project/tree/master/demo/bci-id-translation)\n(and its \ud83d\udcda[generated documentation](https://rsundqvist.github.io/id-translation-project/)) to get a preview of what \nYour generated project might look like, or continue to the next section for a brief feature overview.\n\n[id-translation-project]: https://github.com/rsundqvist/id-translation-project/\n\n# Highlighted Features\n- Convenient interface: [Translator.translate()].\n- Intuitive [Format strings] (e.g. `'{id}:{name}'`), including full\n  [Format Specification Mini-Language] support. Extensions for optional keys.\n- Fetchers for [SQL] and local or remote [file-system] sources.\n- Powerful [Name-to-source] and [Placeholder-to-column] mapping and name extraction.\n- Configurable using [TOML] - see the \ud83c\udf6a[id-translation-project] Cookiecutter template.\n\n[Format strings]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.offline.html#id_translation.offline.Format\n[Format Specification Mini-Language]: https://docs.python.org/3/library/string.html#formatspec\n[SQL]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.fetching.html#id_translation.fetching.SqlFetcher\n[file-system]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.fetching.html#id_translation.fetching.PandasFetcher\n[Name-to-source]: https://id-translation.readthedocs.io/en/stable/documentation/translation-primer.html#name-to-source-mapping\n[Placeholder-to-column]: https://id-translation.readthedocs.io/en/stable/documentation/translation-primer.html#placeholder-mapping\n[TOML]: https://id-translation.readthedocs.io/en/stable/documentation/translator-config.html\n[cached instances]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.Translator.load_persistent_instance.html\n[Translator.translate()]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.Translator.translate.html\n\n## Supported types\n- Supported ID types: `int`, `string`, and `UUID`. Optional heuristics for UUID-like strings.\n- Supports translation of built-in collections: `list`, `dict`, `set`, `tuple`.\n- Supports translation of [pandas types][pandas-translation], including `pandas.MultiIndex` types.\n- Optional and [user-extensible] integration of data types, such as [polars] and [dask].\n\n[pandas-translation]: https://id-translation.readthedocs.io/en/stable/documentation/examples/notebooks/cookbook/pandas-index.html\n[user-extensible]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.dio.html#id_translation.dio.register_io\n[polars]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.dio.integration.polars.html\n[dask]: https://id-translation.readthedocs.io/en/stable/_autosummary/id_translation.dio.integration.dask.html\n\n# Installation\nThe package is published through the [Python Package Index (PyPI)]. Source code\nis available on GitHub: https://github.com/rsundqvist/id-translation\n\n```sh\npip install -U id-translation\n```\n\nThis is the preferred method to install `id-translation`, as it will always install the\nmost recent stable release.\n\n# License\n[MIT](LICENSE.md)\n\n# Documentation\nHosted on Read the Docs: https://id-translation.readthedocs.io\n\n# Contributing\n\nAll contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. To get \nstarted, see the [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md).\n\n[Python Package Index (PyPI)]: https://pypi.org/project/id-translation\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Convert IDs into human-readable labels.",
    "version": "0.12.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/rsundqvist/id-translation/issues",
        "Changelog": "https://github.com/rsundqvist/id-translation/blob/master/CHANGELOG.md",
        "Documentation": "https://id-translation.readthedocs.io",
        "Homepage": "https://github.com/rsundqvist/id-translation",
        "Repository": "https://github.com/rsundqvist/id-translation"
    },
    "split_keywords": [
        "id-translation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f77c0ff5f36524cb00ced9909568e850d5b5d59e0986345f86db468a9a03b7f",
                "md5": "e25143d0ef809b2f1a8c03c4e835434c",
                "sha256": "f757323020fb54489ba3914cbeaed4ed24c405f1ed651ebd0e8a4229089c6a76"
            },
            "downloads": -1,
            "filename": "id_translation-0.12.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e25143d0ef809b2f1a8c03c4e835434c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.11",
            "size": 128235,
            "upload_time": "2024-10-16T21:58:58",
            "upload_time_iso_8601": "2024-10-16T21:58:58.516129Z",
            "url": "https://files.pythonhosted.org/packages/5f/77/c0ff5f36524cb00ced9909568e850d5b5d59e0986345f86db468a9a03b7f/id_translation-0.12.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80a4e6a330c205f61e5622049238c359729f6cb1cd009be14078c3b35e36e0ea",
                "md5": "070678cbe4dcd4a569b1a00a4e5bab2c",
                "sha256": "61952f1cf3ee58183e71c81ecef4ea1ab96cf13aa047c8df3c1b6c636712a012"
            },
            "downloads": -1,
            "filename": "id_translation-0.12.2.tar.gz",
            "has_sig": false,
            "md5_digest": "070678cbe4dcd4a569b1a00a4e5bab2c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.11",
            "size": 100622,
            "upload_time": "2024-10-16T21:59:00",
            "upload_time_iso_8601": "2024-10-16T21:59:00.166746Z",
            "url": "https://files.pythonhosted.org/packages/80/a4/e6a330c205f61e5622049238c359729f6cb1cd009be14078c3b35e36e0ea/id_translation-0.12.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-16 21:59:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rsundqvist",
    "github_project": "id-translation",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "id-translation"
}
        
Elapsed time: 0.33522s