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.
0.2.0 (2015-12-27)
Fixed bug in work day calculation when end date was not a work day
Credits
business_calendar is written and maintained by Antonio Botelho.
Contributors
Please add yourself here alphabetically when you submit your first pull request.
Metadata
Release files for business_calendar 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| business_calendar-0.2.0.zip | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| business_calendar-0.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 28.0 kB
Release files / business_calendar-0.2.0.zip
| Download URL | business_calendar-0.2.0.zip |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1a37a807f58dfc6e3b4f292307316b629e5446680b225afdffc5a56592d49cd
|
|
BLAKE2b-256 checksum How to use checksums |
3083faadc627e2b9e6d34c456c6d7448de226e5247996df6d05e5bc9961b3b6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / business_calendar-0.2.0-py2.py3-none-any.whl
| Download URL | business_calendar-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bcca359db07fbea45a9f969a418ad1bfba1fc0061f2cd6e4dad8b757ec1543c3
|
|
BLAKE2b-256 checksum How to use checksums |
c6b7f27a0fc3fa0050e71f583664008e60921f6a172061426af5a1384e84adf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |