Skip to main content

pyscriptc

pyscriptc

Compile annotated Python to a native binary. No CPython at runtime.

PyPI PyPI downloads per month CI License

pyscriptc compiles typed Python to native executables. It uses Python's inferred types and type hints to generate machine code from supported code. Static output runs without a Python runtime.

pyscriptc is experimental, aims for CPython compatibility, and supports a subset of Python, its builtins and standard library, and selected PyPI packages. For any code that's not supported, it can run it in CPython runtime. The CPython runtime is not bundled and is expected to be available at the host.

Installation

uv tool install pyscriptc

Building a binary needs a clang (or zig) on your PATH; pyscriptc doctor checks. See getting started for other install methods and toolchain setup.

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 and the Python subset.

Hello world

Create hello.py:

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


if __name__ == "__main__":
    main()
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.15.0, 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.

Using the stdlib

The practical summary and the fenced constructs: The Python subset.

Using PyPI packages

We keep track of the share of the top 100 PyPI libraries that compiles. Mind that the compiler requires typed code. The per-library status lives in the generated .agents/docs/support/compat-top100.md (moving to the compat site, see The Python subset).

Contributing

See Contributing for setup and conventions.

License

Apache License 2.0. See LICENSE.

Metadata

Release files for pyscriptc 0.6.1

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.6.1
File Size Uploaded Provenance Actions
pyscriptc-0.6.1.tar.gz 1.4 MB With provenance Details for pyscriptc-0.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 2.8 MB

Release files / pyscriptc-0.6.1.tar.gz

Download URL pyscriptc-0.6.1.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
6f38f95a953cf1665c74b6cfa455c279e5f3734413ebe82e4e0a11edf7c7edd5
BLAKE2b-256 checksum
How to use checksums
2e27d8f04bdabc6a25201950bfbdd7c0519ae5f7c7cbc6d72b48929cef02263b
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 Oct 24, 2026.

Transparency log

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

Download URL pyscriptc-0.6.1-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
20157566b5d6bae9f5fd2b575967e27e0e0e779f291bb66d6dc17b62bc9314b4
BLAKE2b-256 checksum
How to use checksums
d04524818a183b047ee09eb26d7a4da11147f95ae8f7787f5e769a0f5b0826d3
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 Oct 24, 2026.

Transparency log

Security for pyscriptc 0.6.1

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.6.1.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 Oct 24, 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