cwrap
cwrap - ctypes blanket
Decision gist · record as of 2026-08-14
Yes, if you need to call C code from Python and prefer a higher-level wrapper over raw ctypes, and your project is compatible with GPL-3.0 copyleft licensing. The package is actively maintained, has no dependencies, and supports modern Python versions. If your project cannot use GPL-3.0 code, do not install.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later
- Low friction installation with no runtime dependencies.
- Active maintenance: last commit 2026-07-06, release 43 days old.
License · maintenance · safety
GPL-3.0 (copyleft) — GPL-3.0 copyleft license. You must distribute derivative works under the same license; use in proprietary software requires careful review or separate licensing.
last release 2026-07-02 (43 days) · last repo commit 2026-07-06 · 6 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 102,133 downloads/mo, #12,888 on PyPI
Alternatives
Verify before relying
pip install cwrap
import cwrap
# See examples/ directory in repository for usage patterns- Whether cwrap generates wrapper code or provides a runtime abstraction layer
- What C library features are supported (structs, callbacks, pointers, etc.)
- Performance overhead compared to direct ctypes use
What it is and what it does
cwrap simplifies the process of wrapping C code for use in Python by building on top of ctypes. Rather than writing raw ctypes bindings by hand, cwrap provides a higher-level interface to reduce boilerplate and make C interop more ergonomic. It is intended for developers who need to call C functions or work with C data types from Python but want to avoid writing C extension modules.
The package has been in active development since its first release and is marked as Production/Stable. It carries no runtime dependencies, making it lightweight to add to a project. The GPL-3.0 copyleft license means you must ensure compatibility with your project's licensing model before use.
Use it for
- Wrapping a C library to call its functions from Python without writing a C extension module
- Defining Python-friendly interfaces to C structs and data types for scientific or systems code
- Rapid prototyping of C bindings during development before committing to a full extension
- Integrating legacy C code into a Python application without rewriting it
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to call C code from Python and prefer a higher-level wrapper over raw ctypes, and your project is compatible with GPL-3.0 copyleft licensing.
The package is actively maintained, has no dependencies, and supports modern Python versions. If your project cannot use GPL-3.0 code, do not install.
Install
cwrap on PyPI
Before you install
Low friction installation with no runtime dependencies. Active maintenance: last commit 2026-07-06, release 43 days old. Supports Python 3.11 through 3.14.
Requires Python 3.11 or later
License in practice
GPL-3.0 copyleft license. You must distribute derivative works under the same license; use in proprietary software requires careful review or separate licensing.
Quickstart
pip install cwrap
import cwrap
# See examples/ directory in repository for usage patterns
Verify before relying
- Whether cwrap generates wrapper code or provides a runtime abstraction layer
- What C library features are supported (structs, callbacks, pointers, etc.)
- Performance overhead compared to direct ctypes use
Package facts
| License | GPL-3.0 copyleft |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 43 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 102,133 / month, #12,888 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Natural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: LibrariesTopic :: Utilities |
Evidence: cwrap-1.6.16-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 › “call c code from python”
- cwrapcwrap is a Python wrapper around C code that builds on ctypes,…
- cffiCFFI enables Python code to call C functions directly by parsing C…
- rpy2-robjectsProvides a Python interface to call R code and access R objects…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also pyclibrary · pywin32-ctypes · jaraco.windows · pyseccomp · unrar · ctypesgen · nanobind · pyprctl · rpy2-rinterface · rpy2-robjects