Metadata-Version: 2.5
Name: bnspellnum
Version: 0.1.0
Summary: Spell out numbers in Bangla: words, currency (taka/paisa), ordinals, years and dates. Zero dependencies.
Project-URL: Homepage, https://github.com/ediphasLabs/bnspellnum
Project-URL: Issues, https://github.com/ediphasLabs/bnspellnum/issues
Project-URL: Specification, https://github.com/ediphasLabs/bnspellnum/blob/main/spec/SPEC.md
Author: Ediphas Labs
License: MIT
License-File: LICENSE
Keywords: bangla,bengali,i18n,nlp,number-to-words,numbers,taka
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Bengali
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Internationalization
Classifier: Topic :: Software Development :: Localization
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: test
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

# bnspellnum for Python

Spell out numbers in Bangla: words, taka/paisa, ordinals, years and dates.
Zero dependencies, Python ≥ 3.10. Implements the
[bnspellnum spec](https://github.com/ediphasLabs/bnspellnum/blob/main/spec/SPEC.md) `1.0.0`,
and gives the same output as the JavaScript, PHP, C# and C++ packages.

```bash
pip install bnspellnum
```

```python
import bnspellnum as bn

bn.words(1250000)                    # 'বারো লাখ পঞ্চাশ হাজার'
bn.words(200, style="formal")        # 'দুইশত'
bn.words("-3.25")                    # 'ঋণাত্মক তিন দশমিক দুই পাঁচ'
bn.currency("1250.50", cheque=True)  # 'এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা মাত্র'
bn.ordinal(2), bn.ordinal(2, short=True)  # ('দ্বিতীয়', '২য়')
bn.year(1971)                        # 'উনিশশো একাত্তর'
bn.date(16, 12, 1971)                # 'ষোলোই ডিসেম্বর উনিশশো একাত্তর'
bn.date(28, 11, style="short")       # '২৮শে নভেম্বর'
bn.to_bn_digits("2026")              # '২০২৬'
bn.to_en_digits("১২,৫০,০০০")         # '12,50,000'
```

- Accepts `int`, `str` (ASCII or Bangla digits, `,` separators, one `.`) and
  `decimal.Decimal`. `float` raises `InvalidInputError`; pass a string instead.
- Errors: `InvalidInputError` and `OutOfRangeError`, both subclasses of
  `BnSpellNumError` (itself a `ValueError`).
- Fully typed (`py.typed`).

Full documentation, options and spelling decisions are in the
[project README](https://github.com/ediphasLabs/bnspellnum#readme). MIT © Ediphas Labs.
