A modern Python-compatible programming DSL that lets you write code in Maithili using the Devanagari script.
- ✅ 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
.dmaifiles withpython_maithili(cross-platform)
Clone the repo:
git clone https://github.com/alphacrack/python-maithili-dsl.git
cd python-maithili-dslpip install .Now you can run Maithili scripts using either entry point:
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.9 – 3.12.
वर्ग व्यक्ति:
कार्य नव(स्वयं, नाम):
स्वयं.नाम = नाम
कार्य बोलू(स्वयं):
छपाउ("हमर नाम " + स्वयं.नाम + " अछि।")
व्यक्ति१ = व्यक्ति("सुमन")
व्यक्ति१.बोलू()Output:
हमर नाम सुमन अछि।
| Maithili | Python |
|---|---|
कार्य |
def |
वर्ग |
class |
फेर करू |
return |
स्वयं |
self |
यदि |
if |
नहि त |
else |
प्रत्येक |
for |
में |
in |
सत्य |
True |
मिथ्या |
False |
शून्य |
None |
| Maithili | Python |
|---|---|
गणित |
math |
समय |
time |
यादृच्छिक |
random |
तिथि |
datetime |
पुन |
re |
संग्रह |
collections |
सिस्टम |
sys |
पथ |
os.path |
ओएस |
os |
आँकड़ा |
statistics |
- ❗ Common mistakes caught before running
- ❗ Runtime errors shown in Maithili:
⚠️ त्रुटि: कोनो नाम घोषित नहि अछि।.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.
Contributions are expected to come with tests. Run the full suite:
pip install -r requirements-dev.txt
pytest -v --cov=maithili_dsl --cov-report=term-missingCoverage gates: ≥85% overall, ≥90% on cli.py, transpile.py, and
linter.py. See CONTRIBUTING.md for the full
workflow.
See CONTRIBUTING.md to learn how you can help build and improve this DSL.
This project is licensed under the MIT License. See the LICENSE file for details.
- 🌍 Tirhuta script support
- 🌐 Web REPL for
.dmai - 🔌 VS Code extension
while(जबतक) andtry/except(प्रयास/अपवाद) keywords- Type hints and
mypyin CI