How to calculate business days in Python

Three honest options, from stdlib to API, with the trade-offs stated.

1. numpy.busday_offset - fast, weekends only by default

import numpy as np
np.busday_offset("2027-03-25", 2, roll="forward")   # skips Sat/Sun only

Correct only if you supply holidays yourself via holidays=[...] - and keeping that list right, per country, forever, is the actual problem.

2. The holidays package - good data, bring your own math

import holidays
us = holidays.country_holidays("US", years=2027)
"2027-11-25" in us   # True (Thanksgiving)

Excellent open-source calendar data (it's one of the sources Dierum builds on), but business-day arithmetic, per-country weekends, and market calendars are still yours to write and test.

3. One HTTP call

import requests
r = requests.get("https://<host>/v1/add",
    params={"region": "XNYS", "start": "2027-03-25", "days": 2},
    headers={"X-Api-Key": KEY})
r.json()["result"]   # "2027-03-30", Good Friday skipped

Need this in code? The API answers the same questions over HTTPS with one GET request. Free tier of 100 calls a day, and the playground needs no key at all.