python-mayadate
Maya Date:
>>> m = mayadate.date(8, 3, 2, 10, 15)
>>> m
mayadate.date(8, 3, 2, 10, 15)
Human readable:
>>> str(m)
"8.3.2.10.15 | 2 Men | 13 Pax | 1 Ik' | G8"
Long Count:
>>> m.longcountstr
'8.3.2.10.15'
Tzolkin:
>>> m.tzolkinstr
'2 Men'
Haab:
>>> m.haabstr
'13 Pax'
Year Bearer:
>>> m.yearbearerstr
"1 Ik'"
Lord of Night:
>>> m.lordofnightstr
'G8'
To Gregorian Date Conversion:
>>> g = m.togregorian()
>>> g
datetime.date(103, 5, 19)
Computations:
>>> n = m - mayadate.delta(1)
>>> n
mayadate.date(8, 3, 2, 10, 14)
Comparsions:
>>> n < m
True
TODO:
- replace() method
- BCE in togregorian() method
- custom formatting support
- pickle support
- distutils support