Skip to main content

Azerbaijani number-to-words converter for Python

Project description

aznum2words - Azerbaijani Number to Words Converter for Python

aznum2words is a lightweight Python library for converting numbers to Azerbaijani words. It works as an Azerbaijani num2words style converter for integers, decimals, negative numbers, and numeric strings that use either . or , as the decimal separator.

PyPI version Python versions License: MIT Typed Language: Azerbaijani

Features

  • Convert integers to Azerbaijani text: 123 -> yüz iyirmi üç
  • Convert decimal numbers with Azerbaijani fraction wording
  • Handle negative numbers with mənfi
  • Accept int, float, str, and Decimal
  • Support both . and , decimal separators in strings
  • Keep Decimal fractional precision for amount-style text
  • Zero runtime dependencies
  • Typed package marker included for type checkers

Installation

pip install aznum2words

Quick Start

from decimal import Decimal

from aznum2words import AzerbaijaniNumberConverter, convert, num2words

converter = AzerbaijaniNumberConverter()

converter.convert(123456789)
# "yüz iyirmi üç milyon dörd yüz əlli altı min yeddi yüz səksən doqquz"

convert("1,25")
# "bir tam yüzdə iyirmi beş"

num2words(Decimal("0.001"))
# "sıfır tam mində bir"

Examples

from aznum2words import convert

convert(0)
# "sıfır"

convert(-42)
# "mənfi qırx iki"

convert("1001")
# "min bir"

convert("2.7021")
# "iki tam on mində yeddi min iyirmi bir"

Use Cases

aznum2words is useful for Azerbaijani localization, invoices, receipts, financial documents, legal documents, reports, form generation, and applications that need to display numbers as Azerbaijani text.

Common search terms for this package include Azerbaijani number to words, number-to-words Azerbaijani, Azeri num2words, Azerbaijani number converter, Python numbers to words, and Azerbaijani amount in words.

API

The package exposes three public imports:

from aznum2words import AzerbaijaniNumberConverter, convert, num2words

convert(number) and num2words(number) use a shared default converter. Instantiate AzerbaijaniNumberConverter when you prefer an explicit converter object.

Development

python -m pip install -e ".[dev]"
python -m pytest

The package supports Python 3.9+ and has no runtime dependencies.

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

aznum2words-1.0.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

aznum2words-1.0.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file aznum2words-1.0.1.tar.gz.

File metadata

  • Download URL: aznum2words-1.0.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for aznum2words-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4529267d5464648ca2118b39568886d83c33d1d40685609b079e71d76d0218ee
MD5 c06b4db7b4d1414851d8f46b76912c85
BLAKE2b-256 e0423b9b204a52865583f52062dba86ef5ea94ff4072cedb28dc79eb78a11257

See more details on using hashes here.

File details

Details for the file aznum2words-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: aznum2words-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for aznum2words-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb11a9a0a05e4fdd947520ef1555c3c52f20c31fd44a7cdd71b956efb7f9dc4d
MD5 9ca858ae219b83f69e59a57cb89ed3b8
BLAKE2b-256 651f66541cb54e3c475a355b989b818f2127d8a1db85af94ba993980dd496c4f

See more details on using hashes here.

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