Skip to main content

Rokh: Iranian Calendar Events Collection

Project description

Rokh Logo

Rokh: Iranian Calendar Events Collection


PyPI version built with Python3 GitHub repo size Discord Channel

Overview

Rokh provides a unified interface for accessing Iranian calendar events across Jalali, Gregorian, and Hijri date systems. It lets you easily retrieve national holidays, cultural events, and religious occasions by simply passing a date. It automatically converts between calendars and return event's description. You can use it in your apps, bots, and research tools that rely on Iranian date conversions, holidays, and cultural event data.

In Farsi, Rokh is derived from Rokhdad, meaning "event." Rokh itself also means "face" and even refers to the "rook" piece in chess.

PyPI Counter
Github Stars
Branch main dev
CI
Code Quality CodeFactor

Installation

PyPI

Source code

Usage

Get events

Use get_events to retrieve all Iranian calendar events for a given date. Simply specify the date (in Jalali, Gregorian, or Hijri format), and the function returns corresponding events.

>>> from rokh import get_events, DateSystem
>>> get_events(day=1, month=1, year=1403, input_date_system=DateSystem.JALALI)
# {
#    'events': {
#      'gregorian': [
#        {
#          'description': 'روز جهانی شادی',
#          'is_holiday': False
#        }
#      ],
#      'hijri': [],
#      'jalali': [
#        {
#          'description': 'جشن نوروز/جشن سال نو',
#          'is_holiday': True
#        }
#      ]
#    },
#    'gregorian_date': {'day': 20, 'month': 3, 'year': 2024},
#    'hijri_date': {'day': 10, 'month': 9, 'year': 1445},
#    'jalali_date': {'day': 1, 'month': 1, 'year': 1403},
#    'is_holiday': True,
#    'input_date_system': 'jalali',
#    'event_date_system': 'all'
# }

Get today events

Use get_today_events to retrieve today events.

>>> from rokh import get_today_events, DateSystem
>>> get_today_events()
# {
#    'events': {
#      'gregorian': [
#        {
#          'description': 'روز جهانی شادی',
#          'is_holiday': False
#        }
#      ],
#      'hijri': [],
#      'jalali': [
#        {
#          'description': 'جشن نوروز/جشن سال نو',
#          'is_holiday': True
#        }
#      ]
#    },
#    'gregorian_date': {'day': 20, 'month': 3, 'year': 2024},
#    'hijri_date': {'day': 10, 'month': 9, 'year': 1445},
#    'jalali_date': {'day': 1, 'month': 1, 'year': 1403},
#    'is_holiday': True,
#    'input_date_system': 'gregorian',
#    'event_date_system': 'all'
# }

Issues & bug reports

Just fill an issue and describe it. We'll check it ASAP! or send an email to rokh@openscilab.com.

  • Please complete the issue template

You can also join our discord server

Discord Channel

References

1- ساعت و تقویم ایران | تاریخ امروز | Time.ir
2- Jalali Holiday API
3- United Nations List of International Days and Weeks

Show your support

Star this repo

Give a ⭐️ if this project helped you!

Donate to our project

If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .

Rokh Donation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

0.3 - 2025-12-21

Added

  • United nations list of international days and weeks

Changed

  • README.md updated
  • Gregorian events typo fixed

0.2 - 2025-11-20

Added

  • Logo
  • get_today_events function
  • Event issue template

Changed

  • README.md updated
  • get_events function current year bug fixed

0.1 - 2025-10-25

Added

  • get_events function
  • DateSystem enum
  • Jalali events
  • Gregorian events
  • Hijri events

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rokh-0.3.tar.gz (42.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rokh-0.3-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file rokh-0.3.tar.gz.

File metadata

  • Download URL: rokh-0.3.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for rokh-0.3.tar.gz
Algorithm Hash digest
SHA256 f3769358c3cec851cdd1d396ab267ab2685dfb0ebc42887f70023256a1296f9c
MD5 17286026e5952fcb707de292659a498e
BLAKE2b-256 79bf16f2a63d1c99948a3cc0f416ce992bc952dd62b8b70451d560d597fa671d

See more details on using hashes here.

File details

Details for the file rokh-0.3-py3-none-any.whl.

File metadata

  • Download URL: rokh-0.3-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for rokh-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04b90b19b87746a3f34bfba038c4de51942ca6fa6dfc74b7a7fb73cbec212231
MD5 5dc099111b68a1d965533ad92df48c95
BLAKE2b-256 3e80fd1a8418253f5b8f915a76aedb114b51db7e21b56b3d990a9e2df2ce262c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page