Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8f0e98e
Add make_wsgi_app function
djbulsink Oct 21, 2025
6a6f705
Refactor WSGI app configuration to use local variables instead of env…
djbulsink Oct 21, 2025
f33b7c1
Enhance docstrings in config and openapi modules to clarify argument …
djbulsink Oct 21, 2025
1f95b3c
flake codestyle fixes
djbulsink Oct 21, 2025
8168dc5
Fix argument name in load_openapi_document call in make_wsgi_app func…
djbulsink Oct 21, 2025
f68df95
Refactor docstrings in config and openapi modules to use :param for a…
djbulsink Oct 23, 2025
9399cf7
Revert unintended change
djbulsink Oct 23, 2025
14ffc46
Update environment variable check for WSGI app configuration
djbulsink Oct 23, 2025
9455ca5
Type hint, upper cases and var naming
djbulsink Oct 27, 2025
fab8466
Refactor line breaks for improved readability in make_wsgi_app function
djbulsink Oct 27, 2025
0ea15ef
Fix indentation for improved readability in make_wsgi_app function
djbulsink Oct 27, 2025
fcd449e
Fix line breaks for improved readability in make_wsgi_app function
djbulsink Oct 27, 2025
f9d21ed
Add collection items endpoint and refactor item handling in make_wsgi…
djbulsink Oct 27, 2025
d63ea39
Refactor route definitions and response handling for improved readabi…
djbulsink Oct 27, 2025
71c9350
Fix indentation for improved readability in get_jobs endpoint definition
djbulsink Oct 28, 2025
8321213
Fix image reference in vulnerabilities workflow for consistency
djbulsink Oct 28, 2025
299c0b0
[no ci] Revert fix trivy action
djbulsink Oct 28, 2025
d3b1bed
Merge remote-tracking branch 'origin' into fetch-upstream
djbulsink Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions pygeoapi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,30 @@
LOGGER = logging.getLogger(__name__)


def get_config(raw: bool = False) -> dict:
def get_config(config_path: str = None, raw: bool = False) -> dict:
"""
Get pygeoapi configurations

:param config_path: `str` of configuration file location, if `None`
will attempt to read from `PYGEOAPI_CONFIG`
:param raw: `bool` over interpolation during config loading

:returns: `dict` of pygeoapi configuration
"""

if not os.environ.get('PYGEOAPI_CONFIG'):
raise RuntimeError('PYGEOAPI_CONFIG environment variable not set')
if config_path is None:
config_path = os.environ.get('PYGEOAPI_CONFIG')

with open(os.environ.get('PYGEOAPI_CONFIG'), encoding='utf8') as fh:
if config_path is None:
raise KeyError('PYGEOAPI_CONFIG environment variable not set')

with open(config_path, encoding='utf8') as fh:
if raw:
CONFIG = yaml.safe_load(fh)
config = yaml.safe_load(fh)
else:
CONFIG = yaml_load(fh)
config = yaml_load(fh)

return CONFIG
return config


def load_schema() -> dict:
Expand Down
Loading