Skip to main content

nepali-date-numword

nepali-date-numword converts numbers and dates into grammatically correct Nepali words. It supports Nepali number wording, Gregorian date wording, Bikram Sambat date wording, currency suffixes, negative values, floats, and a small CLI for everyday use.

Features

  • Convert integers using the Nepali numbering system: सय, हजार, लाख, करोड, अरब
  • Handle irregular Nepali values from 0 to 100
  • Support negative numbers and floating-point values
  • Add currency suffixes like रुपैयाँ
  • Convert Gregorian dates into Nepali words
  • Convert Bikram Sambat dates into Nepali words
  • Convert AD dates to BS output with use_bs=True
  • Provide CLI support for numbers and dates

Installation

pip install nepali-date-numword

Python 3.10 or newer is required.

For local development:

pip install -e .[dev]

Quick Usage

from datetime import date

from nepali_date_numword import date_to_words, number_to_words, text_to_words

print(number_to_words(123))
# एक सय तेइस

print(number_to_words(-12.5))
# माइनस बाह्र दशमलव पाँच

print(number_to_words(123, currency=True))
# एक सय तेइस रुपैयाँ

print(date_to_words("2024-01-15", calendar="AD"))
# सन् दुई हजार चौबीस जनवरी पन्ध्र तारिख

print(date_to_words("2080-10-01", calendar="BS"))
# वि.सं. दुई हजार अस्सी माघ एक गते

print(date_to_words(date(2024, 1, 15), calendar="AD", use_bs=True))
# वि.सं. दुई हजार अस्सी माघ एक गते

print(date_to_words("2024-01-15", short=True))
# १५ जनवरी २०२४

print(text_to_words("I paid Rs. 123 on 2024-01-15."))
# I paid एक सय तेइस रुपैयाँ on सन् दुई हजार चौबीस जनवरी पन्ध्र तारिख.

API

number_to_words(number, currency=False)

Convert an integer or floating-point value into Nepali words.

Examples:

number_to_words(0)
number_to_words(100000)
number_to_words(12.5)
number_to_words(123, currency=True)

date_to_words(value, calendar="AD", use_bs=False, short=False)

Convert a Gregorian or Bikram Sambat date into Nepali words.

Accepted input forms:

  • ISO string: "2024-01-15"
  • datetime.date or datetime.datetime
  • Tuple: (2024, 1, 15)

Examples:

date_to_words("2024-01-15", calendar="AD")
date_to_words("2080-10-01", calendar="BS")
date_to_words((2024, 1, 15), calendar="AD", use_bs=True)

text_to_words(text, use_bs=False, include_suffix=True, short_dates=False)

Convert mixed sentences by detecting:

  • ISO dates such as 2024-01-15
  • plain numbers such as 123 or 12.5
  • currency patterns such as Rs. 500, NPR 500, or 500 रुपैयाँ

Example:

text_to_words("Invoice total is Rs. 123 and due on 2024-01-15.")

CLI

nepali-date-numword 123
nepali-date-numword --currency 123
nepali-date-numword --date 2024-01-15
nepali-date-numword --date 2024-01-15 --bs
nepali-date-numword --date 2080-10-01 --calendar BS
nepali-date-numword --date 2024-01-15 --short
nepali-date-numword --text "I paid Rs. 123 on 2024-01-15."

Development

Run tests with:

pytest

Notes

  • use_bs=True converts Gregorian input into Bikram Sambat output.
  • BS formatting works directly for explicit BS input such as 2080-10-01.
  • The package keeps bsdatetime as a runtime dependency so installed distributions can do AD-to-BS conversion accurately.

License

MIT

Metadata

Release files for nepali-date-numword 0.1.2

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

Source distribution (sdist)

Source distribution for nepali-date-numword 0.1.2
File Size Uploaded Provenance
nepali_date_numword-0.1.2.tar.gz 11.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nepali-date-numword 0.1.2
File Interpreter ABI Platform
nepali_date_numword-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / nepali_date_numword-0.1.2.tar.gz

Download URL nepali_date_numword-0.1.2.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
242a6fd0a7a97c90a564ab611103b55492e1bb03768adf886a42e9be782374e6
BLAKE2b-256 checksum
How to use checksums
04432a8053ea9e6e8212f2b57cafda3766e81697d87ebf58207f3f5a754ab3e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Release files / nepali_date_numword-0.1.2-py3-none-any.whl

Download URL nepali_date_numword-0.1.2-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2560df0ec7569a092ae94a4097630ea72262ceea233e82d2cd1e8b84225718d2
BLAKE2b-256 checksum
How to use checksums
a3a25e4958c4cdeb5b4c7b54550093cd7963d92267817e6e6aa9edb0ac969c50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Security for nepali-date-numword 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nepali_date_numword-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

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.

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