Skip to main content

Historical chronology tools (indiction, calendar systems, etc.)

Project description

Computus

A small Python library and command line tool for historical chronology.

Author

Ivan Debono

Features

  • Indiction calculation for Anno Domini/Common Era and Byzantine Anno Mundi years
  • Roman numeral conversion in both directions
  • Julian and Gregorian calendar conversion
  • Gregorian, Julian, and Orthodox Easter calculation
  • Era conversion between AD/CE, BC/BCE, Byzantine AM, and AUC
  • Simple historical date parsing

Installation

Using pip

pip install computus

Using uv

uv add computus

Or:

uv pip install computus

Usage (Python)

from computus import (
    arabic_to_roman,
    convert_era,
    easter,
    indiction,
    julian_to_gregorian,
    parse_historical_date,
    roman_to_arabic,
)

i = indiction(525)
print(i)                    # 3
print(arabic_to_roman(i))   # III

print(indiction(6033, "AM"))                # 3
print(convert_era(525, "AD", "AM"))         # 6033
print(julian_to_gregorian(1582, 10, 4))     # (1582, 10, 14)
print(easter(2024, "orthodox"))             # (2024, 5, 5)
print(roman_to_arabic("XLII"))              # 42
print(parse_historical_date("15 March 44 BC"))

Command Line Usage

The original short form still calculates an AD indiction:

computus 525

Example output:

Indiction: 3 (III)

Subcommands expose the full toolset:

computus indiction 6033 --calendar AM
computus roman XLII
computus roman 42
computus easter 2024 --calendar orthodox
computus convert 525 --from AD --to AM
computus calendar 1582 10 4 --from julian --to gregorian
computus parse "15 March 44 BC"

Historical Notes

calendar="AD" and calendar="CE" treat the input year as an Anno Domini/Common Era year. calendar="AM" treats the input year as a Byzantine Anno Mundi year directly. To convert an AD year to Byzantine AM first, use convert_era(year, "AD", "AM").

The library uses traditional historical year numbering: there is no year 0. Use BC/BCE era conversion for years before AD 1.

Development

python -m pip install -e ".[dev]"
pytest

License

PolyForm Noncommercial License 1.0.0

Copyright (c) 2026 Ivan Debono

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

computus-1.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

computus-1.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file computus-1.1.0.tar.gz.

File metadata

  • Download URL: computus-1.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for computus-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4b73b8a445324e345ddf6f9ef88138f7e954c5c93e619934bd6ff9ea2e0f9a73
MD5 af45885821727b4dc41e11f3bd88a31e
BLAKE2b-256 05e5bab1a7e45eda161f20561eb61d200e644cefce56201dee4c272e4beb5f31

See more details on using hashes here.

Provenance

The following attestation bundles were made for computus-1.1.0.tar.gz:

Publisher: publish.yml on ivandebono/computus

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

File details

Details for the file computus-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: computus-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for computus-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e8417691ad9c8b1d784b06a0ac64f8a62fc97412bad7678b33933e6162638ea
MD5 233f61cfd52e865d595062f957f6a2aa
BLAKE2b-256 c70f36ff72efea8334c63a5cbd6654716ea87f1c291ce7c4a4364d223a0b9c74

See more details on using hashes here.

Provenance

The following attestation bundles were made for computus-1.1.0-py3-none-any.whl:

Publisher: publish.yml on ivandebono/computus

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