Metadata-Version: 2.4
Name: pycrusty
Version: 0.2.0
Summary: A practical Python-to-Rust transpiler for a supported subset of Python
Author: LAKE
License: MIT
Project-URL: Homepage, https://example.com/pythrust
Project-URL: Repository, https://example.com/pythrust
Project-URL: Issues, https://example.com/pythrust/issues
Keywords: python,rust,transpiler,compiler,ast
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# pythrust

`pythrust` transpiles a supported subset of Python into Rust and ships with a tiny runtime so the generated code is easy to inspect and extend.

## Install

```bash
pip install .
```

## Run from the command line

```bash
pythrust examples/example.py -o generated.rs
```

Read from standard input:

```bash
python -m pythrust - < examples/example.py
```

## Use as a library

```python
from pythrust import Transpiler, TranspilerConfig

source = """
def add(a, b):
    return a + b
"""

transpiler = Transpiler(TranspilerConfig(optimize=True))
rust_code = transpiler.transpile(source)
print(rust_code)
```

## Supported subset

- imports
- functions
- assignments and augmented assignments
- `if` / `elif` / `else`
- `while`
- `for` over `range(...)`
- `break`, `continue`, `return`, `pass`
- expressions, calls, attributes, subscripts, lists, tuples, dicts
- constant folding and a few small algebraic simplifications

This project is intentionally small and practical: it aims to make transpiled output easy to read first, then optimize it incrementally.
