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

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.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.2.tar.gz (38.6 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.2-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rokh-0.2.tar.gz
Algorithm Hash digest
SHA256 01d9d33f8fe8734fff5fe05b4e5f971f39e75887f998feedd5b237df557f4202
MD5 c4203a0a402079b3b73f7c7c1035d8dc
BLAKE2b-256 218f19757ee98e201b13a2f266c34c2b2ac799b067ca8c2b5db8d1f6906ecf7c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rokh-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef59172ad3bc4b79f58474804f4f9d8fdf3f96c9ad7a617df680ae4cb78aa4e
MD5 eda75dbb58da1739a4d1dbdb354780ab
BLAKE2b-256 a8c45b2779d716883015217c625b4d419d7ec7db37b51f63e4bc3c8e44341c97

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