Skip to content

HallmasterClient

hmwrapper.client.HallmasterClient

Authenticated HTTP client for the Hallmaster internal API.

Handles login, session persistence, and anti-forgery token management.

Credentials can be provided directly or via environment variables

HM_EMAIL, HM_PASSWORD, HM_HALL_ID

Supports use as a context manager::

with HallmasterClient() as client:
    bookings = BookingsAPI(client)
    ...

close()

Close the underlying HTTP session.

get(path, **kwargs)

GET request, returning parsed JSON.

get_html(path, **kwargs)

GET request, returning raw HTML text.

post(path, **kwargs)

POST request with automatic anti-forgery token.

post_form(path, data, **kwargs)

POST an MVC form with anti-forgery token embedded in form data.

Encodes the form body as a pre-built string with bracket characters percent-encoded (%5B/%5D) to avoid WAF rejection, and includes sec-fetch headers to match browser behaviour.