Skip to main content

PyCeler

PyCeler looks for numeric loops in Python code and tries compiling them with Cython. A loop that clears an array, for example, can split the work across threads because each write is independent. A running sum depends on the previous result and has to keep that order. PyCeler checks which transformations apply, compares their results with Python, and measures whether they save time on the inputs it tried.

Installation

Install a published release in your Python environment with pip:

pip install PyCeler

PyCeler 0.1.0 provides wheels for standard CPython 3.11 and newer on Windows x64, Linux x86-64, and Linux ARM64. The Linux wheels target glibc distributions. Pip picks the wheel for your interpreter and platform.

You can analyze Python files with the installed package. To generate and benchmark native candidates or compile your own extensions, you’ll also need a C compiler. On Windows, use MSVC Build Tools with the C++ toolchain and Windows SDK. On Linux, use GCC, Python development headers, and the OpenMP runtime.

Install the third-party libraries your code uses in the same environment before optimizing it. Static analysis reads the source without importing it. Validation and timing can execute the code. NumPy is optional for PyCeler itself and is used for array optimizations.

Try it on a Python file

Point the analyzer at an existing file. Each finding tells you where the loop is and why PyCeler considers it a candidate or skips it.

import PyCeler

source = "my_loops.py"
for loop in PyCeler.Analyze(source):
    print(loop.Function, loop.Line, loop.Reason)

To see the generated Cython, call PyCeler.Convert(source, "output/cython"). To build an importable extension directly, call PyCeler.Compile(source, "output/native"). Both take a file or source directory and write their output separately from your originals. If you already have Cython code, use PyCeler.Compile("existing.pyx", "output/native", Convert=False) to compile it directly.

For eligible loops, the selection report shows how Python, serial Cython, and OpenMP performed at different input sizes. A small array can take longer to split across threads than to process on one. At runtime the module uses the implementation selected for the input and falls back to Python when the input falls outside the conditions it checked.

Build from source

From the root of the GitHub checkout, install the build dependencies and run the build script:

python -m pip install -r requirements.txt
python -B Compile.py

The built package is in Build/Lib/PyCeler. To try the analyzer from the checkout, run:

python -B Compile.py analyze --input Test/Numeric_Loops.py --rank

The example contains both the array fill and the running sum. Example source

Project

GitHub repository · Changelog · Test guide · MIT license

Metadata

Release files for PyCeler 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for PyCeler 0.1.0
File Interpreter ABI Platform Actions
pyceler-0.1.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for pyceler-0.1.0-cp311-abi3-win_amd64.whl
pyceler-0.1.0-cp311-abi3-manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for pyceler-0.1.0-cp311-abi3-manylinux_2_17_aarch64.whl
pyceler-0.1.0-cp311-abi3-manylinux_2_5_x86_64.whl CPython 3.11 abi3 Linux glibc 2.5+ x86-64 Details for pyceler-0.1.0-cp311-abi3-manylinux_2_5_x86_64.whl

Total release size: 4.1 MB

Release files / pyceler-0.1.0-cp311-abi3-win_amd64.whl

Download URL pyceler-0.1.0-cp311-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2823dc0fc5661b439ab60931be3bcd92f66397728652960ad4c5f8d1211c6e51
BLAKE2b-256 checksum
How to use checksums
edd4d684e3dd684a2390b6556da5afbe6d716cfcb21060b138c0eb0f10563b07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / pyceler-0.1.0-cp311-abi3-manylinux_2_17_aarch64.whl

Download URL pyceler-0.1.0-cp311-abi3-manylinux_2_17_aarch64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
abb5c8e0a8e8b7029f384e8bbbd50ae003410684f3857f054daf56eae23c4c28
BLAKE2b-256 checksum
How to use checksums
3f0c41cd3438e403c3fff1558fdff14fbc385cbfe8c28fad633fdcd84b2b2879
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / pyceler-0.1.0-cp311-abi3-manylinux_2_5_x86_64.whl

Download URL pyceler-0.1.0-cp311-abi3-manylinux_2_5_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
8ff8c19db3ead214dfc8121d2fba9754865c03da18e9319eaf66807a859b7424
BLAKE2b-256 checksum
How to use checksums
16bc0bdee143a203a2abedad9c36bd163c9d153baf99f67021ce39d6bb72e328
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for PyCeler 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page