Data Science

Cython – Optimising Static Compiler for Python

Cython is an open source optimising static compiler. This means that it can compile normal Python code without changes (with a few exceptions). This is particularly useful with code that’s heavy in maths or runs in tight loops.

Cython is a superset of the Python programming language, designed to give C-like performance with code that is mostly written in Python. Cython is a compiled language that generates CPython extension modules. These extension modules can then be loaded and used by regular Python code using the import statement. Cython makes writing C extensions for the Python language as simple as coding Python code.

Cython is based on the well-known Pyrex, but supports more cutting edge functionality and optimizations.

Features include:

  • Write Python code that calls back and forth from and to C or C++ code natively at any point. Cython also has a complete set of declarations for CPython’s C-API.
  • Easily tune readable Python code into plain C performance by adding static type declarations. This allows Cython to step out of the dynamic nature of the Python code and generate simpler and faster C code.
  • Use combined source code level debugging to find bugs in your Python, Cython and C code. Cython offers an extension for the GNU Debugger that helps users debug Cython code. The Cython debugger comes with a set of commands that support breakpoints, stack inspection, source code listing, stepping, stepping over, etc.
  • Interact efficiently with large data sets, e.g. using multi-dimensional NumPy arrays.
  • Quickly build your applications within the large, mature and widely used CPython ecosystem.
  • Integrate natively with existing code and data from legacy, low-level or high-performance libraries and applications.
  • Support for integration with IPython/Jupyter notebooks.

Website: cython.org
Support: Documentation, GitHub, Wiki, FAQ, Mailing List (for users), Mailing List (for developers)
Developer: Stefan Behnel, Robert Bradshaw, Lisandro Dalcín, Mark Florisson, Vitja Makarov, Dag Sverre Seljebotn and many contributors
License: Apache License

Cython is written in Python and C. Learn Python with our recommended free books and free tutorials. Learn C with our recommended free books and free tutorials.

Return to Essential Python Tools


Explore Linux

Best Free and Open Source Software - A huge collection of recommended free and open source software covering every major category.
In-depth Linux Software Reviews - Detailed assessments of Linux software covering features, usability and overall quality.

The Big List of Active Linux Distros - An extensive collection of actively developed Linux distributions.
Open Source Alternatives - Alternatives to software and services from Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle and others.
Essential Linux System Tools - Indispensable utilities for monitoring, maintaining and managing Linux systems.
Linux Productivity Tools - Useful utilities for improving productivity and streamlining everyday tasks.
Alternatives to Popular CLI Tools - Modern alternatives to familiar command-line utilities supplied with Linux systems.
Awesome Free Linux Game Tools - Tools, utilities and companion software that improve gaming on Linux.
Machine Learning on Linux - Machine learning and deep learning software, self-hosted applications and practical tools.
Saving Money with Linux - Practical ways to reduce electricity consumption and lower computing costs with Linux.
Linux Candy - Fun, entertaining and sometimes delightfully quirky software from the lighter side of Linux.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted