Skip to main content

Checking the date for belonging to a non-working day, according to official decrees and orders.

Project description

🗓️ isdayoff-api

Production Calendar API Client

PyPI - Version PyPI - Python Version PyPI - Downloads GitHub License CI

🐍 Async + Sync Python client for isdayoff.ru – production calendar data for 7 countries.

Check if a date is a working day, a day off, or a shortened day according to official government decrees.

This is a fork of the original kobylinsky-m/isdayoff.


📦 Installation

pip install isdayoff-api

Requires Python 3.11+.


🚀 Quick Start

Async (recommended)

import asyncio
from isdayoff import DateType, ProdCalendar


async def main():
    async with ProdCalendar(locale="us") as calendar:
        if await calendar.today() == DateType.WORKING:
            print("Today is a working day ✅")
        else:
            print("Today is a day off 🎉")


asyncio.run(main())

Sync

from isdayoff import DateType, SyncProdCalendar


with SyncProdCalendar(locale="us") as calendar:
    if calendar.today() == DateType.WORKING:
        print("Today is a working day ✅")
    else:
        print("Today is a day off 🎉")

🌍 Supported Locales

Code Country
ru Russia
kz Kazakhstan
by Belarus
us United States
uz Uzbekistan
tr Turkey
lv Latvia

📖 API Reference

All methods are available on both ProdCalendar (async) and SyncProdCalendar (sync).

Parameters

Parameter Type Default Description
locale str "ru" Country code
pre bool False Mark shortened pre‑holiday days
covid bool False Mark working days due to COVID‑19
sd bool False Consider 6‑day work week

Methods

# ── Async ──
await calendar.today(locale="ru", pre=True, covid=True, sd=True)
await calendar.tomorrow()
await calendar.date(date(2024, 8, 25))
await calendar.month(date(2024, 8, 1))
await calendar.year(date(2024, 1, 1))
await calendar.range_date(date(2024, 1, 1), date(2024, 5, 1))
calendar.is_leap(date(2024, 1, 1))

# ── Sync ──
calendar.today(locale="ru", pre=True, covid=True, sd=True)
calendar.tomorrow()
calendar.date(date(2024, 8, 25))
calendar.month(date(2024, 8, 1))
calendar.year(date(2024, 1, 1))
calendar.range_date(date(2024, 1, 1), date(2024, 5, 1))
calendar.is_leap(date(2024, 1, 1))

Return Types

Method Returns
today() / tomorrow() / date() DateType (enum)
month() / year() / range_date() dict[str, DateType] — ISO date → type
is_leap() bool

DateType Enum

Value Meaning
DateType.WORKING (0) Working day
DateType.NOT_WORKING (1) Day off / holiday
DateType.SHORTENED (2) Shortened pre‑holiday day
DateType.WORKING_DAY (4) Working day (special period, e.g. COVID)

📋 Full Example

import asyncio
from datetime import date
from isdayoff import DateType, ProdCalendar


async def main():
    async with ProdCalendar(locale="us") as calendar:
        month_data = await calendar.month(date(2024, 8, 1), locale="ru")
        days_off = sum(1 for v in month_data.values() if v == DateType.NOT_WORKING)
        print(f"Days off in August 2024 (RU): {days_off}")


asyncio.run(main())

🛠 Development

# Install dependencies
uv sync

# Run unit tests (mocked, no API calls)
uv run pytest

# Run integration tests (real API calls)
uv run pytest -m integration

# Build package
uv build

Test Suite

Type Count Command
🔬 Unit 40 uv run pytest
🌐 Integration 8 uv run pytest -m integration

🔗 Links


☕ Donate

If this library saves you time or helps your business, consider supporting its development:

Crypto Address
₿ Bitcoin (BTC) bc1q98gg278ywqdfhmxpfttuvsyskdxxmg0ac4sg5a
◉ USDT (TRC-20) TFf8jHqaoTWEEx6XzHTdRpLkMcYcwwRd17
◎ USDT (Solana) 8SZc4jQoMKQeedJMe9VS5bnrWF8PCKvDjwixz3Zg4p2W

Your support keeps the project alive and up to date ❤️


📄 License

MIT

© 2021 Maxim Kobylinsky (original author) · © 2026 Aleksandr Bevz


Data provided by isdayoff.ru

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

isdayoff_api-1.1.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

isdayoff_api-1.1.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file isdayoff_api-1.1.2.tar.gz.

File metadata

  • Download URL: isdayoff_api-1.1.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for isdayoff_api-1.1.2.tar.gz
Algorithm Hash digest
SHA256 15daf9cc548d47f9ad37d6a690146d2b1cf949aeec24425ea82b7dc03cc1fc65
MD5 731a8b2d6bfa8fe02247fdd8737e5941
BLAKE2b-256 1a90fd54beb4a3e819fd6ebeee75da85f492dc93322f9a96f7b61dc36b642e89

See more details on using hashes here.

Provenance

The following attestation bundles were made for isdayoff_api-1.1.2.tar.gz:

Publisher: release.yml on asbevz/isdayoff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file isdayoff_api-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: isdayoff_api-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for isdayoff_api-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c21be16aea317fab88a30a45884eb9f9c8da01e26248c5c9574bfee14f6385b
MD5 1b114fe470140292b297852714a7cab6
BLAKE2b-256 b536a020dea29d79af3fc358edbdeccfac83b81f9e9c4fb9f61613fe07f2edf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for isdayoff_api-1.1.2-py3-none-any.whl:

Publisher: release.yml on asbevz/isdayoff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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