Varṇa is a phonetic unit of Sanskrit language.
Yes, you can install a Python package sanskrit-text using, pip install sanskrit-text
sanskrit-text
pip install sanskrit-text