A pure-Python library for the Hebrew calendar: conversion, astronomy, holidays and religious times, computed entirely locally.
Project description
hebrewcal
A pure-Python library for the Hebrew calendar.
hebrewcal makes the Hebrew calendar usable programmatically and converts it
bidirectionally against the Gregorian and Julian calendars. Every computation is
performed locally — the library never issues network calls to any external service.
It is built for two audiences:
- Religious use — holidays (Israel and the Diaspora, including minority feasts and Shushan Purim), Shabbat candle lighting and Havdalah, zmanim, Torah readings, the Omer count, yahrzeit, and the sabbatical and jubilee cycle.
- Academic use — historical, medieval and ancient dates, Babylonian and biblical month names, proleptic calendars, the Julian/Gregorian reform, and the documented "missing years" of the Anno Mundi count.
Project status. Early development. The calendar core, conversion and date handling (Phase 1) are implemented. Astronomy, holidays and religious times follow on the roadmap.
Installation
pip install hebrewcal
hebrewcal requires Python 3.11+ and has no runtime dependencies (standard library
only).
Quick start
from hebrewcal import GregorianDate, HebrewDate, to_hebrew, to_gregorian, weekday
# What Hebrew date and weekday corresponds to 31 October 1867?
g = GregorianDate(1867, 10, 31)
h = to_hebrew(g)
print(h) # HebrewDate(year=5628, month=8, day=2) -> 2 Marheshvan 5628
print(weekday(g).name) # THURSDAY
# Convert a Hebrew date back to Gregorian.
print(to_gregorian(HebrewDate(5785, 7, 1))) # GregorianDate(year=2024, month=10, day=3)
Every calendar reduces a date to an integer Rata Die (RD) day count and rebuilds a date from it, so any two calendars are interconvertible through RD:
from hebrewcal import GregorianDate, to_julian
GregorianDate(2026, 6, 26).to_rd() # 739793
to_julian(GregorianDate(2026, 6, 26)) # JulianDate(year=2026, month=6, day=13)
Features
- Proleptic Gregorian and Julian calendars, with an explicit, configurable Julian/Gregorian reform helper.
- A complete Hebrew calendar: molad and halakim, the dechiyot ("four gates"), year typing (deficient / regular / complete), the keviah signature, and the Metonic cycle.
- Bidirectional conversion between any supported calendars through Rata Die.
- Parsing of Gregorian input (ISO 8601, DIN 5008 and slash form) and formatting in numeric and named styles.
- A gematria converter between integers and Hebrew numerals.
- Month and weekday name tables (transliteration, Babylonian, biblical).
- The Anno Mundi era with a documented "missing years" notice.
Documentation
Full documentation, including a user guide with many examples, lives at hebrewcal.readthedocs.io.
Development
git clone https://github.com/bsesic/hebrewcal.git
cd hebrewcal
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pre-commit install
Run the lint gate and the test suite:
flake8
ruff check .
mypy
pytest
See CONTRIBUTING.md for the branching strategy and conventions.
Citation
If you use hebrewcal in academic work, please cite it. Citation metadata is provided in
CITATION.cff, and each release is archived on Zenodo.
- Concept DOI (always resolves to the latest version): 10.5281/zenodo.20583972
- Each release also has its own version-specific DOI on the Zenodo record.
License
MIT © Benjamin Schnabel
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 hebrewcal-0.3.0.tar.gz.
File metadata
- Download URL: hebrewcal-0.3.0.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5e275cb8c18923f797987cb1871d55b1bcbea98bc2e65dd56fad638bbabc03a
|
|
| MD5 |
6a7882f5785f98d9d233d0dc9dc6b7d9
|
|
| BLAKE2b-256 |
0789d6ede906836fcaf39761e2e8fcf81e6d04f86aec089f145dbbf18028eb6f
|
Provenance
The following attestation bundles were made for hebrewcal-0.3.0.tar.gz:
Publisher:
release.yml on bsesic/hebrewcal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hebrewcal-0.3.0.tar.gz -
Subject digest:
e5e275cb8c18923f797987cb1871d55b1bcbea98bc2e65dd56fad638bbabc03a - Sigstore transparency entry: 1758115329
- Sigstore integration time:
-
Permalink:
bsesic/hebrewcal@4b79b7cef319024c1b6848d571721124abaf3687 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/bsesic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b79b7cef319024c1b6848d571721124abaf3687 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hebrewcal-0.3.0-py3-none-any.whl.
File metadata
- Download URL: hebrewcal-0.3.0-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd45cd975e51f886d12e8398346ca264b943caf786732e4c56ebeb6e0ef2e6db
|
|
| MD5 |
0ff0ab15463e4114dfbf887a6b1c4d21
|
|
| BLAKE2b-256 |
7661407eb0dd6cf20aa8754947c347caee8ae6c31c0dd1c2a721b1a65e600d8e
|
Provenance
The following attestation bundles were made for hebrewcal-0.3.0-py3-none-any.whl:
Publisher:
release.yml on bsesic/hebrewcal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hebrewcal-0.3.0-py3-none-any.whl -
Subject digest:
fd45cd975e51f886d12e8398346ca264b943caf786732e4c56ebeb6e0ef2e6db - Sigstore transparency entry: 1758115445
- Sigstore integration time:
-
Permalink:
bsesic/hebrewcal@4b79b7cef319024c1b6848d571721124abaf3687 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/bsesic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b79b7cef319024c1b6848d571721124abaf3687 -
Trigger Event:
release
-
Statement type: