Utility for operate with working days.
Project description
Working Calendar
Description
Class WorkingCalendar is utility for operate with working days.
Current version
0.0.1 (2018-07-13)
Installation
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.1.tar.gz.
File metadata
- Download URL: working_calendar-0.0.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95c144d1e4c22bd41543613643423ecfca6460ebaa98b99a3ce3a2a2cf633893
|
|
| MD5 |
ee0991a075a0655f4464a89f22d64a47
|
|
| BLAKE2b-256 |
8ce5b8eccb0d61acdae075419c6dd04233cd57b0c0f8e5482fb2e8d3da4598d5
|
File details
Details for the file working_calendar-0.0.1-py3-none-any.whl.
File metadata
- Download URL: working_calendar-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48999ea66ef12b9f9af0746425ff8bb54b0c542c776d7f6f0569dd810785e6b6
|
|
| MD5 |
a240fff31f5efc543804e9ca36e318cd
|
|
| BLAKE2b-256 |
757abe41a95b8f28aab6f8052f7912f049f22e6176ec0e41845c15445d213524
|