Skip to main content

Calendar for Bikram Sambat

Project description

Bikram Sambat Calendar

Installation

pip install bscal     # or: pipx install bscal

bscal

$ bscal
     Poush 2080
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29

Pass year for a year view, year month for a single month.

bsdate

$ bsdate                          # now
Tue Poush 17 09:14:14 +0545 2080

$ bsdate 2016-09-08               # AD date
Thu Bhadra 23 09:17:21 +0545 2073

$ bsdate 1473305798               # unix timestamp
Thu Bhadra 23 09:21:38 +0545 2073

$ bsdate -c 2073-05-23            # BS to AD
Thu Sep  8 09:19:00 +0545 2016

Flags: -I[FMT] for ISO 8601 (date|hours|minutes|seconds), +FORMAT for BS-aware strftime, -u for UTC.

Python

BSDate is a datetime.date for Bikram Sambat. Same constructors, accessors, arithmetic, ordering. strftime tokens are BS-aware.

from datetime import date
from bscal import BSDate, bs_to_ad, ad_to_bs

BSDate.today()
BSDate.fromisoformat("2081-01-01")
BSDate.from_ad(date(2024, 4, 13)).to_ad()

bs_to_ad(2081, 1, 1)         # (y, m, d) -> date
ad_to_bs(date(2024, 4, 13))  # date -> (y, m, d)

bscal.cal is the stdlib calendar for BS: isleap, leapdays, weekday, monthrange, month_name, month_abbr, and a BSCalendar (subclass of calendar.TextCalendar).

Project details


Download files

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

Source Distribution

bscal-0.0.8.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bscal-0.0.8-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file bscal-0.0.8.tar.gz.

File metadata

  • Download URL: bscal-0.0.8.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bscal-0.0.8.tar.gz
Algorithm Hash digest
SHA256 66bb75dbbf057196105ae199c04507d7fa9236ecbd27c1fd063fc62feef879af
MD5 0b41c28ab1be3bf84dbaf14676b39566
BLAKE2b-256 74fc156542b793271d6ea25d3087ed4056306c4edba92d79bed42550e462473b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bscal-0.0.8.tar.gz:

Publisher: build.yml on skshetry/bscal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bscal-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: bscal-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bscal-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a515d0b506abdbbf12a7a3b009fedf58884683e23629b98071f742204c85509b
MD5 b465dee5f180956af9fb8de592a22733
BLAKE2b-256 7dbfaa2df06f5868ad4d3663cbf59e4e94d929f35793be443d618e5a76368d73

See more details on using hashes here.

Provenance

The following attestation bundles were made for bscal-0.0.8-py3-none-any.whl:

Publisher: build.yml on skshetry/bscal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page