businesstimedelta
Timedelta for business time. Supports exact amounts of time (hours, seconds), custom schedules, holidays, and time zones.
What it is and what it does
BusinessTimeDelta is a Python library that calculates the elapsed time between two datetimes while respecting business hours, not calendar time. It lets you define working schedules (start/end times, working days), exclude lunch breaks and holidays, and perform arithmetic on business time intervals. The package integrates with pytz for timezone handling and the holidays library for holiday exclusion.
You define your business rules once—specifying work hours, days of the week, lunch breaks, and holidays—then use those rules to compute the actual working time between any two datetimes or to add/subtract business time from a given moment. This is useful for SLAs, ticket response times, project scheduling, and any domain where elapsed time should count only working hours.
Use it for:
- Calculate SLA compliance: measure working hours elapsed since a support ticket was opened, excluding nights and weekends.
- Project scheduling: add business days and hours to a start date to estimate a realistic delivery deadline.
- Multi-timezone overlap: find the working-hour intersection between teams in different time zones.
- Payroll and shift tracking: compute hours worked across day and night shifts, accounting for lunch breaks.
- Holiday-aware reporting: exclude company holidays and local holidays from time-tracking calculations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Calculates elapsed working time between two datetimes, accounting for business hours, lunch breaks, holidays, and time zones.
No—not recommended for new projects. The package is abandoned (last commit 2022-01-26) and will not receive updates. While it has low install friction and a permissive MIT license, the lack of maintenance means you will inherit any compatibility issues and cannot rely on bug fixes. Consider an actively maintained alternative if business time calculation is critical to your application.
Install
businesstimedelta on PyPI
pip
pip install businesstimedeltauv
uv add businesstimedeltapoetry
poetry add businesstimedeltaInstalling businesstimedelta
Before you install
Low install friction with only 2 runtime dependencies (pytz and holidays). However, the package is abandoned—last commit was 2022-01-26—so it will not receive bug fixes or updates.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
import datetime
import businesstimedelta
workday = businesstimedelta.WorkDayRule(
start_time=datetime.time(9),
end_time=datetime.time(18),
working_days=[0, 1, 2, 3, 4])
businesshrs = businesstimedelta.Rules([workday])
start = datetime.datetime(2016, 1, 18, 9, 0, 0)
end = datetime.datetime(2016, 1, 22, 18, 0, 0)
bdiff = businesshrs.difference(start, end)
print(bdiff.hours)
Verify before relying
- Whether the package works reliably with modern Python versions despite being abandoned since 2022
- Active maintenance or community forks that may address compatibility issues
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pytz, holidays |
| Maintenance | abandoned — 2,533 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,398,661/month — #3,956 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: businesstimedelta-1.0.1-py3-none-any.whl
Keywords: business, working, time, timedelta, hours, businesstime, businesshours
Tags
More Scheduling packages
Generates country- and subdivision-specific…
permissive · top 1,000 on PyPI
ortoolsOR-Tools provides constraint programming,…
permissive · top 5,000 on PyPI
recurring-ical-eventsExpands recurring iCalendar events (RFC 5545)…
copyleft · top 5,000 on PyPI
caldavA CalDAV (RFC4791) client library for Python…
unclear · top 5,000 on PyPI
icsReads and writes iCalendar (RFC 5545) files in…
permissive · top 15,000 on PyPI
fiscalyearProvides fiscal year, quarter, month, and day…
permissive · top 15,000 on PyPI
business-durationCalculates business duration between two dates…
permissive · top 15,000 on PyPI
temporaProvides utilities, constants, and routines for…
permissive · top 5,000 on PyPI
dateutilsProvides date and time arithmetic operations,…
permissive · top 5,000 on PyPI
deltaParses human-readable duration strings like '1…
permissive · top 15,000 on PyPI
pandas_market_calendarsProvides market and exchange trading calendars…
permissive · top 5,000 on PyPI
chinese-calendarDetermines whether a specific date in China is…
permissive · top 15,000 on PyPI