Bikram Sambat (Nepali) date/datetime conversion and utilities
Project description
bsdatetime
Lightweight, dependency‑free Bikram Sambat (Nepali) calendar utilities for Python.
Documentation: https://rajendra-katuwal.github.io/bsdatetime.docs/
What it does
- Convert between Gregorian (AD) and Bikram Sambat (BS)
- Format / parse BS dates (localized month + weekday names)
- Validate dates, get fiscal year, week number, ranges
- Provide current BS date/time helpers
Install
pip install bsdatetime
Quick start
import datetime, bsdatetime as bs
ad = datetime.date(2024, 12, 25)
bs_tuple = bs.ad_to_bs(ad) # (2081, 9, 9)
ad_back = bs.bs_to_ad(*bs_tuple) # 2024-12-25
text = bs.format_bs_date(*bs_tuple, "%B %d, %Y") # भदौ 09, 2081
current_bs = bs.utils.get_current_bs_date()
Core API (most used)
- ad_to_bs(date)
- bs_to_ad(y, m, d)
- format_bs_date(y, m, d, fmt)
- parse_bs_date(text, fmt)
- is_valid_bs_date(y, m, d)
- utils.get_current_bs_date()
Supported range: BS 1975–2100 (≈ AD 1918–2043)
Django?
Use the companion package for model fields:
pip install django-bsdatetime
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bsdatetime-1.0.0.tar.gz.
File metadata
- Download URL: bsdatetime-1.0.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e4a9f81022350ebd83bc4076181f754df500ca8334970f3a12a1c949ba4a4ee
|
|
| MD5 |
0c49f995768f859235a12ee5054f2888
|
|
| BLAKE2b-256 |
83b8455f4795a5cda9ee74bb662676aafefeea8e68592e17d810f8d52e3b05a2
|
File details
Details for the file bsdatetime-1.0.0-py3-none-any.whl.
File metadata
- Download URL: bsdatetime-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b4d90e37cca1d2a7e3af10119ac742cd7e6626f1188d2097655b71c9b2f8c8c
|
|
| MD5 |
06bd4f9018911730a7551f2eb37cdca7
|
|
| BLAKE2b-256 |
8959927c2267c2280e03c6a2047099582c33275b28ab6fd405c8094c220dc804
|