brooms
Book a study room at the University of Bath from Python.
Froom finds free rooms; brooms books rooms. It drives bath.libcal.com, where Bath students book group study rooms, tables and meeting booths in the Library, 1 West, 8 West, East Building, Norwood House and the Virgil Building. No browser needed, so it works in scripts, cron jobs and agents.
Install
pip install brooms
Requires Python 3.11+.
Quick start
from datetime import date, timedelta
from brooms import Brooms
b = Brooms("ab123", "password") # your Bath username and password
monday = date.today() + timedelta(days=3)
free = [s for s in b.availability(monday, type="group study room", zone="library")
if s.available and s.start.hour == 14]
print(free[0].space.name, free[0].start) # Library 1.12 2026-10-05 14:15:00
booking = b.book(free[0], hours=2) # 14:15-16:15
b.cancel("https://bath.libcal.com/equipment/cancel?id=...") # the link from the email
b.spaces() lists every room, table and booth (b.spaces("city") for the Virgil Building), and looking needs no login at all. There's a fuller script in examples/.
Good to know
- Bookings open 7 days ahead, in 1-hour slots starting at quarter past. A booking can be 1 or 2 hours.
- Cancelling needs the link from the confirmation email the site sends to your university address. It's the only handle the site gives on a booking, so brooms can't list your bookings either. To automate cancelling, have whatever reads your email (e.g. an agent with a Microsoft 365 connector) pass the link to
cancel(). - Logging in goes through Bath's single sign-on with your username and password, like a browser. Keep them out of your code, e.g. in your OS keychain or environment variables.
- Rooms, tables and booths only. Study desks are booked a different way and aren't supported yet. Bath's spaces are free; if one ever costs money,
book()refuses it. - If a booking attempt fails halfway, its slot stays held for about 5 minutes and shows as unavailable until then.
Development
uv sync
uv run pytest # offline, no account needed
uv run pytest -m live # read-only checks against the real site, no account needed
See CONTRIBUTING.md and the roadmap.
License
Metadata
Release files for brooms 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| brooms-0.1.0.tar.gz | 45.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| brooms-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 56.7 kB
Release files / brooms-0.1.0.tar.gz
| Download URL | brooms-0.1.0.tar.gz |
|---|---|
| Size | 45.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f697f11efa39452f856432ce57ff9bc350eca9e44b2892bbb37123be84a8a7fc
|
|
BLAKE2b-256 checksum How to use checksums |
66c7a85cb8868359acdf8b7c60da036e121e9b6f97c2ea5b3745abc3c7e82319
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency logRelease files / brooms-0.1.0-py3-none-any.whl
| Download URL | brooms-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bcf9ba8c7bb3d104a653cca9c665a621ebb6c23890ce10dfc530cfee484ce54
|
|
BLAKE2b-256 checksum How to use checksums |
7850926923d4b86a2f0df3aa8f1e53d4105a7f03242153834b9895a0e2872369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency log