Skip to main content

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="output.console"),
    ],
    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())

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transformkit-0.1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transformkit-0.1.0-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file transformkit-0.1.0.tar.gz.

File metadata

  • Download URL: transformkit-0.1.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for transformkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2393997ba8c174a9deea7d9be00c4fedb3a764216af6753917ba9ad895c3d474
MD5 a376b641200b64d35e19919881c71e74
BLAKE2b-256 3eb294dfd8c4cf526844c7ab630ead46da34fe0f85fc76d16a6aeb09b0ee20ab

See more details on using hashes here.

File details

Details for the file transformkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: transformkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for transformkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf0846a206af5b92047c23c4fe32d27d647b4bcd6f18521165dc64eb0d202b5d
MD5 005106d7076d83df8c87ee42b9d214ab
BLAKE2b-256 5fc44c7e3d73370becb925378404a98604df31257059bc9670e7c4d8abcfdc03

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page