Zero-dependency, stdlib-only Python-to-Rust transpilation corpus for the depyler transpiler.
Zero third-party dependencies. Every Python source file uses exclusively the CPython 3.11+ standard library. This is enforced by AST scanning in CI (Gate 0).
# Clone the repository
git clone https://github.com/paiml/reprorusted-std-only.git
cd reprorusted-std-only
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
make setup# Run all quality gates (6-gate Jidoka pipeline)
make check
# Run tests with coverage
make test
# Export corpus to Parquet format
make export
# Validate stdlib-only constraint
uv run python scripts/validate_stdlib_only.py# Clone and setup
git clone https://github.com/paiml/reprorusted-std-only.git
cd reprorusted-std-only
make setup
# Run all 6-gate Jidoka quality pipeline
make check
# Example: Run a specific module
python -c "from reprorusted_std_only.collections import most_common; print(most_common(['a','b','a','c','a'], 2))"
# Output: [('a', 3), ('b', 1)]
# Export corpus to Parquet for HuggingFace
make exportreprorusted-std-only/
├── src/reprorusted_std_only/
│ ├── builtins/ # abs, len, min, max, sum, sorted, ...
│ ├── collections/ # Counter, defaultdict, deque, ...
│ ├── itertools/ # chain, groupby, permutations, ...
│ ├── functools/ # reduce, partial, lru_cache, ...
│ ├── pathlib/ # Path operations
│ ├── re/ # Regex matching
│ ├── json/ # JSON encode/decode
│ ├── csv/ # CSV parsing
│ ├── math_stats/ # Math and statistics
│ ├── dataclasses/ # Struct-like data classes
│ ├── typing/ # Generics and type hints
│ ├── enum/ # Enumerations
│ ├── argparse/ # CLI argument parsing
│ ├── datetime/ # Date/time operations
│ ├── hashlib_secrets/ # Cryptographic hashing
│ ├── io_files/ # File I/O, StringIO
│ ├── concurrency/ # Threading, asyncio
│ ├── contextlib/ # Context managers
│ ├── struct_binary/ # Binary pack/unpack
│ └── string_text/ # String manipulation
├── scripts/
│ ├── validate_stdlib_only.py # Gate 0: AST scanner
│ └── export_corpus.py # Parquet exporter
└── tests/
└── unit/ # 182 tests, 100% coverage
| Gate | Tool | Requirement |
|---|---|---|
| 0 | AST scanner | Zero third-party imports |
| 1 | ruff check | Zero lint violations |
| 2 | ruff format | Consistent formatting |
| 3 | ty | Zero type errors |
| 4 | bandit | Zero security findings |
| 5 | pytest | 95%+ branch coverage |
Additional standards:
- Google-style docstrings with 3+ doctests per function
- Property-based testing via Hypothesis
- Mutation testing via mutmut (85%+ mutation score)
| Category | Stdlib modules | Rust mapping |
|---|---|---|
builtins |
built-in functions | std primitives |
collections |
collections |
std::collections |
itertools |
itertools |
itertools / std::iter |
functools |
functools |
closures, memoize |
pathlib |
pathlib |
std::path |
re |
re |
regex crate |
json |
json |
serde_json |
csv |
csv |
csv crate |
math_stats |
math, statistics |
std::f64, statrs |
dataclasses |
dataclasses |
struct + derive |
typing |
typing |
generics, traits |
enum |
enum |
enum |
argparse |
argparse |
clap |
datetime |
datetime |
chrono |
hashlib_secrets |
hashlib, secrets |
sha2, rand |
io_files |
io, tempfile, shutil |
std::io, tempfile |
concurrency |
threading, asyncio |
std::thread, tokio |
contextlib |
contextlib |
RAII / Drop |
struct_binary |
struct |
byteorder, bincode |
string_text |
string, textwrap |
std::fmt, textwrap |
# Install dependencies (requires uv)
make setup
# Run all quality gates
make check
# Run tests only
make test
# Check coverage
make coverage
# Export to Parquet
make export
# Generate documentation
make docsThe 6-gate Jidoka pipeline runs on every push:
- Gate 0: Stdlib-only validation (AST scan)
- Gate 1: Lint (ruff check)
- Gate 2: Format (ruff format --check)
- Gate 3: Type check (ty)
- Gate 4: Security (bandit)
- Gate 5: Tests + Coverage (pytest, 95% threshold)
Matrix: Ubuntu + macOS × Python 3.11 + 3.12
- Fork the repository
- Create a feature branch
- Ensure all quality gates pass:
make check - Submit a pull request
Apache-2.0