Cython
The Cython compiler for writing C extensions in the Python language.
Install
cython on PyPI
pip
pip install cythonuv
uv add cythonpoetry
poetry add cythonPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 20 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: cython-3.2.9-py3-none-any.whl
About Cython
from the package's own PyPI description — quoted content, verbatim
The Cython language makes writing C extensions for the Python language as easy as Python itself. Cython is a source code translator based on Pyrex_, but supports more cutting edge functionality and optimizations.
The Cython language is a superset of the Python language (almost all Python code is also valid Cython code), but Cython additionally supports optional static typing to natively call C functions, operate with C++ classes and declare fast C types on variables and class attributes. This allows the compiler to generate very efficient C code from Cython code.
This makes Cython the ideal language for writing glue code for external C/C++ libraries, and for fast C modules that speed up the execution of Python code.
The newest Cython release can always be downloaded from https://cython.org/. Unpack the tarball or zip file, enter the directory, and then run::
pip install .
Note that for one-time builds, e.g. for CI/testing, on platforms that are not covered by one of the wheel packages provided on PyPI and the pure Python wheel that we provide is not used, it is substantially faster than a full source build to install an uncompiled (slower) version of Cython...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Cython is a source-to-source compiler that translates Python code with optional static type annotations into C, enabling you to write fast C extensions and glue code for C/C++ libraries while keeping Python syntax.
Low friction: pure Python wheel available, no runtime dependencies, and actively maintained with releases every few weeks. Latest commit is recent (2026-08-12) and the project has strong community engagement (10825 stars).
Apache-2.0 is permissive; you may use, modify, and distribute Cython-compiled code or extensions with minimal legal friction, provided you retain license notices.
Usage
pip install cython==3.2.9
from Cython.Build import cythonize
Requires Python ≥3.8; compiling Cython code to C extensions typically requires a C compiler (gcc, clang, MSVC) on the target system.
Verdict: Cython 3.2.9 is a stable, actively maintained compiler for writing performant C extensions in Python syntax. Zero known vulnerabilities, permissive licensing, and no runtime dependencies make it a low-risk choice. Recent bug fixes address edge cases in list indexing, closures, and string concatenation. Suitable for production use where C-level performance or C/C++ interop is needed.
Needs verification
- Whether the pure Python wheel (mentioned in description) is actually used by default or if C compilation is required for optimal performance on all platforms.
- Specific performance gains achievable with static typing vs. standard Python on typical workloads.
Similar packages
permissive · top 100 on PyPI
awswranglerpermissive · top 1,000 on PyPI
grpciopermissive · top 100 on PyPI
snowballstemmerpermissive · top 1,000 on PyPI
psycopg-binarycopyleft · top 1,000 on PyPI
murmurhashpermissive · top 1,000 on PyPI
preshedpermissive · top 1,000 on PyPI
blispermissive · top 1,000 on PyPI
lxmlpermissive · top 1,000 on PyPI
propcachepermissive · top 100 on PyPI