Skip to main content

avro.py

A modern Pythonic implementation of the popular Bengali phonetic-typing software Avro Phonetic.

Downloads Python Version License



⚡ Overview

avro.py provides a fully fledged, batteries-included text parser which can parse, reverse and even convert English Roman script into its phonetic equivalent (unicode) of Bengali. At its core, it implements an extensively modified version of the Avro Phonetic Dictionary Search Library by Mehdi Hasan Khan.

✨ Inspirations

This package is inspired from Rifat Nabi's jsAvroPhonetic library and derives from Kaustav Das Modak's pyAvroPhonetic.


🔨 Installation

This package requires Python 3.10 or higher to be used inside your development environment.

# Install or upgrade.
$ pip install -U avro.py

# Or, add with the uv package manager.
$ uv add avro.py

S.N.: Check out avnie!

If you are a tinkerer and you find Python libraries intriguing at first, avnie is a terminal interface for this project. You can check out its installation guide to get going.


Usage Guide

You can also check the examples directory for checking this whole snippet in action, as well as other use cases.

Parsing to Bengali

For a single block of text, use avro.parse():

# Import the package.
import avro

# Our dummy text.
dummy = "ami banglay gan gai."

# Parse a single string.
parsed = avro.parse(dummy)
print(parsed)  # আমি বাংলায় গান গাই।

If you have multiple strings, use avro.parse_iter() to get a list of parsed results:

texts = ["ami banglay gan gai.", "tumi kOthay zao?"]
parsed_list = avro.parse_iter(texts)
print(parsed_list)  # ['আমি বাংলায় গান গাই।', 'তুমি কোথায় যাও?']

Alternatively, set the bijoy flag to True for receiving the output in the Bijoy Keyboard format.

bijoy_output = avro.parse(dummy, bijoy=True)
# Output: Avwg evsjvh় Mvb MvB।

Conversions

To convert a single Bengali string (Avro/Unicode) to the Bijoy Keyboard format:

bijoy_text = avro.to_bijoy("আমি বাংলায় গান গাই।")
print(bijoy_text)  # Avwg evsjvh় Mvb MvB।

To convert multiple strings at once, use avro.to_bijoy_iter():

bijoy_list = avro.to_bijoy_iter(["আমি বাংলায় গান গাই।", "তুমি কোথায় যাও?"])
print(bijoy_list)  # ['Avwg evsjvh় Mvb MvB।', 'tvmf wkrwb‡¶ jd?']

On the contrary, to convert a single Bijoy string back to Unicode Bengali:

unicode_text = avro.to_unicode("Avwg evsjvh় Mvb MvB।")
print(unicode_text)  # আমি বাংলায় গান গাই।

For multiple strings, use avro.to_unicode_iter():

unicode_list = avro.to_unicode_iter(
    ["Avwg evsjvh় Mvb MvB।", "tvmf wkrwb‡¶ jd?"]
)
print(unicode_list)  # ['আমি বাংলায় গান গাই।', 'তুমি কোথায় যাও?']

Reversing Back

To reverse a single Unicode Bengali string back to English Roman script:

reversed_text = avro.reverse("আমি বাংলায় গান গাই।")
print(reversed_text)  # ami banglay gan gai.

To reverse multiple strings at once, use avro.reverse_iter():

rev_list = avro.reverse_iter(["আমি বাংলায় গান গাই।", "তুমি কোথায় যাও?"])
print(rev_list)  # ['ami banglay gan gai.', 'tumi kothay zaw?']

Remapped Exceptions

avro.py also contains a built-in collection of words which are pre-baked to be passed into your text without any processing. These words can be accessed through both the parse and reverse functions, so that you do not have to care for phonetics:

avro.parse("ami Microsoft e kaj kori")
# আমি মাইক্রোসফট এ কাজ করি

Asynchronous Operations

All of the functions above, when suffixed with _async, provide their asynchronous counterparts which have a slight performance bump in certain use cases. Please see the async examples to find out more about their usage.


🛠️ Contributing

:octocat: Fork -> Do your changes -> Send a Pull Request, it's that easy!

This project is based on the uv package manager by Astral. In order to automatically update and set up the environment, you can run the following command:

# (Optional) Install recommended Python version and
# setup virtual environment for development.
$ uv python install && uv venv
$ source .venv/bin/activate

# Install the project:
$ uv sync --all-extras --dev

# Build the project:
$ uv build --verbose

In order to run the tests, you can use the following command:

# Run unit tests:
$ uv run pytest .

❤️ Acknowledgements

avro.py would not be possible without the awesome minds behind the original Avro Keyboard software:

And, some awesome people:


License

MIT or Apache-2.0 (your choice).

Metadata

Release files for avro-py 2026.11.29

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

Source distribution (sdist)

Source distribution for avro-py 2026.11.29
File Size Uploaded Provenance Actions
avro_py-2026.11.29.tar.gz 25.2 kB Without provenance Details for avro_py-2026.11.29.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for avro-py 2026.11.29
File Interpreter ABI Platform Actions
avro_py-2026.11.29-py3-none-any.whl Python 3 none any Details for avro_py-2026.11.29-py3-none-any.whl

Total release size: 52.9 kB

Release files / avro_py-2026.11.29.tar.gz

Download URL avro_py-2026.11.29.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3b88340d09fd5171302e307cbb71ef6df902b09ae05e3cab37c7d3af3869df36
BLAKE2b-256 checksum
How to use checksums
2be8fe869330d284853b3836f1ce55689c5cdc645a3ceea1843ce9d808e34e35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / avro_py-2026.11.29-py3-none-any.whl

Download URL avro_py-2026.11.29-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d917421bc0c2da7c2edb3bed365eb9bca4234ba31c39782a04ad39e873565886
BLAKE2b-256 checksum
How to use checksums
18527855a67f765db6d7a65f55c17cbcead3aa69b8d9f49a45fb3234e411b24b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for avro-py 2026.11.29

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

2026.11.29 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