Overview
mvhs-schedule is a Python library that fetches the day’s class schedule for Mountain View High School from the Firebase database used by the unofficial mvhs.io site. It is published on PyPI as mvhs-schedule and is an async port of an existing npm package of the same name.
Features
- Looks up the schedule type (e.g. “Schedule A”) for a given date, including special schedule days
- Returns the list of periods, with start and end times, for a given schedule or date
- Can fetch periods across a range of consecutive days in one call
- Looks up the start/end time of a specific period on a specific day
- Caches fetched data locally using
platformdirsto avoid repeated Firebase calls - Ships with a GitHub Actions workflow that publishes new versions to PyPI
How it works
The library wraps the Firebase REST API that mvhs.io’s schedule widget reads from, using httpx for async HTTP requests. A FirebaseFetcher class handles fetching and caching the raw schedule and special-day data, which is then parsed into Period objects for the public functions to return. Because every function is a coroutine, callers must await them, letting the library fit into existing asyncio-based bots or scripts (such as scheduling reminders).
