wwdates
¶
Global calendar system.
wwdates fetches official holiday calendars for Brazil (ANBIMA, FEBRABAN, B3) and the United
States (Nasdaq, Federal Holidays), then layers a rich set of working-day / date helpers on top
β is_working_day, add_working_days, working_days_range, delta_working_days,
timezone-aware conversions, and more. Fetched calendars are cached locally so repeated calls
stay fast and offline-friendly.
Contents¶
| Section | Description |
|---|---|
| Usage | Installation, choosing a provider, and basic examples |
| Examples | Task-oriented recipes (settlement dates, expiry, cross-market) |
| API Reference | Public providers and every shared calendar operation |
| FAQ | Common questions and troubleshooting |
| Contributing | Dev setup, testing, wheel build, PR workflow, releasing |
| Changelog | Per-version release history |
Quick start¶
from datetime import date
from wwdates.br.b3 import DatesBRB3
cls_cal = DatesBRB3()
cls_cal.is_working_day(date(2024, 12, 25)) # False β Christmas
cls_cal.add_working_days(date(2024, 12, 24), 3) # skips holidays + weekends
cls_cal.holidays() # [(name, date), ...]
Everything works offline after install. Only the optional DatesUSFederalHolidaysWeb (a live
scrape) needs a browser β enable it with pip install "wwdates[web]" then
playwright install chromium. The rest, including the recommended offline
DatesUSFederalHolidays, need neither. See Usage.
Providers at a glance¶
| Country | Import | Source |
|---|---|---|
| π§π· Brazil | from wwdates.br.anbima import DatesBRAnbima |
ANBIMA national holidays |
| π§π· Brazil | from wwdates.br.febraban import DatesBRFebraban |
FEBRABAN bank holidays |
| π§π· Brazil | from wwdates.br.b3 import DatesBRB3 |
ANBIMA + B3 exchange extras |
| πΊπΈ USA | from wwdates.us.nasdaq import DatesUSNasdaq |
Nasdaq trading calendar |
| πΊπΈ USA | from wwdates.us.federal_holidays import DatesUSFederalHolidays |
US federal holidays (offline, recommended) |
| πΊπΈ USA | from wwdates.us.federal_holidays_web import DatesUSFederalHolidaysWeb |
US federal holidays via live scrape |
Generated from the lib-minimal template via BlueprintX.