Installation & Quickstart
ethio-kit ships zero external runtime dependencies across Python 3.9+, JavaScript / TypeScript (ESM + CJS + Browser/Edge), Dart / Flutter 3.0+, and PHP 8.1+ (PSR-4). All four runtimes are verified against the exact same spec/golden_vectors.json specification.
snake_case (e.g., gregorian_to_ethiopian), JS/TS and Dart use camelCase (e.g., gregorianToEthiopian), and PHP exposes static methods on EthioKit\EthioKit (e.g., EthioKit::gregorianToEthiopian). Use the top language switcher (or append ?lang=php) to toggle all code examples.
Calendar, Ge'ez Numerals, Bahire Hasab & Business Days
Beyene–Kudlek / Unicode ICU Ethiopian ↔ Gregorian conversions, localized formatting, 12-hour EAT clock, bidirectional Ge'ez numerals, movable Orthodox feasts, and Ethiopian banking/business-day arithmetic.
| Function (Py / JS, Dart & PHP) | Purpose & Key Behavior |
|---|---|
| gregorian_to_ethiopian / gregorianToEthiopian | Converts valid Gregorian (y, m, d) to EthiopicDate. Rejects invalid dates like 2024-02-30. |
| ethiopian_to_gregorian / ethiopianToGregorian | Converts valid Ethiopian (y, m, d) (year ≥ 1, Pagume 5/6 aware) to Gregorian. |
| format_ethiopic_date / formatEthiopicDate | Formats in am, en, om, or ti (Tigrinya) with optional weekday name and Ge'ez numerals. |
| parse_ethiopic_date / today_ethiopian | Parses YYYY-MM-DD strings with Pagume validation; returns current EAT Ethiopian date. |
| add_days / add_months / add_years_ethiopian | 13-month calendar arithmetic & signed diffs (diff_days, diff_months, diff_years), clamping Pagume 5/6 safely. |
| ethiopian_month_grid / ethiopian_year_grid | Generates 2D MonthGrid weeks with paired Gregorian dates, Ge'ez numerals, holidays, and Orthodox Nigs; format_month_calendar renders console tables. |
| to_geez_numeral / from_geez_numeral | Bidirectional compound Ge'ez numbers (e.g., 2019 ↔ ፳፻፲፱, 10100 ↔ ፼፻). |
| to_ethiopian_time / format_ethiopian_time | 24h ↔ 12h Ethiopian clock + localized formatting (am, en, om, ti, Ge'ez) + add_ethiopian_time & diff_ethiopian_time_minutes. |
| bahire_hasab / bahireHasab | Computes Evangelist, Wenber, Abekte, Metqi (incl. Metqi=30 years), Mebaja Hamer, Nenewe, Abiy Tsom, Debre Zeit, Hosanna, Siklet, Fasika, Rkbe Kahinat, Erget, Paraklitos, Tsome Hawaryat, and Tsome Dihnet. |
| ethiopian_fasting_periods / is_ethiopian_fasting_day | All 6 Orthodox seasonal fasts + Wednesday/Friday weekly fasts (with 50-day Easter Pentecostal and Genna/Timket exemptions). |
| list_monthly_nigs / get_day_nigs | 30-day Ethiopian Orthodox monthly saint/feast commemorations (major_only filter + Pagume 3 Archangel Raphael). |
| ethiopian_holidays / next_ethiopian_holiday | Unified fixed + movable Orthodox + optional include_islamic + tag filter (public, christian, muslim, state) + custom_holidays. |
| is_ethiopian_business_day / add_ethiopian_business_days | Skips Saturday, Sunday, and Ethiopian public holidays (cached per-year holiday sets for fast large SLA offsets). |
Ethiopic Script, Ejective/Labialized IME & Creator Subtitles
Homophone folding for Amharic search indexing, bidirectional phonetic Latin ↔ Fidel transliteration (with lossless reversible mode), URL slugification, and word-space-aware subtitle wrapping.
| Function (Py / JS, Dart & PHP) | Purpose & Key Behavior |
|---|---|
| normalize_ethiopic / normalizeEthiopic | Folds Amharic homophone families (ሐ/ኀ→ሀ, ሠ→ሰ, ዐ→አ, ፀ→ጸ) with optional 1st/4th order folding. |
| latin_to_fidel / latinToFidel | Phonetic Latin → Fidel IME supporting ejectives, 5th-order ee, and all labialized forms. |
| fidel_to_latin / fidelToLatin | Deterministic Latin transliteration with reversible mode for exact round-trip with latin_to_fidel. |
| ethiopic_slugify / ethiopicSlugify | Builds clean lowercase URL/hashtag slugs from mixed Amharic/Latin text. |
| wrap_subtitle_lines / count_ethiopic_stats | Wraps SRT/captions on ASCII spaces or Ethiopic ፡ word-space; counts Ethiopic/Latin/digit/word stats. |
latin_to_fidel / latinToFidel)t' / T → ጠ, c' / ch' / C → ጨ, p' / P → ጰee (e.g., beet → ቤት, qwee → ቌ)bwa → ቧ, mwa → ሟ, shwa → ሿ, t'wa → ጧqw → ቍ, kw → ኵ, gw → ጕ, hw → ኍPhones (Mobile, Landline & Shortcode) & 14 Regions
Strict ASCII validation for mobile (Ethio Telecom 09…, Safaricom 07…), regional fixed landlines mapped to Ethiopia's current 14 divisions (12 Regional States + 2 Chartered Cities), and shortcodes.
Fayda National ID (Format & MOSIP Verhoeff Checksum)
Supports both 12-digit FIN and 16-digit FAN/VID numbers with official MOSIP Verhoeff check-digit verification (detects 100% of single-digit typos and adjacent digit transpositions).
ETB Currency Precision & Multilingual Words
Decimal string parsing without IEEE-754 float rounding bugs, half-away-from-zero santim rounding ("1.005" → ETB 1.01), arbitrary-precision splitting, and invoice-ready words in Amharic (am), Afaan Oromo (om), and English (en).
Payments, Webhooks & 35+ Bank Receipt Parsers
Transport-agnostic HTTP request builders for Chapa, Telebirr Fabric (X-APP-Key + biz_content), SantimPay, and ArifPay; Telebirr RSA canonical strings; constant-time HMAC-SHA256 webhook verification; webhook normalization; and SMS/URL receipt parsing across 35 Ethiopian banks and wallets.
parse_receipt_reference / parseReceiptReference)cbe, telebirr, mpesa, cbe_birr, boa, awash, dashen, coopbank, zemen, hibret, nib, wegagen, oromia, berhan, bunna, abay, enat, lion, addis, global_bank, amhara, tsehay, siinqee, ahadu, gadaa, tsedey, hijra, zamzam, goh, shabelle, rammis, sikket, sidama_bank, kacha, yaya
Security Hardening, CLI & 4-Language Spec Parity (v0.7.0)
- API Key Redaction & HTTPS-by-Default:
CheckoutRequestredactsAuthorization,x-arifpay-key, andX-APP-Keyheaders in debug/string output;build_checkout_requestrequireshttps://unlessallow_insecure_httpis explicitly enabled. - Strict Webhook Payload & Replay-Window Checks:
verify_webhook_signatureenforces raw string/byte payloads and exact 64-character hex signatures in constant time;is_webhook_timestamp_freshguards against replay attacks (default 300s window, auto-detecting Unix seconds or milliseconds). - Amount DoS Protection & Calendar Bounds: Numeric exponents and digit lengths in
split_birr/format_etbare bounded (≤ 1000); calendar functions reject impossible Gregorian dates and out-of-range Pagume days. - Dedicated
ethio-kitCLI in All 4 Runtimes: Runethio-kit today --geez,ethio-kit cal 2019 1 --geez,ethio-kit holidays 2019 --islamic,ethio-kit fasting 2019,ethio-kit nigs --major,ethio-kit fidel "selamta", orethio-kit birr 1234.50 --words --lang amfrom Python, Node/npx, Dart, or PHP Composer. - Zero-Extension & Browser/Edge Safety: Pure FIPS 180-4 SHA-256 / HMAC-SHA256 in JS and Dart with zero
node:*built-in imports, 100%///DartDoc coverage, and pure UTF-8 + string decimal math in PHP 8.1+ with zerobcmath/gmp/mbstringrequirements.