Simple business days, including custom work week and a holiday list.
Project description
business_calendar
business_calendar is a Python package that implements simple business days calculations. You can use a custom work week and a holiday list.
Documentation
You can find the latest documentation here.
Example
from business_calendar import Calendar, MO, TU, WE, TH, FR
import datetime
date1 = datetime.datetime(2013,1,10)
# normal calendar, no holidays
cal = Calendar()
date2 = cal.addbusdays(date1, 25)
print('%s days between %s and %s' % \
(cal.busdaycount(date1, date2), date1, date2))
# don't work on Fridays? no problem!
cal = Calendar(workdays=[MO,TU,WE,TH])
date2 = cal.addbusdays(date1, 25)
print('%s days between %s and %s' % \
(cal.busdaycount(date1, date2), date1, date2))
# holiday? no problem!
cal = Calendar(workdays=[MO,TU,WE,TH], holidays=['2013-01-17'])
date2 = cal.addbusdays(date1, 25)
print('%s days between %s and %s' % \
(cal.busdaycount(date1, date2), date1, date2)
License
MIT
History
0.1.0 (2014-06-22)
Initial release.
Credits
business_calendar is written and maintained by Antonio Botelho.
Contributors
Please add yourself here alphabetically when you submit your first pull request.
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
Close
Hashes for business_calendar-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3c2393574cfd8e3810231f7b5a027f9bc29bde502af4091372921a1acac7878 |
|
MD5 | 84f46cbd37b5d36150b0d0e4bec27d0f |
|
BLAKE2b-256 | 3b687b8496784ced8560ad98d08e6a39dae277efeefc52f4bc98822acceebb7a |