work-calendar


Namework-calendar JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/Polyrom/work-calendar
SummaryDetermines if a day is a working day in Russia
upload_time2025-09-10 21:24:56
maintainerNone
docs_urlNone
authorPolyrom
requires_python<4.0,>=3.10
licenseNone
keywords utility python official work calendar russia
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![license: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![PyPI](https://img.shields.io/pypi/v/work-calendar?label=pypi%20work-calendar)
![ruff](https://github.com/Polyrom/work-calendar/actions/workflows/linter.yml/badge.svg)
![tests](https://github.com/Polyrom/work-calendar/actions/workflows/tests.yml/badge.svg)

# Work Calendar

A simple no-nonsense library to find out whether a day is a working day in Russia.

Data obtained from [consultant.org](https://www.consultant.ru). 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](work_calendar/total.json).

## Installation

```bash
pip install work-calendar
```

## Usage

```python
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!
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Polyrom/work-calendar",
    "name": "work-calendar",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "utility, python, official, work, calendar, Russia",
    "author": "Polyrom",
    "author_email": "roman61394@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a2/7c/358cb392b2673b24fb2f9eea5bed03ffaf7b3c1a1a922b876a36285cbd53/work_calendar-1.1.0.tar.gz",
    "platform": null,
    "description": "[![license: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![PyPI](https://img.shields.io/pypi/v/work-calendar?label=pypi%20work-calendar)\n![ruff](https://github.com/Polyrom/work-calendar/actions/workflows/linter.yml/badge.svg)\n![tests](https://github.com/Polyrom/work-calendar/actions/workflows/tests.yml/badge.svg)\n\n# Work Calendar\n\nA simple no-nonsense library to find out whether a day is a working day in Russia.\n\nData obtained from [consultant.org](https://www.consultant.ru). 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.\n\nData available **for years 2015-2027**. Feel free to use the [raw json file](work_calendar/total.json).\n\n## Installation\n\n```bash\npip install work-calendar\n```\n\n## Usage\n\n```python\nfrom datetime import date\n\nimport work_calendar\n\nnew_years_holiday = date(2020, 1, 2)\nweekend = date(2021, 4, 4)\nworkday = date(2020, 6, 3)\nfor day in [new_years_holiday, weekend, workday]:\n    if work_calendar.is_workday(day):\n        print(f\"{day.strftime('%A %d.%m.%Y')} is a workday in Russia\")\n    else:\n        print(f\"{day.strftime('%A %d.%m.%Y')} is not a workday in Russia\")\n\ndt_out_of_bounds = dt = date(2090, 1, 2)\ntry:\n    work_calendar.is_workday(dt_out_of_bounds)\nexcept work_calendar.NoDataForYearError:\n    print(f\"No data found for date {dt_out_of_bounds} in work calendar!\")\n```\n\n**Output**\n\n```\nThursday 02.01.2020 is not a workday in Russia\nSunday 04.04.2021 is not a workday in Russia\nWednesday 03.06.2020 is a workday in Russia\nNo data found for date 2090-01-02 in work calendar!\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Determines if a day is a working day in Russia",
    "version": "1.1.0",
    "project_urls": {
        "Documentation": "https://github.com/Polyrom/work-calendar",
        "Homepage": "https://github.com/Polyrom/work-calendar",
        "Repository": "https://github.com/Polyrom/work-calendar.git"
    },
    "split_keywords": [
        "utility",
        " python",
        " official",
        " work",
        " calendar",
        " russia"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ee00a307c9951c25d8390da37b949453b7d12ff63c26db2cf8b578605c81ace",
                "md5": "28d44bd1d59c7153f3be933f5b7e420a",
                "sha256": "0b5faa7be33e54c144ae2e412230fe1781a4cfcd2d80e52eb24688c5711044da"
            },
            "downloads": -1,
            "filename": "work_calendar-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "28d44bd1d59c7153f3be933f5b7e420a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 14799,
            "upload_time": "2025-09-10T21:24:55",
            "upload_time_iso_8601": "2025-09-10T21:24:55.153586Z",
            "url": "https://files.pythonhosted.org/packages/6e/e0/0a307c9951c25d8390da37b949453b7d12ff63c26db2cf8b578605c81ace/work_calendar-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a27c358cb392b2673b24fb2f9eea5bed03ffaf7b3c1a1a922b876a36285cbd53",
                "md5": "eff52cb61811935b23ba6de29a34aaaa",
                "sha256": "2d2ff5d11bb1abec32abbc48178831b87d8ad1350b1fd41995e2c9d19417467c"
            },
            "downloads": -1,
            "filename": "work_calendar-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "eff52cb61811935b23ba6de29a34aaaa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 14739,
            "upload_time": "2025-09-10T21:24:56",
            "upload_time_iso_8601": "2025-09-10T21:24:56.563911Z",
            "url": "https://files.pythonhosted.org/packages/a2/7c/358cb392b2673b24fb2f9eea5bed03ffaf7b3c1a1a922b876a36285cbd53/work_calendar-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-10 21:24:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Polyrom",
    "github_project": "work-calendar",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "work-calendar"
}
        
Elapsed time: 1.36160s