Skip to main content

pyscriptc

pyscriptc

Compile annotated Python to a native binary.

PyPI PyPI downloads per month CI License Sponsor

pyscriptc compiles typed Python to native executables. Types are checked from your annotations and type hints, then lowered to machine code for supported code; outside the supported subset the compiler names the refusal with a stable PSxxxx diagnostic.

Quick start

# hello.py
def main() -> None:
    print("hello from a native binary")


if __name__ == "__main__":
    main()
pyscriptc run hello.py

Live per-module and per-library support status: the compat site.

How pyscriptc compares with the bundlers, the other Python compilers and PyPy: the comparison page.

pyscriptc is experimental, aims for CPython compatibility, and supports a subset of Python, its builtins and standard library, and selected PyPI packages. Code outside the subset stops the build with a diagnostic code (PSxxxx) that names the exact line, or runs through embedded CPython (fallback mode) when you opt in with --island or --fallback=cpython. Fallback mode links against the host CPython: it is not bundled, and a Python installation is expected on the machine.

These pages describe master, which is ahead of the newest released wheel. uv tool install pyscriptc installs the release; uv pip install git+https://github.com/sigilco/pyscriptc installs master. pyscriptc doctor prints the installed version.

Installation

macOS and Linux:

curl -LsSf https://raw.githubusercontent.com/sigilco/pyscriptc/master/docs/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sigilco/pyscriptc/master/docs/install.ps1 | iex"

The script checks the prerequisites, installs what it can, installs pyscriptc and runs pyscriptc doctor. It never uses sudo or an admin shell.

Install with your coding agent

Paste this into your coding agent:

Install pyscriptc from https://pyscriptc.pages.dev/llms.txt, run `pyscriptc doctor`,
then compile and run a hello world with it.
Install with uv
uv tool install pyscriptc

Building a binary needs a clang (or zig) on your PATH; pyscriptc doctor checks. If the host has no zig, install the toolchain wheel with the zig extra and pyscriptc wires it up:

uv tool install "pyscriptc[zig]"

The extra pulls the ziglang wheel; pyscriptc installs a zig PATH shim over it, so --driver zig and cross-compilation work with no other setup. See Getting started for the full toolchain setup.

Release builds send pseudonymous usage events (PostHog EU) so we learn which unsupported constructs block users. Opt out with PYSC_NO_TELEMETRY=1, DO_NOT_TRACK=1 or pyscriptc telemetry disable; details in the telemetry guide and the privacy notice.

The examples above need no C toolchain; building a binary needs clang or zig on your PATH (pyscriptc doctor checks). Windows: the pyscriptc binary runs there (experimental) and coverage works. Emitted programs are experimental cross-compilation only: pyscriptc compile FILE --target x86_64-windows-gnu --driver zig builds a Windows binary from Linux or macOS, but no CI job runs the output and Windows semantics are unverified. Native Windows compiles are not supported yet.

Documentation

Documentation site, including the CLI reference, the Python subset and how pyscriptc compares with other tools.

The shorter editorial version of that comparison, with the measured baseline and the trade-offs stated, is the comparison page.

For agents: llms.txt and llms-full.txt.

Hello world

# hello.py
def main() -> None:
    print("hello from a native binary")


if __name__ == "__main__":
    main()

Run it directly, or build a binary:

pyscriptc run hello.py
pyscriptc compile hello.py --emit bin -o hello && ./hello

Benchmarks

Group Time Peak memory
Kernels (sum-squares, floor-sum, horner, repeat-len) 23.9x faster 5.8x smaller
Scripting 22.2x faster 6.0x smaller
Stdlib calls 14.4x faster 5.2x smaller

Compiled binary versus the same call under CPython 3.14.9, geometric mean per workload group, higher is better. Reference recorded 2026-10-15 on one Linux x86_64 host (8 CPUs, 5 runs per sample).

Source: benchmarks/baseline/reference.json. Fresh numbers are in the job summary of the latest nightly run. Reproduce with uv run python -m benchmarks.baseline.run --check.

What it does not do yet

Code outside the supported subset stops the build with a PSxxxx diagnostic that names the exact line. A binary with no island in it carries no interpreter, so dynamic patterns that need one do not run in it; a binary built with --island runs them on the embedded CPython, at interpreter speed and with a marshalling cost on every call that crosses the boundary. The concrete fences and their causes are in Diagnostics, the behavior differences from CPython are in Divergences from CPython, and the live per-module and per-library status is on the compat site.

Using PyPI packages

We keep track of a pinned corpus of PyPI libraries, and each library's status splits into two planes: what compiles to native code, and what runs on the embedded CPython island. An untyped dependency is not unusable: it runs on the island, at interpreter speed, with a marshalling cost on every call that crosses the boundary. Per-module and per-library support status is tracked on the compat site, fed by the nightly CI workflow, so it cannot go stale the way a page would.

Contributing

See Contributing for setup and conventions. Reported behavior is covered by the Code of Conduct.

License

Apache License 2.0. See LICENSE.

Metadata

Release files for pyscriptc 0.10.0

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

Source distribution (sdist)

Source distribution for pyscriptc 0.10.0
File Size Uploaded Provenance Actions
pyscriptc-0.10.0.tar.gz 2.3 MB With provenance Details for pyscriptc-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyscriptc 0.10.0
File Interpreter ABI Platform Actions
pyscriptc-0.10.0-py3-none-any.whl Python 3 none any Details for pyscriptc-0.10.0-py3-none-any.whl

Total release size: 4.4 MB

Release files / pyscriptc-0.10.0.tar.gz

Download URL pyscriptc-0.10.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
9e5a45a0aba05e61bb196e96b5c89951e1f65d8fdb24fbf02aecd7bae16eb233
BLAKE2b-256 checksum
How to use checksums
3c1c804e8d2ab80fcd9527f2131bc2d83830f9661e20e3ed8fe7d16201a5c469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / pyscriptc-0.10.0-py3-none-any.whl

Download URL pyscriptc-0.10.0-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e022b3539ce5c288b153ee8b509578e64407691a63b2332465142b01e59647cd
BLAKE2b-256 checksum
How to use checksums
7d07820e378e69da56ea484205a85b0ef0d761a6e358c3f8df3b70ba7c05abe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for pyscriptc 0.10.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyscriptc-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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