Converts structure, keys and fields from a record according to predefined rules
Project description
A rule-based record transformation library for Python. Converts input dicts into desired output formats using YAML or dict-based rule configurations. Designed to normalize records of the same data type from different sources into a single validated structure.
Features
Map fields using simple string paths or JMESPath expressions for nested access
Transform field values in-place with 25+ built-in conversion actions (string ops, math, URL cleanup, phone parsing, etc.)
Compute output values with command processors (GeoJSON points, joins, splits, list transforms)
Convert between date formats (Unix timestamps, DD-MM-YYYY, YYYY_MM_DD, etc.)
Run records through Pydantic models or dataclasses with optional method invocation
Conditionally execute rules or skip entire records
Extend with custom field convertors, date formatters, and command classes via protocols
Installation
pip install record-convertor
Quick Start
from record_convertor import RecordConvertorWithRulesDict
rules = {
"name": "item.name",
"brand": "item.brand.name",
"price": "item.price",
}
convertor = RecordConvertorWithRulesDict(rule_dict=rules)
result = convertor.convert({
"item": {
"name": "Widget",
"brand": {"name": "Acme"},
"price": 9.99,
}
})
# {"name": "Widget", "brand": "Acme", "price": 9.99}
Documentation
Full documentation is available at https://record-convertor.readthedocs.io/
License
LGPL-3.0-or-later
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 record_convertor-1.2.0.tar.gz.
File metadata
- Download URL: record_convertor-1.2.0.tar.gz
- Upload date:
- Size: 75.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bced67de0ea48dd7a0779348dcec37141e112979b064e7c45f5042b9c2e9fe2b
|
|
| MD5 |
304a1dc90369aa002f48b6dbc1a3bba2
|
|
| BLAKE2b-256 |
ae6d1d9da401fca29042074c7365f8c7fb2dddcb4e95685084ed939f0a803f81
|
Provenance
The following attestation bundles were made for record_convertor-1.2.0.tar.gz:
Publisher:
main.yml on OlivettaDataGarden/record-convertor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
record_convertor-1.2.0.tar.gz -
Subject digest:
bced67de0ea48dd7a0779348dcec37141e112979b064e7c45f5042b9c2e9fe2b - Sigstore transparency entry: 955837289
- Sigstore integration time:
-
Permalink:
OlivettaDataGarden/record-convertor@d7f2a5ea16820d4d55af5352d774db7ccea2e2f3 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/OlivettaDataGarden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@d7f2a5ea16820d4d55af5352d774db7ccea2e2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file record_convertor-1.2.0-py3-none-any.whl.
File metadata
- Download URL: record_convertor-1.2.0-py3-none-any.whl
- Upload date:
- Size: 59.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 |
4884e2f36377e1b43ae3edc1b340fc0fd7e3e62f15693efa4374e90c4e3c6aba
|
|
| MD5 |
d650db87ca6494bb297f0415dea883a6
|
|
| BLAKE2b-256 |
38ee2a6dc666814860cb815dda2a905ced4b439e750e81dc5354dc2d4cc7add0
|
Provenance
The following attestation bundles were made for record_convertor-1.2.0-py3-none-any.whl:
Publisher:
main.yml on OlivettaDataGarden/record-convertor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
record_convertor-1.2.0-py3-none-any.whl -
Subject digest:
4884e2f36377e1b43ae3edc1b340fc0fd7e3e62f15693efa4374e90c4e3c6aba - Sigstore transparency entry: 955837294
- Sigstore integration time:
-
Permalink:
OlivettaDataGarden/record-convertor@d7f2a5ea16820d4d55af5352d774db7ccea2e2f3 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/OlivettaDataGarden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@d7f2a5ea16820d4d55af5352d774db7ccea2e2f3 -
Trigger Event:
push
-
Statement type: