Files
tampy/README.md

83 lines
1.1 KiB
Markdown

# 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 `ast` module
## Installation
```bash
pip install tampy
```
## Usage
### Build (generate Python code)
```bash
tampy build my_script.tampy
# Generates: my_script.py
```
### Run (build and execute)
```bash
tampy run my_script.tampy
```
## Example
**Input (Tamil code):**
```python
x = 1
y = 2
if x > y:
print("x is greater")
else:
print("y is greater")
```
**Output:**
```python
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:
```json
{
"print": "இருப்பு",
"if": "இணை",
"for": "ஒவ்வொரு"
}
```
## Development
```bash
# Run tests
pytest tests/
# Install in development mode
pip install -e ".[dev]"
# Run tests with coverage
pytest --cov=src
```
## License
MIT