Skip to main content

Tibetan calendar toolkit (traditional + reform engines).

Project description

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 (Note: Insert your actual link here)

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.

Bash

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

Bash

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caltib-0.3.0.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

caltib-0.3.0-py3-none-any.whl (293.9 kB view details)

Uploaded Python 3

File details

Details for the file caltib-0.3.0.tar.gz.

File metadata

  • Download URL: caltib-0.3.0.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for caltib-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f5e958085ce2078cb420fe7f52a55edf2c708e056b2ee364172139aa3e5565ce
MD5 ca124f6e83c45ec853a7fba9a9d0c827
BLAKE2b-256 5525ed103e175797381e5a64cfd3efe8c0149c872fe83528d74d2be199821da0

See more details on using hashes here.

Provenance

The following attestation bundles were made for caltib-0.3.0.tar.gz:

Publisher: publish.yml on gantemur/caltib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file caltib-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: caltib-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 293.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for caltib-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb69e099174e734e4c28319a54611f0c20504caeccfbf6a288ffd6007b6e9b1e
MD5 1300e09cd08d1e18532c4f621c8a98fa
BLAKE2b-256 ff7e0ca4a4a1785964a8d5ff27ebfba63b5a27dbb0a0ea5a8971ce13064f12b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for caltib-0.3.0-py3-none-any.whl:

Publisher: publish.yml on gantemur/caltib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page