Cython
The Cython compiler for writing C extensions in the Python language.
Decision gist · record as of 2026-08-14
Yes. Cython is production-stable (Development Status 5), actively maintained with recent bug fixes, and carries no known security vulnerabilities. It has low install friction and supports a wide range of Python versions. Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C compiler on the system to build extensions from .pyx files; pure Python wheel available via NO_CYTHON_COMPILE=true for CI/testing scenarios.
- Low install friction with a pure Python wheel available.
- Actively maintained with recent releases; repository shows 10824 stars and commits as recent as 2026-08-12.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.
last release 2026-07-24 (21 days) · last repo commit 2026-08-12 · 10,824 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 136,120,921 downloads/mo, #283 on PyPI
Alternatives
Verify before relying
pip install cython
from Cython.Build import cythonize
# Compile example.pyx to C extension
cythonize("example.pyx")- Performance improvement magnitude for typical use cases (speedup factor not quantified in fact sheet)
- Compatibility details with specific C++ standards or compiler versions
- Memory overhead of the Cython runtime layer itself
What it is and what it does
Cython is a compiler that translates Python code into C, bridging the gap between Python's ease of use and C's performance. It extends Python with optional static type annotations and direct C/C++ interoperability, allowing developers to write performance-critical code that compiles to efficient native extensions. The language is a superset of Python—almost all existing Python code is valid Cython—so you can incrementally add type hints and C declarations where they matter most.
Typically used to accelerate compute-heavy Python modules, write glue code for external C/C++ libraries, or build fast data structures. The compiler generates C code that integrates seamlessly with Python, letting you call C functions, use C++ classes, and declare fast C types on variables and class attributes. A pure Python wheel is available for environments where compilation is not practical.
Use it for
- Accelerate numerical or data-processing code by adding type annotations and compiling to native machine code.
- Write glue code that wraps external C or C++ libraries for use in Python applications.
- Build high-performance modules for scientific computing or machine learning pipelines.
- Optimize tight loops or frequently-called functions in existing Python codebases without full rewrites.
- Create drop-in replacements for slow pure-Python modules with minimal syntax changes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Cython is production-stable (Development Status 5), actively maintained with recent bug fixes, and carries no known security vulnerabilities. It has low install friction and supports a wide range of Python versions. Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.
Install
cython on PyPI
Before you install
Low install friction with a pure Python wheel available. Actively maintained with recent releases; repository shows 10824 stars and commits as recent as 2026-08-12. Supports Python 3.8 through 3.14 and multiple implementations (CPython, PyPy, Stackless).
Requires a C compiler on the system to build extensions from .pyx files; pure Python wheel available via NO_CYTHON_COMPILE=true for CI/testing scenarios.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.
Quickstart
pip install cython
from Cython.Build import cythonize
# Compile example.pyx to C extension
cythonize("example.pyx")
Verify before relying
- Performance improvement magnitude for typical use cases (speedup factor not quantified in fact sheet)
- Compatibility details with specific C++ standards or compiler versions
- Memory overhead of the Cython runtime layer itself
Package 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 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 136,120,921 / month, #283 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/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: CProgramming Language :: C++Programming Language :: CythonProgramming 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 :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: Python :: Implementation :: StacklessTopic :: Software Development :: Code GeneratorsTopic :: Software Development :: CompilersTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: cython-3.2.9-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 › “static typing python performance”
- CythonCython is a source code translator that compiles Python code to C,…
- mypy-boto3-piProvides type annotations and IDE autocompletion support for boto3's…
- types-pkg-resourcesProvides type stubs for pkg_resources to enable static type checking…
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 hatch-cython · cffi · extension-helpers · scikit-build · pyobjc-core · pyobjc · pybind11-global · pybind11 · pycapnp · ManimPango