A Python component scaffold for configuration utilities.
Project description
appfx.configuration
appfx.configuration is a typed Python configuration component with Azure App
Configuration support. It can load .env values into environment variables,
read settings from Azure App Configuration using DefaultAzureCredential, and
optionally write Azure settings into os.environ for libraries that read from
environment variables.
Package names
- PyPI / distribution name:
appfx-configuration - Python import namespace:
appfx.configuration - Environment namespace:
appfx.configuration.env - Azure configuration namespace:
appfx.configuration.azure
Installation
Install the package from PyPI once published:
python -m pip install appfx-configuration
For local development, install the package in editable mode with developer tools:
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
Configuration
Copy .env.example to .env, then replace the sample endpoint with your
Azure App Configuration endpoint URL:
Copy-Item .env.example .env
AZURE_APPCONFIG_ENDPOINT=https://<your-app-configuration-name>.azconfig.io
The endpoint key name must be exactly AZURE_APPCONFIG_ENDPOINT. The Azure
loader reads this value from .env / os.environ before connecting to Azure App
Configuration.
.env is intentionally ignored by Git so local endpoints and secrets are not
committed.
Usage
Load only .env values into os.environ:
from appfx.configuration.env import load_environment_variables
local_settings = load_environment_variables()
Read settings from Azure App Configuration and local .env values as a
dictionary:
from appfx.configuration.azure import load_app_configuration_settings
settings = load_app_configuration_settings()
value = settings["MY_SETTING"]
Load .env and Azure App Configuration values into os.environ:
from appfx.configuration.azure import load_app_configuration_environment
settings = load_app_configuration_environment()
The loader uses DefaultAzureCredential, so authenticate with one of the Azure
Identity-supported mechanisms before running code that contacts Azure, such as
Azure CLI sign-in, managed identity, or environment-based credentials.
Loading behavior
load_app_configuration_settings() returns a dictionary and does not write Azure
App Configuration values into os.environ. Use
load_app_configuration_environment() when you want Azure values added to the
process environment. Existing process environment values win by default; pass
override=True to replace them with loaded configuration values.
The loaders use this precedence order:
- Azure App Configuration values load first.
- Values from
.envoverride Azure values with the same key. - Existing process environment values may override matching keys from
.env.
Unrelated process environment variables are not included in the returned settings
dictionary. If AZURE_APPCONFIG_ENDPOINT is missing or blank, the loader raises
AzureAppConfigurationEndpointError with a clear setup message.
Validate locally
python -m pytest
python -m pytest --cov
python -m ruff check .
python -m ruff format --check .
python -m mypy
python -m build
python -m twine check dist/*
Publishing
This project is configured for PyPI Trusted Publishing through GitHub Actions, so releases do not require a PyPI API token in GitHub secrets or local terminals.
Before the first publish, create a PyPI pending publisher for
appfx-configuration with these values:
- PyPI project name:
appfx-configuration - Owner:
Dongbumlee - Repository name:
appfx-configuration - Workflow name:
publish.yml - Environment name:
pypi
To publish a release, create and publish a GitHub release, or run the Publish
workflow manually from GitHub Actions after the pending publisher is configured.
Project layout
src/appfx/configuration/- package sourcesrc/appfx/configuration/env.py-.envenvironment loadersrc/appfx/configuration/azure/- Azure App Configuration helperstests/- automated testsdocs/- package documentationexamples/- runnable usage examplesscripts/- maintenance/release script notes
Next steps
- Add full public API documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file appfx_configuration-0.1.0.tar.gz.
File metadata
- Download URL: appfx_configuration-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe6f14efa4d8b9da2eb86f2ad54a21811e0576788a401e734452642f65077473
|
|
| MD5 |
813606713b6fa50ab0477c37ed57d0eb
|
|
| BLAKE2b-256 |
9ea5436a11f5fbac1c40b1259a078bdbbfbd2999e86ebdef0ac4c8a9d364fdf1
|
Provenance
The following attestation bundles were made for appfx_configuration-0.1.0.tar.gz:
Publisher:
publish.yml on Dongbumlee/appfx-configuration
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
appfx_configuration-0.1.0.tar.gz -
Subject digest:
fe6f14efa4d8b9da2eb86f2ad54a21811e0576788a401e734452642f65077473 - Sigstore transparency entry: 1637453812
- Sigstore integration time:
-
Permalink:
Dongbumlee/appfx-configuration@dc0ef32e4df56556a6624d5d1e0c37cc19ff754b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Dongbumlee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc0ef32e4df56556a6624d5d1e0c37cc19ff754b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file appfx_configuration-0.1.0-py3-none-any.whl.
File metadata
- Download URL: appfx_configuration-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c4c4f463ed9b265075dfd1c60246cea96ec704b265b1dafc496805ede2bad7f
|
|
| MD5 |
92a77c5ea175173175e58b05a7771146
|
|
| BLAKE2b-256 |
6515706aedd4034b9b185356f1edbfb3eef128ad6cfa548685d5b463d71948d0
|
Provenance
The following attestation bundles were made for appfx_configuration-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Dongbumlee/appfx-configuration
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
appfx_configuration-0.1.0-py3-none-any.whl -
Subject digest:
4c4c4f463ed9b265075dfd1c60246cea96ec704b265b1dafc496805ede2bad7f - Sigstore transparency entry: 1637454015
- Sigstore integration time:
-
Permalink:
Dongbumlee/appfx-configuration@dc0ef32e4df56556a6624d5d1e0c37cc19ff754b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Dongbumlee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc0ef32e4df56556a6624d5d1e0c37cc19ff754b -
Trigger Event:
workflow_dispatch
-
Statement type: