Skip to main content

A cython compiler for compiling source code in string form.

Project description

https://img.shields.io/pypi/v/cypyler.svg https://img.shields.io/travis/gpkc/Cypyler.svg

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.

Source Distribution

cypyler-0.2.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

cypyler-0.2.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cypyler-0.2.0.tar.gz.

File metadata

  • Download URL: cypyler-0.2.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cypyler-0.2.0.tar.gz
Algorithm Hash digest
SHA256 94d99b853d83089b7690eb1b52ede9bcad3f98210e09e2611e2499f7722f45fb
MD5 a26d4aaddbc82608338f1d99d49ded72
BLAKE2b-256 999c2a9d0151fe4301a7e77fc74caa6b68bcda57b318348a49434db7435db926

See more details on using hashes here.

File details

Details for the file cypyler-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cypyler-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3872c8e17ed5958f303c26bbdeb3f9c072ca3eb4e99345fb94a8a0dc995d400f
MD5 b697bb9d5dd1bb1f3e2862b4332554c9
BLAKE2b-256 bfc5ed8b7d08407a29f68183c30d907895ed9ed7765ca7dacc02c273e9f97d9e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page