Skip to main content

Python port (in progress) of the Turbo Pascal Pohualli calendrical utility

Project description

Pohualli (Python Port)

CI Coverage Docs Changelog

Work-in-progress Python reimplementation of the original Turbo Pascal Pohualli calendar utility.

Goals

  • Faithful translation of core calendrical calculations (Maya & Aztec systems)
  • 819-day cycle, planetary synodic values, year bearer computation
  • Configurable New Era and correction parameters
  • Composite API producing structured results
  • Config persistence (save/load JSON)
  • Clear, testable Python modules separated from any UI
  • Modern packaging & minimal dependencies

Structure

pohualli/
  __init__.py
  autocorr.py          # Auto-derivation of correction offsets
  aztec.py             # Aztec-specific name tables & conversions
  calendar_dates.py    # Gregorian / Julian conversion helpers
  cli.py               # Command-line interface entry point
  composite.py         # High-level composite computation
  correlations.py      # Correlation preset management
  cycle819.py          # 819-day cycle station & value
  maya.py              # Core Tzolk'in / Haab / Long Count logic
  moon.py              # Moon age & eclipse heuristic
  planets.py           # Planet synodic computations
  templates/           # Web UI Jinja2 templates
  types.py             # Dataclasses for config & corrections
  webapp.py            # FastAPI application
  yearbear.py          # Year bearer packing/unpacking
  zodiac.py            # Star & earth zodiac logic
tests/
  test_autocorr.py
  test_calendar_parity.py
  test_composite.py
  test_cycle_planets.py
  test_maya.py
  test_moon_zodiac.py
  test_web.py
  test_yearbear_cli.py
docs/                  # MkDocs documentation sources
mkdocs.yml             # MkDocs configuration
Dockerfile
docker-compose.yml
pyproject.toml
LICENSE
README.md

Composite Usage (Python)

from pohualli import compute_composite
res = compute_composite(2451545)
print(res.tzolkin_name, res.long_count, res.star_zodiac_name)

CLI Examples

# Human-readable
pohualli from-jdn 2451545 --year-bearer-ref 0 0
# JSON output
pohualli from-jdn 2451545 --json > result.json
# Override New Era
pohualli from-jdn 2451545 --new-era 584285 --json
# Save & load config
pohualli save-config config.json
pohualli load-config config.json

Tests

python -m pytest -q

Web UI

Install web extras and run development server:

python -m pip install -e .[web]
uvicorn pohualli.webapp:app --reload

Open http://127.0.0.1:8000 in a browser.

Documentation

Published docs (main branch): https://muscariello.github.io/pohualli-python/

Docker

Build locally:

docker build -t pohualli .
docker run --rm -p 8000:8000 pohualli

Pre-built Images (GitHub Container Registry)

Multi-architecture images (linux/amd64, linux/arm64) are published automatically from main and version tags via GitHub Actions.

Pull latest:

docker pull ghcr.io/muscariello/pohualli-python:latest

Run:

docker run --rm -p 8000:8000 ghcr.io/muscariello/pohualli-python:latest

Use a specific version tag:

docker pull ghcr.io/muscariello/pohualli-python:v1.2.3

References

  • Sołtysiak, Arkadiusz & Lebeuf, Arnold. (2011). Pohualli 1.01. A computer simulation of Mesoamerican calendar systems. 8(49), 165–168.

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

pohualli-0.2.1.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

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

pohualli-0.2.1-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file pohualli-0.2.1.tar.gz.

File metadata

  • Download URL: pohualli-0.2.1.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pohualli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cf4fc05a6a704110d814dc634bf10638ee20d4e4f517fffcf8086ef837ee38ce
MD5 44995e4e14c3c5838135b7d7dd8a14e5
BLAKE2b-256 8340e0878ce30dccaa635e31da956f7409d91390a79d959494c722618b99b0a8

See more details on using hashes here.

File details

Details for the file pohualli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pohualli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pohualli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4af1797dad762257456df8c259c29de8e2c3f3384d838b0831590a48fa86f1fe
MD5 d7cad40966759b0eb64a87ece248c21a
BLAKE2b-256 26f2bac803344070d34d59c9aa32be95e8ba9f5e1d2e68f722d8acdb45ba3690

See more details on using hashes here.

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