skillfed

pact-python-ffi

Python bindings for the Pact FFI library

pact-python-ffi v0.5.4.1 1.4M downloads/30d#3,901 on PyPI677
Permissive license MIT Active released

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-ffi

uv

uv add pact-python-ffi

poetry

poetry add pact-python-ffi

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Testing

Tags

pact ffi python bindingscontract testing low-level apipact c interface wrapperffi bindings for pactadvanced pact testingcontract testing frameworkpact foreign function interface
ffi-bindingscontract-testinglow-level-api

More Testing packages