caltib
High-Precision Tibetan Calendrical Math
caltib is a rigorous Python library designed to unify 15th-century historical algorithms with 21st-century astrophysics. It provides a polymorphic framework for evaluating traditional lunisolar calendars alongside modern mathematical reforms.
Live Demonstration
The library can be evaluated directly in the browser without local installation. The web calendar runs completely client-side via WebAssembly: 👉 Launch the caltib Web App
Key Features
- Unified API: Evaluate traditional engines (Phugpa, Mongol, Tsurphu, etc.) and modern reforms (L0–L6) using a single, harmonized interface.
- Progressive Reforms: A tiered sequence of engines advancing from pure-integer mean motion (L0) and fixed-iteration Picard solvers (L1–L3) to strictly reproducible floating-point models (L4–L5) and JPL-powered numerical integration (L6).
- Strict Reproducibility: L0–L5 engines utilize integer sine-tables or Chebyshev minimax polynomials to ensure bit-for-bit consistency across all CPU architectures.
- Localized Physics: Support for geographical location injection to accurately handle spherical sunrise boundaries and civil day-numbering conventions.
- Design & Diagnostics Laboratory: A professional-grade toolkit for designing new calendar parameters via continued fractions and analyzing secular drift over millennia.
Installation
caltib is designed to be lightweight. The core package has zero external dependencies, making it highly suitable for embedded environments or web deployment.
Core: Traditional engines & Reform Tiers L0-L5
pip install caltib
Tools: Diagnostic charting & parameter design (requires NumPy & Matplotlib)
pip install "caltib[tools]"
Ephemeris: JPL DE422 integration & L6 engine (requires Skyfield & jplephem)
pip install "caltib[ephemeris]"
Quickstart
Basic Day Query
from datetime import date
import caltib
# Standard traditional lookup
info = caltib.day_info(date(2026, 2, 21), engine="mongol")
print(f"Mongol Tithi: {info.tibetan.tithi}")
Advanced Localized Reform
from caltib.engines.specs import LOC_MONTREAL
import caltib
# Build an L3 engine localized to Montreal coordinates.
# L3 utilizes fixed-iteration rational Picard solvers and spherical sunrise geometry.
engine = caltib.get_calendar("l3", location=LOC_MONTREAL)
info = engine.day_info(date(2026, 2, 21))
Diagnostics & Design
The library includes a comprehensive diagnostic suite to rigorously analyze calendar accuracy and historical deviations.
- Secular Drift: Track how sidereal calendars decouple from the tropical equinox over 1,500-year timescales.
- Variance Mapping: Visualize the error propagation and variance of traditional anomaly approximations.
- Rational Design: Derive optimal convergents for constructing new calendar architectures.
Example Usage:
# Analyze secular acceleration against JPL DE422 numerical integration
caltib diag analysis --engine mongol --ephem de422
License: Distributed under the MIT License. Created by Tsogtgerel Gantumur.
Metadata
Release files for caltib 0.3.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| caltib-0.3.9.tar.gz | 3.2 MB | With provenance | Details for caltib-0.3.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| caltib-0.3.9-py3-none-any.whl | Python 3 | none | any | Details for caltib-0.3.9-py3-none-any.whl |
Total release size: 3.5 MB
Release files / caltib-0.3.9.tar.gz
| Download URL | caltib-0.3.9.tar.gz |
|---|---|
| Size | 3.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f72ef8b6cb60a56355ca8750e4211a2eb76dce8cc287338531e34e0d2ca1d859
|
|
BLAKE2b-256 checksum How to use checksums |
10d26d9b60be269ce98bd2388d6351a585a5e108e6515482a4d54cd819f63807
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / caltib-0.3.9-py3-none-any.whl
| Download URL | caltib-0.3.9-py3-none-any.whl |
|---|---|
| Size | 307.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1962a2508013424d43815961e5e986696a685125651ff1953334b02a10e2f3ce
|
|
BLAKE2b-256 checksum How to use checksums |
054ab958464ffe4b2e52f73f5582a64261cc4c526704503b0d8d1f4f830ead81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logSecurity for caltib 0.3.9
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
Both files in this release have been uploaded with provenance metadata.
Attestation for caltib-0.3.9.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 Nov 22, 2026.
Transparency logA 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.