Skip to main content

Python bindings for Datum stream blueprints

Project description

datum-stream

Python bindings for Datum stream blueprints.

Datum mirrors the Source -> Flow -> Sink and GraphDSL vocabulary from the Rust crate while keeping Python execution explicit: building a pipeline creates an immutable blueprint, and work starts only when a runnable graph is materialized with a Runtime.

Install

python -m pip install datum-stream

The package requires Python 3.13 or newer and depends on PyArrow. User Python code always runs through Arrow UDF batches: integer-stream map, filter, and flat_map wrap callables into single-column Arrow batches, while map_batches is the vectorized RecordBatch -> RecordBatch tier.

For scalar integer hot paths, use the named kernels such as map_add, map_multiply, and filter_greater_than. For Arrow batch streams, use typed col() expressions for lowerable work and map_batches for arbitrary Python. Terminal arithmetic is named too: Sink.fold() / Sink.fold_sum() sum values, and Sink.fold_product() multiplies them. Graph partitions select the typed PartitionStrategy.MODULO constant.

The package ships PEP 561 stubs (py.typed) with generic Source, Flow, Sink, RunnableGraph, Inlet, and Outlet types. Public construction is always strict: graph wiring and declared Arrow schemas are validated during builder calls, and empty Arrow inputs require an explicit schema=....

Example

import datum

with datum.Runtime() as runtime:
    graph = (
        datum.Source.range(1, 5)
        .map_add(1)
        .to_mat(datum.Sink.fold_product())
    )
    completion = graph.run(runtime)
    assert completion.wait() == 120

Scope

The current Python surface covers integer linear streams, a focused GraphDSL surface (Broadcast, Balance, Merge, Partition, Zip, Concat, and Interleave), Arrow batch UDFs, and Datum Connect for trusted client/server execution. Connect can run linear plans, supported junction graphs, tuple FlowShape results, direct ZipShape runs, and Merge/Concat/Interleave FanInShape runs. Local Connect defaults to arrow-ipc; remote Arrow payloads should prefer arrow-ipc-zstd when compression is wanted. Those wire-format defaults were chosen by measurement.

For the broader guide, see the Datum Python docs in docs/guides/python.

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

datum_stream-0.10.10.tar.gz (745.1 kB view details)

Uploaded Source

Built Distributions

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

datum_stream-0.10.10-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.13+manylinux: glibc 2.17+ x86-64

datum_stream-0.10.10-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.5 MB view details)

Uploaded CPython 3.13+manylinux: glibc 2.17+ ARM64

File details

Details for the file datum_stream-0.10.10.tar.gz.

File metadata

  • Download URL: datum_stream-0.10.10.tar.gz
  • Upload date:
  • Size: 745.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datum_stream-0.10.10.tar.gz
Algorithm Hash digest
SHA256 afab00b7edcbfbdc2a061dff4225ed6019a5720f1b6a3851772dc149ee7aef8e
MD5 269d7f41999a3b6c07a0f9b4a5af880e
BLAKE2b-256 8dda23c1cbfbe4abadf204915da587d0d3c1afb8c6aa1f432c2728507120d151

See more details on using hashes here.

File details

Details for the file datum_stream-0.10.10-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for datum_stream-0.10.10-cp313-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f24076b9b20f95d215af2e11fe2204dd745f81ee41b1ffd46560269b9374a716
MD5 d88f72296d9a4a3cf37b38b18ca47b4f
BLAKE2b-256 d14fbe70fcc5f2c27956597c5b74d5b241ce6c7bcf717acc7f44573794c34357

See more details on using hashes here.

File details

Details for the file datum_stream-0.10.10-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for datum_stream-0.10.10-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e04d78b96ecefd078559fce79e91e2f7fa3da99002e7e4c21f89bc76756fe02f
MD5 de6a23a9ef7b859a23a8b43df71ef4f9
BLAKE2b-256 741ae68cfe50e2326c903d0d5815ba5ff71e08b3b043d871c42c2f70b3003dd5

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