Nepali DateNepali DateBikram Sambat Date Engine

Overview

Complete documentation and feature guide for the Nepali Date Library in Python applications.

The Nepali Date Library for Python provides a clean and idiomatic toolkit with zero external dependencies for Bikram Sambat calendar operations. It handles bidirectional conversion between Bikram Sambat and Gregorian calendars, date arithmetic, custom string formatting, fiscal year calculations, and calendar grid generation for Python applications and data pipelines.


Installation

Install the package from PyPI using your package manager:

pip install nepali-date-library

Quick Example

from nepali_date_library import NepaliDate, ADtoBS, BStoAD

# Current Nepali date
today = NepaliDate()
print(today.format("YYYY-MM-DD"))

# Specific Bikram Sambat date (month 0 is Baisakh)
event = NepaliDate(2081, 6, 15)
print(event.format("dddd, MMMM DD, YYYY"))

# Standalone date conversion
bs_date = ADtoBS("2024-11-15")
ad_date = BStoAD("2081-07-30")

Feature Matrix

FeatureSupportDescription
Bikram Sambat Calendar EngineYesCalendar matrix spanning 1976 through 2100 BS, audited and updated annually each Ashwin.
Bidirectional AD to BS ConversionYesStandalone conversion functions and full object instances.
Date ArithmeticYesAdd and subtract days, months, and years with automatic rollover.
Fiscal Year OperationsYesOfficial Nepalese fiscal calendar starting on 1 Shrawan.
Custom Format PatternsYesToken formatting for year, month, weekday, and Devanagari script.
Calendar Grid BuilderYesForty two cell matrix generation for calendar interfaces.

Package Information

SpecificationDetails
PyPI Packagenepali-date-library
RepositoryGitHub
Supported PythonPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13+
LicenseMIT License
Advertisement

On this page