Metadata-Version: 2.4
Name: bhs-calendars
Version: 2.9.1
Summary: Bundled BHS-area school bell-schedule calendar data for the bells library
Author: Peter Seibel
License-Expression: MIT
Project-URL: Homepage, https://github.com/gigamonkey/bells
Project-URL: Repository, https://github.com/gigamonkey/bells
Project-URL: Bug Tracker, https://github.com/gigamonkey/bells/issues
Keywords: bell schedule,school,calendar,berkeley high,bhs,education,data
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Education
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# bhs-calendars (Python)

Bundled bell-schedule calendar data for Berkeley High School and nearby middle
schools, as a Python distribution. This is the Python counterpart of the npm
[`@peterseibel/bhs-calendars`](https://github.com/gigamonkey/bells/tree/main/bhs-calendars) package and ships the same
per-year JSON.

It is data, not logic — pair it with the [`bells`](https://github.com/gigamonkey/bells/tree/main/libs/python) library to build
schedules without supplying your own `{year}.json` files.

```sh
pip install bhs-calendars
```

## Usage

```python
from bhs_calendars import by_id, load_all
from bells import BellSchedule

# Grouped by school, each school's years sorted chronologically:
years = by_id()["bhs"]
schedule = BellSchedule(years, {})

# Or the flat list of every bundled school-year:
all_years = load_all()   # list[dict]
```

`load_all()` mirrors the npm package's default export (a flat list of yearly
calendar objects). `by_id()` groups those by their `id` field — `"bhs"`,
`"king-6"`, `"king-7"`, `"king-8"`, `"longfellow-6"`, `"longfellow-78"`,
`"willard-6"`, `"willard-78"` — with each group's years sorted by `firstDay`.

Unlike the library's `Calendars` loader (which reads `{year}.json` from a
directory or URL), this data is bundled on disk with the package: no filesystem
layout or network access required. The trade-off is that it only covers the
BHS-area schools.

## Data source

The JSON under `bhs_calendars/data/` is copied verbatim from the canonical
`bhs-calendars/` directory at the repository root (the npm package source). Run
`make sync-calendars` from the repo root to refresh it after the source data
changes.
