Python bindings for the DataMorph transformation engine
Project description
datamorph-python
datamorph-python exposes the DataMorph transformation engine as a normal Python package.
Install it with:
pip install datamorph-python
Then import it with:
from datamorph import evaluate, read, write
Quick Start
from datamorph import evaluate
script = """
output application/json
---
{
id: payload.id,
requestId: headers.requestId,
stage: attributes.stage,
env: vars.env
}
"""
result = evaluate(
script,
payload={"id": 42},
headers={"requestId": "req-001"},
attributes={"stage": "test"},
variables={"env": "dev"},
)
assert result == {
"id": 42,
"requestId": "req-001",
"stage": "test",
"env": "dev",
}
API
evaluate(script, payload=None, headers=None, attributes=None, variables=None, payload_mime=None)transform(...)as an alias forevaluate(...)eval_expression(expression)read(input_text, mime_type)write(data, mime_type)validate(script)version()
Notes
- Package name on PyPI:
datamorph-python - Import name in Python:
datamorph - Wheels built from this folder contain the Rust engine, so users do not need a separate DataMorph installation.
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
datamorph_python-1.22.1.tar.gz
(33.5 MB
view details)
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 datamorph_python-1.22.1.tar.gz.
File metadata
- Download URL: datamorph_python-1.22.1.tar.gz
- Upload date:
- Size: 33.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
978a79bbc55c04e6e825a19b7c39f9a0346159437d0945ece7f58657c2340f3b
|
|
| MD5 |
11410e5ec5a93dc1cf38a11e8f06ec2e
|
|
| BLAKE2b-256 |
80b85e1f599c7502554ae4a6264eb9169777d7986f042fd1058e0d59186ad649
|
File details
Details for the file datamorph_python-1.22.1-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: datamorph_python-1.22.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 32.6 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d51e4dbf89038d338111a348a8c13a28a9d7d4271708f59e85ef778567dfaca3
|
|
| MD5 |
ef983e92c63e37a01b44d3660bde9a46
|
|
| BLAKE2b-256 |
6abd58fafc679a09d1a31bf6124f2e0655336f2ec02071d4cbb6b1ea3a6e3e15
|