xvlady / python-holidays-ru

is_weekend, is_holidays

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-holidays

A fast, efficient Python library for Russia country, province and state specific sets of holidays on the fly. It aims to make determining whether a specific date is a holiday as fast and flexible as possible.

Package:Python supported versions PyPI version Downloads
CD/CI: https://coveralls.io/repos/github/xvlady/python-holidays-ru/badge.svg?branch=main
Meta:Code style License

Install

The latest stable version can always be installed or updated via pip:

$ pip install --upgrade holidays-ru

Documentation

View Quick Start. You can use original library from other country and other functional https://github.com/dr-prodigy/python-holidays

Quick Start

from datetime import date
from holidays_ru import check_holidays, is_holidays

check_holiday(date(2023, 1, 1))  # True
check_holiday(date(2023, 1, 12)) # False
check_holiday(date(2022, 12, 31)) # True
check_holiday(date(2022, 12, 31), with_weekends=False) # False, it's Sunday
is_holiday(date(2023, 1, 1))     # "New Year's Day"
is_holiday(date(2023, 1, 12))    # ""
is_holiday(date(2023, 1, 15))    # "Weekend"
is_holiday(date(2023, 1, 15))    # "Moved weekend"
is_holiday(date(2023, 1, 12))    # "", it's work Sunday

Contributions

Issues and pull requests are always welcome. Please see here for more information.

License

Code and documentation are available according to the MIT License (see LICENSE).

About

is_weekend, is_holidays

License:MIT License


Languages

Language:Python 100.0%