Skip to main content

A robust sexagesimal, metrological, and astronomical engine for Babylonian mathematics. From the Eduba to the Jupyter Notebook.

Project description

🏺 MesoMath v2.1.0

The Mesopotamian Computational Engine for Python.

PyPI - Version PyPI - Status Python 3.11+ Hatch project Documentation Status Binder

MesoMath is a high-precision computational framework engineered for the rigorous study of ancient Mesopotamian mathematics, metrology, chronology, timekeeping, and archaeoastronomy. It provides native command-line environments (CLI), Jupyter integration, and authentic epigraphic support (Old Babylonian transliteration and Unicode cuneiform rendering).


✨ What's New in v2.1.0?

MesoMath has evolved into a unified metapackage, structurally decoupling core arithmetic from chronological anchoring systems:

  • mesomath Core: Introduces the BabF class for native sexagesimal (base-60) fractional arithmetic without floating-point rounding artifacts.
  • mesotimes Subsystem: A dedicated historical engine driving:
    • Empirical & Proleptic Chronology: Seamless alignment with historical cuneiform registers.
    • Elastic Timekeeping: Shifting horizon-based day boundaries (Sunset-to-Sunset) and dynamic nocturnal watches (maṣṣarātu).
    • Archaeoastronomy: High-fidelity celestial positioning and eclipse matrices.

🚀 Quick Start

Installation

Install the complete environment globally using pipx (recommended for CLI apps):

$ pipx install mesomath

The Scribal Console

Launch the pre-configured advanced interactive environment:

$ ibabcalc

1. Dimensional Arithmetic & Fractions

MesoMath manages geometric dimensions and base-60 rational numbers natively:

from mesomath import Blen, Bsur

# Objects understand localized metrological ratios
width = Blen('3 ninda')
area = Bsur('1 sar')

# Dimensional descent via division engine
length = area / width
print(length.prtf())  # Output: '1/3 ninda'

2. Epigraphic Authenticity

Export mathematical computations directly into cuneiform strings or scholarly transliterations:

from mesomath import Bcap

vol = Bcap('3 bariga 2 ban')
print(vol.translit)   # Output: '3(barig) 2(ban2) še'
print(vol.cuneiform)  # Output: 𒑗 𒑐 𒊺

3. Chronology & Archaeoastronomy

Translate continuous timeline anchors into historical calendars and calculate complex planetary visibilities:

from mesomath import ChronDate

# Instantiate a target Julian date
date = ChronDate.from_julian(-378, 5, 17)
print(date.babylonian)
# Output: 'Year 26 of Artaxerxes II, month: 2 (Aiaru), day: 14'
# Generate localized micro-historical data grids
date.day_ephemeris(city='Susa')
=================================================================
               MESOPOTAMIAN DAILY EPHEMERIS: SUSA                
=================================================================
  Julian Day:  1583129.5       | Civil Calendar: Julian (-378/5/17)
  Chronology:  Year 26 of Artaxerxes II, month: 2 (Aiaru), day: 14
-----------------------------------------------------------------
  SOLAR CONTEXT:
    Sunrise : 01:46 UT | Sunset : 15:32 UT
    Transit : 08:39 UT | Season : Day: 52 of spring
-----------------------------------------------------------------
  LUNAR INTERVALS (Phenomena in current lunation):
    [Neomenia] NA Interval: -68.35 min (Time from Sunset to Moonset)
    [Mid-Month] MI-MUSH:    19.77 min (Simultaneous visibility)
    [End-Month] KUR:        -894.34 min (Dawn crescent disappearance)
-----------------------------------------------------------------
  PLANETARY VISIBILITY ( Twilight vs. Arc of Vision ):
    * Mercury    -> Invisible / Glare                   (Required Av: 12.0°)
    * Venus      -> VISIBLE (Morning Star)     (Required Av: 6.0°)
    * Mars       -> VISIBLE (Morning Star)     (Required Av: 14.0°)
    * Jupiter    -> VISIBLE (Evening Star)     (Required Av: 9.0°)
    * Saturn     -> VISIBLE (Evening Star)     (Required Av: 11.0°)
=================================================================
# Visualize the sky timeline across ancient nocturnal watches
date.night_at_a_glance(city='Susa')
===================================================================
          NIGHT AT A GLANCE: SUSA (-378-05-17)
===================================================================
UT Hours:  09  11  13  15  17  19  21  23  01  03  05  07  09  
Local H.:  12  14  16  18  20  22  00  02  04  06  08  10  12  
-------------------------------------------------------------------
 Sky/Sun :  #############::.               .::###############
-------------------------------------------------------------------
 Moon    :              =====================                
-------------------------------------------------------------------
 Mercury :  ----------                      -----------------
 Venus   :  ------------                     ----------------
 Mars    :  -                          --------------------- 
 Jupiter :          -----------------------                  
 Saturn  :  ------------------------                    -----
===================================================================
Legend:  # Day  : Civ/Nav Twilight  . Ast Twilight    Night
         - Planet above horizon     = Moon above horizon

📚 Documentation

The complete user manual, tutorials, and mathematical references are available at mesomath.readthedocs.io.


🏛️ Acknowledgments & Sources

  • Mathematical Metrology: Structured upon the breakthrough historical analyses of Christine Proust (Tablettes mathématiques de Nippur, 2007) and canonical scribal lexical lists.
  • Archaeoastronomy & Eclipses: Driven by the raw ephemeris computational methods and historical eclipse logs compiled in NASA's Five Millennium Canon of Eclipses by Fred Espenak and Jean Meeus.
  • Chronological Registers: Grounded on the empirical data frameworks from Babylonian Chronology: 626 B.C. – A.D. 75, by Richard A. Parker and Waldo H. Dubberstein (2nd edition, Brown University Press, 1971).

Developed by jccsvq

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

mesomath-2.1.2.tar.gz (577.8 kB view details)

Uploaded Source

Built Distribution

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

mesomath-2.1.2-py3-none-any.whl (343.0 kB view details)

Uploaded Python 3

File details

Details for the file mesomath-2.1.2.tar.gz.

File metadata

  • Download URL: mesomath-2.1.2.tar.gz
  • Upload date:
  • Size: 577.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.1 cpython/3.11.2 HTTPX/0.28.1

File hashes

Hashes for mesomath-2.1.2.tar.gz
Algorithm Hash digest
SHA256 dbae24009b680209721ff41f3a8557d57be8dd5b2b20f9b166f914013d2d7b7d
MD5 9c5cc942eeb534d4b2b07dd062777082
BLAKE2b-256 eb17d8c154e1ca54d98fab75fffb73cd474605021dc951417d4fb43f91619a77

See more details on using hashes here.

File details

Details for the file mesomath-2.1.2-py3-none-any.whl.

File metadata

  • Download URL: mesomath-2.1.2-py3-none-any.whl
  • Upload date:
  • Size: 343.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.1 cpython/3.11.2 HTTPX/0.28.1

File hashes

Hashes for mesomath-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cab5d7beb7e641da40f1ae20fb11b58a4e8802e78212af65cac4d0bd27a632fb
MD5 c5e5d72f3e27456015d89700b0e3e968
BLAKE2b-256 fbc82bf13ac8795a1d9937bae484941b9ceef4f6b799609b1781c2bd30ed7bae

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