Ship your Python as one small, fast file.

pyscriptc compiles typed Python into a native program that runs without Python installed. Parts it can't compile yet can run on Python, as islands inside your program.

Read the docs
uv tool install pyscriptc
One file
No Python, venv or pip on the target for native builds.
24x faster
Compute loops, against Python 3.14.
5.8x leaner
Less peak memory than Python. 142 KB Linux binary.
Fallback
Parts outside the compiled subset can run on Python.

The same program, measured both ways

Typed in vim, run on Python, compiled, run again. Every number shown was measured on this machine.

$vim sum_squares.py
1 def sum_squares(n: int) -> int:
2 total = 0
3 i = 0
4 while i < n:
5 total += i * i
6 i += 1
7 return total
8
9
10 print(sum_squares(2_000_000))
$python sum_squares.py
2666664666667000000
0.14 s 17.2 MB peak
$pyscriptc compile sum_squares.py --emit bin -o sum_squares
sum_squares
compiled in 0.82 s
$./sum_squares
2666664666667000000
<0.01 s 1.9 MB peak
Pythonpyscriptc
Wall time0.14 s<0.01 s
Peak memory17.2 MB1.9 MB
File size0.2 KB2.2 MB

The Python column is the script alone; running it also needs a Python install.

Measured on this machine at build time: macOS 27.2 arm64, Python 3.14.9, pyscriptc 0.10.0.

classify.py
def classify(tag: str) -> str:
    match tag:
        case "stream":
            return "streaming"
        case "ping" | "pong":
            return "keepalive"
    return "unknown"

print(classify("pong"))
$ pyscriptc compile classify.py --emit bin -o classify
classify
$ ./classify
keepalive
Edit it, then press Run. The output comes from the compiler itself.Open in the playground

Every line ends up somewhere you can see

Compiled to machine codeNativeNo interpreter involved. This is where the speed and the small file come from.
Runs on Python, inside your programIslandSame behaviour, interpreter speed. Today the target usually needs Python and your packages; pure-Python ones can be bundled with the file.
The build stops and says whyBlockedYou get the file, the line and a numbered code, plus what to change.

Measured, not promised

Method and data
Peak memory
pyscriptc2.1 MB
Python12.1 MB
Wall time, compute loops
pyscriptc0.70 ms
Python16.6 ms

Straight answers

Do I have to rewrite my code?You add type annotations. It stays Python and still runs on Python.
Will it behave like Python?Differences are written down and numbered. Anything else is a bug.
Can I back out?Delete the build step. Your source never changed language.

Try it on one script

$ uvx pyscriptc assess app.py