Cython
cython.org
What it is
Cython is a free compiler for Python and the extended Cython language, used to create C extensions for Python. It translates source code into C or C++ that can be built as Python extension modules. Optional static type declarations can help produce more efficient C, while declared C and C++ types let Python code call existing C or C++ code. Cython supports source-level debugging across Python, Cython and C, and the project describes uses including wrapping external libraries, embedding CPython in applications and speeding up Python code with C modules. It can work with multidimensional NumPy arrays and integrate with low-level libraries and applications. Installation is available through pip, and some scientific Python distributions bundle it. A C compiler is required, with installation guidance for Linux, macOS and Windows. The project describes compatibility with major C and C++ compilers for CPython 3.8 and later, and characterizes PyPy support as mostly usable. Limited API and free-threading CPython support in Cython 3.1 are experimental. Cython is available under the Apache 2.0 License.
Spec sheet
- What it does
- Cython is an optimising static compiler for Python and the extended Cython language, used to write C extensions for Python.Read 30 Sep 2026 · cython.org
- Build requirement
- Cython requires a C compiler; the installation guide gives compiler guidance for Linux, macOS and Windows.Read 30 Sep 2026 · docs.cython.org
- C and C++
- Cython lets Python code call C or C++ code and supports declaring C or C++ types.Read 30 Sep 2026 · cython.org
- Data and libraries
- The project describes using Cython with multidimensional NumPy arrays and integrating with existing low-level libraries and applications.Read 30 Sep 2026 · cython.org
- Debugging
- Cython supports combined source-level debugging across Python, Cython and C code.Read 30 Sep 2026 · cython.org
- Experimental support
- The homepage says support for the CPython Limited API and free-threading CPython is available in Cython 3.1 but considered experimental.Read 30 Sep 2026 · cython.org
- Generated code
- Cython translates source code into C or C++ code that can be compiled as Python extension modules.Read 30 Sep 2026 · docs.cython.org
- Installation
- The documentation recommends installing Cython with pip and says some scientific Python distributions, including Anaconda and Sage, bundle it.Read 30 Sep 2026 · docs.cython.org
- 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.Read 30 Sep 2026 · cython.org
- 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.Read 30 Sep 2026 · cython.org
- Static typing
- Optional static type declarations can help generate more efficient C code from Python-like code.Read 30 Sep 2026 · docs.cython.org
- Support channels
- The homepage directs users with questions to the Cython users mailing list and links a separate core developer mailing list.Read 30 Sep 2026 · cython.org
Plans and prices
Strong points and limits
Strong points
- Translates Cython and Python source into C or C++.
- Supports debugging across Python, Cython and C.
- Works with multidimensional NumPy arrays.
- Available under the Apache 2.0 License.
Limits
- A C compiler is required.
- Limited API and free-threading support are experimental.
- PyPy support is described as mostly usable.
Who it suits
Cython suits Python developers building C extensions, wrapping external C libraries or embedding CPython in applications. It may also fit developers seeking faster Python code through C modules, provided they have a C compiler.
Verdict
Cython provides a path from Python-like code to compiled extension modules, with options for C and C++ integration. A C compiler is needed, and some newer compatibility support remains experimental.
Where Specifiction places it
- Code Transpilers#12 of 287.9