Install
$ agentstack add mcp-paiml-depyler ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ● Filesystem access Used
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
depyler
A Python-to-Rust transpiler with semantic verification and memory safety analysis.
[](https://crates.io/crates/depyler) [](https://docs.rs/depyler) [](https://github.com/paiml/depyler/actions/workflows/ci.yml) [](https://opensource.org/licenses/MIT)
Depyler translates annotated Python code into idiomatic Rust, preserving program semantics while providing compile-time safety guarantees. Part of the PAIML Stack.
Table of Contents
- [What's New in v4.1.1](#whats-new-in-v411)
- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Supported Python Features](#supported-python-features)
- [Stdlib Module Support](#stdlib-module-support)
- [Architecture](#architecture)
- [Documentation](#documentation)
- [Quality Metrics](#quality-metrics)
- [Contributing](#contributing)
- [License](#license)
What's New in v4.1.1
str(dict.get(key, default))fix: No longer generates spurious.unwrap()calls- 25+ Python module mappings:
tempfile,datetime,os,shutil,glob, and more - E0433 import resolution: Improved handling of unresolved imports
[profile.test] opt-level=1: Faster test execution
Multi-Corpus Convergence (v3.25.0+)
All three external corpus targets met:
| Corpus | Compile Rate | Target | |--------|--------------|--------| | Tier 1 (stdlib) | 92.7% (38/41) | 80% | | Tier 2 (typed-cli) | 62.5% (10/16) | 60% | | Tier 5 (algorithms) | 47.5% (48/101) | 40% | | Internal examples | 80% (256/320) | 80% |
Features
- Type-Directed Transpilation — Uses Python type annotations to generate appropriate Rust types
- Memory Safety Analysis — Infers ownership and borrowing patterns automatically
- Semantic Verification — Property-based testing to verify behavioral equivalence
- Single-Command Compilation — Compile Python to native binaries with
depyler compile - 27 Stdlib Modules — Production-ready support for common Python standard library modules
- 80%+ Single-Shot Compile Rate — Most Python files compile on first transpilation attempt
Installation
cargo install depyler
Requirements
- Rust 1.83.0 or later
- Python 3.8+ (for test validation)
Quick Start
Compile to Binary
The fastest way to use Depyler:
# Compile Python to a standalone binary
depyler compile script.py
# Run the compiled binary
./script
Transpile to Rust
# Transpile a Python file to Rust
depyler transpile example.py
# Transpile with semantic verification
depyler transpile example.py --verify
Example
Input (fibonacci.py):
def fibonacci(n: int) -> int:
if n i32 {
if n Result> {
let options = TranspileOptions::default()
.with_verification(true);
let rust_code = transpile_file("example.py", options)?;
println!("{}", rust_code);
Ok(())
}
Supported Python Features
| Feature | Status | |---------|--------| | Functions with type annotations | Supported | | Basic types (int, float, str, bool) | Supported | | Collections (List, Dict, Tuple, Set) | Supported | | Control flow (if, while, for, match) | Supported | | Comprehensions (list, dict, set) | Supported | | Generator expressions | Supported | | Exception handling (→ Result) | Supported | | Classes and methods | Supported | | Async/await | Supported | | Context managers | Supported |
Not Supported: Dynamic features (eval, exec), runtime reflection, multiple inheritance, monkey patching.
Stdlib Module Support
27 modules validated with 151 tests passing (100% coverage).
| Category | Modules | |----------|---------| | Serialization | json, struct, base64, csv | | Date/Time | datetime, calendar, time | | Cryptography | hashlib, secrets | | Text | textwrap, re, string | | Math | math, decimal, fractions, statistics | | File System | os, pathlib, io | | Data Structures | collections, copy, memoryview, array | | Functional | itertools, functools | | Random | random | | System | sys |
See [validation report](tdd-book/VALIDATION-FINAL-2025-10-26.md) for details.
Architecture
Python AST → HIR → Type Inference → Rust AST → Code Generation
| Component | Description | |-----------|-------------| | Parser | RustPython AST parser | | HIR | High-level intermediate representation | | Type System | Conservative type inference with annotation support | | Verification | Property-based testing for semantic equivalence | | Codegen | Rust code generation via syn/quote |
Documentation
- API Documentation
- [MCP Quickstart](docs/MCP_QUICKSTART.md)
- [Agent Mode Guide](AGENT.md)
- [Developer Prompts](docs/prompts/)
- [Changelog](CHANGELOG.md)
- [TDD Book](tdd-book/)
- 🤖 Coursera Hugging Face AI Development Specialization - Build Production AI systems with Hugging Face in Pure Rust
Quality Metrics
| Metric | Value | |--------|-------| | Single-Shot Compile Rate | 80% (256/320 examples) | | Line Coverage | 87.85% | | Function Coverage | 92.85% | | Total Tests | 23,335+ | | Mutation Kill Rate | 75%+ |
Run coverage locally:
cargo llvm-cov nextest --workspace --lib --summary-only
Contributing
Contributions welcome! Please follow the quality standards:
- Write tests first (TDD)
- Maintain 80%+ coverage for new code
- Pass all clippy checks:
cargo clippy -- -D warnings - Format code:
cargo fmt
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
MSRV
Minimum Supported Rust Version: 1.83
Cookbook
See depyler-cookbook for examples and recipes.
License
Licensed under MIT License. See [LICENSE](LICENSE) for details.
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: paiml
- Source: paiml/depyler
- License: MIT
- Homepage: https://paiml.github.io/depyler/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.