Deprecated utility for simple working-day calculations.
Project description
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_countfor fast business-day arithmetic;pandas.tseries.offsets.CustomBusinessDayfor pandas-based date workflows;workalendarorholidaysfor 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.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file working_calendar-0.0.2.tar.gz.
File metadata
- Download URL: working_calendar-0.0.2.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d0ad0c960f1b9fd6004bd794ad49577a27d9a1093fc1331c27f641316223de2
|
|
| MD5 |
5c312edd3b9f9a37fc3843e6df5f01e0
|
|
| BLAKE2b-256 |
4a18168386ef085132d03659f11528b04caf455759f5d66914ab3c24a62c823a
|
File details
Details for the file working_calendar-0.0.2-py3-none-any.whl.
File metadata
- Download URL: working_calendar-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a45d4595b4728bfef94e941edf3a9306c515c9c17eff702f563a9e6817e47a00
|
|
| MD5 |
50249e778dfbcf430e58330389e47184
|
|
| BLAKE2b-256 |
d547830a06781a8dcbda5c1a3d55c2132926e588fe0a0052f8025c48703f80fa
|