--- id: business-duration version: "0.68" license: MIT license_treatment: permissive maintenance: aging --- # business-duration — Calculates business duration in days, hours, minutes and seconds by excluding weekends, public holidays and non-business hours License: permissive · Maintenance: aging · Downloads: 74.1K/mo ## What it is and what it does Business-Duration is a utility for calculating elapsed time between two dates while respecting business calendars. It excludes weekends, public holidays, and hours outside a defined business window (e.g., 9 AM to 5 PM), returning the result in your choice of unit: days, hours, minutes, or seconds. The package accepts start and end dates as Python datetime objects, optional custom holiday lists, and a weekend definition, making it useful for SLA tracking, ticket resolution times, or any scenario where you need to measure only active business time. The package depends on numpy and pandas for its core operations. It integrates with the holidays library to handle public holiday calendars and works with both single date pairs and vectorized operations over pandas DataFrames. The implementation is straightforward: you pass datetime objects, business hours, holidays, and a unit, and receive a numeric result representing business duration in that unit. Use it for: - Calculate SLA response or resolution times for support tickets, excluding nights and weekends. - Measure project task duration in business days for resource planning and reporting. - Batch-process a DataFrame of ticket timestamps to compute business hours elapsed per row. - Generate business-day-aware time metrics for compliance or audit reporting. - Build custom business calendars with state-specific or company-specific holidays. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Calculates business duration between two dates by excluding weekends, public holidays, and non-business hours, returning results in days, hours, minutes, or seconds. Yes, if you need business-duration calculations and can tolerate high install friction from numpy/pandas dependencies. The package is stable and permissively licensed, but maintenance is aging—last commit in 2020 with infrequent updates. Suitable for production use in SLA tracking or business-time reporting; consider it a mature utility rather than an actively developed project. No known security vulnerabilities. ## Install pip install business-duration uv add business-duration poetry add business-duration ## Installing business-duration Before you install: High install friction due to compiled dependencies (numpy, pandas). Package maintenance is aging—last commit was 2020-04-02, though a release appeared on 2025-10-12; the repository remains active but infrequently updated. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, provided you retain the license notice. Quickstart: from business_duration import businessDuration import pandas as pd from datetime import time start_date = pd.to_datetime('2017-07-01 02:02:00') end_date = pd.to_datetime('2017-07-07 04:48:00') biz_open_time = time(7, 0, 0) biz_close_time = time(17, 0, 0) result = businessDuration(startdate=start_date, enddate=end_date, starttime=biz_open_time, endtime=biz_close_time, unit='hour') Requires numpy and pandas, which have compiled dependencies and may require build tools or pre-built wheels for your platform. Verify before relying: - Whether the package works with modern Python versions (requires_python is unspecified in metadata). - Whether the 2025-10-12 release represents active maintenance or a one-off update after years of inactivity. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: aging - Downloads: 74.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags business hours duration calculator, working days between dates, exclude weekends holidays time, business time elapsed, work hours duration, business day calculator, non-business hours exclusion, business-calendar, time-calculation, sla-tracking [View on SkillFed](https://skillfed.io/packages/business-duration) · [View on PyPI](https://pypi.org/project/business-duration/)