ethio-kit logo ethio-kit v0.7.0
Interactive Playground →
Section 01

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.

pip install ethio-kit
npm install ethio-kit
dart pub add ethio_kit
composer require meismem/ethio-kit
Naming Convention Note: Python uses 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.
Section 02

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 / gregorianToEthiopianConverts valid Gregorian (y, m, d) to EthiopicDate. Rejects invalid dates like 2024-02-30.
ethiopian_to_gregorian / ethiopianToGregorianConverts valid Ethiopian (y, m, d) (year ≥ 1, Pagume 5/6 aware) to Gregorian.
format_ethiopic_date / formatEthiopicDateFormats in am, en, om, or ti (Tigrinya) with optional weekday name and Ge'ez numerals.
parse_ethiopic_date / today_ethiopianParses YYYY-MM-DD strings with Pagume validation; returns current EAT Ethiopian date.
add_days / add_months / add_years_ethiopian13-month calendar arithmetic & signed diffs (diff_days, diff_months, diff_years), clamping Pagume 5/6 safely.
ethiopian_month_grid / ethiopian_year_gridGenerates 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_numeralBidirectional compound Ge'ez numbers (e.g., 2019 ↔ ፳፻፲፱, 10100 ↔ ፼፻).
to_ethiopian_time / format_ethiopian_time24h ↔ 12h Ethiopian clock + localized formatting (am, en, om, ti, Ge'ez) + add_ethiopian_time & diff_ethiopian_time_minutes.
bahire_hasab / bahireHasabComputes 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_dayAll 6 Orthodox seasonal fasts + Wednesday/Friday weekly fasts (with 50-day Easter Pentecostal and Genna/Timket exemptions).
list_monthly_nigs / get_day_nigs30-day Ethiopian Orthodox monthly saint/feast commemorations (major_only filter + Pagume 3 Archangel Raphael).
ethiopian_holidays / next_ethiopian_holidayUnified fixed + movable Orthodox + optional include_islamic + tag filter (public, christian, muslim, state) + custom_holidays.
is_ethiopian_business_day / add_ethiopian_business_daysSkips Saturday, Sunday, and Ethiopian public holidays (cached per-year holiday sets for fast large SLA offsets).
Section 03

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 / normalizeEthiopicFolds Amharic homophone families (ሐ/ኀ→ሀ, ሠ→ሰ, ዐ→አ, ፀ→ጸ) with optional 1st/4th order folding.
latin_to_fidel / latinToFidelPhonetic Latin → Fidel IME supporting ejectives, 5th-order ee, and all labialized forms.
fidel_to_latin / fidelToLatinDeterministic Latin transliteration with reversible mode for exact round-trip with latin_to_fidel.
ethiopic_slugify / ethiopicSlugifyBuilds clean lowercase URL/hashtag slugs from mixed Amharic/Latin text.
wrap_subtitle_lines / count_ethiopic_statsWraps SRT/captions on ASCII spaces or Ethiopic ፡ word-space; counts Ethiopic/Latin/digit/word stats.
Phonetic IME Mapping Reference (latin_to_fidel / latinToFidel)
Ejectives: t' / T → ጠ, c' / ch' / C → ጨ, p' / P → ጰ
5th-order vowel: ee (e.g., beet → ቤት, qwee → ቌ)
8th-order labials: bwa → ቧ, mwa → ሟ, shwa → ሿ, t'wa → ጧ
Labiovelars: qw → ቍ, kw → ኵ, gw → ጕ, hw → ኍ
Section 04

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.

011 ET-AA
022 ET-OR
025 DD/HA/SO
033 ET-AF
034 ET-TI
046 CE/SI/SE
047 GA/SW
057 ET-BE
058 ET-AM
14 Regions
Section 05

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).

Section 06

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).

Section 07

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.

35 Supported Receipt Providers (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

Section 08

Security Hardening, CLI & 4-Language Spec Parity (v0.7.0)

  • API Key Redaction & HTTPS-by-Default: CheckoutRequest redacts Authorization, x-arifpay-key, and X-APP-Key headers in debug/string output; build_checkout_request requires https:// unless allow_insecure_http is explicitly enabled.
  • Strict Webhook Payload & Replay-Window Checks: verify_webhook_signature enforces raw string/byte payloads and exact 64-character hex signatures in constant time; is_webhook_timestamp_fresh guards 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_etb are bounded (≤ 1000); calendar functions reject impossible Gregorian dates and out-of-range Pagume days.
  • Dedicated ethio-kit CLI in All 4 Runtimes: Run ethio-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", or ethio-kit birr 1234.50 --words --lang am from 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 zero bcmath/gmp/mbstring requirements.