pyclibrary
C binding automation
Decision gist · record as of 2026-08-14
Yes. Low install friction, active maintenance, no known vulnerabilities, and permissive MIT license make this a safe choice. Install it if you need to call C libraries from Python and want to avoid hand-writing ctypes boilerplate; skip it if you prefer explicit control over bindings or are already using a dedicated FFI tool like cffi.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; C header files must be present and syntactically valid for the parser to process them.
- Low friction: pure-Python wheel with a single runtime dependency (pyparsing).
- Actively maintained as of 2026-07-17 with recent release history since 2015.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive): you may use, modify, and distribute this package freely in commercial and private projects, with minimal restrictions beyond preserving the license notice.
last release 2025-09-03 (345 days) · last repo commit 2026-07-17 · 72 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 399,719 downloads/mo, #6,945 on PyPI
Alternatives
Verify before relying
pip install pyclibrary
from pyclibrary import CParser
parser = CParser(['myheader.h'])
print(parser.defs['functions'])- Extent of C syntax coverage beyond the documented macro, typedef, struct, union, enum, function prototype, and global variable support.
- Whether the ctypes backend handles all common calling conventions and platform-specific type mappings automatically.
- Real-world performance on large or complex header files with heavy macro nesting or conditional compilation.
What it is and what it does
PyClibrary is a pure-Python C parser and ctypes binding automation library that reads C header files and extracts their definitions—macros, typedefs, structs, unions, enums, function prototypes, and global variables—then uses those definitions to simplify calling C libraries from Python. It evaluates typedefs down to their fundamental C types and can automatically build C structs and perform type conversions when invoking functions through ctypes' cdll or windll interfaces.
The package aims to be FFI-agnostic, presenting a backend-independent API; currently only ctypes is implemented, though a cffi backend is noted as theoretically possible. It depends only on pyparsing and runs on Python 3.10 and later. The library is a maintained fork of an earlier Launchpad project and is actively developed, making it suitable for projects that need to reduce boilerplate when wrapping existing C libraries.
Use it for
- Automatically generate Python ctypes wrappers from C header files to call compiled C libraries without manual struct and type definitions.
- Parse and evaluate C macros and typedefs to determine their underlying C types for use in Python binding code.
- Simplify integration of legacy C libraries into Python projects by automating the extraction of function signatures and struct layouts.
- Build Python-friendly wrappers around Windows DLLs or Unix shared libraries with automatic type conversion on function calls.
- Reduce maintenance burden when C library headers change by regenerating bindings from the updated headers.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, active maintenance, no known vulnerabilities, and permissive MIT license make this a safe choice. Install it if you need to call C libraries from Python and want to avoid hand-writing ctypes boilerplate; skip it if you prefer explicit control over bindings or are already using a dedicated FFI tool like cffi.
Install
pyclibrary on PyPI
Before you install
Low friction: pure-Python wheel with a single runtime dependency (pyparsing). Actively maintained as of 2026-07-17 with recent release history since 2015.
Requires Python 3.10 or later; C header files must be present and syntactically valid for the parser to process them.
License in practice
MIT license (permissive): you may use, modify, and distribute this package freely in commercial and private projects, with minimal restrictions beyond preserving the license notice.
Quickstart
pip install pyclibrary
from pyclibrary import CParser
parser = CParser(['myheader.h'])
print(parser.defs['functions'])
Verify before relying
- Extent of C syntax coverage beyond the documented macro, typedef, struct, union, enum, function prototype, and global variable support.
- Whether the ctypes backend handles all common calling conventions and platform-specific type mappings automatically.
- Real-world performance on large or complex header files with heavy macro nesting or conditional compilation.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepyparsing |
| Maintenance | Actively maintained 345 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 399,719 / month, #6,945 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pyclibrary-0.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ctypes bindings automation”
- pyclibraryParses C header files and automates ctypes-based bindings to C…
- cwrapcwrap is a Python wrapper around C code that builds on ctypes,…
- ctypesgenctypesgen parses C header files and automatically generates Python…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also CppHeaderParser · ctypesgen · cwrap · pywin32-ctypes · debug-mgr · glfw · abi3info · jaraco.windows · cffi · pyseccomp