Skip to main content

A comprehensive library for Persian and international holidays.

Project description

X-Holidays

A comprehensive Python library for managing Persian (Jalali), International, and Islamic holidays, as well as famous birthdays.

Features

  • Jalali Date Support
  • National & Seasonal Holidays
  • International Observances
  • Famous Birthdays
  • Islamic Holidays

Files

X-Holidays/
├── LICENSE
├── MANIFEST.in
├── README.md
├── requirements.txt
├── setup.py
├── test_app.py
└── x_holidays/
---->├── init.py
---->├── utils.py
---->├── seasons.py
---->├── global_events.py
---->├── birthdays.py
---->└── islamic.py

Installation

pip install git+https://github.com/Amir-X/X-Holidays.git
  • Or:
pip install X-Holidays
  • Or clone and install locally:
git clone https://github.com/Amir-X/X-Holidays.git

cd X-Holidays

pip install -e .

Usage

from x_holidays import Holiday

manager = Holiday()

# Get all holidays for Jalali Year 1403
holidays = manager.get_all_holidays(1403)
for h in holidays[:5]:
    print(h)

# Search for a keyword
results = manager.search_by_keyword("nowruz", year=1403)
print(results)

# Check if a specific date is a holiday
import jdatetime
date_to_check = jdatetime.date(1403, 1, 1)
if manager.is_holiday(date_to_check):
    print(f"{date_to_check} is a holiday!")

# Calculate working days
wd_count = manager.count_working_days("1403-01-01", "1403-01-10")
print(f"Working days: {wd_count}")

Author

Amir-X

Requirements

jdatetime>=4.1.0
hijri-converter>=2.2.0


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

x_holidays-1.1.6.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

x_holidays-1.1.6-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file x_holidays-1.1.6.tar.gz.

File metadata

  • Download URL: x_holidays-1.1.6.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for x_holidays-1.1.6.tar.gz
Algorithm Hash digest
SHA256 f4852826510dd7459e10f29373cbd0905b7b3ba8e8d6e0134d3af8b33bf33444
MD5 4cfbb56d2ab83663e082b52a7043a0b9
BLAKE2b-256 261b2ab1757693d1296383f67be4022e58f9b141853528cb036173335485cbf7

See more details on using hashes here.

File details

Details for the file x_holidays-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: x_holidays-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for x_holidays-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 75f82994ff3105dd13a41f7609f57d3228a4294431bd7b9aae6d7e83d65adac5
MD5 9817fe914cb09a8401d2931af4f1d61f
BLAKE2b-256 c87ae01c963ea8dc3310103238510659c97cc235d3900497217cb0cb512fa2f5

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