Coptic calendar arithmetic — date conversion, Easter, and feast days
Project description
kiahk (Python)
Coptic calendar arithmetic — date conversion, Easter, and feast days. Python port of kiahk. Identical results to all other ports against core/test-vectors.json.
Package: https://pypi.org/project/kiahk/
Install
pip install kiahk
Or from this repo for development:
cd py
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
Quick start
from kiahk import CopticDate, GregorianDate, CopticCalendar
# Convert Gregorian → Coptic
g = GregorianDate(2025, 1, 11)
c = g.to_coptic()
print(c.year, c.month, c.day) # 1741 5 3
# Convert Coptic → Gregorian
c2 = CopticDate(1742, 1, 1)
g2 = c2.to_gregorian()
print(g2.year, g2.month, g2.day) # 2025 9 11
# Coptic Easter for a Gregorian year
easter = CopticCalendar.easter_date(2025)
print(easter.year, easter.month, easter.day) # 2025 4 20
# All major feasts for a Gregorian year, sorted by date
for feast in CopticCalendar.year_feasts(2025):
g = feast.gregorian_date
print(f"{g.year}-{g.month:02d}-{g.day:02d} {feast.name('en')}")
Sample output:
1741 5 3
2025 9 11
2025 4 20
2025-01-07 Nativity of Christ
2025-01-19 Epiphany (Theophany)
2025-02-10 Nineveh Fast
2025-02-24 Great Lent (start)
2025-04-07 Annunciation
2025-04-13 Palm Sunday
2025-04-20 Easter Sunday
2025-05-29 Ascension
2025-06-08 Pentecost
2025-08-22 Assumption of Mary
2025-09-27 Feast of the Cross
Render a date in English and Arabic
The library exposes Coptic month names in en + ar via CopticCalendar.month_name(month, locale). The full 13-entry table is also re-exported as COPTIC_MONTHS for callers that prefer raw data.
from kiahk import GregorianDate, CopticCalendar
g = GregorianDate(2025, 4, 20)
c = g.to_coptic()
print(f"{c.day} {CopticCalendar.month_name(c.month, 'en')} {c.year} AM")
print(f"{c.day} {CopticCalendar.month_name(c.month, 'ar')} {c.year} للشهداء")
Sample output:
12 Parmouti 1741 AM
12 برمودة 1741 للشهداء
API at a glance
| Type / method | Purpose |
|---|---|
GregorianDate(y, m, d) |
Value type; raises InvalidGregorianDateError on bad input |
GregorianDate.to_coptic() → CopticDate |
Convert |
GregorianDate.to_native_date() / from_native_date(date) |
Interop with datetime.date |
CopticDate(y, m, d) |
Value type; raises InvalidCopticDateError on bad input |
CopticDate.to_gregorian() → GregorianDate |
Convert |
Feast |
id, type, category, gregorian_date, .name(locale) |
Feast.name("fr") |
Raises UnsupportedLocaleError for unknown locale |
CopticCalendar.easter_date(year) → GregorianDate |
Coptic Easter |
CopticCalendar.moveable_feast(feast_id, year) → Feast |
One moveable feast |
CopticCalendar.year_feasts(year) → list[Feast] |
All feasts, sorted ascending |
CopticCalendar.month_name(month, locale) → str |
Coptic month name; raises InvalidCopticMonthError / UnsupportedLocaleError |
COPTIC_MONTHS |
13-entry list of dicts (mirrors core/coptic_months.json) |
Supported locales for Feast.name(...) and CopticCalendar.month_name(...): en, ar.
Run tests
cd py
.venv/bin/pytest -v
License
Licensed under the MIT License.
Maintained by Amir Magdy at WizardLabz.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kiahk-0.1.3.tar.gz.
File metadata
- Download URL: kiahk-0.1.3.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03efb4186324603326a25916346154e6d570f22aee39c6206a98e5010b3eb863
|
|
| MD5 |
3d8f1e44035afb1be6c591b372e4d669
|
|
| BLAKE2b-256 |
607028d5039374ef17903145246396d6f124b31a5638fd56bc6f2448ddc1f934
|
Provenance
The following attestation bundles were made for kiahk-0.1.3.tar.gz:
Publisher:
release-pypi.yml on amir-magdy-of-wizardlabz/kiahk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiahk-0.1.3.tar.gz -
Subject digest:
03efb4186324603326a25916346154e6d570f22aee39c6206a98e5010b3eb863 - Sigstore transparency entry: 1625348668
- Sigstore integration time:
-
Permalink:
amir-magdy-of-wizardlabz/kiahk@9d237c7cb782f8804dcb0792f231bec80fc76d1c -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/amir-magdy-of-wizardlabz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@9d237c7cb782f8804dcb0792f231bec80fc76d1c -
Trigger Event:
push
-
Statement type:
File details
Details for the file kiahk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: kiahk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
604e350e094a5d773c0d77caf266795ef70777ed29baa00880a3b187b28faa18
|
|
| MD5 |
659a07ffbc1d556dd8252f985bbec159
|
|
| BLAKE2b-256 |
201ea899148b1758b3c5fccd274b2fccead0fde023b0cf7bec6316a5a0668eaa
|
Provenance
The following attestation bundles were made for kiahk-0.1.3-py3-none-any.whl:
Publisher:
release-pypi.yml on amir-magdy-of-wizardlabz/kiahk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiahk-0.1.3-py3-none-any.whl -
Subject digest:
604e350e094a5d773c0d77caf266795ef70777ed29baa00880a3b187b28faa18 - Sigstore transparency entry: 1625348734
- Sigstore integration time:
-
Permalink:
amir-magdy-of-wizardlabz/kiahk@9d237c7cb782f8804dcb0792f231bec80fc76d1c -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/amir-magdy-of-wizardlabz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@9d237c7cb782f8804dcb0792f231bec80fc76d1c -
Trigger Event:
push
-
Statement type: