Multi-Language Transpiler Framework
Project description
Transpiler 🚀
A production-grade, multi-language transpiler framework. Parse source code from one language into a language-agnostic Intermediate Representation (IR), apply semantic passes, and generate source code in your target language.
✨ Features
- Multi-Source Parsing: Support for C, Go, Java, JavaScript, Python, and Rust via tree-sitter.
- Language-Agnostic IR: A robust internal representation that preserves semantics across paradigms.
- Intelligent Passes: Built-in type inference and semantic analysis to ensure correctness.
- Cross-Language Generation: High-quality code generation for all supported target languages.
- Production Ready: Fully type-hinted, linted with Ruff, and verified with 100% test coverage.
🛠 Installation
From PyPI
pip install transpiler
From Source
git clone https://github.com/ahron-maslin/transpiler.git
cd transpiler
pip install .
For development (including testing and linting tools):
pip install -e ".[dev]"
🚀 Quick Start
Use the transpiler CLI to convert code instantly:
# Convert a Python script to JavaScript
transpiler example.py --to js
# Convert a C header to Rust
transpiler header.c --to rust
Example
Input (Python):
def fib(n: int) -> int:
if n <= 1: return n
return fib(n - 1) + fib(n - 2)
Command:
transpiler fib.py --to js
Output (JavaScript):
function fib(n) {
if ((n <= 1)) {
return n;
}
return (fib((n - 1)) + fib((n - 2)));
}
🧪 Development
We value code quality and maintainability.
Running Tests
pytest
Linting & Formatting
We use Ruff for linting and Black for formatting.
black src/ tests/
ruff check src/ tests/
Pre-commit Hooks
Ensure your changes meet our standards before committing:
pre-commit install
📦 CI/CD
- CI: Every PR and push to
mastertriggers our GitHub Actions suite, testing on Python 3.10-3.12. - Releases: Automated PyPI publishing on tag creation (e.g.,
git tag v0.1.0 && git push origin v0.1.0).
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file transpiler-0.1.1.tar.gz.
File metadata
- Download URL: transpiler-0.1.1.tar.gz
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07196e7280f595c7238aaf2682354bbf52cd2012e83e4209e40afb29b2976e5e
|
|
| MD5 |
acbfb859372e32e85c65e2a2121b62d4
|
|
| BLAKE2b-256 |
88167c21c89c3e16cc70808876bdaa897c6a1b43fcbb2d74574bbeec80a0a3c9
|
Provenance
The following attestation bundles were made for transpiler-0.1.1.tar.gz:
Publisher:
release.yml on ahron-maslin/transpiler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
transpiler-0.1.1.tar.gz -
Subject digest:
07196e7280f595c7238aaf2682354bbf52cd2012e83e4209e40afb29b2976e5e - Sigstore transparency entry: 1525134564
- Sigstore integration time:
-
Permalink:
ahron-maslin/transpiler@7f52afa47b1f244599601fa5ae7430d638818f3d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ahron-maslin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f52afa47b1f244599601fa5ae7430d638818f3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file transpiler-0.1.1-py3-none-any.whl.
File metadata
- Download URL: transpiler-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18fa6cf2fd84cee0695a538fecae006dcbd93337ce3614e36b6e6c8f9ff90478
|
|
| MD5 |
5df5f8a0e5b0bb7d67f2830ddb47231f
|
|
| BLAKE2b-256 |
5fe04fa565bb8b67e5d6b92bde99d8395a4274bb9cc564a72f3fff2171cf78d7
|
Provenance
The following attestation bundles were made for transpiler-0.1.1-py3-none-any.whl:
Publisher:
release.yml on ahron-maslin/transpiler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
transpiler-0.1.1-py3-none-any.whl -
Subject digest:
18fa6cf2fd84cee0695a538fecae006dcbd93337ce3614e36b6e6c8f9ff90478 - Sigstore transparency entry: 1525134572
- Sigstore integration time:
-
Permalink:
ahron-maslin/transpiler@7f52afa47b1f244599601fa5ae7430d638818f3d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ahron-maslin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f52afa47b1f244599601fa5ae7430d638818f3d -
Trigger Event:
push
-
Statement type: