← All packages

Time & Earth rotation

star-calendar 0.1.0

Calendar dates and Julian day numbers, exactly

Public state: Released & Verified. The registry label is RELEASED. What the states mean →

Apache-2.0 Released & Verified single file

Summary

Exact integer conversion between calendar dates and Julian Day Numbers in the Julian, proleptic Gregorian and civil calendars from JDN 0 to year 9999; identical to ERFA, CPython datetime and NAIF SPICE on 9014 dates, and dates that do not exist are refused.

Run in your browser

Edit the code and press Run (or Ctrl+Enter). Python runs in your browser with this package's published code. The first run downloads Python once (about 12 MB).

Runs in the browser: all 65 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026.

Use it on your computer

No account and no GitHub needed. Download, then install with one command:

python -m pip install star_calendar-0.1.0-py3-none-any.whl

In Python: import star_calendar

Get started →

Cite it, and its bill of materials

For a paper, a report or a supplier file: the citation in two formats, and the software bill of materials (SBOM) in the two standard formats, with the fingerprint of the wheel.

@software{cavazzini_star_calendar_0_1_0,
  author  = {Cavazzini, Andrea},
  title   = {{star-calendar}: Calendar dates and Julian day numbers, exactly},
  version = {0.1.0},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_calendar/},
  note    = {Apache-2.0. Source: https://github.com/Andrea07072000/S.T.A.R.-, commit dc09f61d}
}

For developers

Install directly from the public repository:

python -m pip install "star-calendar @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_calendar"

README · tests · evidence (GitHub)

Technical sheet

Package
star-calendar
Import name
star_calendar
Version
0.1.0
Licence
Apache-2.0
Python
>=3.9
Dependencies
none (standard library only)
Capability
star.time.calendar
Maturity
Released & Verified (RELEASED)
Published commit
dc09f61d

Requirements

  • R1 jdn(year, month, day, calendar) and calendar_date(jdn, calendar) for "gregorian", "julian" and "auto" (Julian up to 1582-10-04, Gregorian from 1582-10-15); astronomical year numbering; valid from JDN 0 to 9999-12-31.
  • R2 julian_date(...) returns the pair (JD at the preceding midnight, fraction of day): the sum is the Julian Date and the pair keeps a nanosecond that a single float would lose. weekday(jdn) (0 = Monday), day_of_year(...).
  • R3 Measured: the same day number as ERFA, CPython datetime and NAIF SPICE (MIXED calendar) on 9014 dates, zero mismatches, including years B.C. and every day around the 1582 switch.
  • R4 Every function returns integers (or the documented pair) or raises ValueError: non-integer or boolean year, month, day or day number; a date that does not exist in the calendar (29 February 1900 Gregorian, 1582-10-05 to 1582-10-14 civil); an unknown calendar; a time outside the day; anything outside the valid range.

Limits (what is not claimed)

A calendar, not a time scale: no leap seconds, no UTC/TT/TDB conversion, no time zones, no local adoption dates of the Gregorian calendar (the civil switch is the papal one of October 1582).

Release gate

Computed by the registry from the result files, with the same function that decides RELEASED.

Mutation score, latest measure of each module (needs at least 0.850)
  • star_calendar.py 0.948 (2026-10-06)
Independent implementations written by others (needs 2)
CPython datetime ordinals, ERFA cal2jd / jd2cal (C), NAIF CSPICE str2et, MIXED calendar
Also compared with, not counted
published values: Meeus, Astronomical Algorithms, chapter 7 examples
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Unit testsVERIFIED2026-10-0665 passed in 0.88s
ReviewVERIFIED2026-10-06Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed
ReviewVERIFIED2026-10-06Re-running the cross-check gives a byte-identical evidence file
Reference valueVERIFIED2026-10-06all five reproduced exactly, in both directions (suite: 65 passed in 0.88s)
Cross-check with independent librariesVERIFIED2026-10-06star_calendar gives the same Julian Day Number as three independent implementations over its whole range
BenchmarkVERIFIED2026-10-06exact integer arithmetic: mismatches are counted, not measured; erfa 0/3000, datetime 0/3000, spice 0/3014
Clean install from the release tagVERIFIED2026-10-06pytest outside the tree: 65 passed in 0.26s

Fingerprints (SHA-256)

star_calendar-0.1.0-py3-none-any.whlde705ff2aadbb52c80b8061a710ca9c6c1e31d3ef58699ff4e4f850c436542c1
star_calendar.py5f13630e7f6b18a15f81f71232bdde3fb705581e12123545f47f30302d4d7e29
star_calendar-0.1.0-source.zip434f7820a8a2a510b80274193b015d731cd033f1e3d7d97c369a46b02b847624

results