A tool for transpiling code from python to C using AI agents.
Project description
transpilatron
Write Python. Get a native C binary. No C knowledge required.
uvx transpilatron your_code.py
Benchmarks
| Benchmark | Python | C | Speedup |
|---|---|---|---|
| Sieve of Eratosthenes (10M numbers) | 0.526s | 0.022s | 24x |
| Selection sort (10K elements) | 1.963s | 0.033s | 58x |
Verified on the same machine. Same output. Fully static binaries.
How it works
transpilatron uses an AI agent to convert your Python project into C, compiles it (using -O2 or -O3 flags), and hands you a fully static binary. No runtime, no interpreter, no dependencies.
- Reads your Python entry file and follows all imports
- Transpiles the full project to C
- Writes a Makefile and compiles with static linking
- Drops the binary in
out/
Requirements
| Tool | Why |
|---|---|
| uv | Run transpilatron instantly with uvx |
C compiler (gcc/clang) & make |
Compile the generated C code into a static binary |
All must be on your PATH before running.
Install
# Run without installing
uvx transpilatron your_code.py
# Or install globally
uv tool install transpilatron
On first run, the tool installs its dependencies, and asks you to authenticate with poolside.
Usage
uvx transpilatron your_code.py
The binary lands at out/<your_code>. That's it.
What it handles
- Pure Python logic → idiomatic C
- HTTP (
requests,urllib3) → raw BSD sockets - JSON → cJSON
- Threading → pthreads
- File I/O → POSIX syscalls
- Multi-file projects → one binary
- Detects and fixes common Python bugs during transpilation
- Supports many major Python libraries with C extensions by simply using their C backends or alternatives
- The system attempts to translate pure Python libraries as well
Limitations
- Linux and macOS only
torch/tensorflow— not supported (aborts with a clear error)- Some dynamic Python patterns (metaclasses, heavy monkey-patching) may not translate cleanly
Examples
examples/
├── sieve.py # Prime number sieve — 24x speedup
└── sort.py # Selection sort — 58x speedup
Why uv?
uv is the fastest Python package manager on the planet. uvx lets you run any Python tool instantly without installing it. If you're not using uv yet, you should be.
Outputs fully static binaries. Runs even in initramfs. No dynamic linker required.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file transpilatron-7.0.0.tar.gz.
File metadata
- Download URL: transpilatron-7.0.0.tar.gz
- Upload date:
- Size: 52.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a35426bb87620837d872b2588cb84873613ca9b267d98fa4462ba56f29591959
|
|
| MD5 |
f6e0be83f1b967dd639fc26e876e6d9c
|
|
| BLAKE2b-256 |
ea10ee0604973a26b86e2bb2e863777de664f2fa948d3d0873759b934f0d1093
|
File details
Details for the file transpilatron-7.0.0-py3-none-any.whl.
File metadata
- Download URL: transpilatron-7.0.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f41eea7cb6de81f96a2e35de7ad5eb870a98dc56c4fecf226992dfc126e6f16
|
|
| MD5 |
46bd2f4751cb88426fb7f866de3525f8
|
|
| BLAKE2b-256 |
ac8afa2ae8c4cbab7088708a7212c2c5fe0a661a7ef33b7b5c5ce58a3b6d3dac
|