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.0.0.tar.gz (13.6 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.0.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: x_holidays-1.0.0.tar.gz
  • Upload date:
  • Size: 13.6 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.0.0.tar.gz
Algorithm Hash digest
SHA256 d679579e734ed86fd9624c16f4cccb4c1d471b5f7a418d53a9caa2dd85bf9d48
MD5 8ccc7610a99dad2edd6b0bf7d5d5f0cf
BLAKE2b-256 55e2257bfb54676093bd97b4becbd0468283c18610d7e23b27383bedcd5c53b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: x_holidays-1.0.0-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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c044992e7c53f6be3f49d530a89c9493ef60f8dec2451e1048632428c6bf11cd
MD5 7a4bfab700dd82fce0f82afbc8990067
BLAKE2b-256 2a74bd8de4bc0d5afda0392abc0c15e437846b1b3f47715752bd13aec29415d2

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