Skip to main content

Working Calendar

Deprecated / unmaintained

This project is no longer maintained and should not be used for new projects. It was originally created in 2018 as a small utility for working-day calculations.

For new code, consider maintained alternatives depending on your needs:

  • numpy.busdaycalendar / numpy.busday_count for fast business-day arithmetic;
  • pandas.tseries.offsets.CustomBusinessDay for pandas-based date workflows;
  • workalendar or holidays for country-specific public holidays;
  • businesstimedelta, business-duration, or similar packages for business-time intervals with working hours.

The package remains available on PyPI for historical compatibility. No new features, bug fixes, or compatibility updates are planned.

PyPI version Python versions Wheel Typed License

Description

Class WorkingCalendar is a utility for working-day calculations.

Current version

0.0.2 (final deprecation release)

Installation

Installation is kept here for existing users only:

pip install working-calendar

Example

from datetime import date
from working_calendar import WorkingCalendar


if __name__ == '__main__':
    wc = WorkingCalendar()

    holidays = [
        date(2018, 2, 23),
        date(2018, 3, 8),
        date(2018, 3, 9),
    ]
    additional_working_days = [
        date(2018, 3, 10),
    ]
    not_standard_working_day = (date(2018, 3, 10), 240)  # 240 min = 4 hours

    wc.extend_holidays(holidays)
    wc.extend_working_days(additional_working_days)
    wc.update_not_standard_working_day(not_standard_working_day[0], not_standard_working_day[1])

    print(wc.count_working_days_between(date(2018, 3, 1), date(2018, 3, 12)))  # 7 working days
    print(wc.count_working_days_in_year(2018))  # 259 working days
    print(wc.count_working_days_in_month(2018, 2))  # 19 working days

    print(wc.count_working_minutes_between(date(2018, 3, 1), date(2018, 3, 12)))  # 3120 minutes
    print(wc.count_working_minutes_in_year(2018))  # 124080 minutes
    print(wc.count_working_minutes_in_month(2018, 2))  # 9120 minutes

    print(wc.count_working_hours_between(date(2018, 3, 1), date(2018, 3, 12)))  # 52.0 hours
    print(wc.count_working_hours_in_year(2018))  # 2068.0 hours
    print(wc.count_working_hours_in_month(2018, 2))  # 152.0 hours

    print(wc.get_next_working_day(date(2018, 3, 7)))  # 2018-03-10
    print(wc.skip_working_days(date(2018, 3, 10), 10))  # 2018-03-23

Metadata

Release files for working-calendar 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for working-calendar 0.0.2
File Size Uploaded
working_calendar-0.0.2.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for working-calendar 0.0.2
File Interpreter ABI Platform
working_calendar-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / working_calendar-0.0.2.tar.gz

Download URL working_calendar-0.0.2.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7d0ad0c960f1b9fd6004bd794ad49577a27d9a1093fc1331c27f641316223de2
BLAKE2b-256 checksum
How to use checksums
4a18168386ef085132d03659f11528b04caf455759f5d66914ab3c24a62c823a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / working_calendar-0.0.2-py3-none-any.whl

Download URL working_calendar-0.0.2-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a45d4595b4728bfef94e941edf3a9306c515c9c17eff702f563a9e6817e47a00
BLAKE2b-256 checksum
How to use checksums
d547830a06781a8dcbda5c1a3d55c2132926e588fe0a0052f8025c48703f80fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page