Client¶
SonnysClient ¶
SonnysClient(
api_id: str,
api_key: str,
site_code: str | None = None,
*,
max_retries: int = 3,
backoffice_username: str | None = None,
backoffice_password: str | None = None,
)
Client for the Sonny's Carwash Controls Data API.
Manages authentication and HTTP session lifecycle. Use as a context
manager or call :meth:close explicitly when done.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_id
|
str
|
Sonny's API ID credential. Also doubles as the BackOffice
subdomain (e.g. |
required |
api_key
|
str
|
Sonny's API key credential. |
required |
site_code
|
str | None
|
Optional site code to scope requests to a specific site. Applies only to the Data API path; ignored by the BackOffice resource (every BackOffice shift already carries its own site code). |
None
|
max_retries
|
int
|
Maximum number of retries for 429 responses. |
3
|
backoffice_username
|
str | None
|
Username for a BackOffice (manager portal)
user. Required to use :attr: |
None
|
backoffice_password
|
str | None
|
Password for the BackOffice user. |
None
|
backoffice
cached
property
¶
backoffice: BackOfficeResource
Access the BackOffice web-UI scraper.
Requires backoffice_username and backoffice_password at
client construction. See :class:BackOfficeResource for the
available methods.