skip to navigation
skip to content

Not Logged In

business_calendar 0.1.0

Simple business days, including custom work week and a holiday list.

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.

 
File Type Py Version Uploaded on Size
business_calendar-0.1.0-py2.py3-none-any.whl (md5) Python Wheel 3.3 2014-06-22 11KB
business_calendar-0.1.0.tar.gz (md5) Source 2014-06-22 9KB
  • Downloads (All Versions):
  • 8 downloads in the last day
  • 55 downloads in the last week
  • 92 downloads in the last month