Work Calendar
A simple no-nonsense library to find out whether a day is a working day in Russia.
Data obtained from consultant.org. I try to parse it as soon as the official calendar for the following year is published, which is normally late summer or early autumn.
Data available for years 2015-2027. Feel free to use the raw json file.
Installation
pip install work-calendar
Usage
from datetime import date
import work_calendar
new_years_holiday = date(2020, 1, 2)
weekend = date(2021, 4, 4)
workday = date(2020, 6, 3)
for day in [new_years_holiday, weekend, workday]:
if work_calendar.is_workday(day):
print(f"{day.strftime('%A %d.%m.%Y')} is a workday in Russia")
else:
print(f"{day.strftime('%A %d.%m.%Y')} is not a workday in Russia")
dt_out_of_bounds = dt = date(2090, 1, 2)
try:
work_calendar.is_workday(dt_out_of_bounds)
except work_calendar.NoDataForYearError:
print(f"No data found for date {dt_out_of_bounds} in work calendar!")
Output
Thursday 02.01.2020 is not a workday in Russia
Sunday 04.04.2021 is not a workday in Russia
Wednesday 03.06.2020 is a workday in Russia
No data found for date 2090-01-02 in work calendar!
Release files for work-calendar 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| work_calendar-1.1.0.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| work_calendar-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.5 kB
Release files / work_calendar-1.1.0.tar.gz
| Download URL | work_calendar-1.1.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2ff5d11bb1abec32abbc48178831b87d8ad1350b1fd41995e2c9d19417467c
|
|
BLAKE2b-256 checksum How to use checksums |
a27c358cb392b2673b24fb2f9eea5bed03ffaf7b3c1a1a922b876a36285cbd53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Darwin/24.6.0
|
Release files / work_calendar-1.1.0-py3-none-any.whl
| Download URL | work_calendar-1.1.0-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b5faa7be33e54c144ae2e412230fe1781a4cfcd2d80e52eb24688c5711044da
|
|
BLAKE2b-256 checksum How to use checksums |
6ee00a307c9951c25d8390da37b949453b7d12ff63c26db2cf8b578605c81ace
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Darwin/24.6.0
|