A complete Ethiopian Calendar & Bahire Hasab toolkit for Python
Kenat (Amharic: ቀናት) is a powerful and authentic Ethiopian calendar library for Python. It offers full support for date conversion, holiday computation (including Bahire Hasab), localized formatting, Geez numerals, and more — all without external dependencies.
🚀 Ported from the original kenat JS library.
- 🔄 Bidirectional Conversion: Ethiopian ↔ Gregorian calendars
- 📅 Full Holiday System: Christian, Muslim, cultural, and public holidays
- ⛪ Bahire Hasab: Accurate movable feast calculations (e.g. Fasika, Tsome Nebiyat)
- 🏷️ Holiday Filtering: Filter holidays by type (
public,christian,muslim, etc.) - 📆 Date Arithmetic: Add/subtract days, months, years (13-month calendar support)
- 🔠 Localized Formatting: Amharic and English support
- 🔢 Geez Numerals: Convert integers to ግዕዝ numeral strings
- ⏰ Ethiopian Time Support: 12-hour Ethiopian ↔ 24-hour Gregorian
- 🗓️ Calendar Grids: Monthly/yearly calendar generation
Install the library from source:
pip install kenatFor development/testing:
pip install -e ".[test]"from kenat import Kenat
today = Kenat.now()
print(today.get_ethiopian())
# → {'year': 2017, 'month': 9, 'day': 26}
print(today.format({'lang': 'english', 'show_weekday': True}))
# → "Tuesday, Ginbot 26 2017"from kenat import get_holidays_for_year
holidays = get_holidays_for_year(2017)
# Example: Find Fasika (Easter)
fasika = next(h for h in holidays if h['key'] == 'fasika')
print(fasika['ethiopian']) # → {'year': 2017, 'month': 8, 'day': 21}from kenat import get_holidays_for_year, HolidayTags
# Public only
get_holidays_for_year(2017, filter_by=HolidayTags.PUBLIC)
# Christian and Muslim holidays
get_holidays_for_year(2017, filter_by=[HolidayTags.CHRISTIAN, HolidayTags.MUSLIM])from kenat import Kenat
meskel = Kenat("2017/1/17")
print(meskel.is_holiday()) # → [Holiday object]
non_holiday = Kenat("2017/1/18")
print(non_holiday.is_holiday()) # → []from kenat import Kenat
bh = Kenat("2017/1/1").get_bahire_hasab()
print(bh['evangelist']) # → {'name': 'ማቴዎስ', 'remainder': 1}
print(bh['movableFeasts']['fasika']['ethiopian'])
# → {'year': 2017, 'month': 8, 'day': 21}from kenat import Kenat
date = Kenat("2017/2/10")
print(date.add(days=10)) # → Add days
print(date.add(months=-1)) # → Subtract a monthfrom kenat import Kenat
a = Kenat("2015/5/15")
b = Kenat("2012/5/15")
print((a - b).days) # → 1095 days
print(a.diff_in_days(b)) # → 1095from kenat import to_geez
print(to_geez(2017)) # → ፳፻፲፯- Fork & clone the repo
- Create a new branch:
git checkout -b feature/your-feature - Make your changes, add tests in
/tests/ - Run
pytestto ensure everything passes - Submit a pull request 🚀
Melaku Demeke GitHub: @MelakuDemeke
MIT License — see LICENSE for details.
