--- id: cffi version: "2.1.1" license: MIT-0 license_treatment: permissive maintenance: active --- # cffi — Foreign Function Interface for Python calling C code. License: permissive · Maintenance: active · Popularity: top 100 on PyPI ## Install pip install cffi uv add cffi poetry add cffi ## Description [![GitHub Actions Status](https://github.com/python-cffi/cffi/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/python-cffi/cffi/actions/workflows/ci.yaml?query=branch%3Amain++) [![PyPI version](https://img.shields.io/pypi/v/cffi.svg)](https://pypi.org/project/cffi) [![Read the Docs](https://img.shields.io/badge/docs-latest-blue.svg)][Documentation] CFFI ==== Foreign Function Interface for Python calling C code. Please see the [Documentation] or uncompiled in the `doc/` subdirectory. Download -------- [Download page](https://github.com/python-cffi/cffi/releases) Source Code ----------- Source code is publicly available on [GitHub](https://github.com/python-cffi/cffi). Contact ------- [Mailing list](https://groups.google.com/forum/#!forum/python-cffi) Testing/development tips ------------------------ After `git clone` or `wget && tar`, we will get a directory called `cffi` or `cffi-x.x.x`. We call it `repo-directory`. To run tests under CPython, run the following in the `repo-directory`: pip install pytest pip install -e . # editable install of CFFI for local development pytest src/c/ testing/ [Documentation]:... ## AI interpretation — verify before relying CFFI enables Python code to call C functions directly by parsing C declarations and generating the necessary bindings, with a single runtime dependency on pycparser. Verdict: CFFI is a mature, actively maintained top-100 PyPI package with no known vulnerabilities and permissive licensing. Medium install friction from compiled wheels is offset by broad platform support and recent activity. Suitable for production use when calling C code is required. [View on SkillFed](https://skillfed.io/packages/cffi) · [View on PyPI](https://pypi.org/project/cffi/)