Skip to main content

A Python transpiler to write Python code using Bangla keywords.

Project description

CodeBangla

CodeBangla is a Python package that allows you to write Python code using Bangla keywords (in English transliteration). It is designed to help beginners, especially students in Bangladesh, to learn programming concepts without being intimidated by English-based syntax.

This project transpiles .bp (BanglaPython) files into standard .py files, which can then be executed by the Python interpreter.

⚠️ Known Issues

  • Numeral Conversion: The automatic conversion of Bengali numerals (e.g., ১২৩) to English numerals (123) is currently not working due to a deep, unresolved issue in the tokenization process. All other features are functional.

🚀 Features

  • Bangla Keywords: Write Python using intuitive Bangla words (jodi, noile, chhap, shuru, etc.).
  • Transpiler: Converts your Bangla-Python code into clean, standard Python code.
  • CLI Tool: Run your .bp files directly from the command line.
  • Safe Replacement: Preserves strings, comments, and code structure by using Python's native tokenizer.

📦 Installation

  1. Clone the repository:

    git clone https://github.com/gemini/codebangla.git
    cd codebangla
    
  2. Install the package:

    pip install -e .
    

📝 Usage

You can use codebangla in two ways:

1. Run a file directly

Create a file with a .bp extension, for example, hello.bp:

# hello.bp
shuru main():
    chhap("Hello from CodeBangla!")

main()

Now, run it from your terminal:

codebangla run hello.bp

2. Compile a file

You can also compile your .bp file into a standard .py file.

codebangla compile hello.bp

This will create a hello.py file in the same directory.

🧪 Running Tests

To run the included tests, first install the developer dependencies:

pip install -r requirements.txt

Then, run pytest:

pytest

🗺️ Keyword Mappings

Here are some of the supported Bangla keywords and their Python equivalents:

Bangla Python
chhap print
neoa input
jodi if
noile else
jotokkhon while
shuru def
phiredao return
sotti True
miththa False
er_jonno for
moddhe in

...and many more!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codebangla-0.1.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codebangla-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file codebangla-0.1.1.tar.gz.

File metadata

  • Download URL: codebangla-0.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for codebangla-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8145102fa711955a8481b461f5162ca2000dc606910b05cdd6be771c89740100
MD5 457b9e67db2f9f467e709c637d695689
BLAKE2b-256 a2d2130c8a976d99c5143bd0b1b666646a86823cdda7b0f008a1d99d9ec8ffaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for codebangla-0.1.1.tar.gz:

Publisher: publish-to-pypi.yml on saky-semicolon/CodeBangla

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codebangla-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: codebangla-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for codebangla-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 201dbb1c1bf5826e8f2e95a087ee44d29c6f842cb7c042136ce94ee534058bb4
MD5 83703d04d6d664c2b250d016d8f6ba88
BLAKE2b-256 eeec1b15ad404a1a68c62eff8033657d3983f6665bd91a83b1de18712b0fca79

See more details on using hashes here.

Provenance

The following attestation bundles were made for codebangla-0.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on saky-semicolon/CodeBangla

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page