avro-py


Nameavro-py JSON
Version 2024.5.1 PyPI version JSON
download
home_pagehttps://pypi.org/project/avro-py
SummaryA modern Pythonic implementation of Avro Phonetic.
upload_time2024-05-01 12:03:19
maintainerNone
docs_urlNone
authorHitBlast
requires_python<4.0,>=3.8
licenseMIT
keywords python phonetics avro avro phonetic bangla bengali bengali phonetics 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" height="40px"/> avro.py

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

[![Downloads](https://static.pepy.tech/personalized-badge/avro-py?period=total&units=international_system&left_color=grey&right_color=black&left_text=Downloads)](https://pepy.tech/project/avro-py)
![Python Version](https://img.shields.io/pypi/pyversions/avro.py.svg?color=black&label=Python)
![License](https://img.shields.io/pypi/l/avro.py.svg?color=black&label=License)

<br>

<img src="https://github.com/hitblast/avro.py/blob/main/assets/banner.png" style="width: 500px; height: auto;"><br>

[![Unit Tests](https://github.com/hitblast/avro.py/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/hitblast/avro.py/actions/workflows/unit-tests.yml)
[![Linting](https://github.com/hitblast/avro.py/actions/workflows/linting.yml/badge.svg)](https://github.com/hitblast/avro.py/actions/workflows/linting.yml)
[![Formatting](https://github.com/hitblast/avro.py/actions/workflows/formatting.yml/badge.svg)](https://github.com/hitblast/avro.py/actions/workflows/formatting.yml)

<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).

> The original project ([pyAvroPhonetic](https://github.com/kaustavdm/pyAvroPhonetic)) can only be used on versions up to **Python 2.7** and doesn't contain proper support for Python's third major version AKA Python 3. It is noteworthy that Python 2 has officially been deprecated by the original maintainers and its usage is being discouraged overall. <br>

## ✨ 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.8 or higher** to be used inside your development environment.

```sh
# Install / upgrade.
$ pip install avro.py
```

<br>

## 🔖 Usage Guide

### 1. `parse()`
This is the most basic use case for avro.py, which includes parsing English Roman script to unicode Bengali:

```python
# Imports.
import avro

# Parsing some text.
output = avro.parse('ami banglay gan gai.')
print(output)
```

### 2. `parse(bijoy=True)`
Alternatively, we can generate the same output, but in compliance with the Bijoy Keyboard format:

```python
# Parsing some text in Bijoy!
output = avro.parse('tumi emon keno?', bijoy=True)
```

### 3. `to_bijoy()`
We can also use avro.py to convert existing unicode Bengali to its Bijoy Keyboard equivalent:

```python
# Converting some text.
bijoy_text = avro.to_bijoy('আমি বাংলায় গান গাই।')
```

### 4. `reverse()`
Finally, you can reverse unicode Bengali to English as well (newly added).

```python
# Reversing back!
reversed_text = avro.reverse('আমার সোনার বাংলা।')
```

---

## 🔖 Command Line Usage

Alternatively, instead of using avro.py from within your Python project, you can also use it as a simple,
tiny command-line interface for easy parsing and reversing of text.

```sh
# Installing the package.
$ pip install avro.py[cli]
```

Here are some examples for you to get started with:

```sh
# Main help section.
$ avro --help  # or, use: avro <command> --help

# Parsing some text.
$ avro parse "tumi onek bhalO!"
$ avro parse --bijoy "amio kharap na, taina?"  # (bijoy keyboard format)

# Reversing.
$ avro reverse "তাই তো!"

# Using additional flags to ease workflow.
$ avro parse --from-clip  # (fetching input from clipboard)
$ avro parse "asolei!" --copy  # (copying output to clipboard)
$ avro parse --from-clip --copy  # (clipboard input -> output)
```

<br>

## 🛠️ Contributing

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

---

**Additional Developer Notes**

In short, avro.py doesn't depend on any third-party libraries. However, if you'd like to contribute to the project, you'll need a handful of such useful tools.

**Poetry** has been used to manage the project's dependencies and virtual environment. You can install it by following [the instructions here](https://python-poetry.org/docs/). The dependencies have been configured using the `pyproject.toml` file and doesn't require manual installation. Simply set up your developer environment using the following commands: <br>

```sh
# Set up virtual environment and activate it.
$ python3 -m venv venv && source venv/bin/activate

# Install required first-party dependencies and Poetry for dependency management.
# (Note: Skip this step if Poetry is globally installed and added to PATH.)
$ pip install -U pip setuptools && pip install poetry

# Setup project using Poetry.
$ poetry install --all-extras
```

### 🐛 We're looking for bug hunters, by the way!

If you come across any kind of bug or wanna request a feature, please let us know by opening an issue [here](https://github.com/hitblast/avro.py/issues). We do need more ideas to keep the project alive and running, don't we? :P

---

<br>

## 👑 Acknowledgements

- [Mehdi Hasan Khan](https://github.com/mugli) for originally developing and maintaining [Avro Phonetic](https://github.com/omicronlab/Avro-Keyboard).
- [Rifat Nabi](https://github.com/torifat) for porting it to Javascript.
- [Sarim Khan](https://github.com/sarim) for writing ibus-avro which helped to clarify my concepts further.
- [Kaustav Das Modak](https://github.com/kaustavdm) for porting Rifat Nabi's JavaScript iteration to Python 2.
- Md Enzam Hossain for helping him understand the ins and outs of the Avro dictionary and the way it works.

<br>

## 📋 License

Licensed under the [MIT License](https://github.com/hitblast/avro.py/blob/main/LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/avro-py",
    "name": "avro-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "python, phonetics, avro, avro phonetic, bangla, bengali, bengali phonetics, transliteration",
    "author": "HitBlast",
    "author_email": "hitblastlive@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6a/04/8601aefb5df8049d0ed0b4f6a1ddb42c504d4d6972f0c4faf729064ce093/avro_py-2024.5.1.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\" height=\"40px\"/> avro.py\n\nA modern Pythonic implementation of the popular Bengali phonetic-typing software **Avro Phonetic.**\n\n[![Downloads](https://static.pepy.tech/personalized-badge/avro-py?period=total&units=international_system&left_color=grey&right_color=black&left_text=Downloads)](https://pepy.tech/project/avro-py)\n![Python Version](https://img.shields.io/pypi/pyversions/avro.py.svg?color=black&label=Python)\n![License](https://img.shields.io/pypi/l/avro.py.svg?color=black&label=License)\n\n<br>\n\n<img src=\"https://github.com/hitblast/avro.py/blob/main/assets/banner.png\" style=\"width: 500px; height: auto;\"><br>\n\n[![Unit Tests](https://github.com/hitblast/avro.py/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/hitblast/avro.py/actions/workflows/unit-tests.yml)\n[![Linting](https://github.com/hitblast/avro.py/actions/workflows/linting.yml/badge.svg)](https://github.com/hitblast/avro.py/actions/workflows/linting.yml)\n[![Formatting](https://github.com/hitblast/avro.py/actions/workflows/formatting.yml/badge.svg)](https://github.com/hitblast/avro.py/actions/workflows/formatting.yml)\n\n<br>\n\n</div>\n\n## \u26a1 Overview\n\n**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).\n\n> The original project ([pyAvroPhonetic](https://github.com/kaustavdm/pyAvroPhonetic)) can only be used on versions up to **Python 2.7** and doesn't contain proper support for Python's third major version AKA Python 3. It is noteworthy that Python 2 has officially been deprecated by the original maintainers and its usage is being discouraged overall. <br>\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.8 or higher** to be used inside your development environment.\n\n```sh\n# Install / upgrade.\n$ pip install avro.py\n```\n\n<br>\n\n## \ud83d\udd16 Usage Guide\n\n### 1. `parse()`\nThis is the most basic use case for avro.py, which includes parsing English Roman script to unicode Bengali:\n\n```python\n# Imports.\nimport avro\n\n# Parsing some text.\noutput = avro.parse('ami banglay gan gai.')\nprint(output)\n```\n\n### 2. `parse(bijoy=True)`\nAlternatively, we can generate the same output, but in compliance with the Bijoy Keyboard format:\n\n```python\n# Parsing some text in Bijoy!\noutput = avro.parse('tumi emon keno?', bijoy=True)\n```\n\n### 3. `to_bijoy()`\nWe can also use avro.py to convert existing unicode Bengali to its Bijoy Keyboard equivalent:\n\n```python\n# Converting some text.\nbijoy_text = avro.to_bijoy('\u0986\u09ae\u09bf \u09ac\u09be\u0982\u09b2\u09be\u09df \u0997\u09be\u09a8 \u0997\u09be\u0987\u0964')\n```\n\n### 4. `reverse()`\nFinally, you can reverse unicode Bengali to English as well (newly added).\n\n```python\n# Reversing back!\nreversed_text = avro.reverse('\u0986\u09ae\u09be\u09b0 \u09b8\u09cb\u09a8\u09be\u09b0 \u09ac\u09be\u0982\u09b2\u09be\u0964')\n```\n\n---\n\n## \ud83d\udd16 Command Line Usage\n\nAlternatively, instead of using avro.py from within your Python project, you can also use it as a simple,\ntiny command-line interface for easy parsing and reversing of text.\n\n```sh\n# Installing the package.\n$ pip install avro.py[cli]\n```\n\nHere are some examples for you to get started with:\n\n```sh\n# Main help section.\n$ avro --help  # or, use: avro <command> --help\n\n# Parsing some text.\n$ avro parse \"tumi onek bhalO!\"\n$ avro parse --bijoy \"amio kharap na, taina?\"  # (bijoy keyboard format)\n\n# Reversing.\n$ avro reverse \"\u09a4\u09be\u0987 \u09a4\u09cb!\"\n\n# Using additional flags to ease workflow.\n$ avro parse --from-clip  # (fetching input from clipboard)\n$ avro parse \"asolei!\" --copy  # (copying output to clipboard)\n$ avro parse --from-clip --copy  # (clipboard input -> output)\n```\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\n---\n\n**Additional Developer Notes**\n\nIn short, avro.py doesn't depend on any third-party libraries. However, if you'd like to contribute to the project, you'll need a handful of such useful tools.\n\n**Poetry** has been used to manage the project's dependencies and virtual environment. You can install it by following [the instructions here](https://python-poetry.org/docs/). The dependencies have been configured using the `pyproject.toml` file and doesn't require manual installation. Simply set up your developer environment using the following commands: <br>\n\n```sh\n# Set up virtual environment and activate it.\n$ python3 -m venv venv && source venv/bin/activate\n\n# Install required first-party dependencies and Poetry for dependency management.\n# (Note: Skip this step if Poetry is globally installed and added to PATH.)\n$ pip install -U pip setuptools && pip install poetry\n\n# Setup project using Poetry.\n$ poetry install --all-extras\n```\n\n### \ud83d\udc1b We're looking for bug hunters, by the way!\n\nIf you come across any kind of bug or wanna request a feature, please let us know by opening an issue [here](https://github.com/hitblast/avro.py/issues). We do need more ideas to keep the project alive and running, don't we? :P\n\n---\n\n<br>\n\n## \ud83d\udc51 Acknowledgements\n\n- [Mehdi Hasan Khan](https://github.com/mugli) for originally developing and maintaining [Avro Phonetic](https://github.com/omicronlab/Avro-Keyboard).\n- [Rifat Nabi](https://github.com/torifat) for porting it to Javascript.\n- [Sarim Khan](https://github.com/sarim) for writing ibus-avro which helped to clarify my concepts further.\n- [Kaustav Das Modak](https://github.com/kaustavdm) for porting Rifat Nabi's JavaScript iteration to Python 2.\n- Md Enzam Hossain for helping him understand the ins and outs of the Avro dictionary and the way it works.\n\n<br>\n\n## \ud83d\udccb License\n\nLicensed under the [MIT License](https://github.com/hitblast/avro.py/blob/main/LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A modern Pythonic implementation of Avro Phonetic.",
    "version": "2024.5.1",
    "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": [
        "python",
        " phonetics",
        " avro",
        " avro phonetic",
        " bangla",
        " bengali",
        " bengali phonetics",
        " transliteration"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a78b2d35d53ccd3064e51f96c242b91ac5e659c96d57a9e1ffbb6944e05be92",
                "md5": "99e7c8499f70851f1501d6d1f30a5ebb",
                "sha256": "844ccb2dc37e1a4d880bc8b1adac0b96186dde9817cb6cbe0473183e49d920ea"
            },
            "downloads": -1,
            "filename": "avro_py-2024.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "99e7c8499f70851f1501d6d1f30a5ebb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 17627,
            "upload_time": "2024-05-01T12:03:17",
            "upload_time_iso_8601": "2024-05-01T12:03:17.235464Z",
            "url": "https://files.pythonhosted.org/packages/9a/78/b2d35d53ccd3064e51f96c242b91ac5e659c96d57a9e1ffbb6944e05be92/avro_py-2024.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a048601aefb5df8049d0ed0b4f6a1ddb42c504d4d6972f0c4faf729064ce093",
                "md5": "f1da27db9b88bef6b8228eb4143d4a83",
                "sha256": "83442b6a225336cfdd659704b7076bdd9542b8665520ba6939ae568470adc58a"
            },
            "downloads": -1,
            "filename": "avro_py-2024.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f1da27db9b88bef6b8228eb4143d4a83",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 17871,
            "upload_time": "2024-05-01T12:03:19",
            "upload_time_iso_8601": "2024-05-01T12:03:19.325977Z",
            "url": "https://files.pythonhosted.org/packages/6a/04/8601aefb5df8049d0ed0b4f6a1ddb42c504d4d6972f0c4faf729064ce093/avro_py-2024.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-01 12:03:19",
    "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"
}
        
Elapsed time: 0.23444s