Skip to main content

Lightweight local dataflow and shared-memory channels for Python.

Project description

dsline

dsline is a lightweight local dataflow framework for Python data processing and inter-process communication.

Current development follows ROADMAP.md. The first implementation target is a fixed-slot SPSC bytes channel. The current PyO3 ShmChannel binding is an in-process prototype over the dsline-shm fixed-slot SPSC channel; the real OS shared-memory backend is still intentionally gated behind the 0.0.1 implementation work.

Status

This repository is at the first test-version stage. It is suitable for API, packaging, protocol, and benchmark harness validation, but it is not yet the final dual-process shared-memory transport.

Current boundaries:

  • ShmChannel is an in-process prototype.
  • send/recv for existing bytes uses a copy path.
  • alloc/publish zero-copy APIs are not exposed.
  • MPSC, multi-consumer, crash recovery, and real OS shared memory are still future work.

Install for development

python -m pip install "maturin>=1.5,<2"
python -m maturin develop --manifest-path crates/dsline-python/Cargo.toml
import dsline

with dsline.ShmChannel("demo", capacity=4, slot_size=64) as ch:
    ch.send(b"hello")
    assert ch.recv() == b"hello"

Zero-copy wording follows the project rule:

dsline provides true zero-copy transfer only for eligible shared-memory alloc/publish payloads after the safety gate is complete. Existing bytes, bytearray, and ndarray values sent through send/recv are expected to use a single copy into shared memory.

Implemented prototype pieces:

  • dsline-core: fixed-slot SPSC bytes ring, checksum, Frame header, metadata TLV encode/decode.
  • dsline-shm: fixed-slot storage trait, in-memory and file-backed storage backends, region state model, and SPSC bytes channel over FREE, WRITING, COMMITTED, PINNED, and CORRUPTED.
  • dsline-python: PyO3 ShmChannel binding over the dsline-shm prototype and Python exception exports.

CLI

python -m dsline info
python -m dsline bench shm --message-size 4096 --count 100000 --json

After installation, the console script is also available:

dsline info
dsline bench shm --message-size 4096 --count 100000 --json

Verification

cargo fmt --all --check
cargo test
python -m maturin build --manifest-path crates/dsline-python/Cargo.toml --interpreter python
python -m unittest discover -s tests/python

License

MIT License.

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

dsline-0.0.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

dsline-0.0.1-cp39-abi3-win_amd64.whl (305.3 kB view details)

Uploaded CPython 3.9+Windows x86-64

File details

Details for the file dsline-0.0.1.tar.gz.

File metadata

  • Download URL: dsline-0.0.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for dsline-0.0.1.tar.gz
Algorithm Hash digest
SHA256 62e6a773d02689a727984df401a7b41b846c6d350af41991c03f817d23fd6acb
MD5 a7a0ad27eab48a099865573bfa0f514f
BLAKE2b-256 044b0e4fee425dfc7f9045467de7e5d7404f391ea09620dc12339875d2f71f85

See more details on using hashes here.

File details

Details for the file dsline-0.0.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: dsline-0.0.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 305.3 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for dsline-0.0.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d16badd8bc9454f7b37ec250938220cf429a23fb79dcaa73d2f1ccf1f9069f85
MD5 7ccf644596b8702a1a37d7a390e757fe
BLAKE2b-256 4008963f53c67d4a650731de9b14bf4150b11055e374dd784b2d0be7fa69f722

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