Skip to main content

wwdates wwdates

Project Status: Active Python Version Linting Type-checked: mypy Test Coverage License Open Issues Contributions Welcome

Global calendar system. Python package.

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.

📖 Full documentation: https://guilhermegor.github.io/wwdates/

✨ Key Features

🗓️ Holiday providers

One class per calendar source; all share the same date-operations surface — they differ only in which holidays they load.

Most sources come in two flavours: an offline class (the default — no network, no cache) and a *Web class that reads the publisher's live page.

Provider Import Holidays
DatesBRAnbima wwdates.br.anbima 🇧🇷 ANBIMA national holidays (offline, recommended)
DatesBRAnbimaWeb wwdates.br.anbima_web 🇧🇷 The same set, fetched live from ANBIMA
DatesBRFebraban wwdates.br.febraban 🇧🇷 FEBRABAN bank holidays (offline, recommended)
DatesBRFebrabanWeb wwdates.br.febraban_web 🇧🇷 The same set, fetched live from FEBRABAN
DatesBRB3 wwdates.br.b3 🇧🇷 National + B3 exchange non-trading days (offline, recommended)
DatesBRB3Web wwdates.br.b3_web 🇧🇷 Scraped from B3's trading calendar (2021–2026 only)
DatesUSNasdaq wwdates.us.nasdaq 🇺🇸 Nasdaq market closures
DatesUSFederalHolidays wwdates.us.federal_holidays 🇺🇸 US federal holidays (offline, recommended)
DatesUSFederalHolidaysWeb wwdates.us.federal_holidays_web 🇺🇸 US federal holidays via live scrape

⚙️ Shared calendar operations

Every provider inherits the full surface: working-day predicates (is_working_day, is_holiday, is_weekend), business-day arithmetic (add_working_days, nearest_working_day, get_nth_weekday_month), ranges & deltas (working_days_range, delta_working_days, delta_working_hours), timezone/timestamp conversions, and locale-aware formatting. See the API Reference for the complete list.

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • Poetry (recommended)

Installation

pip install wwdates

Or with Poetry:

poetry add wwdates

Everything works offline after install — no browser needed. The recommended DatesUSFederalHolidays computes federal holidays locally.

Optional: the browser-scrape provider ([web] extra)

Only the DatesUSFederalHolidaysWeb provider needs a browser — it scrapes federalholidays.net with Playwright, which is not installed by the base package. It is vital only if you specifically want that provider's live-scraped dates; otherwise skip this entirely and use the offline DatesUSFederalHolidays.

To enable it, install the optional web extra (note the brackets — quote them so the shell does not glob), then fetch the browser binary:

pip install "wwdates[web]"   # adds Playwright
playwright install chromium  # one-time browser download (pip cannot do this step)

Without both steps, constructing/using DatesUSFederalHolidaysWeb raises a clear ImportError telling you to run them.

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), ...]

DatesBRB3 here is just an example — the same methods work on every provider; only the loaded holiday set differs. More recipes in the Examples guide.

📚 Documentation

🛠️ Development

git clone https://github.com/guilhermegor/wwdates.git
cd wwdates
make init                  # or: bash tasks.sh init  (venv + deps + pre-commit hooks)
make unit_tests            # run the test suite
make install_dist_locally  # build the wheel and smoke-import it

See Contributing for the full branch/PR workflow and CI gate.

👨‍💻 Authors

Guilherme Rodrigues
GitHub
LinkedIn

🤝 Contributing

Issues and PRs are welcome. Please read CONTRIBUTING.md first for dev setup, tests, the branch/PR workflow, and the CI gate.

📜 License

This project is licensed under the MIT License — see LICENSE for details.

Metadata

Release files for purecalendars 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for purecalendars 1.0.1
File Size Uploaded Provenance Actions
purecalendars-1.0.1.tar.gz 66.4 kB With provenance Details for purecalendars-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for purecalendars 1.0.1
File Interpreter ABI Platform Actions
purecalendars-1.0.1-py3-none-any.whl Python 3 none any Details for purecalendars-1.0.1-py3-none-any.whl

Total release size: 158.0 kB

Release files / purecalendars-1.0.1.tar.gz

Download URL purecalendars-1.0.1.tar.gz
Size 66.4 kB
Tags Source
SHA-256 checksum
How to use checksums
319d1c5f8dca91620dacd725cdc74c847ad076e7843e2678bdd9d1df7a9659b6
BLAKE2b-256 checksum
How to use checksums
c96f6f28b380cb61d97a5ff16c5c10fe68d57bc83d7e9d395ec0054dd36f83d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / purecalendars-1.0.1-py3-none-any.whl

Download URL purecalendars-1.0.1-py3-none-any.whl
Size 91.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0031748be8c1fb742317fc390a94ae1b134083852d4dadf59d417d649959e4a7
BLAKE2b-256 checksum
How to use checksums
b3989c9d94daca4536c38d27a069d5e9c40acf827f469df27fffcbf63a8b5c4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for purecalendars 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for purecalendars-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page