Cython

Dag Sverre Seljebotn will present Cython, of which he is one of the developers.

Cython is a superset of the Python language which, when translated to C and compiled, can be loaded as an extension module into the standard CPython interpreter.

The Cython language is essentially Python with optional typing and a bit of low-level C thrown in. One can use it to:

  • Wrap C and C++ libraries. Whereas some other tools (SWIG) offer 1:1 API translation, Cython is more about conveniently writing a high-level Python interface on top of a low-level library.
  • Speed. Cython is very popular in scientific Python in order to do number crunching.

I'll provide a general introduction with some examples both from calling a C library and from number crunching, and then we'll be able to dive into the use cases of the group present and see if Cython is a good fit for your particular problems.

 

Join or login to comment.

  • Alexander R.

    Thanks for holding the talk. Cython+Python is a nice addition to the toolbox.

    June 19, 2013

  • Robert S.

    Dag Sverre informative talk with a good level of technical content and live demos. I'll certainly be revisiting Cython as a technology choice for some projects as a result of this talk. My favourite part: The "with nogil:" block.

    Enjoyed the Python pils afterwards too. People are solving very interesting problems with Python in Oslo.

    June 19, 2013

  • Johan H.

    Interesting subject. Good talk. Unfortunately the presenter spoke very quietly, and his microphone did not work, so it was quite hard to grasp everything that was said.

    June 19, 2013

  • Dag Sverre S.

    Following up my talk with some resources. The slides are at

    https://github.com/dagss/talk-cython-2013-june/blob/master/cython.pdf

    And the png wrapper example at

    https://github.com/dagss/talk-cython-2013-june/blob/master/examples/png4py/png4py.pyx

    Documentation is somewhat of a weak spot in Cython, but the users' mailing list is very good and responsive, and feel free to ask any questions there (even generic ones like "will Cython be a good fit for this project"). See http://cython.org

    Feel free to email me personally too ([masked]) if it's too generic/subjective for the mailing list.

    Finally, I forgot to mention that there's also some C++ support in Cython these days (working in a similar way to C, i.e., you re-declare what you use). Cython cannot generate new C++ classes (or inherit from them), it is strictly for wrapping.

    June 18, 2013

  • Robert S.

    In Teknologihuset go to the top floor!

    June 18, 2013

  • Alexander A.

    A possible location is Bitraf. We recently moved to Youngs gate 6. We have a room that can host about 20 - 25 people.

    May 29, 2013

    • Robert S.

      Thanks for offering. We're sorted at Teknologihuset now.

      May 31, 2013

Our Sponsors

People in this
Meetup are also in:

Imagine having a community behind you

Get started Learn more
Rafaël

We just grab a coffee and speak French. Some people have been coming every week for months... it creates a kind of warmth to the group.

Rafaël, started French Conversation Group

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy