Skip to content

AppConfig

Bases: BaseSettings

App configuration model passed to build_app(), either loaded from app-config.yaml or constructed at runtime.

The fields maximum_days_ahead, minutes_before_reminder, calendar_shown, and contact_email can be set globally here, or overridden for individual resources in the resource config yaml file.

Attributes:

Name Type Description
title str

Title of your app, displayed on the home page if there are multiple resources, and openapi docs if enabled.

description str

Description of your app, displayed on the home page if there are multiple resources, and openapi docs if enabled.

app_email str

The email address of the dedicated Google account used for resource calendars.

timezone ZoneInfo

the IANA timezone to use for displaying all calendars.

version str

App version number.

db_echo bool

Whether resource sqlite databases should echo their operations to the console, for debugging purposes. Defaults to False.

openapi_url str | None

If desired, a URL for the openapi docs generated by FastAPI. Defaults to None, which disables autogeneration of docs.

custom_form_fields list[CustomFormField]

custom html form input fields to add for all reservation pages, appended to any fields defined in individual resource config yaml files. Defaults to empty list.

maximum_days_ahead int | None

Positive integer, global default for how many days ahead users can reserve all resources. If None, reservations can be made for any time in the future. Individual resource config files can override this. Defaults to 14 if not set here or overridden.

minutes_before_reminder int

Positive integer, global default for how many minutes before a reservation to send an email reminder to the user, if they've selected to receive one. Individual resource config files can override this. Defaults to 60 if not set here or overridden.

calendar_shown bool

If False, omit the embedded Google calendar view from all reservation pages. The calendar view will also be omitted if the resource has more than 4 calendars, to avoid visual clutter. Individual resource config files can override this. Defaults to True if not set here or overridden.

contact_email str

A contact email address for user issues, listed on all reservation pages if desired. Individual resource config files can override this. Defaults to None if not set here or overridden.

from_yaml(path) classmethod

helper method to load the config from the yaml path passed.

Parameters:

Name Type Description Default
path YamlPath

pathlib.Path object for a valid yaml file defining the config with the same args listed.

required