Persistent JSON message queues for Python - native bindings for local and remote IPC
Project description
Plasmite Python Bindings (v0)
These bindings wrap the libplasmite C ABI via ctypes.
Installation
Wheels are designed to bundle native assets under plasmite/_native/:
libplasmite.(dylib|so)for ctypes loadingplasmiteCLI binary (invoked via Python console script entrypoint)
Using uv (recommended)
uv tool install plasmite
For project dependencies in a uv-managed workspace:
uv add plasmite
Runtime load order is:
PLASMITE_LIB_DIRoverride (development escape hatch)- Bundled
plasmite/_native/libplasmite.(dylib|so)absolute path - System linker fallback (
plasmite/libplasmite)
For development/testing from this repo, see Install & Test below.
Build Requirements
- Python 3.10+
libplasmitebuilt from this repo (cargo build -p plasmite) for local development
Install & Test
From the repo root:
cargo build -p plasmite
Canonical repo-root command:
just bindings-python-test
Equivalent manual commands (from bindings/python):
uv venv
source .venv/bin/activate
PLASMITE_LIB_DIR="$(pwd)/../../target/debug" uv pip install -e .
PLASMITE_LIB_DIR="$(pwd)/../../target/debug" PLASMITE_BIN="$(pwd)/../../target/debug/plasmite" python3 -m unittest discover -s tests
Build a wheel with bundled native assets from a specific SDK directory:
PLASMITE_SDK_DIR=/path/to/sdk python -m build
Usage
from plasmite import Client, Durability
with Client("./data") as client:
with client.create_pool("docs", 64 * 1024 * 1024) as pool:
message = pool.append_json(
b'{"kind":"note","text":"hi"}',
["note"],
Durability.FAST,
)
print(message.decode("utf-8"))
frame = pool.get_lite3(1)
print(len(frame.payload))
for item in pool.tail(tags=["note"], max_messages=1, timeout_ms=100):
print(item.decode("utf-8"))
Pool.tail(..., tags=[...]) uses exact tag matching and composes with other filters using AND semantics.
Error behavior
- Invalid local arguments raise
ValueError/TypeError. - ABI/runtime failures raise
PlasmiteErrorwithkind,path,seq, andoffsetwhen present.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plasmite-0.2.0.tar.gz.
File metadata
- Download URL: plasmite-0.2.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb8dd364bae61e125f016d2a8c942736e420c3fda125fe552ab65f057ff81215
|
|
| MD5 |
5d80b055b94e670ff381abb58e01ac52
|
|
| BLAKE2b-256 |
83f0331a50f5840be9fc2b640bf3e29d5b5b7d36b36233f7950a025d6f32f8b1
|
File details
Details for the file plasmite-0.2.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: plasmite-0.2.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9745efe0574d168664854a8ca55f163d4e8a2ceceabf5b89619031e54835a754
|
|
| MD5 |
cdf9e4819ba4cba5e8bfb960c33f60ef
|
|
| BLAKE2b-256 |
91fca7860ae685c842db849928159f0861a55e76890bbb6850fa5f11a9b7a20c
|
File details
Details for the file plasmite-0.2.0-cp311-cp311-macosx_11_0_universal2.whl.
File metadata
- Download URL: plasmite-0.2.0-cp311-cp311-macosx_11_0_universal2.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.11, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5df6f0336695ace42fc8587aa644d8ba1533f197a5f4a99379d22b3cf6dd990b
|
|
| MD5 |
f80621e12ba0419d454692b21adeb2f9
|
|
| BLAKE2b-256 |
2b301d8c38149030d8e6f0d664a112d462ba2fa792dade2f7fb129b7ef756e33
|
File details
Details for the file plasmite-0.2.0-cp311-cp311-macosx_10_12_universal2.whl.
File metadata
- Download URL: plasmite-0.2.0-cp311-cp311-macosx_10_12_universal2.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.11, macOS 10.12+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2634426e1dc5ff3d1402f393207b05c58c4cca7c0ca773a29699ef4804815c6c
|
|
| MD5 |
1d20101cf233ecc39297e186b022fec3
|
|
| BLAKE2b-256 |
f99ba635c43a7d93efcf78487ea6d789ec6eacdebebb52d4c28fdf1182e48b33
|