Skip to main content

Nepali Phone Number

Nepali Phone Number is a Python library for dealing with nepali phone numbers with both nepali and english inputs.

Installation

Use the package manager pip to install nepali-phone-number.

pip install nepali-phone-number

Usage

Nepali Phone Number

from nepali_phone_number import NepaliPhoneNumber

phone_number = NepaliPhoneNumber(nepali_number_input='९८४६५११९६२') # for nepali input

phone_number.convert_to_english()   # returns "9846511962"
phone_number.is_valid_number()      # returns "True" for valid number and "False" for invalid number
phone_number.get_number_detail()    # returns number detail eg. {'number': '9846511962', 'network_provider': 'NTC'}

phone_number.get_number_detail()    # returns {'number': '9816154724', 'network_provider': 'NCELL', 'zone': 'Gandaki', 'sim_type': 'Prepaid'}
                                    # in case of ncell number


phone_number = NepaliPhoneNumber(english_number_input='9846511962')    # for english input
phone_number.convert_to_nepali()    # returns "९८४६५११९६२"

Nepali LandLine Number

from nepali_phone_number import NepaliLandLineNumber

land_line_number = NepaliLandLineNumber(nepali_number_input='०६१५२८५१८') # for nepali input

land_line_number.convert_to_english()   # returns "061538518"
land_line_number.is_valid_number()      # returns "True" for valid number and "False" for invalid number
land_line_number.get_number_detail()    # returns number detail eg. {'number': '061538518', 'area': 'Kaski'}


phone_number = NepaliLandLineNumber(english_number_input='061538518')    # for english input
phone_number.convert_to_nepali()    # returns "०६१५२८५१८"

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for nepali-phone-number 0.0.3

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-phone-number 0.0.3
File Size Uploaded
nepali-phone-number-0.0.3.tar.gz 6.4 kB Details

Release files / nepali-phone-number-0.0.3.tar.gz

Download URL nepali-phone-number-0.0.3.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7a61fee9987c5112f8dc30ef62ab448a3e097726600f73898f1e80a661e528f0
BLAKE2b-256 checksum
How to use checksums
ad4294ed25e664b9bcc3db63ad9113a286384f2df2eb73d3ef4925a2f5a90b82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

1 release file

0.0.1

1 release file

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