{"id":35094346,"url":"https://github.com/paiml/depyler","last_synced_at":"2026-04-01T16:56:50.676Z","repository":{"id":297308648,"uuid":"996250059","full_name":"paiml/depyler","owner":"paiml","description":"Compiles Python to Rust, helping transition off of Python to Energy Efficient and Safe Rust Code","archived":false,"fork":false,"pushed_at":"2026-03-09T05:06:37.000Z","size":58554,"stargazers_count":336,"open_issues_count":125,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-09T09:49:21.632Z","etag":null,"topics":["conversion","mcp","port","python","pythontorust","rust"],"latest_commit_sha":null,"homepage":"https://paiml.github.io/depyler/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paiml.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-04T17:13:41.000Z","updated_at":"2026-03-08T11:37:22.000Z","dependencies_parsed_at":"2025-06-05T02:31:23.289Z","dependency_job_id":"e226574a-35eb-4ded-af9c-5cf441a26dba","html_url":"https://github.com/paiml/depyler","commit_stats":null,"previous_names":["paiml/depyler"],"tags_count":104,"template":false,"template_full_name":null,"purl":"pkg:github/paiml/depyler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fdepyler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fdepyler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fdepyler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fdepyler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paiml","download_url":"https://codeload.github.com/paiml/depyler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paiml%2Fdepyler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30459968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T03:55:51.346Z","status":"ssl_error","status_checked_at":"2026-03-13T03:55:33.055Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conversion","mcp","port","python","pythontorust","rust"],"created_at":"2025-12-27T15:04:24.315Z","updated_at":"2026-03-13T06:10:15.113Z","avatar_url":"https://github.com/paiml.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/hero.svg\" alt=\"depyler\" width=\"800\"\u003e\n\n  # depyler\n\n  **A Python-to-Rust transpiler with semantic verification and memory safety analysis.**\n\n  [![Crates.io](https://img.shields.io/crates/v/depyler.svg)](https://crates.io/crates/depyler)\n  [![Documentation](https://docs.rs/depyler/badge.svg)](https://docs.rs/depyler)\n  [![CI](https://github.com/paiml/depyler/actions/workflows/ci.yml/badge.svg)](https://github.com/paiml/depyler/actions/workflows/ci.yml)\n  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\u003c/div\u003e\n\n---\n\nDepyler translates annotated Python code into idiomatic Rust, preserving program semantics while providing compile-time safety guarantees. Part of the [PAIML Stack](https://github.com/paiml).\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Usage](#usage)\n- [Supported Python Features](#supported-python-features)\n- [Stdlib Module Support](#stdlib-module-support)\n- [Architecture](#architecture)\n- [Documentation](#documentation)\n- [Quality Metrics](#quality-metrics)\n- [Contributing](#contributing)\n- [License](#license)\n\n## v3.25.0 Milestone: Multi-Corpus Convergence\n\nAll three external corpus targets now met:\n\n| Corpus | Compile Rate | Target |\n|--------|--------------|--------|\n| Tier 1 (stdlib) | **92.7%** (38/41) | 80% ✅ |\n| Tier 2 (typed-cli) | **62.5%** (10/16) | 60% ✅ |\n| Tier 5 (algorithms) | **47.5%** (48/101) | 40% ✅ |\n| Internal examples | **80%** (256/320) | 80% ✅ |\n\n## Features\n\n- **Type-Directed Transpilation** — Uses Python type annotations to generate appropriate Rust types\n- **Memory Safety Analysis** — Infers ownership and borrowing patterns automatically\n- **Semantic Verification** — Property-based testing to verify behavioral equivalence\n- **Single-Command Compilation** — Compile Python to native binaries with `depyler compile`\n- **27 Stdlib Modules** — Production-ready support for common Python standard library modules\n- **80%+ Single-Shot Compile Rate** — Most Python files compile on first transpilation attempt\n\n## Installation\n\n```bash\ncargo install depyler\n```\n\n### Requirements\n\n- Rust 1.83.0 or later\n- Python 3.8+ (for test validation)\n\n## Quick Start\n\n### Compile to Binary\n\nThe fastest way to use Depyler:\n\n```bash\n# Compile Python to a standalone binary\ndepyler compile script.py\n\n# Run the compiled binary\n./script\n```\n\n### Transpile to Rust\n\n```bash\n# Transpile a Python file to Rust\ndepyler transpile example.py\n\n# Transpile with semantic verification\ndepyler transpile example.py --verify\n```\n\n### Example\n\n**Input** (`fibonacci.py`):\n```python\ndef fibonacci(n: int) -\u003e int:\n    if n \u003c= 1:\n        return n\n    return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\n**Output** (`fibonacci.rs`):\n```rust\nfn fibonacci(n: i32) -\u003e i32 {\n    if n \u003c= 1 {\n        return n;\n    }\n    fibonacci(n - 1) + fibonacci(n - 2)\n}\n```\n\n## Usage\n\n### Compilation Options\n\n```bash\n# Compile with custom output name\ndepyler compile script.py -o my_app\n\n# Debug build (faster compilation)\ndepyler compile script.py --profile debug\n\n# Release build (optimized, default)\ndepyler compile script.py --profile release\n```\n\n### Transpilation Options\n\n```bash\n# Show transpilation trace\ndepyler transpile example.py --trace\n\n# Explain transformation decisions\ndepyler transpile example.py --explain\n\n# Analyze migration complexity\ndepyler analyze example.py\n```\n\n### Library Usage\n\n```rust\nuse depyler::{transpile_file, TranspileOptions};\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let options = TranspileOptions::default()\n        .with_verification(true);\n\n    let rust_code = transpile_file(\"example.py\", options)?;\n    println!(\"{}\", rust_code);\n\n    Ok(())\n}\n```\n\n## Supported Python Features\n\n| Feature | Status |\n|---------|--------|\n| Functions with type annotations | Supported |\n| Basic types (int, float, str, bool) | Supported |\n| Collections (List, Dict, Tuple, Set) | Supported |\n| Control flow (if, while, for, match) | Supported |\n| Comprehensions (list, dict, set) | Supported |\n| Generator expressions | Supported |\n| Exception handling (→ Result\u003cT, E\u003e) | Supported |\n| Classes and methods | Supported |\n| Async/await | Supported |\n| Context managers | Supported |\n\n**Not Supported:** Dynamic features (eval, exec), runtime reflection, multiple inheritance, monkey patching.\n\n## Stdlib Module Support\n\n**27 modules validated** with 151 tests passing (100% coverage).\n\n| Category | Modules |\n|----------|---------|\n| Serialization | json, struct, base64, csv |\n| Date/Time | datetime, calendar, time |\n| Cryptography | hashlib, secrets |\n| Text | textwrap, re, string |\n| Math | math, decimal, fractions, statistics |\n| File System | os, pathlib, io |\n| Data Structures | collections, copy, memoryview, array |\n| Functional | itertools, functools |\n| Random | random |\n| System | sys |\n\nSee [validation report](tdd-book/VALIDATION-FINAL-2025-10-26.md) for details.\n\n## Architecture\n\n```\nPython AST → HIR → Type Inference → Rust AST → Code Generation\n```\n\n| Component | Description |\n|-----------|-------------|\n| Parser | RustPython AST parser |\n| HIR | High-level intermediate representation |\n| Type System | Conservative type inference with annotation support |\n| Verification | Property-based testing for semantic equivalence |\n| Codegen | Rust code generation via syn/quote |\n\n## Documentation\n\n- [API Documentation](https://docs.rs/depyler)\n- [MCP Quickstart](docs/MCP_QUICKSTART.md)\n- [Agent Mode Guide](AGENT.md)\n- [Developer Prompts](docs/prompts/)\n- [Changelog](CHANGELOG.md)\n- [TDD Book](tdd-book/)\n- 🤖 [Coursera Hugging Face AI Development Specialization](https://www.coursera.org/specializations/hugging-face-ai-development) - Build Production AI systems with Hugging Face in Pure Rust\n\n## Quality Metrics\n\n| Metric | Value |\n|--------|-------|\n| **Single-Shot Compile Rate** | 80% (256/320 examples) |\n| **Line Coverage** | 87.85% |\n| **Function Coverage** | 92.85% |\n| **Total Tests** | 14,000+ |\n| **Mutation Kill Rate** | 75%+ |\n\nRun coverage locally:\n```bash\ncargo llvm-cov nextest --workspace --lib --summary-only\n```\n\n## Contributing\n\nContributions welcome! Please follow the quality standards:\n\n1. Write tests first (TDD)\n2. Maintain 80%+ coverage for new code\n3. Pass all clippy checks: `cargo clippy -- -D warnings`\n4. Format code: `cargo fmt`\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n\n## MSRV\n\nMinimum Supported Rust Version: **1.83**\n\n## License\n\nLicensed under MIT License. See [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":["📚 Projects (1974 total)","MCP Servers"],"sub_categories":["Tools \u0026 Libraries","Software Development"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaiml%2Fdepyler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaiml%2Fdepyler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaiml%2Fdepyler/lists"}