(Sūtra [सूत्र]: A Sanskrit term meaning "string" or "thread," referring to an aphorism or a collection of concise rules.)
SutraLang allows you to write Python code using Devanagari script with intuitive Sanskrit keyword mappings. This project translates .skt
files containing this Sanskrit-based syntax into standard Python code, which can then be executed or saved.
- Sanskrit Syntax: Write Python logic using familiar Sanskrit terms.
- Seamless Integration: Import standard Python modules or other
.skt
modules. - Compatibility: Uses standard Python execution environments.
- Transpilation: Option to convert
.skt
files directly into standard.py
files. - Interactive Console (REPL): Experiment with SutraLang code interactively.
.
│
├── Docs/
│ ├── DOCUMENTATION.md # Detailed mappings of Sanskrit to Python keywords/functions.
│ ├── ABOUT.md # Project overview for collaborators/AI.
│ └── FUTURE_PLANS.md # Ideas for future development.
├── examples/ # Example .skt scripts showcasing various features.
│ ├── devanagari_example.skt
│ ├── greeting_example.skt
│ ├── math_example.skt
│ ├── random_example.skt
│ └── time_example.skt
├── घटकः/ # "Components" - Directory for wrapped .skt modules.
│ ├── गणित.skt # Wrapper for Python's math module.
│ ├── नियोग_देवनागरीलिपौ_सञ्चिका.skt # Devanagari script validator.
│ ├── समय.skt # Wrapper for Python's datetime module.
│ └── यादृच्छिक.skt # Wrapper for Python's random module.
├── LICENSE # MIT License file.
├── pyproject.toml # Project metadata, dependencies, and script entry points.
├── README.md # Main README for users (this file).
├── sutralang/ # Main package directory for SutraLang.
│ ├── __init__.py # Makes sutralang a Python package.
│ ├── mappings.py # Core Sanskrit-to-Python keyword/function dictionary.
│ ├── repl.py # Implements the interactive REPL (sutralang-console).
│ └── sanskrit.py # Core transpiler logic, import hook, and CLI runners.
└── .gitignore # Specifies intentionally untracked files for Git.
- Clone the repository:
git clone https://github.com/VinsmokeSomya/SutraLang.git cd SutraLang
- Install the package in editable mode:
pip install -e .
-
Write your code using Sanskrit keywords (see Full Documentation for mappings).
-
Save the file with a
.skt
extension (e.g.,कार्यक्रमः.skt
).- Example: "Hello, World!"
To print "Hello, World!" in SutraLang, you would write:
छापय("🕉️✨नमस्ते विश्व!🌍")
- Example: "Hello, World!"
To print "Hello, World!" in SutraLang, you would write:
-
Run a file directly:
sutralang-run कार्यक्रमः.skt
-
Transpile to a standard Python file:
sutralang-transpile कार्यक्रमः.skt output.py
-
Launch the Interactive Console (REPL):
sutralang-console
For a complete list of Sanskrit keyword and function mappings, please see:
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Copyright © 2025 Vinsmoke Somya. This project is MIT licensed.