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
tracingevents piped straight into Pythonlogging. - 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 usepyo3-async-runtimes::tokio::future_into_pyso awaitables are native Python coroutines. - Close semantics: dropping the sender (via
close(),with tx:, or garbage collection) closes the channel. Receivers seeChannelClosedErrorwhen empty; iterators terminate cleanly. - Observability: Rust
tracingevents are emitted as JSON on stderr, then parsed by a background reader thread and re-emitted on theferryboat.rustPython logger. Users configure formatting on theferryboatlogger.
License
MIT
Benchmarks
Release files for ferryboat 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 10.4 MB
Release files / ferryboat-0.2.0-cp312-cp312-win_amd64.whl
| Download URL | ferryboat-0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 808.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e9f784a28081f3b9b9574b863d2c848f43e1b270aca25ec809a6d1151f1494f3
|
|
BLAKE2b-256 checksum How to use checksums |
ff54ec36a61e4d100f683396015d8cecaa38ef462d504d70148eb5eebda8da63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ferryboat-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 923.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
27e52691fc46aa3d0a387b905e2ef6855505fc1491b2bf60e78a23e4d55471fe
|
|
BLAKE2b-256 checksum How to use checksums |
530f335ac3373a5e1add3ce7f22d29505ef79aaba5dcf5896543110121da2eb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ferryboat-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 894.5 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
85599359b78ff75d4e79447d61f56aae15fa2bc9586a96f6a556f455ab718636
|
|
BLAKE2b-256 checksum How to use checksums |
c450543c65881ed7a1cbd1810f366fabdd974d5692c2e1e0a6018dc6e37ddd83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | ferryboat-0.2.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 851.5 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
39d17ce8bf9c40af0de5cc496e01fc4b3abf3094d7d333484eb395045f75d277
|
|
BLAKE2b-256 checksum How to use checksums |
b001a5c6e1c1fb70401828fdfb09047d3dc1b5ea4345f4f2b76f04980b22a736
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp311-cp311-win_amd64.whl
| Download URL | ferryboat-0.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 807.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1365274d7fe2f3278298825a1a72d0e75df6bdcb0c5603f73e9acfacbe4d2542
|
|
BLAKE2b-256 checksum How to use checksums |
4fc2130363422a1043ca7d78a3d6036c8f4ecc5ea3475fcb9716d2c4c5aac058
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ferryboat-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 920.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d439496db0520688a3df23c682b9543264776a018d025c85216b497c693e48cf
|
|
BLAKE2b-256 checksum How to use checksums |
8b05c3958a661916f6d4ce2af42b76e5938fdc44effd2ab42c568b9deae4d6d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ferryboat-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 892.7 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
8c5caa884936505180497c79926b81c13c9dec60b22ad7496ce4c6d2c0cae848
|
|
BLAKE2b-256 checksum How to use checksums |
4745af06b5117b732297f5321622d77876f8e077ea457930410bc02332c88db3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | ferryboat-0.2.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 849.5 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
cdd35bc4ac26f594adc370016f71efaa609ce113f7ccacf0e933c93b15c1bb8c
|
|
BLAKE2b-256 checksum How to use checksums |
058dabd067880d1ccb554a0e29d1de5110f83d3ec189ed3fe44c943bb475e08d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp310-cp310-win_amd64.whl
| Download URL | ferryboat-0.2.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 807.6 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5c8f4dbc49195e2de1c6b0a92fa41eb73615db3bb860efb11e82f118e42ce447
|
|
BLAKE2b-256 checksum How to use checksums |
6c5b3a6e65e74cf930e702b0de660ffdcdeb283f3db9098f9c07479fdbd2f7e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ferryboat-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 920.4 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1cbf975b9593a7f8f3b77e95110c4daf3047c361f2f1b1c8ac87c69c36477c91
|
|
BLAKE2b-256 checksum How to use checksums |
2c2e0b824b105cfe3052c7ceeee7012ff5a10c99b54d030ea7359b819355553a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ferryboat-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 892.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
1db3d525a71f0842038295c3acd67b0cf29688bf53ed8c1aee181b700093614b
|
|
BLAKE2b-256 checksum How to use checksums |
0b058dea89d1c84bc37ad0ecf1c1d111a1fa73015543b1c4a0808cbbf96df5c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / ferryboat-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | ferryboat-0.2.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 849.4 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b3adcbf20172bba91ae3672d020bee9a5b18665e24feb9a0764aede39de4e54a
|
|
BLAKE2b-256 checksum How to use checksums |
28476e500c601aa107a5abdd5268577ddd09dfd37ea0f160abdf6f851cdba11b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency log