Skip to main content

A cython compiler for compiling source code in string form.

Project description

A cython compiler for compiling source code in string form.

Example:

from cypyler import TMPCypyler

code = """
def add(x, y):
    return x + y
"""

cp = TMPCypyler()
built_module = cp.build(code)
built_module.add(2, 3)

Usage

Cypyler

Instantiation

from cypyler import Cypyler

cp = Cypyler('<build_dir>', '<libraries>', '<include_dirs>')

Where build_dir is the desired directory (path) for the module to be built on. The arguments libraries and include_dirs are lists containing libraries and include directories that should be passed to Cython when compiling.

Building

cp.build('<code>', '<suffix>')

Where code is the code in string form. The suffix argument defaults to .pyx.

TMPCypyler

Instantiation

from cypyler import TMPCypyler

cp = Cypyler('<build_dir_prefix>', '<libraries>', '<include_dirs>')

Where build_dir_prefix is a prefix for the temporary build directory. The build directory is created using the tempfile.mkdtemp function from the Python standard library.

Building

cp.build('<code>', '<suffix>')

Where code is the code in string form. The suffix argument defaults to .pyx.

  • Free software: MIT license

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
cypyler-0.2.0-py2.py3-none-any.whl (5.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Feb 22, 2018
cypyler-0.2.0.tar.gz (4.2 kB) Copy SHA256 hash SHA256 Source None Feb 22, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page