--- id: types-cffi version: "2.0.0.20260518" license: Apache-2.0 license_treatment: permissive maintenance: active --- # types-cffi — Typing stubs for cffi License: permissive · Maintenance: active · Downloads: 20.7M/mo ## What it is and what it does types-cffi is a type stub package that bridges the gap between cffi and Python's static type checkers. It provides type annotations for the cffi library so that tools like mypy and pyright can understand and validate code that uses cffi to call C functions from Python. The stubs are maintained as part of the typeshed project and target cffi version 2.0.*. This package is not a runtime dependency of your application—it's a development-time tool that helps catch type errors during static analysis. You install it alongside cffi, and your type checker automatically uses it when analyzing code. It requires Python >=3.10 and has been tested with mypy 2.1.0 and pyright 1.1.409. Use it for: - Enable mypy or pyright to type-check code that calls cffi functions and classes - Catch type errors in cffi bindings before runtime in CI/CD pipelines - Provide IDE autocomplete and type hints for cffi APIs in editors that support type stubs ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides type stubs for the cffi package, enabling static type checkers like mypy and pyright to understand and validate code that uses cffi for C foreign function interfaces. Yes, if you use cffi and want static type checking. Install it as a dev dependency alongside cffi to enable type checkers to validate your C bindings. No runtime overhead; purely a type-checking aid. No known vulnerabilities. ## Install pip install types-cffi uv add types-cffi poetry add types-cffi ## Installing types-cffi Before you install: Low friction install as a pure-Python wheel. Actively maintained through typeshed; last commit 2026-08-14 and release 88 days ago indicate current upkeep. License in practice: Apache-2.0 permissive license allows use in most projects without significant restrictions. Quickstart: pip install types-cffi # In your code, import cffi normally; type checkers will use the stubs import cffi ffi = cffi.FFI() Requires Python >=3.10. Only useful when used alongside a type checker (mypy, pyright, etc.) in your development workflow. Verify before relying: - Whether type coverage is complete for all cffi 2.0.* APIs or if gaps remain - Compatibility with type checkers other than mypy 2.1.0 and pyright 1.1.409 ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 20.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags type stubs cffi, cffi type hints, static type checking cffi, mypy cffi support, pyright cffi annotations, type-stubs, static-analysis [View on SkillFed](https://skillfed.io/packages/types-cffi) · [View on PyPI](https://pypi.org/project/types-cffi/)