Skip to main content

A Python package to convert numbers to Nepali words

Project description

Nepali Number to Word Converter

A Python package that converts numbers to Nepali words and numerals following proper OOP principles.

Features

  • Convert numbers to Nepali words (up to 99 खर्ब)
  • Convert numbers to Nepali numerals with proper formatting (१,२३,४५६ /-)
  • Support for positive and negative numbers
  • Proper error handling for unsupported numbers

Installation

  1. Install the package:
pip install nepali_number_to_word

Usage

from nepali_number_to_word import NepaliNumberConverter

# Convert numbers to Nepali words (class method)
result = NepaliNumberConverter.convert_to_nepali_words(123456789)
print(result)  # Output: बाह्र करोड चौतिस लाख छपन्न हजार सात सय उनान्नब्बे रूपैयाँ मात्र

# Convert numbers to Nepali numerals (static method)
result = NepaliNumberConverter.convert_to_nepali_numerals(123456789)
print(result)  # Output: १२,३४,५६,७८९ /-

# Examples
print(NepaliNumberConverter.convert_to_nepali_words(123))      # एक सय तेइस रूपैयाँ मात्र
print(NepaliNumberConverter.convert_to_nepali_numerals(123))   # १२३ /-

# Error handling
try:
    NepaliNumberConverter.convert_to_nepali_words(1000000000000000)  # Raises ValueError
except ValueError as e:
    print(e)  # Numbers beyond 999,999,999,999,999 (99 खर्ब) are not supported

Number Units

The converter supports the following Nepali number units:

  • खर्ब (Kharab) = 100,000,000,000
  • अरब (Arab) = 1,000,000,000
  • करोड (Crore) = 10,000,000
  • लाख (Lakh) = 100,000
  • हजार (Thousand) = 1,000

License

MIT License

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

nepali_number_to_word-0.1.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

nepali_number_to_word-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file nepali_number_to_word-0.1.1.tar.gz.

File metadata

  • Download URL: nepali_number_to_word-0.1.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for nepali_number_to_word-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c030bab20a18609496f989c63ed193cc1884444d84b8f8eacbdbb5fe2f02c6a4
MD5 0d2178c976db4470539a6173f81c95a3
BLAKE2b-256 a15e03fb3c970a7e2ee785c4451466d4b8080f9398d7a0f969fa120d960a90c6

See more details on using hashes here.

File details

Details for the file nepali_number_to_word-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nepali_number_to_word-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b8e97ce7ac42e9e785b51c63a1efeec3235193aa2f2a73f5ee5b529e930c822
MD5 23de867dc00dae1535c35ab815a04688
BLAKE2b-256 7fcd88f63f15be1045bc7c87ff8737754d88c90e82348e9d5c5fa29b44676ad2

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