Skip to main content

purecalendars purecalendars

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

Holiday calendars and business-day arithmetic for Brazilian and US markets, computed offline.

purecalendars ships official holiday calendars for Brazil (ANBIMA, FEBRABAN, B3) and the United States (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. Every calendar is computed locally: no network, no cache, no browser.

Renamed from wwdates in 3.0.0. Use import purecalendars. Since 3.0.1, import wwdates still works but emits a DeprecationWarning; that alias is removed in 4.0.0. The live fetchers (*Web classes, DatesUSNasdaq) moved to the separate opendata-calendars package, which returns purecalendars calendars.

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

✨ Key Features

🗓️ Holiday providers

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

Provider Import Holidays
DatesBRAnbima purecalendars.br.anbima 🇧🇷 ANBIMA national holidays
DatesBRFebraban purecalendars.br.febraban 🇧🇷 FEBRABAN bank holidays
DatesBRB3 purecalendars.br.b3 🇧🇷 National + B3 exchange non-trading days
DatesUSFederalHolidays purecalendars.us.federal_holidays 🇺🇸 US federal holidays (statutory + observed)

⚙️ 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 purecalendars

Or with Poetry:

poetry add purecalendars

Everything works offline after install — no network, no browser.

Quick start

from datetime import date

from purecalendars.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/purecalendars.git
cd purecalendars
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 3.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 3.0.1
File Size Uploaded Provenance Actions
purecalendars-3.0.1.tar.gz 35.9 kB With provenance Details for purecalendars-3.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 85.3 kB

Release files / purecalendars-3.0.1.tar.gz

Download URL purecalendars-3.0.1.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
98897af133577eb880ecb33fa116b1f97674704d61451e233b05e6e12995bd26
BLAKE2b-256 checksum
How to use checksums
791762df521ade1eb92a6fef3cfa08bb17ad158fc688872f2c0d3835ce3b6f7f
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-3.0.1-py3-none-any.whl

Download URL purecalendars-3.0.1-py3-none-any.whl
Size 49.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
643413fa1f554dcc54fbe228e618b65a57d2e35b278205c28e471f41b00ff169
BLAKE2b-256 checksum
How to use checksums
8a4ed835f57f0fe7fd664902521f572b689b275a4f6185076853c023419f104a
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 3.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-3.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