GitHub - cython/cython: The most widely used Python to C compiler (original) (raw)

Welcome to Cython!

Cython is an optimising Python compiler that makes writing C extensions for Python as easy as Python itself.

Cython translates Python code to C/C++ code, but additionally supports calling C functions and declaring C types on variables and class attributes. This allows broad to fine-grained manual tuning that lets the compiler generate very efficient C code from Cython code.

This makes Cython the ideal language for wrapping external C libraries, and for fast C modules that speed up the execution of Python code.

Cython has more than 70 million downloadsper month on PyPI. You can support the Cython project viaGithub Sponsors orTidelift.

Installation:

If you already have a C compiler, just run following command:

pip install Cython

otherwise, see the installation page.

License:

The original Pyrex program, which Cython is based on, was licensed "free of restrictions" (see below). Cython itself is licensed under the permissive Apache License.

See LICENSE.txt.

Contributing:

Want to contribute to the Cython project? Here is some help to get you started.

Differences to other Python compilers

Started as a project in the early 2000s, Cython has outlivedmost other attemptsat producing static compilers for the Python language.

Similar projects that have a relevance today include:

In comparison to the above, Cython provides

The following is from Pyrex:

Cython was originally based on Pyrexby Greg Ewing, with the following written in the Pyrex readme document:

This is a development version of Pyrex, a language for writing Python extension modules.

For more info, take a look at:

Comments, suggestions, bug reports, etc. are most welcome!

Copyright stuff: Pyrex is free of restrictions. You may use, redistribute, modify and distribute modified versions.

The latest version of Pyrex can be found here.

Greg Ewing, Computer Science Dept

University of Canterbury

Christchurch, New Zealand

A citizen of NewZealandCorp, a wholly-owned subsidiary of USA Inc.