pyblackboxprotobuf
Python 3.9+ bindings for the pure Rust blackboxprotobuf crate. The package
uses a small stable C ABI and Python's standard-library ctypes, so it is not
tied to a specific CPython minor version.
This package continues the API lineage of NCC Group's original
nccgroup/blackboxprotobuf
project. The original project is Copyright (c) 2018-2023 NCC Group Plc and is
distributed under the MIT License. The earlier Python 3.9+ refactor reorganized
that implementation in aFunnyStrange's project style; this version replaces
the codec implementation with the independently written Rust port and exposes
it through a stable C ABI plus ctypes for faster encoding and decoding. It is
not an official NCC Group release and is not endorsed by NCC Group.
Build a platform wheel. The PEP 517 backend invokes Cargo automatically and embeds the release dynamic library:
python -m pip install build
python -m build --wheel
python -m pip install --force-reinstall dist\pyblackboxprotobuf-*.whl
The resulting filename uses py3-none-<platform> because the ctypes ABI is
independent of CPython minor versions but still contains native platform code.
For source-tree development, build_native.py remains available after a
normal Cargo release build.
cargo build --release
python python/pyblackboxprotobuf/build_native.py
from pyblackboxprotobuf import ProtobufFactory
data = {"1": "Alice", "2": b"opaque"}
typedef = {"1": {"type": "string"}, "2": {"type": "bytes"}}
encoded = ProtobufFactory.protobuf_encode(data, typedef)
decoded, inferred = ProtobufFactory.protobuf_decode(encoded)
protobuf_encode, protobuf_decode, grpc_encode, grpc_stream_encode, and
grpc_decode are compatible with the retained API in blackboxprotobuf_origin.
Releases
The GitHub Actions workflow builds and installs wheels for manylinux x86_64,
Windows x86_64, macOS Intel, and macOS ARM64. A v* tag publishes the tested
wheels and source distribution through PyPI Trusted Publishing.
Publish the matching blackboxprotobuf Rust crate to crates.io before tagging
this repository. This repository is independent and resolves
blackboxprotobuf = 0.1.1 directly from crates.io; Cargo.lock pins the native
release build to the reviewed dependency graph.
Create a project-scoped PyPI API token, save it as the PYPI_API_TOKEN secret
in this repository (or its pypi GitHub environment), and then push a tag such
as v0.1.0. The workflow reads that secret without printing it and rejects
tags whose version does not match pyproject.toml.
See NOTICE for the complete upstream relationship and attribution.
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 pyblackboxprotobuf-0.1.0.tar.gz.
File metadata
- Download URL: pyblackboxprotobuf-0.1.0.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71b67e2926771010bb28b867c489f161d2b6e21ae02d4f673fe521c75c70a557
|
|
| MD5 |
dff7639109d707902f1ca8657e7aa375
|
|
| BLAKE2b-256 |
b8f1725727fe59538134b6a7b83975c3e2b56d1cea6f170c07617a14764632ae
|
File details
Details for the file pyblackboxprotobuf-0.1.0-py3-none-win_amd64.whl.
File metadata
- Download URL: pyblackboxprotobuf-0.1.0-py3-none-win_amd64.whl
- Upload date:
- Size: 206.1 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5001b695a399d823c0b1cd65fc306064fb6e2d5df4e4c8d837fa354b277a346b
|
|
| MD5 |
3654c806294c2adb1e7761e48b367f65
|
|
| BLAKE2b-256 |
52116afb47632206e367fc9d4a60f2a9f035cdd86ceff443ff3a482a92d51c14
|
File details
Details for the file pyblackboxprotobuf-0.1.0-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyblackboxprotobuf-0.1.0-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 342.8 kB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e7a183af6700a49879f53576b0f769aa6ac3fa6d9f5edf8ace1956bb6fcadef
|
|
| MD5 |
5b849e41a4d728526277dbf0e8b8915b
|
|
| BLAKE2b-256 |
be3b5abe260c20ebe3bbdb34b58a47b61d9dfeec21fc08a7d0ee94c804aa204f
|
File details
Details for the file pyblackboxprotobuf-0.1.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyblackboxprotobuf-0.1.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 294.6 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb6044f61b76238b9258dc8261c6933dc6923a2e29bedc52ad8c265086254656
|
|
| MD5 |
13e3e3e47fe3f789d532a98656f061f0
|
|
| BLAKE2b-256 |
2c4ec49bef7d065774496b010fc172584330f0526abdf5f7c4c40ef834d163ef
|
File details
Details for the file pyblackboxprotobuf-0.1.0-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pyblackboxprotobuf-0.1.0-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 307.8 kB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae950db6cda9511677f20282fc227b0156f3cb9cab74d6362284ea3994f00bb3
|
|
| MD5 |
bae9a1be334300114f075d5124aa1ee6
|
|
| BLAKE2b-256 |
368351678e7b28dec2f0c2a289258350d0b37ce28a4916cfec601b96879e31ad
|