pact-python-ffi
Python bindings for the Pact FFI library
What it is and what it does
pact-python-ffi is a thin Python wrapper around the Pact FFI, a C API exposed by the Pact reference implementation. It provides direct access to low-level Pact operations for developers who need fine-grained control or are building higher-level libraries. Most classes wrap C pointers directly and implement `__del__` methods to manage memory allocated by the underlying library, preventing leaks.
The package is intended for advanced users and library authors rather than typical contract-testing workflows. Functions from the FFI are exposed directly as module-level callables; the API is not guaranteed stable. For standard contract testing, the main Pact Python library is recommended instead.
Use it for:
- Building custom higher-level abstractions or domain-specific testing frameworks on top of the raw FFI.
- Integrating contract testing into specialized CI/CD or testing orchestration systems requiring low-level control.
- Accessing FFI functionality not yet exposed by higher-level libraries.
- Advanced debugging or introspection of Pact operations at the C API level.
- Porting or adapting FFI bindings from other languages to Python-based toolchains.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides direct Python bindings to the Pact FFI (Foreign Function Interface), exposing low-level C API functions for contract testing without higher-level abstraction.
Yes, if you are an advanced user or library author building on Pact and need direct FFI access. No, if you are doing standard contract testing—use the main Pact Python library instead. Active maintenance, no known vulnerabilities, permissive license, and broad platform support make it safe to adopt for its intended use case.
Install
pact-python-ffi on PyPI
pip
pip install pact-python-ffiuv
uv add pact-python-ffipoetry
poetry add pact-python-ffiInstalling pact-python-ffi
Before you install
Medium install friction due to platform-specific binary wheels across macOS, Linux, Windows, and ARM variants. Active maintenance with recent release; last commit 2026-08-13. Supports Python 3.10–3.14.
License in practice
MIT license (permissive). No restrictions on commercial or private use; attribution required.
Quickstart
pip install pact-python-ffi
import pact_python_ffi
# Access FFI functions directly
Requires Python ≥3.10. Binary wheels are platform-specific; installation pulls the appropriate wheel for your OS and architecture.
Verify before relying
- Stability guarantees for the FFI API surface across minor/patch versions.
- Performance characteristics or overhead of the wrapper layer compared to direct usage.
- Compatibility with the main pact-python library when both are used together.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — cffi |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,434,855/month — #3,901 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pact_python_ffi-0.5.4.1-cp310-abi3-macosx_12_0_arm64.whl; pact_python_ffi-0.5.4.1-cp310-abi3-macosx_12_0_x86_64.whl; pact_python_ffi-0.5.4.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pact_python_ffi-0.5.4.1-cp310-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pact_python_ffi-0.5.4.1-cp310-abi3-musllinux_1_2_aarch64.whl; pact_python_ffi-0.5.4.1-cp310-abi3-musllinux_1_2_x86_64.whl; pact_python_ffi-0.5.4.1-cp310-abi3-win_amd64.whl; pact_python_ffi-0.5.4.1-cp310-abi3-win_arm64.whl
Keywords: contract-testing, ffi, pact, pact-python
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pact-pythonPact Python implements consumer-driven contract…
permissive · top 5,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
pemjaPemJa enables Python code to call Java methods…
permissive · top 15,000 on PyPI
apache-tvm-ffiProvides a stable, minimal C ABI and FFI for…
permissive · top 5,000 on PyPI
cffiCFFI enables Python code to call C functions…
permissive · top 100 on PyPI
anchorpy-coreProvides Python bindings to Anchor Rust code,…
permissive · top 15,000 on PyPI
hip-pythonProvides low-level Python and Cython bindings…
permissive · top 15,000 on PyPI
python-interfaceDeclares interfaces and statically asserts that…
permissive · top 15,000 on PyPI
dealDeal is a Python library for design by contract…
permissive · top 15,000 on PyPI
github-copilot-sdkPython SDK for programmatic control of GitHub…
permissive · top 5,000 on PyPI