--- id: cwrap version: "1.6.16" license: GPL-3.0 license_treatment: copyleft maintenance: active --- # cwrap — cwrap - ctypes blanket License: copyleft · Maintenance: active · Downloads: 102.1K/mo ## 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 above — verify before relying. cwrap is a Python wrapper around C code that builds on ctypes, allowing you to call C functions and work with C data structures from Python. 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 pip install cwrap uv add cwrap poetry add cwrap ## Installing cwrap 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. 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 Requires Python 3.11 or later 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_current - Install friction: low - Maintenance: active - Downloads: 102.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ctypes wrapper, call c code from python, python c bindings, c interop library, c function wrapper, python ctypes abstraction, c data structure binding, c-interop, ctypes [View on SkillFed](https://skillfed.io/packages/cwrap) · [View on PyPI](https://pypi.org/project/cwrap/)