Registry / testing / pact-python-ffi

pact-python-ffi

JSON →
library0.5.4.0pypypiunverified

`pact-python-ffi` provides low-level Python bindings for the underlying Pact FFI (Foreign Function Interface) library, which is written in Rust. It enables Python applications to directly interact with the core Pact logic for contract testing. While often an internal dependency of the higher-level `pact-python` library, it can be used independently for advanced FFI control. The current version is `0.4.28.2`, and it is part of the `pact-python` monorepo, following its active release cadence.

pip install pact-python-ffi
INSTALL
IMPORT
SIG · PACT-PYTHON-FFI
P
pact-python-ffi
testingpythonv0.5.4.0
Install
2.0s avg
Import
Disk
53MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 71.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.0s · import 0.000s · 37MB
53MB installed
● package 53MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ffi_version
from pact_ffi import ffi_version
from pact_ffi import ffi_version

This quickstart demonstrates how to import and use basic functions from the `pact-python-ffi` library, such as initializing FFI logging and retrieving the underlying FFI library version. It shows how to interact with the FFI directly.

import os from pact_ffi import ffi_version, ffi_log_level, ffi_init # Initialize the FFI logging # PACT_LOG_LEVEL can be 'trace', 'debug', 'info', 'warn', 'error' log_level = os.environ.get('PACT_LOG_LEVEL', 'info') ffi_init(log_level) print(f"Pact FFI initialized with log level: {log_level}") # Get and print the FFI library version version = ffi_version() print(f"Pact FFI library version: {version}") # Example of setting log level dynamically (optional, usually set once) # ffi_log_level("debug") # print("Log level set to debug.")
Debug
Known issues
breakingThe `pact.v3.ffi` module has been removed and its functions replaced by the top-level `pact_ffi` package.
fix
Update all imports from `from pact.v3.ffi import ...` to `from pact_ffi import ...`.
affects: `pact-python-ffi >= 0.4.28.0`
breakingPython 3.9 support has been officially dropped.
fix
Upgrade your Python environment to 3.10 or newer. Earlier versions of `pact-python-ffi` might still support Python 3.9.
affects: `pact-python-ffi >= 0.4.28.2`
gotcha`pact-python-ffi` is a low-level FFI binding. Most users seeking Python-based Pact contract testing should primarily use the `pact-python` library, which leverages `pact-python-ffi` internally, rather than interacting directly with `pact-python-ffi`.
fix
For typical consumer/provider testing, consider `pip install pact-python` for a higher-level API.
affects: All versions
Upgrade
Version history
0.5.4.0latest on PyPI · released May 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
Resources
pact-python-ffi — pip install pact-python-ffi · libregistry