O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Cython

Video Description

In this Learning Cython training course, expert author Caleb Hattingh will teach you how to create your own simple extension modules in Cython, analyze performance of Cython code, and package your Cython extension module so it can be shared with others. This course is designed for users that already have a basic working knowledge of Python.

You will start by learning the basics of Cython, such as how to compile Cython, add tests, and add types. From there, Caleb will teach you how to explore Cython with the Jupyter Notebook. This video tutorial will also teach you about the Cython language, such as adding types to code, exceptions and docstrings, and loops and memoryviews. You will also cover extension types, wrapping C and C++ libraries, Cython compiler directives, and concurrency. Finally, Caleb will leave you with some tips and tricks.

Once you have completed this computer based training course, you will have learned how to create your own simple extension modules in Cython, analyze the performance of Cython code, and how to package your own Cython extension module so that it can be shared with others.

Table of Contents

  1. Introduction
    1. Introduction 00:02:15
    2. About The Author 00:02:11
    3. The Optimization Process 00:04:25
    4. How To Access Your Working Files 00:01:15
  2. Setup And Workflow
    1. Python Setup 00:02:33
    2. What Does Cython Do? 00:05:07
  3. First Steps
    1. Using Cython 00:04:46
    2. Compiling Cython 00:04:24
    3. Adding Tests - Part 1 00:04:41
    4. Adding Tests - Part 2 00:04:42
    5. Profiling 00:05:10
    6. Annotation 00:02:52
    7. Adding Types - Part 1 00:04:16
    8. Adding Types - Part 2 00:05:03
  4. Exploring Cython With The Jupyter Notebook
    1. Exploring Cython In The Notebook 00:02:46
    2. Tour Of The Notebook 00:03:58
    3. Timing Magic And Markdown 00:04:21
    4. Cython Case Study With Color 00:06:26
  5. The Cython Language
    1. Fundamentals Of Types 00:04:27
    2. C Types In Detail 00:05:34
    3. Adding Types To Code 00:04:26
    4. Adding Types To Functions 00:05:09
    5. Exceptions And Docstrings 00:04:33
    6. Type Declaration For Built-In Python Types 00:04:12
    7. Type Declaration For Native Structured Types 00:05:48
    8. Python Native Types Vs Cython Native Types 00:04:10
    9. Loops And Memoryviews - Part 1 00:02:57
    10. Loops And Memoryviews - Part 2 00:03:46
    11. Loops And Memoryviews - Part 3 00:04:14
    12. Introduction To Strings In Cython 00:03:05
    13. String Examples 00:03:54
    14. Pointers In Cython 00:03:22
    15. Pointers In Cython - Examples 00:03:19
    16. Type-Casting 00:05:32
    17. Fused Types 00:04:44
  6. Extension Types
    1. Extension Types 00:04:53
    2. Attributes And Members 00:05:38
    3. Initialization And Finalization 00:04:21
    4. Initialization And Finalization - Case Study 00:06:16
    5. Methods Of Extension Types 00:05:22
    6. OOP Features - Inheritance And Polymorphism 00:04:07
    7. OOP Features By Example 00:04:40
    8. Be Careful Of Multiple Constructor Calls 00:02:04
    9. Special Methods 00:03:03
    10. Operator Overloading 00:04:06
    11. Operator Overloading - Case Studies 00:06:49
    12. Properties And Iterators 00:02:16
  7. Wrapping C And C++ Libraries
    1. Working With C And C++ Libraries 00:06:18
    2. .pxd Interface Files - Part 1 00:04:52
    3. .pxd Interface Files - Part 2 00:03:45
    4. .pxd Example - Mac 00:11:16
    5. .pxd Example - Windows 00:11:09
    6. Pre-Made .pxd Files 00:05:22
    7. Standard .pxds Examples 00:03:43
    8. Cython, C++ And You 00:04:58
    9. C++ By Example 00:05:37
  8. Cython Compiler Directives
    1. Cython Switches And Directives 00:03:24
    2. How To Set Compiler Directives 00:03:04
    3. A Tour Of Popular Directives 00:04:21
  9. Concurrency
    1. Concurrency 00:06:41
    2. Cython Parallel 00:03:09
    3. Cython Parallel - Examples 00:05:12
    4. Examples Using Threads 00:05:51
  10. Modules And Packages
    1. Packaging For Fun And Profit 00:05:42
    2. Building Cython Extensions 00:03:40
    3. Making Wheels 00:02:31
    4. Packages With .pxd Files 00:03:30
    5. Packages Wrapping C Code - Easy Way 00:05:13
    6. Packages Wrapping C Code - Hard Way 00:02:46
    7. Packages Wrapping C Libraries 00:04:51
  11. Tips, Tricks, And Extras
    1. Making Executables 00:06:36
    2. Case Study - Pandas Datetimes 00:07:14
    3. pyximport 00:02:07
    4. Faster Object Creation 00:02:29
  12. Conclusion
    1. Conclusion 00:02:20