Skip to main content

Sanskrit-Py

A Sanskrit-inspired programming language built on top of Python.

Sanskrit-Py lets you write Python-like programs using Sanskrit syntax and keywords while transpiling them into executable Python code.


Features

  • Sanskrit-inspired syntax
  • Python transpiler/compiler
  • Interactive REPL
  • Simple CLI interface
  • Educational programming language design
  • Lightweight and beginner-friendly
  • Extensible architecture

Installation

Install from PyPI:

pip install sanskrit-py

Verify installation:

sanskrit

Quick Example

Sanskrit Code

krte n antah vividham(1, 5):
    mudranam(n)

Output

1
2
3
4

REPL (Interactive Terminal)

Launch the Sanskrit interactive shell:

sanskrit

Example session:

==========================================================
   sanskrit-py Python Interactive Terminal (REPL)
                  संगणक संस्कृतम्
==========================================================

>>> mudranam("नमस्ते")
नमस्ते

Language Keywords

Sanskrit Keyword Meaning
mudranam print
krte for
yadi if
anyatha else
tavat while
varga class
kriya function

Running Sanskrit Files

Run a Sanskrit source file:

sanskrit example.sk

Development Installation

Install editable mode for development:

pip install -e .

Project Structure

sanskrit-py/
│
├── sanskrit/
│   ├── __init__.py
│   ├── cli.py
│   ├── compiler.py
│   ├── core.py
│   ├── parser.py
│   ├── repl.py
│   └── runtime.py
│
├── tests/
├── README.md
├── LICENSE
└── pyproject.toml

Requirements

  • Python 3.8+
  • pip

Example Programs

Conditional

yadi x > 10:
    mudranam("बृहत्")
anyatha:
    mudranam("लघु")

Loop

krte n antah vividham(1, 10):
    mudranam(n)

Function

kriya namaste():
    mudranam("नमस्ते")

Installation for TestPyPI

pip install --index-url https://test.pypi.org/simple/ sanskrit-py

License

Apache-2.0 License



Vision

Sanskrit-Py is an experimental attempt to explore programming language design using Sanskrit grammar concepts inspired by Paninian systems and Indian linguistic traditions.

Metadata

Release files for sanskrit-py 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sanskrit-py 1.0.2
File Size Uploaded Provenance Actions
sanskrit_py-1.0.2.tar.gz 8.1 kB Without provenance Details for sanskrit_py-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sanskrit-py 1.0.2
File Interpreter ABI Platform Actions
sanskrit_py-1.0.2-py3-none-any.whl Python 3 none any Details for sanskrit_py-1.0.2-py3-none-any.whl

Total release size: 16.9 kB

Release files / sanskrit_py-1.0.2.tar.gz

Download URL sanskrit_py-1.0.2.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8b15477fb5767d375c4eda875bf7abfa895865cf639c6c030f0d629afa4ac70f
BLAKE2b-256 checksum
How to use checksums
9e64971d2322ebfa0b66196757ccf470d845ad37caa0b3f329e1e9c14f531cd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0

Release files / sanskrit_py-1.0.2-py3-none-any.whl

Download URL sanskrit_py-1.0.2-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6950fe3ed02fe90a64b4cbba120a81ffa7913fd811312bc14588ac3ad2a5e8f5
BLAKE2b-256 checksum
How to use checksums
7e26806376f1258a41231fe32692cfeaf444b17bb04727064459cd66d124491a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0

Security for sanskrit-py 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page