Metadata-Version: 2.4
Name: python_maithili
Version: 0.4.0
Summary: Run Python code written in Maithili using Devanagari script
Author: Bishwas Jha
Author-email: Bishwas Jha <jha.bishwas@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Bishwas Jha
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/alphacrack/python-maithili-dsl
Project-URL: Issues, https://github.com/alphacrack/python-maithili-dsl/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: Hindi
Classifier: Topic :: Software Development :: Interpreters
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: license-file
Dynamic: requires-python

# README.md

# 📜 Devnagiri Maithili DSL

A modern Python-compatible programming DSL that lets you write code in **Maithili** using the **Devanagari script**.

---

## 🔧 Features
- ✅ Full Maithili syntax mapped to Python
- ✅ Supports OOP (classes, methods, self)
- ✅ Devanagari numerals (`०-९`)
- ✅ Built-in module translation (e.g., `गणित` → `math`)
- ✅ Runtime error messages in Maithili
- ✅ Linter with style & syntax feedback in Maithili
- ✅ Command-line tool: run `.dmai` files with `python_maithili` (cross-platform)

---

## 🚀 Getting Started

### 📦 Installation
Clone the repo:
```bash
git clone https://github.com/alphacrack/python-maithili-dsl.git
cd python-maithili-dsl
```

### 🔧 Install CLI Tool (cross-platform)
```bash
pip install .
```

Now you can run Maithili scripts using either entry point:
```bash
python_maithili examples/hello.dmai
# or, without installing the console script:
python -m maithili_dsl examples/hello.dmai
```
✅ Works on Mac, Windows, and Linux, on Python 3.10 – 3.12.

See [`examples/README.md`](examples/README.md) for a description of every bundled example program.

---

## 📄 Example: `examples/person.dmai`
```python
वर्ग व्यक्ति:
    कार्य नव(स्वयं, नाम):
        स्वयं.नाम = नाम

    कार्य बोलू(स्वयं):
        छपाउ("हमर नाम " + स्वयं.नाम + " अछि।")

व्यक्ति१ = व्यक्ति("सुमन")
व्यक्ति१.बोलू()
```
Output:
```
हमर नाम सुमन अछि।
```

---

## 🧠 Maithili Keywords
| Maithili       | Python       |
|----------------|--------------|
| `कार्य`         | `def`         |
| `वर्ग`          | `class`       |
| `फेर करू`      | `return`      |
| `स्वयं`         | `self`        |
| `यदि`          | `if`          |
| `नहि त`        | `else`        |
| `प्रत्येक`      | `for`         |
| `में`          | `in`          |
| `सत्य`         | `True`        |
| `मिथ्या`       | `False`       |
| `शून्य`         | `None`        |

---

## 📦 Built-in Modules Mapping
| Maithili      | Python        |
|---------------|---------------|
| `गणित`        | `math`        |
| `समय`         | `time`        |
| `यादृच्छिक`   | `random`      |
| `तिथि`        | `datetime`    |
| `पुन`         | `re`          |
| `संग्रह`       | `collections` |
| `सिस्टम`       | `sys`         |
| `पथ`          | `os.path`     |
| `ओएस`         | `os`          |
| `आँकड़ा`       | `statistics`  |

---

## 🧹 Linting & Errors
- ❗ Common mistakes caught before running
- ❗ Runtime errors shown in Maithili:
```bash
⚠️ त्रुटि: कोनो नाम घोषित नहि अछि।
```

---

## 🔐 Security
`.dmai` scripts are executed in a sandbox: a restricted `__builtins__`
mapping (no `exec` / `eval` / `open` / `compile` / `breakpoint`) and a
module import whitelist mapped from `MAITHILI_MODULES`. Raw Python
`import` statements that weren't translated from Maithili names are
rejected before execution.

To report a vulnerability, see [SECURITY.md](SECURITY.md).

---

## 🧪 Testing
Contributions are expected to come with tests. Run the full suite:
```bash
pip install -r requirements-dev.txt
pytest -v --cov=maithili_dsl --cov-report=term-missing
```
Coverage gates: ≥85% overall, ≥90% on `cli.py`, `transpile.py`, and
`linter.py`. See [CONTRIBUTING.md](CONTRIBUTING.md) for the full
workflow.

---

## 🤝 Contributing
See [`CONTRIBUTING.md`](CONTRIBUTING.md) to learn how you can help build and improve this DSL.
Good entry points are issues labeled
[`good first issue`](https://github.com/alphacrack/python-maithili-dsl/labels/good%20first%20issue).
This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).

---

## 📄 License
This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.

---

## 🌐 Future Goals
- 🌍 Tirhuta script support
- 🌐 Web REPL for `.dmai`
- 🔌 VS Code extension
- `while` (`जबतक`) and `try`/`except` (`प्रयास`/`अपवाद`) keywords
- Type hints and `mypy` in CI

---
