About Cython
Cython is an optimising static compiler for both the Python programming language and the extended Cython programming language (based on Pyrex). It makes writing C extensions for Python as easy as Python itself.
Cython gives you the combined power of Python and C to let you
- write Python code that calls back and forth from and to C or C++ code natively at any point.
- easily tune readable Python code into plain C performance by adding static type declarations, also in Python syntax.
- use combined source code level debugging to find bugs in your Python, Cython and C code.
- 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.
The Cython language is a superset of the Python language that additionally supports calling C/C++ functions and declaring C/C++ types on variables and class attributes. This allows the compiler to generate very efficient C code from Cython code. The C code is generated once and then compiles with all major C/C++ compilers in CPython 3.8 and all later versions. Cython 3.0.x supports Python 2.7 / 3.5 and later. We regularly run integration tests against all supported CPython versions and their latest in-development branches to make sure that the generated code stays widely compatible and well adapted to each version. PyPy support is mostly usable. The latest PyPy version is always recommended here. Support for the CPython Limited API and free-threading CPython is available in Cython 3.1 but considered experimental.
All of this makes Cython the ideal language for wrapping external C libraries, embedding CPython into existing applications, and for fast C modules that speed up the execution of Python code.
đ·ïž Your donation can help the Cython project! đ·ïžïž
Making Cython a great programming language for you, and keeping it up to speed with the Python ecosystem and the changing requirements of its diverse user bases, takes a lot of time and dedication. To support the maintenance and future development of the Cython language and compiler, YOU can sponsor the work of Stefan Behnel via:
Note that PayPal takes 5 - 15% fees for small non-EUR payments, which is money that you pay without helping us. Consider signing up for a GitHub Sponsors subscription instead.
Documentation
- Cython Documentation
- The Cython Wiki.
- The Cython FAQ (and the older Pyrex FAQ)
External resources:
- Cython videos on pyvideo.org
- Stefan's blog posts about Cython and what's new in Cython releases.
- Cython - A Guide for Python Programmers, book by Kurt W. Smith, O'Reilly 2015
- Cython: The best of both worlds, article by Stefan Behnel, Robert Bradshaw et al., IEEE 2011
- SciPy 2009 proceedings (pdf): Cython Tutorial; Fast Numerical Computations with Cython
If you still have questions, feel free to send an email to the cython users mailing list. Aspects of the core development are discussed on the cython core developer mailing list. If you are unsure which list to use, the cython users list is probably the right one to use, which has the larger audience. There is also a #cython channel on the freenode IRC servers for Cython related chats.
Download
Cython is freely available under the open source Apache 2.0 License.
The latest stable release of Cython is 3.1.4 (released 2025-09-16). Cython is available from the PyPI package index repository.
People
Core Developers: Stefan Behnel, Robert Bradshaw, David Woods, MatĂșĆĄ Valo, Lisandro DalcĂn
Contributors: Marc Abramowitz, Wichert Akkerman, Martin R. Albrecht, Fedor Alekseev, Peter Alexander, Francesc Alted, Somin An, Elliott Sales de Andrade, Ivan Andrus, Michael Anselmi, Arfrever Frehtes Taifersar Arahesis, Takuro Ashie, Phil Austin, Shreyan Avigyan, William Ayd, Josh Ayers, Max Bachmann, Haoyu Bai, Grant Baillie, Nicolas Barbey, Gustavo Sverzut Barbieri, Christopher H. Barker, Richard Barnes, David Barnett, Christopher Bartak, Ălvaro Abella BascarĂĄn, Andrea Bedini, Ian Bell, Oscar Benjamin, Sebastian Berg, Jonas Bernoulli, Janek Bevendorff, Aditya Bhosale, Denis Bilenko, Bryan Bishop, Charles Blake, Chuck Blake, Max Bohnet, Guro Bokum, Bertrand Bordage, Alexey Borzenkov, Georg Brandl, Matthias Braun, Volker Braun, Nils Braun, Erik M. Bray, Erik Bray, Matthew Brett, Marcus Brinkmann, Jordan BriĂšre, Spencer Brown, Andrew Brown, Michael Buesch, Lars Buitinck, Evgeni Burovski, Matthias Bussonnier, Corentin Cadiou, Guilherme Caminha, Josiah Carlson, Brandon Casey, Thomas A Caswell, Vladimir Cerny, Ondrej Certik, Matthew Chan, Shalabh Chaturvedi, Chia-Hsiang Cheng, Yuriy Chernyshov, Tasha Ren Chin, Eric Chlebek, David Christenson, Tzu-ping Chung, Craig Citro, James Clarke, B. Clausius, Christian Clauss, Alyssa Coghlan, Maximilien Colange, Samuel Colvin, Alexander Condello, Ludovic Cotterousse, David Cournapeau, Andreas van Cranenburgh, Armon Dadgar, Björn Dahlgren, Jeppe Dakin, Gerald Dalley, Thijs Damsma, Rajat Dash, Gabi Davar, Julien Delafontaine, Vincent Delecroix, Jeroen Demeyer, Michael V. DePalatis, Orivej Desh, Didier Deshommes, Eric Dill, Ulrich Dobramysl, Roman Donchenko, Egor Dranischnikow, Jon Dufresne, Nicolas Dumazet, Frederik Dyrmose, Ali Ebrahim, Matthew Edwards, John Ehresman, Eddie Elizondo, Sean Enck, Raffi Enficiaud, Michael Ensslin, Gerion Entrup, Yuri Escalianti, LoĂŻc EstĂšve, Jason Evans, Kenrick Everett, Gregory Ewing, Curtis Faith, Thomas J. Fan, Matthew Feickert, Yu Feng, Thomas Fenzl, Isuru Fernando, Ioannis Filippidis, Boris Filippov, Segev Finer, Eric Firing, Mark Florisson, Claudio Freire, Danilo Freitas, Jason Fried, Bradley M. Froehle, Gary Furnish, Syam Gadde, MartĂn GaitĂĄn, Pablo Galindo, VĂctor Molina GarcĂa, Tim Gates, Gabriel Gellner, Julian Gethmann, Pierre Glaser, Igor Gnatenko, Prakhar Goel, Christoph Gohlke, Nathan Goldbaum, Evgeny Golyshev, Ralf Gommers, Mike Graham, Brian Granger, Robert David Grant, Olivier Grisel, Sam Gross, Christoph Groth, Moritz GroĂ, Charles Grunwald, Candide Guevara, Adrien Guinet, Chris Gyurgyik, MichaĆ GĂłrny, Hans Moritz GĂŒnther, Valentin Haenel, Yaroslav Halchenko, Luke Hamburg, Richard Hansen, Tao He, Tong He, Jonathan Helgert, Michael Helmling, Alex Henrie, Ian Henriksen, Philip Herron, Noam Hershtig, Magnus Lie Hetland, David Hirschfeld, Cheuk Ting Ho, Ewout ter Hoeven, Wieland Hoffmann, Till Hoffmann, Clemens Hofreither, Chris Hogan, Elisha Hollander, Myles Hollowed, Jackson Howard, TomĂĄĆĄ HrnÄiar, Miro HronÄok, Jiajun Huang, Nicolas Hug, Thomas Hunger, Eric Huss, Alex Huszagh, Julien Jerphanion, Joe Jevnik, Eric T. Johnson, Matthew Johnson, Pierre Jolivet, Andrew V. Jones, SĂžren Fuglede JĂžrgensen, Dmitry Kalinkin, Ivan Kapeykin, Igor Kaplounenko, Omer Katz, Hugo van Kemenade, Karl Kempe, Rafe Kettler, Jerome Kieffer, W. Trevor King, John Kirkham, Jim Kleckner, Thomas Kluyver, Felix KohlgrĂŒber, LĂĄszlĂł Kiss KollĂĄr, Mike Kolupaev, Liguo Kong, Mikhail Korobov, Sebastian Koslowski, Kacper Kowalik, Taras Kozlov, Anselm Kruis, Jakub KulĂk, Patrick Kunzmann, MatÄj Laitl, Ronan Lamy, Torsten Landschoff, Ćukasz Langa, Eric Larson, Chris Lasher, Mathias Laurin, Sergei Lebedev, Emmanuel Leblond, Mark Lee, Antony Lee, Callie LeFave, Zhenbo Li, Thomas Li, Alex Lindsay, Molly Lloyd, Mark Lodato, Thomas Lotze, Xenia Lu, Alex Lubbock, Denis Lukianov, Pedro Marques da Luz, DraĆŸen LuÄanin, Jason Madden, Syrtis Major, Vitja Makarov, Michael Man, Yesudeep Mangalapilly, Tadeu Manoel, Nathan Manville, Gabriel de Marmiesse, Vladimir Matveev, Ben McGinnes, Bernard McKeever, Angus McMorland, Dr Alex Meakins, Brock Mendel, Petr Messner, Alexis Mignon, Mark Mikofski, Dan Miller, Volker Mische, Lawrence Mitchell, Sturla Molden, Alessandro Molina, Benedikt Morbach, Mansour Moufid, Johannes Mueller, Paul van Mulbregt, Inada Naoki, Arvind Natarajan, Nikita Nemkin, Minh Van Nguyen, Daniele Nicolodi, Lysandros Nikolaou, David Nogueira, R. Andrew Ohana, Yasuyuki Oka, Naelson Douglas C. Oliveira, Dimitri Papadopoulos Orfanos, Jay Oster, Omer Ozarslan, Joonas Paalasmaa, Andrey Paramonov, Olivier Parcollet, Nicolas Pauss, Oleksandr Pavlyk, Brent Pedersen, Mark Peek, Alexandra Pereira, Fernando Perez, Diego Elio PettenĂČ, Gabriel Pettier, Emmanuel Gil Peyrot, Nguyá» n Gia Phong, Matti Picus, Charles Pigott, Aditya Pillai, KryĆĄtof PilnĂĄÄek, Antoine Pitrou, Marcel Plch, Andrey Plotnikov, Pasha Podolsky, Andreas Poehlmann, Quentin Poirier, Nick Pope, Vadim Pushtaev, Martin Quarda, Vyas Ramasubramani, Jeff Ramnani, Nikolaus Rath, Martin Raum, J Robert Ray, Leo Razoumov, Peinthor Rene, Brandon Rhodes, Armin Rigo, Stefano Rivera, Min RK, Joon Ro, ClĂ©ment Robert, Golden Rockefeller, Fabian Rost, Guy Rozendorn, Julian RĂŒth, Felix Salfelder, Loisaida Sam, Aidan Hobson Sayers, Dean Scarff, Michael Schatzow, Martin K. Scherer, Frank Schlimbach, Ralf Schmitt, Eli Schwartz, Michael Seifert, Yury Selivanov, Dag Sverre Seljebotn, Alexander Shadchin, Dmitry Shesterkin, Zaur Shibzukhov, Wenjun Si, Corbin Simpson, Alok Singhal, Kent Slaney, Kirill Smelkov, Ivan Smirnov, Nathaniel J. Smith, Kurt Smith, Sam Sneddon, Yury Sokov, Zackery Spytz, Ashwin Srinath, Martijn van Steenbergen, William Stein, Steinn Steinsen, Alexey Stepanov, Marcel Stimberg, Victor Stinner, Harmen Stoppels, Federico Stra, Andrew Straw, John Stumpo, Michael J. Sullivan, Boxiang Sun, Sviatoslav Sydorenko, Mike Taves, Julian Taylor, Dimitri Tcaciuc, Martin Teichmann, Marvin Teichmann, MaroĆĄ Telka, Mikhail Terekhov, Gregor Thalhammer, Kevin R. Thornton, Nick Timkovich, Josh Tobin, James Tocknell, Peter Todd, Erik Tollerud, Gonzalo TornarĂa, Gabriele N. Tornetta, Giovanni Torres, Dmitry Trofimov, Antonio Valentino, Valentin Valls, Joris Vankerschaver, Daniele Varrazzo, Jochen Van de Velde, Jelmer VernooÄł, David Vierra, Petr Viktorin, Thomas Vincent, Mathieu Virbel, Pauli Virtanen, Ruben Vorderman, Jelle van der Waa, Marius Wachtler, Philipp Wagner, Aaron M. Watson, Warren Weckesser, Tzer-jen Wei, Benjamin Weigel, peng weikang, Brian Wignall, Jakub Wilk, Alex Willmer, Steven Winfield, Willem Jan Withagen, Jouke Witteveen, Carl Witty, Scott Wolchok, Matt Wozniski, Felix Wu, Evgeny Yakimov, Yue Yang, Mads Ynddal, Charles L. Yost, Yury V. Zaytsev, Jelle Zijlstra.
Financial Contributions: Google and Enthought funded Dag Seljebotn to greatly improve Cython integration with NumPy. Kurt Smith and Danilo Freitas were funded through the Google Summer of Code program to work on improved Fortran and C++ support respectively, and in 2010 Haoyu Bai was funded to work on Python 3 compatibility. Cython is supported by Tidelift subscriptions.
Special Thanks to Greg Ewing for inventing and developing Cython's predecessor Pyrex and for his valuable input in language design decisions.
Useful Links
- Wiki
- General users mailing list and archive
- Core developer mailing list and archive
- Bug & Feature Tracker
- Source code repositories (using the Git DVCS)