Skip to main content

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

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

Source distribution (sdist)

Source distribution for caltib 0.3.7
File Size Uploaded Provenance Actions
caltib-0.3.7.tar.gz 3.2 MB With provenance Details for caltib-0.3.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for caltib 0.3.7
File Interpreter ABI Platform Actions
caltib-0.3.7-py3-none-any.whl Python 3 none any Details for caltib-0.3.7-py3-none-any.whl

Total release size: 3.5 MB

Release files / caltib-0.3.7.tar.gz

Download URL caltib-0.3.7.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
f57698d458a2e09f74da413fc4e446693041e2c66d46b351b8afd69ee8917f0d
BLAKE2b-256 checksum
How to use checksums
6e4c949a6ff75326c0af8118792ef2f4780f1f85c3f12d04ef2c1289fe7b09de
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 21, 2026.

Transparency log

Release files / caltib-0.3.7-py3-none-any.whl

Download URL caltib-0.3.7-py3-none-any.whl
Size 305.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6138c3cd95a0525447df30099333fb476ac5695e69b0bc19187513e0379977d7
BLAKE2b-256 checksum
How to use checksums
76748b17e3675f7649517c02393c7c37435681b34e4223ed99b41d0ac27dbab2
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 21, 2026.

Transparency log

Security for caltib 0.3.7

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.

Select from 2 files

Attestation for caltib-0.3.7.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 21, 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.

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