Name | avro-py JSON |
Version |
2025.8.11
JSON |
| download |
home_page | None |
Summary | A modern Pythonic implementation of Avro Phonetic. |
upload_time | 2025-08-11 02:40:08 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2022-present Anindya Shiddhartha Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
avro
avro phonetic
bangla
bengali
bengali phonetics
phonetics
python
transliteration
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<!-- SPDX-License-Identifier: MIT -->
<div align="center">
# <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/python/python.png" width="35px"/> avro.py
A modern Pythonic implementation of the popular Bengali phonetic-typing software **Avro Phonetic.**
[](https://pepy.tech/project/avro-py)


<br>
<img src="https://github.com/hitblast/avro.py/blob/main/assets/banner.png?raw=True" style="width: 500px; height: auto;"><br>
</div>
## ⚡ 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](https://github.com/mugli).
### ✨ Inspirations
This package is inspired from Rifat Nabi's jsAvroPhonetic library and derives from Kaustav Das Modak's pyAvroPhonetic.
<br>
## 🔨 Installation
This package requires **Python 3.9 or higher** to be used inside your development environment.
```sh
# Install or upgrade.
pip install -U avro.py
```
<br>
## Usage Guide
You can also check the [examples](https://github.com/hitblast/avro.py/tree/main/examples) directory for
checking [this whole snippet](https://github.com/hitblast/avro.py/blob/main/examples/basic.py) in
action, as well as other use cases.
### Parsing to Bengali
For a single block of text, use `avro.parse()`:
```python
# 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:
```python
texts = ['ami banglay gan gai.', 'tumi kothay jao?']
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.
```python
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:
```python
bijoy_text = avro.to_bijoy("আমি বাংলায় গান গাই।")
print(bijoy_text) # Avwg evsjvh় Mvb MvB।
```
To convert multiple strings at once, use `avro.to_bijoy_iter()`:
```python
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:
```python
unicode_text = avro.to_unicode("Avwg evsjvh় Mvb MvB।")
print(unicode_text) # আমি বাংলায় গান গাই।
```
For multiple strings, use `avro.to_unicode_iter()`:
```python
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:
```python
reversed_text = avro.reverse("আমি বাংলায় গান গাই।")
print(reversed_text) # ami banglay gan gai.
```
> [!WARNING]
> The reverse functions are by-nature lossy and might not output the correct replacement for some letters in favor of readability sometimes.
To reverse multiple strings at once, use `avro.reverse_iter()`:
```python
rev_list = avro.reverse_iter(['আমি বাংলায় গান গাই।', 'তুমি কোথায় যাও?'])
print(rev_list) # ['ami banglay gan gai.', 'tumi kothay jao?']
```
<br>
## 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:
> [!NOTE]
> Remapping is a work-in-progress feature. Some words may still be missing.
```python
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](https://github.com/hitblast/avro.py/blob/main/examples/async.py) to find out more about their usage.
<br>
## 🛠️ Contributing
:octocat: "_Fork -> Do your changes -> Send a Pull Request, it's that easy!_" <br>
This project is based on the [uv](https://github.com/astral-sh/uv) package
manager by Astral. In order to automatically update and set up the environment,
you can run the following command:
```sh
# (Optional) Install recommended Python version: (also sets up the virtual environment)
$ 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:
```sh
# Run unit tests:
$ uv run pytest .
```
<br>
## ❤️ Acknowledgements
avro.py would not be possible without the awesome minds behind the original Avro Keyboard software:
- [Mehdi Hasan Khan](https://github.com/mugli)
- [Rifat Nabi](https://github.com/torifat)
- [Sarim Khan](https://github.com/sarim)
- [Kaustav Das Modak](https://github.com/kaustavdm)
And, some awesome people:
- [Saleh Sadiq Tanim](https://github.com/TanimSk)
- [Isfer Hossain](https://github.com/furtidev)
- [Md. Abdullah Al Riyad](https://github.com/Itsmemonzu)
- [baseplate-admin](https://github.com/baseplate-admin)
<br>
## License
This project has been licensed under the [MIT License](https://github.com/hitblast/avro.py/blob/main/LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "avro-py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "avro, avro phonetic, bangla, bengali, bengali phonetics, phonetics, python, transliteration",
"author": null,
"author_email": "HitBlast <hitblastlive@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/a2/69/e33c9e0cd30083b83e6280aa64ea2b7677df05194b50c823d227223339b1/avro_py-2025.8.11.tar.gz",
"platform": null,
"description": "<!-- SPDX-License-Identifier: MIT -->\n\n<div align=\"center\">\n\n# <img src=\"https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/python/python.png\" width=\"35px\"/> avro.py\n\nA modern Pythonic implementation of the popular Bengali phonetic-typing software **Avro Phonetic.**\n\n[](https://pepy.tech/project/avro-py)\n\n\n\n<br>\n\n<img src=\"https://github.com/hitblast/avro.py/blob/main/assets/banner.png?raw=True\" style=\"width: 500px; height: auto;\"><br>\n\n</div>\n\n## \u26a1 Overview\n\n**avro.py** provides a fully fledged, batteries-included text parser which can\nparse, reverse and even convert English Roman script into its phonetic\nequivalent (unicode) of Bengali. At its core, it implements an extensively\nmodified version of the **Avro Phonetic Dictionary Search Library** by [Mehdi\nHasan Khan](https://github.com/mugli).\n\n### \u2728 Inspirations\n\nThis package is inspired from Rifat Nabi's jsAvroPhonetic library and derives from Kaustav Das Modak's pyAvroPhonetic.\n\n<br>\n\n## \ud83d\udd28 Installation\n\nThis package requires **Python 3.9 or higher** to be used inside your development environment.\n\n```sh\n# Install or upgrade.\npip install -U avro.py\n```\n\n<br>\n\n## Usage Guide\n\nYou can also check the [examples](https://github.com/hitblast/avro.py/tree/main/examples) directory for\nchecking [this whole snippet](https://github.com/hitblast/avro.py/blob/main/examples/basic.py) in\naction, as well as other use cases.\n\n### Parsing to Bengali\n\nFor a single block of text, use `avro.parse()`:\n\n```python\n# Import the package.\nimport avro\n\n# Our dummy text.\ndummy = 'ami banglay gan gai.'\n\n# Parse a single string.\nparsed = avro.parse(dummy)\nprint(parsed) # \u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964\n```\n\nIf you have multiple strings, use `avro.parse_iter()` to get a list of parsed results:\n\n```python\ntexts = ['ami banglay gan gai.', 'tumi kothay jao?']\nparsed_list = avro.parse_iter(texts)\nprint(parsed_list) # ['\u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964', '\u09a4\u09c1\u09ae\u09bf \u0995\u09cb\u09a5\u09be\u09af\u09bc \u09af\u09be\u0993?']\n```\n\nAlternatively, set the `bijoy` flag to `True` for receiving the output in the [Bijoy Keyboard]() format.\n\n```python\nbijoy_output = avro.parse(dummy, bijoy=True)\n# Output: Avwg evsjvh\u09bc Mvb MvB\u0964\n```\n\n### Conversions\n\nTo convert a single Bengali string (Avro/Unicode) to the Bijoy Keyboard format:\n\n```python\nbijoy_text = avro.to_bijoy(\"\u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964\")\nprint(bijoy_text) # Avwg evsjvh\u09bc Mvb MvB\u0964\n```\n\nTo convert multiple strings at once, use `avro.to_bijoy_iter()`:\n\n```python\nbijoy_list = avro.to_bijoy_iter(['\u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964', '\u09a4\u09c1\u09ae\u09bf \u0995\u09cb\u09a5\u09be\u09af\u09bc \u09af\u09be\u0993?'])\nprint(bijoy_list) # ['Avwg evsjvh\u09bc Mvb MvB\u0964', 'tvmf wkrwb\u2021\u00b6 jd?']\n```\n\nOn the contrary, to convert a single Bijoy string back to Unicode Bengali:\n\n```python\nunicode_text = avro.to_unicode(\"Avwg evsjvh\u09bc Mvb MvB\u0964\")\nprint(unicode_text) # \u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964\n```\n\nFor multiple strings, use `avro.to_unicode_iter()`:\n\n```python\nunicode_list = avro.to_unicode_iter(['Avwg evsjvh\u09bc Mvb MvB\u0964', 'tvmf wkrwb\u2021\u00b6 jd?'])\nprint(unicode_list) # ['\u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964', '\u09a4\u09c1\u09ae\u09bf \u0995\u09cb\u09a5\u09be\u09af\u09bc \u09af\u09be\u0993?']\n```\n\n### Reversing Back\n\nTo reverse a single Unicode Bengali string back to English Roman script:\n\n```python\nreversed_text = avro.reverse(\"\u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964\")\nprint(reversed_text) # ami banglay gan gai.\n```\n\n> [!WARNING]\n> The reverse functions are by-nature lossy and might not output the correct replacement for some letters in favor of readability sometimes.\n\nTo reverse multiple strings at once, use `avro.reverse_iter()`:\n\n```python\nrev_list = avro.reverse_iter(['\u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09af\u09bc \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964', '\u09a4\u09c1\u09ae\u09bf \u0995\u09cb\u09a5\u09be\u09af\u09bc \u09af\u09be\u0993?'])\nprint(rev_list) # ['ami banglay gan gai.', 'tumi kothay jao?']\n```\n\n<br>\n\n## Remapped Exceptions\n\navro.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:\n\n> [!NOTE]\n> Remapping is a work-in-progress feature. Some words may still be missing.\n\n```python\navro.parse(\"ami Microsoft e kaj kori\")\n# \u0986\u09ae\u09bf \u09ae\u09be\u0987\u0995\u09cd\u09b0\u09cb\u09b8\u09ab\u099f \u098f \u0995\u09be\u099c \u0995\u09b0\u09bf\n```\n\n## Asynchronous Operations\n\nAll 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](https://github.com/hitblast/avro.py/blob/main/examples/async.py) to find out more about their usage.\n\n<br>\n\n## \ud83d\udee0\ufe0f Contributing\n\n:octocat: \"_Fork -> Do your changes -> Send a Pull Request, it's that easy!_\" <br>\n\nThis project is based on the [uv](https://github.com/astral-sh/uv) package\nmanager by Astral. In order to automatically update and set up the environment,\nyou can run the following command:\n\n```sh\n# (Optional) Install recommended Python version: (also sets up the virtual environment)\n$ uv python install && uv venv\n$ source .venv/bin/activate\n\n# Install the project:\n$ uv sync --all-extras --dev\n\n# Build the project:\n$ uv build --verbose\n```\n\nIn order to run the tests, you can use the following command:\n\n```sh\n# Run unit tests:\n$ uv run pytest .\n```\n\n<br>\n\n## \u2764\ufe0f Acknowledgements\n\navro.py would not be possible without the awesome minds behind the original Avro Keyboard software:\n\n- [Mehdi Hasan Khan](https://github.com/mugli)\n- [Rifat Nabi](https://github.com/torifat)\n- [Sarim Khan](https://github.com/sarim)\n- [Kaustav Das Modak](https://github.com/kaustavdm)\n\nAnd, some awesome people:\n\n- [Saleh Sadiq Tanim](https://github.com/TanimSk)\n- [Isfer Hossain](https://github.com/furtidev)\n- [Md. Abdullah Al Riyad](https://github.com/Itsmemonzu)\n- [baseplate-admin](https://github.com/baseplate-admin)\n\n<br>\n\n## License\n\nThis project has been licensed under the [MIT License](https://github.com/hitblast/avro.py/blob/main/LICENSE).\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2022-present Anindya Shiddhartha Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "A modern Pythonic implementation of Avro Phonetic.",
"version": "2025.8.11",
"project_urls": {
"Documentation": "https://hitblast.github.io/avro.py",
"Homepage": "https://pypi.org/project/avro-py",
"Repository": "https://github.com/hitblast/avro.py"
},
"split_keywords": [
"avro",
" avro phonetic",
" bangla",
" bengali",
" bengali phonetics",
" phonetics",
" python",
" transliteration"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "64e2f8c3205814c5764a0bc1140cddb8200a339dffd34b5f51daa218c2ede7b6",
"md5": "8f49342bd3b10389a81ff882612c791d",
"sha256": "416cc7768eb8b814ba95ae07d5fa01e59033ca9fbd20b5705aa0910cad719b19"
},
"downloads": -1,
"filename": "avro_py-2025.8.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8f49342bd3b10389a81ff882612c791d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 22858,
"upload_time": "2025-08-11T02:40:07",
"upload_time_iso_8601": "2025-08-11T02:40:07.431999Z",
"url": "https://files.pythonhosted.org/packages/64/e2/f8c3205814c5764a0bc1140cddb8200a339dffd34b5f51daa218c2ede7b6/avro_py-2025.8.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a269e33c9e0cd30083b83e6280aa64ea2b7677df05194b50c823d227223339b1",
"md5": "33fd23d0d352e4cc3e3dc582e789b10a",
"sha256": "f55064dc3bc0ac4b63ca14cf7e7a1027fbc645fd14ccfb3c751f91d8d86ba132"
},
"downloads": -1,
"filename": "avro_py-2025.8.11.tar.gz",
"has_sig": false,
"md5_digest": "33fd23d0d352e4cc3e3dc582e789b10a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 20748,
"upload_time": "2025-08-11T02:40:08",
"upload_time_iso_8601": "2025-08-11T02:40:08.291111Z",
"url": "https://files.pythonhosted.org/packages/a2/69/e33c9e0cd30083b83e6280aa64ea2b7677df05194b50c823d227223339b1/avro_py-2025.8.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-11 02:40:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hitblast",
"github_project": "avro.py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "avro-py"
}