Skip to content

A simple python utility for calculating business time aware timedeltas between two datetimes

License

Notifications You must be signed in to change notification settings

seatgeek/businesstime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

businesstime

https://badge.fury.io/py/businesstime.png https://travis-ci.org/seatgeek/businesstime.png?branch=master

BusinessTime is a simple utility for calculating business time aware timedeltas between two datetimes. BusinessTime's understanding of weekends, holidays and business hours can be easily configured in code.

>>> datetime(2013, 12, 26, 5) - datetime(2013, 12, 23, 12)
datetime.timedelta(2, 61200)
>>> bt = businesstime.BusinessTime(holidays=businesstime.holidays.usa.USFederalHolidays())
>>> bt.businesstimedelta(datetime(2013, 12, 23, 12), datetime(2013, 12, 26, 5))
datetime.timedelta(1, 18000)

Features

  • Simple, pythonic, business-time-aware datetime math
  • A simple declarative format for defining holidays
  • A number of useful iterators/predicate functions related to holidays/weekends/business hours

About

A simple python utility for calculating business time aware timedeltas between two datetimes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages