Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

NepDate for Python logo

nepdate-python

CI nepdate-core on PyPI nepdate-patro on PyPI Python versions License: MIT

Bikram Sambat (Nepali calendar) dates, conversion, formatting and parsing for Python 3.11 and newer. Part of the NepDate family: the shared data and spec live in the hub sanamhub/nepdate; the C# original is NepDate.

Status: 0.1.0-beta.1 (0.1.0b1 on PyPI), the first public pre-release. The API is listed in docs/API.md and may still change before 0.1.0. Patro data (tithi, holidays, events) is informational, not an official calendar.

  • Import nepdate. The core distribution is nepdate-core, because nepdate on PyPI belongs to an unrelated project (ADR-0007).
  • Tithi, public holidays and events are a separate distribution, nepdate-patro (import nepdate_patro). The core has none of that data.
  • Pure Python, zero runtime dependencies (except tzdata on Windows, for today()), typed (py.typed), and works on free-threaded 3.14t.
  • BS 1901-01-01 to 2199-12-30 (AD 1844-04-11 to 2143-04-15). Same results as C# NepDate and the other ports, proved by the shared vectors.

Install

pip install --pre nepdate-core

--pre is needed while only pre-releases exist; pin nepdate-core==0.1.0b1 to stay on this one.

Quick start

>>> from nepdate import Lang, NepaliDate
>>> d = NepaliDate(2080, 5, 15)
>>> str(d)
'2080/05/15'
>>> d.to_date()
datetime.date(2023, 9, 1)
>>> d.long(weekday=True, lang=Lang.NE)
'शुक्रवार, भदौ १५, २०८०'
>>> NepaliDate.parse("2080/05/15") == d
True

Arithmetic stays on the BS calendar, so month lengths come from the shared data rather than from the Gregorian calendar:

>>> d.add_days(1000)
NepaliDate(2083, 2, 14)
>>> d.add_months(13)
NepaliDate(2081, 6, 15)
>>> d.fiscal_year().label()
'2080/81'

Patro: tithi, holidays and events

The core has no patro data. Install both distributions:

pip install --pre nepdate-core nepdate-patro
>>> from nepdate import Lang, NepaliDate
>>> from nepdate_patro import coverage, info
>>> day = info(NepaliDate(2080, 5, 15))
>>> day.is_public_holiday
True
>>> day.tithi.label(Lang.EN)
'Dwitiya'
>>> [event.label(Lang.EN) for event in day.events]
['Saparu (Gaijatra) (Kathmandu Holiday)', 'Ropain Jatra']
>>> coverage().start
NepaliDate(2077, 1, 1)

info never raises: a date outside the coverage returns one shared empty CalendarInfo. The data currently covers BS 2077-01-01 to 2084-08-20.

API

The complete signatures, defaults and exceptions are in the API contract.

Module Exported names
nepdate MIN, MAX, NepaliDate, Lang, Month, Weekday, Overflow, DateOrder, Separator, DateDiff, FiscalYear, Quarter, DateRange, ErrorKind, NepDateError, to_nepali_digits
nepdate_patro Tithi, Event, CalendarInfo, info, coverage, public_holidays

Documentation

Page What it covers
API The complete public surface
Benchmarks B1 to B8 against the other Python packages and C# NepDate
Competitors The Python packages in the benchmark
Mutation testing How the test suite is checked against mutmut
Fuzzing How the parsers and formatter are fuzzed with atheris
Release The pre-tag matrix, freshness rule, rehearsal and post-publish check
ADRs Why the design is what it is
Changelog What changed in each version
Contributing Setup, tests and commits
Security Reporting a vulnerability
Data error form A wrong date, holiday or tithi, reported in the hub
Spec Behaviour and vectors, in the hub
Other languages The same library for Rust, Go, TypeScript, Swift, Kotlin and C++

License

MIT (LICENSE). Calendar data from NepDate by Raju Prasai and contributors, MIT (NOTICE). Not affiliated with the Government of Nepal.

Metadata

Release files for nepdate-core 0.1.0b1

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

Source distribution (sdist)

Source distribution for nepdate-core 0.1.0b1
File Size Uploaded Provenance
nepdate_core-0.1.0b1.tar.gz 60.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nepdate-core 0.1.0b1
File Interpreter ABI Platform
nepdate_core-0.1.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 122.3 kB

Release files / nepdate_core-0.1.0b1.tar.gz

Download URL nepdate_core-0.1.0b1.tar.gz
Size 60.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c6ac0c495ff2991a11472552c2d3a9abd2fc68f9ae9eb26856e096aaab0ed6f7
BLAKE2b-256 checksum
How to use checksums
44743df011d76422c9b7e3797f36f991305be7f244fd9f076ef8fe357023f735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / nepdate_core-0.1.0b1-py3-none-any.whl

Download URL nepdate_core-0.1.0b1-py3-none-any.whl
Size 61.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3000783f7e4ba0b3806376bb1418e7071bbd9a8fc83fc71728e5cc0552e653a
BLAKE2b-256 checksum
How to use checksums
611f280654a60ae3f10158c801c5f84a5c14b919afb312cdfbb64bf9946f3d68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for nepdate-core 0.1.0b1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nepdate_core-0.1.0b1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

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
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