TransformKit SDK — node-based media pipeline engine for Python
Project description
@transformkit/sdk (Python)
Node-based media pipeline engine for Python — a faithful port of the TypeScript SDK.
Install
pip install transformkit
Quick start
import asyncio
from transformkit import (
ConfigField,
Edge,
NodeInstance,
Pipeline,
create_context,
create_default_registry,
create_mock_transport,
run_pipeline,
validate_pipeline,
)
pipeline = Pipeline(
nodes=[
NodeInstance(id="in", type="pipeline.input"),
NodeInstance(id="convert", type="image.convert", config={
"format": ConfigField(value="png", editable=False),
}),
NodeInstance(id="out", type="pipeline.output"),
],
edges=[
Edge(source="in", target="convert"),
Edge(source="convert", target="out"),
],
)
result = validate_pipeline(pipeline, create_default_registry())
assert result.valid
async def main():
transport = create_mock_transport()
ctx = create_context(b"\xff" * 1024, "heic")
outputs = await run_pipeline(pipeline, create_default_registry(), transport, ctx)
for out in outputs:
print(out.metadata.output_file_name, len(out.file))
asyncio.run(main())
Metadata stripping
Metadata handling is an explicit graph operation, not a flag on the output. Drop
image.strip-metadata, video.strip-metadata, or audio.strip-metadata into
the branch that should come out clean; leave other branches untouched to keep
EXIF/XMP/IPTC/container tags. Each strip node has one boolean config field,
enabled (default True) — set to False to bypass the node without removing
it from the graph.
Transports implement the operation: "strip-metadata" payload as a lossless
pass when possible (ffmpeg -c copy -map_metadata -1 for video/audio;
chunk-walk or re-emit without tag data for images). ICC color profiles are
always preserved to avoid unintended color shifts.
Because stripping is a regular node, two pipeline.output nodes can share an
upstream image.convert and differ only in whether a strip-metadata node
sits before one of them — no per-output flag propagation, no conflict error.
License
MIT
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 transformkit-0.2.0.tar.gz.
File metadata
- Download URL: transformkit-0.2.0.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd62084108128752ca979c993bef8b0981da92352efa4a761425d553515f00f3
|
|
| MD5 |
94a54943ada8f7f88d6369357f4d7ae2
|
|
| BLAKE2b-256 |
daa87d10cd0f1528907470ffe2e05185711b6c9ed6defd5979058f9c671e81b6
|
File details
Details for the file transformkit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: transformkit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 42.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07de80cb88e0c295a95169ba09c65cfe289298f634519e868df9a4ccaeb087a4
|
|
| MD5 |
867450c0f9bf838e7e0b0364b7202ed6
|
|
| BLAKE2b-256 |
136b70ca9eef1a2895075b063e1f7f6a447916df7cfd76ba345202b2bb6af4cd
|