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-libraryQuick 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
| Feature | Support | Description |
|---|---|---|
| Bikram Sambat Calendar Engine | Yes | Calendar matrix spanning 1976 through 2100 BS, audited and updated annually each Ashwin. |
| Bidirectional AD to BS Conversion | Yes | Standalone conversion functions and full object instances. |
| Date Arithmetic | Yes | Add and subtract days, months, and years with automatic rollover. |
| Fiscal Year Operations | Yes | Official Nepalese fiscal calendar starting on 1 Shrawan. |
| Custom Format Patterns | Yes | Token formatting for year, month, weekday, and Devanagari script. |
| Calendar Grid Builder | Yes | Forty two cell matrix generation for calendar interfaces. |
Package Information
| Specification | Details |
|---|---|
| PyPI Package | nepali-date-library |
| Repository | GitHub |
| Supported Python | Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13+ |
| License | MIT License |
Advertisement