Skip to main content

Python package for nepali processes

Project description


Python package for processing every nepali stuffs


Python >= 3


pip install nepali


  1. English to Nepali, Nepali to English date conversions with Nepali Timezone
  2. Nepali Characters (Months, Days, etc)
  3. Number to nepali numbers and nepali numbers to english.


Represents nepali date, converts English date to nepali date and nepali date to english date

from nepali.datetime import NepaliDate  

Creating new object

# object with current date
np_date = NepaliDate(year, month, day)

# object with today's date
np_date =

Object from python's

import datetime

date =
np_date = NepaliDate.from_date(date)

Get python's object


Get python's datetime.datetime object



Represents nepali date time

from nepali.datetime import NepaliDateTime  

Creating new object

# object with specific datetime
np_datetime = NepaliDateTime(year, month, day[, hour[, minute[, second]]]) # arguments must be nepali

# object with current datetime
np_datetime =

Object from python's datetime.datetime

import datetime

dt =
np_datetime = NepaliDateTime.from_datetime(dt)

Get NepaliDate object

Get python's datetime.time object


Get python's datetime.datetime object


Date String Format
Equivalent to python's datetime strftime format

npDateTime =
print(npDateTime.strftime('%a %A %w %d %b %B %m %y %Y %H %I %p %M %S'))
print(npDateTime.strftime_en('%a %A %w %d %b %B %m %y %Y %H %I %p %M %S'))
बुध बुधबार ३ २६ मंसिर मंसिर ०८ ७५ २०७५ ११ ११ शुभप्रभात ०६ १३
Wed Wednesday 3 26 Mangsir Mangsir 08 75 2075 11 11 AM 06 13

timedelta operations

ndt =
print(ndt + datetime.timedelta(hours=5))
print(ndt - datetime.timedelta(hours=5))


HumanizeDate converts NepaliDateTime to nepali human readable form

from nepali.datetime import HumanizeDateTime  

Creating new object

# object from nepali datetime
ndt =
humanize = HumanizeDateTime(ndt)

# object from python datetime
dt =
humanize = HumanizeDateTime(dt)

Get string


Humanize with threshold
returns date in nepali characters if more than threshold(in seconds) else returns humanize form

humanize = HumanizeDateTime(ndt, threshold=60) # 60 seconds

# custom format after threshold
humanize = HumanizeDateTime(ndt, threshold=60, format='%Y-%m-%d') # 60 seconds

For Django Template

Add 'nepali' to your INSTALLED_APPS setting.


IN your Template

{% load nepalidatetime %}
{% nepalinow %}
{% nepalinow '%Y-%m-%d' %}
{{ datetimeobj|nepalidate:"%Y-%m-%d" }}
{{ datetimeobj|nepalihumanize }}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nepali, version 0.4.2
Filename, size File type Python version Upload date Hashes
Filename, size nepali-0.4.2-py3-none-any.whl (12.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size nepali-0.4.2.tar.gz (11.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page