--- id: pycapnp version: "2.2.4" license: BSD-2-Clause license_treatment: permissive maintenance: active --- # pycapnp — A cython wrapping of the C++ Cap'n Proto library License: permissive · Maintenance: active · Downloads: 1.7M/mo ## What it is and what it does pycapnp wraps the C++ Cap'n Proto library, bringing schema-driven serialization and RPC to Python. Cap'n Proto is a data interchange format designed for speed—messages defined in a schema serialize to compact binary format, avoiding deserialization overhead. The library supports both synchronous and asynchronous RPC via a promise-style API, useful for distributed systems where efficiency matters. The package includes prebuilt wheels for Python 3.9 through 3.14 on Linux, macOS, and Windows, though source builds require compilation tooling. It depends only on jinja2 at runtime. The library is actively maintained with recent fixes for memory leaks and NULL pointer dereferences, stable since initial release in 2013. Use it for: - Serialize structured data to compact binary format for efficient storage or network transmission. - Implement RPC servers and clients with async/await support for inter-process communication. - Define strongly-typed message schemas to enforce data contracts across service boundaries. - Build distributed systems where serialization overhead and latency are critical. - Exchange data with other Cap'n Proto implementations using shared schema definitions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pycapnp is a Python binding for Cap'n Proto, a serialization and RPC framework enabling efficient schema-based message exchange and remote procedure calls. Yes, if you need schema-driven serialization and RPC with Cap'n Proto and can meet C++14 compiler and build-tool requirements. Production-stable, actively maintained, no known vulnerabilities, prebuilt wheels for common platforms. Not recommended if you cannot install a C++ compiler or prefer pure-Python serialization. ## Install pip install pycapnp uv add pycapnp poetry add pycapnp ## Installing pycapnp Before you install: Medium install friction: requires a C++14 compiler, cmake, and Python development headers. Prebuilt wheels available for Python 3.9–3.14 on Linux, macOS, and Windows, but source builds need compilation tooling. Actively maintained with recent release (42 days old) and no known vulnerabilities. License in practice: BSD-2-Clause is permissive; you may use, modify, and distribute pycapnp freely in open-source and commercial projects, provided you retain the license notice and disclaimer. Quickstart: pip install pycapnp import capnp # Schema-based message creation and serialization message = capnp.new_message() message.write(open('data.bin', 'w')) Requires C++14-compatible compiler (gcc 6.1+, clang 6+, or Visual Studio 2017+), cmake, and Python development headers. On Linux, Python dev headers often in separate package. 32-bit Linux requires capnproto compiled with -fPIC. Verify before relying: - Whether bundled capnproto (1.4.0 as of v2.2.4) meets your requirements or system-installed version is preferred. - Performance characteristics and serialization overhead versus other Python serialization frameworks. - Practical PyPy compatibility beyond classifier listing. - Specific RPC latency and throughput characteristics for your use case. ## Package facts - License: BSD-2-Clause (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 1.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cap'n proto python, schema serialization, rpc framework, message serialization, capnproto binding, async rpc, data interchange format, serialization, rpc, schema-driven [View on SkillFed](https://skillfed.io/packages/pycapnp) · [View on PyPI](https://pypi.org/project/pycapnp/)