Metadata-Version: 2.4
Name: opendata-calendars
Version: 1.0.0
Summary: Fetch exchange and bank holiday calendars from their publishers (B3, ANBIMA, FEBRABAN, NASDAQ, US federal), with cache and provenance, returned as purecalendars calendars
License: MIT
License-File: LICENSE
Keywords: opendata-calendars,python,library
Author: guilhermegor
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development :: Libraries
Provides-Extra: web
Requires-Dist: beartype (>=0.22)
Requires-Dist: defusedxml (>=0.7)
Requires-Dist: lxml (>=5.0)
Requires-Dist: numpy (>=1.22)
Requires-Dist: pandas (>=2.1.0)
Requires-Dist: playwright (>=1.40) ; extra == "web"
Requires-Dist: purecalendars (>=4.1.0,<5)
Requires-Dist: requests (>=2.32)
Requires-Dist: xlrd (>=2.0.2)
Project-URL: Bug Reports, https://github.com/guilhermegor/opendata-calendars/issues
Project-URL: Homepage, https://github.com/guilhermegor/opendata-calendars
Project-URL: Repository, https://github.com/guilhermegor/opendata-calendars
Project-URL: Source, https://github.com/guilhermegor/opendata-calendars
Description-Content-Type: text/markdown

<!-- readme-archetype: library -->
# opendata-calendars

<p align="center"><img src="https://raw.githubusercontent.com/guilhermegor/opendata-calendars/main/assets/logo_lorem_ipsum.png" width="200" alt="opendata-calendars logo"></p>

[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
![Python Version](https://img.shields.io/badge/python-3.11%2B-blue.svg)
[![PyPI](https://img.shields.io/pypi/v/opendata-calendars.svg)](https://pypi.org/project/opendata-calendars/)
[![Downloads](https://img.shields.io/pepy/dt/opendata-calendars)](https://pepy.tech/projects/opendata-calendars)
[![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://guilhermegor.github.io/opendata-calendars/)
[![Linting](https://img.shields.io/badge/linting-ruff_%7C_codespell-blue)](https://github.com/astral-sh/ruff)
[![Mypy](https://img.shields.io/badge/type--checked-mypy-blue)](https://mypy-lang.org)
![Test Coverage](https://raw.githubusercontent.com/guilhermegor/opendata-calendars/badges/coverage.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
![Open Issues](https://img.shields.io/github/issues/guilhermegor/opendata-calendars)
![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-darkgreen.svg)

<!-- slug: overview -->
## Overview

Fetch exchange and bank holiday calendars from their publishers (B3, ANBIMA, FEBRABAN, NASDAQ, US federal), with cache and provenance, returned as purecalendars calendars

<!-- slug: documentation -->
## Documentation

The documentation site lives at https://guilhermegor.github.io/opendata-calendars/. Serve it locally with `bash bin/poe_exec.sh docs_serve`.

<!-- slug: getting-started -->
## Getting Started

Python 3.11+ is the only prerequisite; `bin/venv.sh` installs [Poetry](https://python-poetry.org/) when it is missing.

<!-- slug: install -->
### Install

```bash
git clone https://github.com/guilhermegor/opendata-calendars.git
cd opendata-calendars
bash bin/venv.sh
bash bin/poe_exec.sh init
```

`poe` lives inside the virtualenv, so `bin/venv.sh` creates it first; `bin/poe_exec.sh` then
runs `poe init` without activating anything.

<!-- slug: usage -->
### Usage

```bash
pip install opendata-calendars
```

```python
from datetime import date

from opendata_calendars.br import DatesBRB3Web

cls_calendar = DatesBRB3Web()
print(cls_calendar.holidays()[:3])
print(cls_calendar.is_working_day(date(2026, 12, 24)))
```

Each `*Web` class fetches its publisher's page, caches it on disk under `opendata_calendars_cache`,
and exposes the business-day arithmetic of `purecalendars`. Brazilian providers live in
`opendata_calendars.br` (B3, ANBIMA, FEBRABAN), US providers in `opendata_calendars.us` (Nasdaq,
federal holidays). The federal-holidays scrape needs a browser: install the `web` extra and run
`playwright install chromium` once. The classes build on the public calendar base of
`purecalendars` (4.1.0 and later), so the dependency is pinned below the next major.

<!-- slug: project-structure -->
## Project Structure

```text
opendata-calendars/
├── .github/        workflows, CODEOWNERS, PR template
├── .specs/         feature specs and backlog trackers
├── bin/            gate scripts and helpers
├── docs/           published documentation
├── src/            the opendata_calendars package
├── tests/
│   ├── unit/
│   └── integration/
├── pyproject.toml
└── poe_tasks.toml  task runner entry points
```

<!-- slug: development -->
## Development

After the bootstrap under Install, any task can be run with the bootstrap script:
`bash bin/poe_exec.sh <task>`, and `bash bin/poe_exec.sh` with no task lists them.

```bash
bash bin/poe_exec.sh unit_tests
bash bin/poe_exec.sh integration_tests
```

Once the first release's docs deploy has created the `gh-pages` branch, run
`bash bin/poe_exec.sh enable_pages` once: until that branch exists, `init` leaves Pages untouched.

<!-- slug: public-api -->
## Public API

The public surface is the `__all__` of `opendata_calendars`, `opendata_calendars.br` and
`opendata_calendars.us`; everything under `_internal/` is private. The top-level `__all__` is
`["__version__"]`; the providers are `DatesBRAnbimaWeb`, `DatesBRB3Web` and `DatesBRFebrabanWeb`
in `br`, and `DatesUSFederalHolidaysWeb` and `DatesUSNasdaq` in `us`.

### API guarantee (1.x)

From 1.0.0, the names in the `__all__` of `opendata_calendars`, `opendata_calendars.br` and
`opendata_calendars.us` follow semantic versioning: removing or
renaming one, or changing its signature or behaviour incompatibly, happens only in a new
major version. New names and backwards-compatible changes arrive in minor and patch releases.
Everything under `opendata_calendars._internal`, and any name not in `__all__`, is private and
may change in any release. The package ships `py.typed`, so its annotations are part of the
typed API.

<!-- slug: publishing -->
## Publishing

Releases go out from the release workflows under `.github/workflows/`; the git tag is the
version.

The path from 0.x to 1.0.0, and the release gate that guards it, is in
[docs/releasing-1-0-0.md](docs/releasing-1-0-0.md).

<!-- slug: contributing -->
## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for the branch, commit and review rules.

<!-- slug: license -->
## License

This project is licensed under MIT; see [LICENSE](LICENSE).

<!-- slug: authors -->
## Authors

- guilhermegor — [GitHub](https://github.com/guilhermegor) | [LinkedIn](https://www.linkedin.com/in/guilhermegor/)

<!-- slug: useful-links -->
## Useful Links

- [GitHub Repository](https://github.com/guilhermegor/opendata-calendars)
- [Issue Tracker](https://github.com/guilhermegor/opendata-calendars/issues)
- [Documentation](https://guilhermegor.github.io/opendata-calendars/)

---

<sub>Generated from the lib-minimal template via [BlueprintX](https://github.com/guilhermegor/blueprintx).</sub>
<!-- add any project disclaimer inside the sub tag above; for a library wrapping a third party, e.g. "Unofficial, community library. Not affiliated with or endorsed by ORG_NAME." -->

