Skip to main content

ferryboat

In-process, Rust-core communication channel for Python. Zero TCP, zero IPC, zero subprocess overhead — just a lock-free channel living inside your Python process as a native extension.

  • Speed: crossbeam-channel (sync) + tokio::sync::mpsc (async) primitives, GIL released on every blocking operation.
  • No data loss: bounded channels with backpressure. Senders block or await; they never drop.
  • Dual API: sync and async, same Rust core.
  • Observability: structured Rust tracing events piped straight into Python logging.
  • Ergonomic: type-annotated, context managers, iterators, async iterators.

Installation

pip install ferryboat

Usage

Sync API

import logging
import threading
import ferryboat

ferryboat.configure_logging(level="INFO", fmt="text")
logging.basicConfig(level=logging.DEBUG)

tx, rx = ferryboat.Channel.new(capacity=1024)

def producer() -> None:
    with tx:                                # closes sender on exit
        for i in range(10_000):
            tx.send(f"msg-{i}".encode())

threading.Thread(target=producer).start()

for msg in rx:                              # iterates until sender closes
    print(msg.decode())

Async API

import asyncio
import ferryboat

ferryboat.configure_logging(level="DEBUG")

async def producer(tx: ferryboat.AsyncSender) -> None:
    async with tx:
        for i in range(10_000):
            await tx.send(f"msg-{i}".encode())

async def consumer(rx: ferryboat.AsyncReceiver) -> None:
    async for msg in rx:                    # StopAsyncIteration on close
        print(msg.decode())

async def main() -> None:
    tx, rx = ferryboat.AsyncChannel.new(capacity=1024)
    await asyncio.gather(producer(tx), consumer(rx))

asyncio.run(main())

Batch receive (drain)

batch: list[bytes] = rx.drain()
process_batch(batch)

Timeout receive

try:
    msg = rx.recv_timeout(timeout_ms=500)
except TimeoutError:
    print("Nothing arrived in 500 ms")

Logging configuration

import ferryboat

# Text format (default) — readable in the terminal
ferryboat.configure_logging(level="DEBUG", fmt="text")

# JSON format — structured, for log aggregators
ferryboat.configure_logging(level="INFO", fmt="json")

# Or control the Rust log level via env var:
#   FERRYBOAT_LOG=warn python your_app.py

Environment variables:

Variable Default Effect
FERRYBOAT_LOG info Rust tracing level filter
FERRYBOAT_LOG_FORMAT text text or json

Building from source

Prerequisites

  • Rust ≥ 1.75 (install via rustup)
  • Python ≥ 3.10
  • maturin ≥ 1.4 (pip install maturin)

Development build

git clone https://github.com/your-org/ferryboat
cd ferryboat

python -m venv .venv
source .venv/bin/activate           # Windows: .venv\Scripts\activate

pip install maturin pytest pytest-asyncio
maturin develop --release

pytest tests/

Production wheel

maturin build --release
pip install target/wheels/ferryboat-*.whl

CI (GitHub Actions skeleton)

- uses: PyO3/maturin-action@v1
  with:
    command: build
    args: --release --out dist
- run: pip install dist/ferryboat-*.whl && pytest tests/

Design notes

  • GIL discipline: sync blocking calls use py.allow_threads(); async calls use pyo3-async-runtimes::tokio::future_into_py so awaitables are native Python coroutines.
  • Close semantics: dropping the sender (via close(), with tx:, or garbage collection) closes the channel. Receivers see ChannelClosedError when empty; iterators terminate cleanly.
  • Observability: Rust tracing events are emitted as JSON on stderr, then parsed by a background reader thread and re-emitted on the ferryboat.rust Python logger. Users configure formatting on the ferryboat logger.

License

MIT

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

ferryboat-0.1.9-cp312-cp312-win_amd64.whl (393.7 kB view details)

Uploaded CPython 3.12Windows x86-64

ferryboat-0.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (493.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ferryboat-0.1.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (495.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

ferryboat-0.1.9-cp312-cp312-macosx_11_0_arm64.whl (453.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ferryboat-0.1.9-cp311-cp311-win_amd64.whl (390.9 kB view details)

Uploaded CPython 3.11Windows x86-64

ferryboat-0.1.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (490.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ferryboat-0.1.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (494.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

ferryboat-0.1.9-cp311-cp311-macosx_11_0_arm64.whl (451.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

ferryboat-0.1.9-cp310-cp310-win_amd64.whl (391.1 kB view details)

Uploaded CPython 3.10Windows x86-64

ferryboat-0.1.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (490.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ferryboat-0.1.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (494.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

ferryboat-0.1.9-cp310-cp310-macosx_11_0_arm64.whl (451.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file ferryboat-0.1.9-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ferryboat-0.1.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 393.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ferryboat-0.1.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f120173eefa6fe85c018197d9ac66d7d10b08f3eadf67695c5fa9f5f46025496
MD5 fc65b248ef2497e238580fedaeabd877
BLAKE2b-256 7923b6b951ac9b8bbf523196f2ccb9fea4200a5b11ec7a131228ec80ae5ddc60

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp312-cp312-win_amd64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 62cdb75ae30cfdfe5da1632385f37e69201a65d8cbe4e2bcc2aba04f5dadd84a
MD5 75bc0eca6cc701ef25bf77e409fe6cbb
BLAKE2b-256 84a98b9c6d3fc21bc9bed611ff6ffd06accab1ce0841e70e4de34d6f2429255f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4e8c586774ec25b85e184e06fb675e825b496d14b305ecbfe9aeac4d2103ab94
MD5 07a29266dad224e8e413a5cf7dffc01b
BLAKE2b-256 b776a67063e3239b65a5ce24c16f1e40318484d9bb296fd0a47b72b688f39474

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2847837156d382949089e3ed47fcf39ff5c34b882a9a8f18b348ca89fdba385
MD5 12d621f086a900e15148dbb54f24d7ea
BLAKE2b-256 862761bd9e103d24b38a1cca92c0d51eaefb68e7a990258a2ced8adee0c7da24

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ferryboat-0.1.9-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 390.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ferryboat-0.1.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6da85ba3df4bad5bad717d2b650ce760c45cbd13c4131167e5c11558e35c2e37
MD5 bc9c3e067f2a9d68e8e8328fc52c3e45
BLAKE2b-256 4e87988b774a1a06ef13c5df6f13e03dd86ca80b245afe0793838e37edb80e49

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp311-cp311-win_amd64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c39c151545ecb948a3265835478b9d764a719488523e9624b3e6c3606c9c106
MD5 3ccd1e8fcba0f5f2afff8cd065629435
BLAKE2b-256 ac6ad1eb4d60fba0a5d9ad6c4a773083a178aa50c710c30fced2ec2c2e0a3eba

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 16da98a86109e41880e170514fc4727e02a31355270064861a638fe8bcbc05e8
MD5 799f3ea60f538e3db14f889b5aa2b31b
BLAKE2b-256 290a998ea53060ea6e917a0a1435522938d6b2a6438578fca46c35d992c48b9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b09bd88e860ed43caa01e5c63e19b56824eec5f5a59ecbe3f90ad662820c01d
MD5 3effc05d62652122e51cd3b241f449ff
BLAKE2b-256 1c80883472113a0e001e56a17f8df6981b92b9f11e2bdb22536e4e51ff4e57de

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ferryboat-0.1.9-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 391.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ferryboat-0.1.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d6d0f8e470a551e0189a41b11c2df89a0d2169d2690e4f729bdc42fe3c1496ba
MD5 3845c63defac3b1379e169b201d558f8
BLAKE2b-256 36a726125e87fc059fe29ab816dfba2fc6b67b0e86b43af6110b52a2a0cf52bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp310-cp310-win_amd64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5fc10d583bfc9a01f820ee59a7498672af0f5ddb0a53aa3758a3425982e086a
MD5 21e81da108a16db2269e71dbd0b5b6a7
BLAKE2b-256 fbc7db37e5b05750286d00dbbb37e1aebec2bc328c200096c2905e7f678d3ded

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9213709fa78b2e12a7406076025abd65c6400b46b92ee1f5c7305ebabc413919
MD5 6885755b19a3faa8ac7af0a5378a9f88
BLAKE2b-256 f55c1f9c0459251c5586ee0739459010eaf527fedaba44a0d9077fd2f6725257

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferryboat-0.1.9-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferryboat-0.1.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 faf8a544acc69f6ab8f6361278d1fb3ebc39c211ebc0f0baacc589d7abe5bcc7
MD5 c4fa28589fdb471b694c21c30a8e92be
BLAKE2b-256 3fa8ac89070f1b9fc90e7d90b8517aaedfccf6638e7ba5f952b971eea08708a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferryboat-0.1.9-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on loggerheads-with-binary/ferryboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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