Skip to main content

ethiocalendar

ethiocalendar is a Python date and time library for the Ethiopian calendar. It converts between Ethiopian and Gregorian dates, detects leap years, and exposes date / datetime objects that mirror the standard library.

Conversion uses the same Ethiopic Amete Mihret epoch as Unicode ICU (JD_EPOCH_OFFSET_AMETE_MIHRET = 1723856, Beyene–Kudlek).


Installation

pip install ethiocalendar

Features

  • Convert Ethiopian → Gregorian and Gregorian → Ethiopian
  • date and datetime objects with the familiar standard-library methods
  • Today's date in both calendars
  • Ethiopian leap years (Pagume 6 when year % 4 == 3)
  • Round-trip conversions, including Pagume

Quick examples

Object API (existing, unchanged)

import datetime
import ethiocalendar as ec

# Meskerem 1, 2012 EC → September 12, 2019 GC
print(ec.date(2012, 1, 1).togregorian())
# datetime.date(2019, 9, 12)

print(ec.fromgretoethio(datetime.date(2025, 11, 12)))
# ethiocalendar.date(2018, 3, 3)

print(ec.date.today())
print(ec.is_puagume6(2011))  # True

Convenience functions

import ethiocalendar as ec

print(ec.to_gregorian(2012, 1, 1))
# (2019, 9, 12)

print(ec.from_gregorian(2025, 11, 12))
# (2018, 3, 3)

print(ec.today())
# (year, month, day) in the Ethiopian calendar

print(ec.is_leap_year(2011))  # True
print(ec.is_leap_year(2012))  # False

Round-trip

import ethiocalendar as ec

date_ec = (2012, 1, 1)
to_gc = ec.to_gregorian(*date_ec)
back_ec = ec.from_gregorian(*to_gc)
assert date_ec == back_ec

Calendar notes

  • The Ethiopian year has 13 months: 12 × 30 days, plus Pagume (5 days, or 6 in a leap year).
  • Leap years occur every 4 years when year % 4 == 3.
  • Meskerem 1 falls on 11 September in the Gregorian calendar, or 12 September when the following Gregorian year is a leap year. That shortcut holds for Ethiopian years 1900–2091. Because the Ethiopian calendar does not skip century leap days, New Year drifts by one Gregorian day after 2100 (which is not a Gregorian leap year).

Tests

pytest -q

Author

Mukerem Ali Nur GitHub · PyPI

Metadata

Release files for ethiocalendar 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ethiocalendar 1.2.0
File Size Uploaded
ethiocalendar-1.2.0.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ethiocalendar 1.2.0
File Interpreter ABI Platform
ethiocalendar-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.2 kB

Release files / ethiocalendar-1.2.0.tar.gz

Download URL ethiocalendar-1.2.0.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c545eb96971a64a1d617dcd43fec109f45a70e4f50f711d8d86406b24994a8b4
BLAKE2b-256 checksum
How to use checksums
23e72fc10a581b62d9ff777342c58044f24b34837d03e8d42ba8966c1c3bd2c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / ethiocalendar-1.2.0-py3-none-any.whl

Download URL ethiocalendar-1.2.0-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14a4505ceff71f00603760f744cb507985d1f0b8f26a9537f8d54f874552758e
BLAKE2b-256 checksum
How to use checksums
ee3ce2510e401e77725a1315e3840da0bd38ec157a978a4d276aa521188ea897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.2

1 release file

1.1

1 release file

1.0.2

2 release files

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page