Cython

What Cython is
Cython is a free static compiler for Python and the extended Cython language, used to build C extensions for Python. It converts source code into C or C++ that can be compiled as Python extension modules. Optional static type declarations can help generate more efficient C code from Python-like code, and Cython lets Python code call C or C++ through declared types. It also supports source-level debugging across Python, Cython, and C. The project describes uses such as wrapping external C libraries, embedding CPython in existing applications, and speeding up Python code with fast C modules. Cython can work with multidimensional NumPy arrays and integrate with existing low-level libraries and applications. Installation is available through pip, and some scientific Python distributions, including Anaconda and Sage, bundle it. A C compiler is required, with installation guidance for Linux, macOS, and Windows. The homepage describes generated-code compatibility with major C and C++ compilers for CPython 3.8 and later, while PyPy support is described as mostly usable. Limited API and free-threading support in Cython 3.1 are experimental. Cython is available under the Apache 2.0 License.
Who it suits
Cython suits Python developers who need to build C extensions, wrap external C libraries, or embed CPython in existing applications. It also fits those working with low-level libraries or multidimensional NumPy arrays.
What it does well
- Available free under the Apache 2.0 License.
- Generates C or C++ extension-module source.
- Supports declared C and C++ types.
- Provides source-level debugging across Python, Cython, and C.
- Installation guidance covers Linux, macOS, and Windows.
What to know first
- Requires a C compiler.
- Limited API and free-threading support are experimental.
- PyPy support is described as mostly usable.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Cython | Freely available under the open source Apache 2.0 License | Free |
As cython.org lists them, read 30 Sept 2026. The maker's own page has the final word.
Getting started
- Install Cython with pip, or use a scientific Python distribution that bundles it, such as Anaconda or Sage.
- Install a C compiler using the guidance for your operating system.
- Use Cython's source-to-source conversion to generate C or C++ code for compilation as a Python extension module.
Verdict
Cython offers a route from Python-like source to compiled extension modules, with options for static types, C/C++ interoperation, and debugging. Users need a C compiler, and the listed Limited API and free-threading support remains experimental.
Questions
Is Cython free?
Yes. It is freely available under the Apache 2.0 License.
Which operating systems does Cython support?
Cython is available for Linux, macOS and Windows.
What does Cython generate?
It translates source code into C or C++, which can be compiled as Python extension modules.
Does Cython require a compiler?
Yes. Building extensions requires a C compiler, and the installation guide provides compiler guidance for Linux, macOS and Windows.
Which Python implementations does it support?
The homepage describes generated-code compatibility with major C and C++ compilers for CPython 3.8 and later, and says PyPy support is mostly usable.
How can users ask questions about Cython?
The project directs users to the Cython users mailing list and links a separate core developer mailing list.
Facts from Cython's own pages
- Build requirement
- Cython requires a C compiler; the installation guide gives compiler guidance for Linux, macOS and Windows. · docs.cython.org, 30 Sept 2026
- C and C++
- Cython lets Python code call C or C++ code and supports declaring C or C++ types. · cython.org, 30 Sept 2026
- Data and libraries
- The project describes using Cython with multidimensional NumPy arrays and integrating with existing low-level libraries and applications. · cython.org, 30 Sept 2026
- Debugging
- Cython supports combined source-level debugging across Python, Cython and C code. · cython.org, 30 Sept 2026
- Experimental support
- The homepage says support for the CPython Limited API and free-threading CPython is available in Cython 3.1 but considered experimental. · cython.org, 30 Sept 2026
- Generated code
- Cython translates source code into C or C++ code that can be compiled as Python extension modules. · docs.cython.org, 30 Sept 2026
- Installation
- The documentation recommends installing Cython with pip and says some scientific Python distributions, including Anaconda and Sage, bundle it. · docs.cython.org, 30 Sept 2026
- Intended use
- The project identifies wrapping external C libraries, embedding CPython in existing applications and speeding up Python code with fast C modules as use cases. · cython.org, 30 Sept 2026
- Python compatibility
- The homepage says generated code compiles with major C and C++ compilers for CPython 3.8 and later, and describes PyPy support as mostly usable. · cython.org, 30 Sept 2026
- Static typing
- Optional static type declarations can help generate more efficient C code from Python-like code. · docs.cython.org, 30 Sept 2026
- Support channels
- The homepage directs users with questions to the Cython users mailing list and links a separate core developer mailing list. · cython.org, 30 Sept 2026
- What it does
- Cython is an optimising static compiler for Python and the extended Cython language, used to write C extensions for Python. · cython.org, 30 Sept 2026
Where Cython stands on Freedom251
- Code Transpilers#6 of 28