Skip to main content

Sanskrit Text

https://img.shields.io/pypi/v/sanskrit-text Documentation Status Python Version Support GitHub Issues GitHub Followers Twitter Followers

Sanskrit Text (Devanagari) Utility Functions

Features

  • Syllabification

  • Varṇa Viccheda

  • Pratyāhāra Encoding-Decoding

  • Uccāraṇa Sthāna Yatna Utility

  • Several other utility functions

Install

To install Sanskrit Text, run this command in your terminal:

$ pip install sanskrit-text

Usage

Python API

import sanskrit_text as skt

text = "कवि भारतः"

# Clean text (keep only Sanskrit letters and spaces)
clean_text = skt.clean(text)

# Syllabification
syllables = skt.get_syllables(text)

# Varṇa decomposition and join
viccheda = skt.split_varna(text, technical=True, flat=True)
reconstructed = skt.join_varna(viccheda)

# Ucchāraṇa information
ucchaarana = skt.get_ucchaarana(text)
signature = skt.get_signature(text)

Command Line Interface

After installation, the skt command provides a small CLI:

# Clean text
$ echo "अ b १।" | skt clean
अ

# Get syllables (JSON output)
$ skt syllables "कवि भारतः"

# Varṇa decomposition (technical, flat list)
$ skt split-varna --technical --flat "कवि भारतः"

# Ucchāraṇa and signature (JSON output)
$ skt ucchaarana "कवि"
$ skt signature "कवि"

Credits

This package was created with Cookiecutter and the hrishikeshrt/cookiecutter-pypackage project template.

History

Unreleased

  • Add a command-line interface (skt) with subcommands for cleaning text, obtaining syllables and varṇa decomposition.

  • Add a basic unit test suite covering core utilities and the CLI.

  • Fix marker_to_swara for extended mātrā characters.

  • Update packaging metadata and Trove classifiers for a production-ready release.

0.2.3 (2022-09-14)

  • Clarify documentation for join_varna and update general project documentation.

0.2.2 (2022-09-13)

  • Add two missing nuktā consonants to the alphabet definitions.

0.2.1 (2022-09-07)

  • Resolve a merge issue affecting the codebase.

0.2.0 (2022-09-07)

  • Reformat code with Black and improve documentation.

0.1.1 (2022-07-05)

  • Packaging and release metadata updates.

0.1.0 (2022-07-03)

  • First release on PyPI.

Metadata

Release files for sanskrit-text 1.0.0

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-text 1.0.0
File Size Uploaded
sanskrit_text-1.0.0.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sanskrit-text 1.0.0
File Interpreter ABI Platform
sanskrit_text-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 38.9 kB

Release files / sanskrit_text-1.0.0.tar.gz

Download URL sanskrit_text-1.0.0.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
859af1584dcb156255a008c50b452e625a99360fbaa0bb54c8dad703b6fa0ddc
BLAKE2b-256 checksum
How to use checksums
8e5baa6a7df67ce0404809801b0b37bee6dd9beb3928b5aaa41558329bbb1538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release files / sanskrit_text-1.0.0-py2.py3-none-any.whl

Download URL sanskrit_text-1.0.0-py2.py3-none-any.whl
Size 14.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
26d4eadaea64452fde45b42a31ed63c603ee4e9c3674fd4bde22e692b68e49a7
BLAKE2b-256 checksum
How to use checksums
360b9eab427b396807541c69515867edf9a7fdee770dfb0c3842e7f2fcd24e52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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