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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 71.7MB
glibcpy 3.10–3.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.fixUpdate 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.fixUpgrade 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`.fixFor 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.