31cc2766430fb1ad3dc46872238b092f703f24f2
Tampy
A Python compiler/transpiler that converts Tamil code syntax to Python.
Features
- Build mode: Generate Python code from Tamil syntax
- Run mode: Build and execute Tamil code directly
- Configurable keywords: Custom keyword mappings via JSON
- Minimal dependencies: Uses Python's built-in
astmodule
Installation
pip install tampy
Usage
Build (generate Python code)
tampy build my_script.tampy
# Generates: my_script.py
Run (build and execute)
tampy run my_script.tampy
Example
Input (Tamil code):
x = 1
y = 2
if x > y:
print("x is greater")
else:
print("y is greater")
Output:
x = 1
y = 2
if x > y:
print('x is greater')
else:
print('y is greater')
Configuration
Edit src/tampy/keywords.json to customize keyword mappings:
{
"print": "இருப்பு",
"if": "இணை",
"for": "ஒவ்வொரு"
}
Development
# Run tests
pytest tests/
# Install in development mode
pip install -e ".[dev]"
# Run tests with coverage
pytest --cov=src
License
MIT