bizdays

raw JSON →
1.0.19 verified Fri May 01 auth: no python

bizdays is a Python library for business days calculations, including offsetting dates, computing business days between dates, and generating calendars with custom holidays. Current version: 1.0.19, with monthly releases.

pip install bizdays
error ModuleNotFoundError: No module named 'bizdays.utils'
cause Importing from a non-existent submodule. bizdays does not expose a 'utils' submodule.
fix
Use from bizdays import Calendar instead.
error ValueError: Invalid date format. Use YYYY-MM-DD.
cause Passing a date object without converting to string or using an incorrect format.
fix
Ensure dates are strings in 'YYYY-MM-DD' format or datetime.date objects.
error requests.exceptions.ConnectionError: Failed to load calendar from remote
cause No internet connection when using Calendar.load with a remote calendar name.
fix
Use a local calendar file or ensure internet access.
breaking In version 1.0, the library dropped support for Python 3.6 and below. Ensure your Python version is >=3.9 as per current requirements.
fix Upgrade Python to 3.9 or higher.
gotcha Calendar.load('Brazil/ANBIMA') relies on an internet connection to fetch holiday data. If offline, the call will fail.
fix Pre-load the calendar and cache it, or use a local JSON file with `Calendar` constructor.
gotcha Date arguments to bizdays functions must be strings in 'YYYY-MM-DD' format or datetime.date objects. Passing pandas Timestamps may cause unexpected behavior.
fix Convert Timestamps using .date() or format to string before passing.
deprecated The `load` method with a string argument (e.g., 'Brazil/ANBIMA') is stable but may be deprecated in future in favor of a more explicit API. Check release notes for updates.
fix Monitor changelog for any changes to calendar loading.

Basic usage: load a calendar and perform business day calculations.

from bizdays import Calendar

# Create a calendar with Brazil's holidays
cal = Calendar.load('Brazil/ANBIMA')

# Calculate business days offset
result = cal.offset('2026-05-01', 5)
print(result)  # Should print next business day after 5 days

# Calculate business days between dates
days = cal.bizdays('2026-05-01', '2026-05-10')
print(days)  # Number of business days