Skip to main content

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.

Downloads Download format TravisCI

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.

0.2.1 (2015-12-27)

  • Fixed distribution issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

business_calendar-0.2.1.zip (15.2 kB view details)

Uploaded Source

Built Distribution

business_calendar-0.2.1-py2.py3-none-any.whl (12.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file business_calendar-0.2.1.zip.

File metadata

File hashes

Hashes for business_calendar-0.2.1.zip
Algorithm Hash digest
SHA256 ed434c389c277438592df7285fde5882d3c26c6d9658a9cd3c35adee4d136d6d
MD5 7ff8f2cc99f3e9321867ed494cd1ea83
BLAKE2b-256 c63e1f169d876cf8b041607934c8915057c86bdc3e80b499fd79118d9cef005b

See more details on using hashes here.

File details

Details for the file business_calendar-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for business_calendar-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2f91a0a41c8b7bd641afa33befc6e8d5e871beb16c827bc2d508f1025e78c635
MD5 448a7364107e3f1e3bd8d633d3ecdbd1
BLAKE2b-256 bc72c4a6df785b7684190756fc58e97cfb3baf298670ff421f4dadde74d50f8b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page