Skip to main content

detakon

PyPI - Version PyPI - Python Version


Description

A data converter than uses configuration files (referred to as detamaps) to map fields in the source data to output data, and perform operations on the data before outputting. Detamaps may also contain configuration data for the data source and output, and defaults to use if fields are missing, or blank/empty.

Table of Contents

Documentation

The latest documentation can be found at https://detakon.readthedocs.io/

For older versions of documentation, they can be found inside your copy of the respository under the "/docs" directory and built using Sphinx. The first version that contained documentation was v0.3.0.

Installation

pip install detakon

Usage

Detakon(detamap, source, destination).process()

Sample:

from detakon.converter import Detakon

invoice_converter = Detakon("invoice_detamap.json", "data_dump_2026-01-01.csv", "invoice_2026-01-01.csv")
invoice_converter.process()

Detamap Files

A detamap configuration file is used to provide all details necessary for the data conversion.

A datamap must be a Python dictionary, or convertable to a Python dictionary. Currently this means either a dictionary or JSON file (plans to add TOML support).

Please see the documentation for more detail on detamaps.

A detamap typically has the following sections:

A detamap JSON file may look similar to:

{
    "Mappings": {
        "Customer Id": "External ID",
        "First Name": "First Name",
        "Last Name": "Last Name",
        "Company": "Company",
        "Country": "Country",
        "Phone 1": "Phone",
        "Phone 2": "Cell",
        "Email": "Email",
        "Website": "URL",
        "Postal Code": "Zip"
    },
    "Defaults": {
        "Postal Code": "00000"
    },
    "Operations": [
        {"hashmap": {"fields": "Country",
                        "arguments": [{
                            "United States of America": "USA",
                            "Antarctica (the territory South of 60 deg S)": "Antarctica"}]
                        }
                    },
        {"strip": {"fields": "*"}},
        {"strip": {"arguments": ["+1-"], "fields": ["Phone 1", "Phone 2"]}},
        {"upper": {"fields": ["Email", "Last Name", "First Name"]}}
    ],
    "Source": {
        "argument": "filepath",
        "type": "str",
        "encoding": "utf-8",
        "format": "csv",
        "delimiter": ","
    },
    "Output": {
        "fields": ["External ID", "Company", "Last Name", "First Name", "Country", "Zip", "Phone", "Cell", "Email", "URL"],
        "argument": "filepath",
        "type": "str",
        "append": false,
        "omit_heading": false,
        "encoding": "utf-8",
        "format": "csv",
        "delimiter": ","
    }
}

Above sample is not all-inclusive. Detamaps, source data, and output expect full chain of custody. No security guarantees are made. Users are advised not to use untrusted, or malformed data.

Join us on Discord

Join the Detakon Discord Server.

License

detakon is distributed under the terms of the MIT license.

Metadata

Release files for detakon 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detakon 0.5.1
File Size Uploaded Provenance Actions
detakon-0.5.1.tar.gz 51.9 kB Without provenance Details for detakon-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for detakon 0.5.1
File Interpreter ABI Platform Actions
detakon-0.5.1-py3-none-any.whl Python 3 none any Details for detakon-0.5.1-py3-none-any.whl

Total release size: 71.1 kB

Release files / detakon-0.5.1.tar.gz

Download URL detakon-0.5.1.tar.gz
Size 51.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4dbdf5c913b2896238cdd6a638c597b66a01ce16bd4f0cc50251c37c568cbdf6
BLAKE2b-256 checksum
How to use checksums
ac6ee4bc51ab6d0e4d380771a008e8d7807d18dd175f036018d7d5c8ff9f8fe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.2 cpython/3.11.2 HTTPX/0.28.1

Release files / detakon-0.5.1-py3-none-any.whl

Download URL detakon-0.5.1-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a1c3ba88a4bedf18d76d8f3e2482d64c453b785684af4055e8ed21f9ddc7eaf
BLAKE2b-256 checksum
How to use checksums
66f6a03915cbfebda4805abfd08890357e58e05d821a989b38bc36113cfe1528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.2 cpython/3.11.2 HTTPX/0.28.1

Security for detakon 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page