Skip to main content

python_hindi

python_hindi is a Python library (with command-line utilities) for programming Python in Hindi. (Haan, Bhai possible hai!)

python_hindi runs in Python 3.6+

After downloading this library, you can write a script like:

# if-else

sankhya = poornank(niwesh("Ek sankhya daalein: "))
yadi (sankhya % 2) == 0:
    bol("{0} sam hai".format(sankhya))
anyatha:
    bol("{0} visam hai".format(sankhya))
# while loop

num = 0
jabtak num < 10:
    num += 1
    yadi (num % 2) == 0:
        jaari
    bol(num)
#for loop

languages = ['Swift', 'Python', 'Go', 'JavaScript']
pratyek language mein languages:
    bol(language)

Name the file kuchbhi.pyhi and run it with pyhi kuchbhi.pyhi.

You can also import other .pyhi and .py files from the main file:

aayat kuchbhi

Installing

To install with pip, type in the terminal:

and for non-errors support :

pip install python-hindi

This will create the command-line script: pyhi

Usage

You can run pyhi files with pyhi <file>

You can start the Hindi Python console with just pyhi

Example:

pyhi file.pyhi

.pyhi file syntax

.pyhi file supports Hindi Python syntax (syntax with keywords like aayat (import)
and functions like bol (print)) in addition to normal Python syntax.

Use from normal Python file/repl

You can use it as a library:

To import .pyhi files into your .py file:

from python_hindi import create_hook
create_hook(run_module=False, console=False) # without running the main module or starting the repl
import pyhi_module # now you can import .pyhi files

Or to start the REPL from the normal REPL:

from python_hindi import create_hook
create_hook(run_module=True, console=True) # *with* starting the repl

jupyter/ipython

python-hindi supports jupyter and ipython interactive console by IPython extension. To use:

Install Jupyter Notebook by: pip install notebook
Start Jupyter Notebook by: jupyter notebook. Then create a new Python 3 by the new button.

In the first cell, enter the text %load_ext python_hindi and press Ctrl + Enter.

Now you can write Hindi Python in the entire notebook.

Dependencies

python-hindi depends on the Python libraries:

  • friendly - for more friendly Hinglish(hindi in roman script) traceback

  • ideas - most of this library is built on this project. It supports easy creation of import hooks and it has a simple example for replacing keywords with French keywords

  • [rich] - rich is a Python library for rich text and beautiful formatting in the terminal.

Contribute

For all errors, problems, or suggestions, please open a GitHub issue

Author

Karan Singh

License

This project is licensed under the BSD-4 License.

Release files for python_hindi 0.1.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 python_hindi 0.1.2
File Size Uploaded
python_hindi-0.1.2.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python_hindi 0.1.2
File Interpreter ABI Platform
python_hindi-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / python_hindi-0.1.2.tar.gz

Download URL python_hindi-0.1.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
99620ab6a05c5d7293037592ff2f7609b841ff0959dac363ee328c7674127e49
BLAKE2b-256 checksum
How to use checksums
1b9ec066a1aee104de9b7224746225b6195cbd97510273780a503e2fa7c36fc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.5 Windows/10

Release files / python_hindi-0.1.2-py3-none-any.whl

Download URL python_hindi-0.1.2-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77ad7e22cca1e7f519f4a177a13007a4b8b09361f97ab77f2e421f678871ae45
BLAKE2b-256 checksum
How to use checksums
180eb948e54d897112ba9745e54a2e5f127170a657fc007bd509f84df2846b7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.5 Windows/10

Release history Release notifications | RSS feed

This release

0.1.2 This release

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