Skip to main content

Convert .py and .pyx to (.pyd | .so) very easily.

Project description

Cythonize one step faster

https://img.shields.io/badge/build-beta-brightgreen https://img.shields.io/badge/license-MIT-green https://img.shields.io/static/v1?label=Created%20with%20%E2%9D%A4%EF%B8%8F%20by&message=TechLearners&color=red

Introduction

cythonizer.py is a script that will attempt to automatically convert one or more .py and .pyx files into the corresponding compiled .pyd | .so binary modules files. Example:

$ python cythonizer.py myext.pyx

pip install cythonizer will automatically create an executable script in your Scripts/ folder, so you should be able to simply:

$ cythonizer myext.py

or even:

$ cythonizer *.pyx

You can type:

$ cythonizer -h

to obtain the following CLI:

usage: cythonizer.py [-h] [--annotation] [--numpy-includes]
                     [--debugmode] filenames [filenames ...]

positional arguments:
filenames         .py and .pyx files only

optional arguments:
-h, --help        show this help message and exit
--annotation      (default: False)
--numpy-includes  (default: False)
--debugmode       (default: False)
  • --annotation will create the HTML Cython annotation file.
  • --numpy-includes will add the numpy headers to the build command.
  • Compiler flags -O2 -march=native are automatically passed to the compiler.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cythonizer, version 1.2.0b3
Filename, size File type Python version Upload date Hashes
Filename, size cythonizer-1.2.0b3.tar.gz (5.5 kB) File type Source Python version None Upload date Hashes View
Filename, size cythonizer-1.2.0b3-py3-none-any.whl (4.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page