business_days_between
Count business days and list weekday holidays between two dates using country-specific holiday calendars. Ideal for SLAs, delivery windows, or payroll periods.
Instructions
Count business days and list weekday holidays between two dates.
Use this to measure working-day spans for SLAs, delivery windows, or payroll
periods. Weekend holidays are NOT listed in holidays_in_range (they do not
reduce the business-day count); weekday holidays are.
Args: start_date: ISO 8601 date string (YYYY-MM-DD). Must be <= end_date. end_date: ISO 8601 date string (YYYY-MM-DD). country: ISO 3166-1 alpha-2 code (case-insensitive, normalized to upper). inclusive: When True, both endpoints count toward the range. When False (default), end_date is excluded (half-open interval). subdiv: Optional country-specific subdivision code (case-sensitive; see get_supported_countries). When omitted, only nation-wide holidays are considered.
Returns: dict with keys: start_date, end_date, country, subdiv (only if provided), inclusive, business_days (int), calendar_days (int), holidays_in_range (list of {date, name} for weekday holidays only).
Raises:
ValueError: if start_date > end_date, the span exceeds 100 years,
dates are malformed, or country/subdiv is unknown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_date | Yes | ||
| end_date | Yes | ||
| country | Yes | ||
| inclusive | No | ||
| subdiv | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||