AppConfig
Bases: BaseModel
Application configuration for build_app().
An AppConfig can be constructed directly or loaded from app-config.yaml. It
defines the parking spaces managed by the app, site metadata, optional waitlist
behavior, and the runtime settings used to initialize databases and integrations.
Attributes:
| Name | Type | Description |
|---|---|---|
title |
str
|
Human-readable app title shown in the site and OpenAPI metadata. |
description |
str
|
Short description shown in site and API metadata. |
version |
str
|
Application version string. |
app_email |
EmailStr
|
Google account email used to send waitlist messages. |
app_email_name |
str | None
|
Friendly display name for outbound email.
Defaults to |
app_url |
HttpUrl
|
Public base URL where the app is hosted. |
spaces |
list[SpaceConfig]
|
Configured parking spaces and their static metadata. |
show_individual_spaces |
bool
|
Whether to show the "Spaces" section of the page with individual space occupancy statuses and durations, alongside aggregate counts. You may want to hide this section if your system has a lot of spaces. Defaults to True. |
store_usage_durations |
bool
|
Whether to store occupied and free durations for computing median duration and wait-time estimates. Defaults to True. |
usage_median_num |
int
|
Number of recent duration rows per space type and state to use when computing median usage. Defaults to 1000. |
waitlist |
bool
|
Whether to enable the email waitlist feature. Defaults to True. |
waitlist_free_debounce_minutes |
NonNegativeInt
|
Minutes a space must remain free before waitlist notifications begin. Defaults to 1. |
waitlist_interval_minutes |
PositiveInt
|
Minutes between waitlist notifications while a space remains free. Defaults to 15. |
contact_email |
EmailStr | None
|
Optional support contact included in the site UI and email messages. Defaults to None. |
image |
ImageFile | None
|
Model for a descriptive image to display on the site, with required metadata. Defaults to None. |
page_icon |
str
|
The Mkdocs Material stock icon to use for the monitor page in the navigation sidebar. Search https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/#search for all icons available. Defaults to "octicons/eye-24". |
db_echo |
bool
|
Whether SQLite operations should be echoed for debugging. Defaults to False. |
openapi_url |
str | None
|
Optional FastAPI OpenAPI path. Set to |
space_counter
cached
property
Count configured working spaces by type.
Returns:
| Type | Description |
|---|---|
Counter[SpaceType]
|
Counter[SpaceType]: Mapping of space type to configured working-space count. |
space_types
cached
property
List the active configured space types.
Returns:
| Type | Description |
|---|---|
list[SpaceType]
|
list[SpaceType]: Space types with at least one working configured space. |
total_spaces
cached
property
Return the total number of configured spaces.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Count of configured spaces, including out-of-order entries. |
from_yaml(path)
classmethod
Load application configuration from a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
YamlPath
|
Valid YAML file defining an |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Self |
Self
|
Parsed application configuration. |