Skip to main content

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.

  1. Reads your Python entry file and follows all imports
  2. Transpiles the full project to C
  3. Writes a Makefile and compiles with static linking
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transpilatron-7.0.0.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transpilatron-7.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for transpilatron-7.0.0.tar.gz
Algorithm Hash digest
SHA256 a35426bb87620837d872b2588cb84873613ca9b267d98fa4462ba56f29591959
MD5 f6e0be83f1b967dd639fc26e876e6d9c
BLAKE2b-256 ea10ee0604973a26b86e2bb2e863777de664f2fa948d3d0873759b934f0d1093

See more details on using hashes here.

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

Hashes for transpilatron-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f41eea7cb6de81f96a2e35de7ad5eb870a98dc56c4fecf226992dfc126e6f16
MD5 46bd2f4751cb88426fb7f866de3525f8
BLAKE2b-256 ac8afa2ae8c4cbab7088708a7212c2c5fe0a661a7ef33b7b5c5ce58a3b6d3dac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page