Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

Cython

cython.org

  • Free plan
  • Windows
  • macOS
  • Linux
7.2 Club score Visit cython.org

What Cython is

Cython is an optimising static 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 compiled as Python extension modules. Optional static type declarations can help generate more efficient C code, and Python code can call C or C++ through declared types. Cython also supports source-level debugging across Python, Cython, and C. The project describes uses including wrapping external C libraries, embedding CPython in existing applications, and speeding up Python code with C modules. It can be used with multidimensional NumPy arrays and integrated 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, and calls PyPy support 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 wrap C libraries, embed CPython in an application, or build C extensions. It also fits projects that use low-level libraries or multidimensional NumPy arrays.

Good to know, and what to watch

  • Translates Cython and Python-oriented code into C or C++.
  • Optional static types can improve generated C code efficiency.
  • Supports source-level debugging across Python, Cython, and C.
  • Can wrap external C libraries.
  • A C compiler is required.
  • Limited API and free-threading support are experimental.
  • PyPy support is described as mostly usable.

Cython

Free

Free plan

Getting started

  1. Install Cython with pip, or use a distribution that bundles it
  2. Install a C compiler for Linux, macOS or Windows
  3. Write Python or extended Cython source
  4. Declare optional static types or C and C++ interfaces
  5. Compile the generated C or C++ into a Python extension module

Limits to check

Cython requires a C compiler. Support for the CPython Limited API and free-threading CPython in Cython 3.1 is experimental, and PyPy support is described as mostly usable.

The verdict

Cython provides a path from Python-oriented code to compiled C or C++ extensions, with support for native libraries and debugging. Users need a C compiler, and some newer compatibility support remains experimental.

Questions people ask

How much does Cython cost?

Cython is free and available under the open-source Apache 2.0 License.

Which operating systems are supported?

Compiler guidance covers Linux, macOS and Windows. Scientific Python distributions such as Anaconda and Sage also bundle Cython.

What does Cython generate?

It translates source into C or C++ code that can be compiled as Python extension modules.

Can Cython use C and C++ libraries?

Yes. Python code can call C or C++ code, with declarations for their types. Wrapping external C libraries is one stated use.

Which Python versions are supported?

The homepage says generated code compiles with major C and C++ compilers for CPython 3.8 and later. PyPy support is described as mostly usable.

Where can users ask questions?

The project directs questions to the Cython users mailing list and provides a separate core developer mailing list.

What the maker publishes

Build requirement
Cython requires a C compiler; the installation guide gives compiler guidance for Linux, macOS and Windows. source
C and C++
Cython lets Python code call C or C++ code and supports declaring C or C++ types. source
Data and libraries
The project describes using Cython with multidimensional NumPy arrays and integrating with existing low-level libraries and applications. source
Debugging
Cython supports combined source-level debugging across Python, Cython and C code. source
Experimental support
The homepage says support for the CPython Limited API and free-threading CPython is available in Cython 3.1 but considered experimental. source
Generated code
Cython translates source code into C or C++ code that can be compiled as Python extension modules. source
Installation
The documentation recommends installing Cython with pip and says some scientific Python distributions, including Anaconda and Sage, bundle it. source
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. source
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. source
Static typing
Optional static type declarations can help generate more efficient C code from Python-like code. source
Support channels
The homepage directs users with questions to the Cython users mailing list and links a separate core developer mailing list. source
What it does
Cython is an optimising static compiler for Python and the extended Cython language, used to write C extensions for Python. source

Checked against the maker's pages on 30 Sept 2026.