calista.config¶
calista.config
¶
Configuration utilities for CALISTA.
This module centralizes small helpers and constants related to application configuration.
DatabaseUrlNotSetError
¶
Bases: Exception
Raised when the CALISTA_DB_URL environment variable is not set.
get_db_url()
¶
Get the database URL from the environment.
Returns:
| Type | Description |
|---|---|
str
|
The value of the |
Raises:
| Type | Description |
|---|---|
DatabaseUrlNotSetError
|
If |
build_alembic_config(db_url=None, stdout=sys.stdout)
¶
Build an Alembic Config object for CALISTA's migrations.
Sets only Alembic "main" options:
- sqlalchemy.url → the database URL you pass
- script_location → CALISTA's packaged Alembic scripts
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_url
|
str | None
|
SQLAlchemy database URL (e.g., |
None
|
stdout
|
TextIO
|
Text stream Alembic will write status lines to. Defaults to
|
stdout
|
Returns:
| Type | Description |
|---|---|
Config
|
An |