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

Note: You only need uv on your host machine. The AI agent automatically detects, installs, and configures all other development and verification dependencies (like C compilers, make, valgrind, and system headers) inside the build environment.

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

Comparison

While tools like Nuitka and PyInstaller package the CPython interpreter (and its dynamic standard libraries) to guarantee compatibility, transpilatron completely strips the CPython runtime. By translating Python logic into pure, dependency-free C, it allows you to build single, fully static binaries that run in environments with zero external libraries.

Tool Approach CPython Runtime Dependency? Fully Static Binaries? Output Size Ideal For
transpilatron Source-to-source C translation via LLM No Yes (trivial) < 1MB Any Python application (CLI tools, microservices, serverless, initramfs, scratch containers, embedded)
Nuitka Translates Python to C calling CPython APIs Yes No (requires "shared libs galore" and dynamic loading) ~30MB+ 100% CPython compatibility for desktop/server applications
PyInstaller Bundles Python interpreter + .pyc files into a zip Yes No (unpacks dynamic libraries to /tmp at runtime) ~30MB - 100MB+ Distributing desktop apps where size and startup speed don't matter
Cython Compiles Python/Cython to a C extension module Yes No (produces a .so file that must be imported inside Python) N/A (requires python host) Speeding up hot paths inside an existing Python project
PyPy Alternative JIT-compiled interpreter Yes No N/A (it's a heavy runtime) Long-running Python server applications needing JIT speedups

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.1.tar.gz (52.8 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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file transpilatron-7.0.1.tar.gz.

File metadata

  • Download URL: transpilatron-7.0.1.tar.gz
  • Upload date:
  • Size: 52.8 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.1.tar.gz
Algorithm Hash digest
SHA256 45f1704b1ce1b48d544b4c68c7589792c86260ad613a39e3b62693dd40ca1578
MD5 2ea41708c683c6751dd8832f3988c179
BLAKE2b-256 aaabb475c633000fa9516b6fa8ee3ac43ba99d4bf2b446426528f98f89d2bf0e

See more details on using hashes here.

File details

Details for the file transpilatron-7.0.1-py3-none-any.whl.

File metadata

  • Download URL: transpilatron-7.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 40a4890380e1f3934346082d7e37ed9301b9be3141166ee22665392fa1552710
MD5 3d2bd58ef1b30f2d2ead671689073756
BLAKE2b-256 fb3de6a0826fd8a2788bae291f53360bd8056da4378167131e525eb1e6ff9895

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