Skip to main content

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

Metadata

Release files for bsdatetime 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bsdatetime 1.0.1
File Size Uploaded Provenance Actions
bsdatetime-1.0.1.tar.gz 10.7 kB Without provenance Details for bsdatetime-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bsdatetime 1.0.1
File Interpreter ABI Platform Actions
bsdatetime-1.0.1-py3-none-any.whl Python 3 none any Details for bsdatetime-1.0.1-py3-none-any.whl

Total release size: 21.3 kB

Release files / bsdatetime-1.0.1.tar.gz

Download URL bsdatetime-1.0.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
52a52f57fb2c30aeb85356f3f9c6861eaec9f349fa9f93da13098903084bfe16
BLAKE2b-256 checksum
How to use checksums
f883c7b7d56a9e2e532b60e601d32427ab8cf4d9b9723947d5d06d2b069be561
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / bsdatetime-1.0.1-py3-none-any.whl

Download URL bsdatetime-1.0.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9250519ceb6659b9a31a206c8fac24ced9b1ed44e02e709e276d631f9b4dff5
BLAKE2b-256 checksum
How to use checksums
f9f04b326e8c466a3f3b54b1b289d44912416a62ca677c1870456a686fd08def
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for bsdatetime 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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