Skip to content

Settings

settings

get_settings() cached

Return the cached Settings instance (memoized via lru_cache).

Source code in xplan_tools/settings/settings.py
@lru_cache
def get_settings() -> Settings:
    """Return the cached `Settings` instance (memoized via ``lru_cache``)."""
    return Settings()

Settings

Bases: BaseSettings

Runtime configuration for database access and schema creation.

Values are read from environment variables prefixed with xmas_ (e.g. db_srid is set via XMAS_DB_SRID) or from a .env file; unknown variables are ignored.

Attributes:

Name Type Description
db_srid int

EPSG SRID of the geometry columns created in the database.

db_schema str | None

PostgreSQL schema to place the tables in; None uses the default (public) namespace.

db_views bool

Whether to create per-geometry-type views alongside the tables.

db_insert_batch_size int

Number of features per batch when bulk-inserting.

db_pool_size int

SQLAlchemy connection-pool size for PostgreSQL engines.

db_pool_max_overflow int

Connections allowed beyond db_pool_size.

db_pool_timeout int

Seconds to wait for a pooled connection before erroring.

db_pool_recycle int

Seconds after which a pooled connection is recycled.

db_pool_pre_ping bool

Whether to liveness-check pooled connections before use.