Python library for creating configuration objects that read from various sources, including files, environment variables, and Azure Key Vault.
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Getting Started
essex-config is a Python library for creating configuration objects that read from various sources, including files, environment variables, and Azure Key Vault.
pip install essex-config
Basic Usage
Create a configuration object for connecting to a customer database:
from pydantic import BaseModel, Field
from essex_config import load_config
class CustomerDatabase(BaseModel):
"""Configuration for connecting to the Customer Database"""
host: str = Field(default="127.0.0.1", description="DB connection host")
port: int = Field(description="DB connection port")
password: str = Field(description="DB connection password")
if __name__ == "__main__":
config = load_config(CustomerDatabase)
print(config)
When load_config(CustomerDatabase) is executed, values are populated from environment variables or default values.
Nested Configurations
Nest configuration objects:
class Inner(BaseModel):
inner_hello: str
class NestedConfiguration(BaseModel):
hello: str
nested: Inner
nested_config = load_config(NestedConfiguration)
load_config() populates every field, including nested_config.nested.inner_hello. The default prefix for every field in Inner is nested, which can be changed with Annotated[Inner, Prefixed("new_prefix")].
Project details
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 essex_config-0.0.6.tar.gz.
File metadata
- Download URL: essex_config-0.0.6.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd8b1859cbb2628a93af16b8edb297f7a608aba53a9a05d776b4834e2f484ded
|
|
| MD5 |
a7f3402398b03efa19cc23cc6b4948ca
|
|
| BLAKE2b-256 |
c81b1776b4950fb21b10e3112adce8deef433f20fc1d5c72545884bef90adefb
|
Provenance
The following attestation bundles were made for essex_config-0.0.6.tar.gz:
Publisher:
python-publish.yml on microsoft/essex-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
essex_config-0.0.6.tar.gz -
Subject digest:
cd8b1859cbb2628a93af16b8edb297f7a608aba53a9a05d776b4834e2f484ded - Sigstore transparency entry: 166141490
- Sigstore integration time:
-
Permalink:
microsoft/essex-toolkit@e0a11e94f56de979a5e9e97f5e1f3af874b8bbd0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/microsoft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e0a11e94f56de979a5e9e97f5e1f3af874b8bbd0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file essex_config-0.0.6-py3-none-any.whl.
File metadata
- Download URL: essex_config-0.0.6-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ad1be9e989f2e3f2582079d0232bb9d4ba3cf0d216cb8e0062f243c49a1f0a4
|
|
| MD5 |
0c37aa9e28d52137ff9650a8c12dc83e
|
|
| BLAKE2b-256 |
3a510dfa69971d0f71da4be70e644ca855b3e83334dc6775816db455f7b714c8
|
Provenance
The following attestation bundles were made for essex_config-0.0.6-py3-none-any.whl:
Publisher:
python-publish.yml on microsoft/essex-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
essex_config-0.0.6-py3-none-any.whl -
Subject digest:
5ad1be9e989f2e3f2582079d0232bb9d4ba3cf0d216cb8e0062f243c49a1f0a4 - Sigstore transparency entry: 166141493
- Sigstore integration time:
-
Permalink:
microsoft/essex-toolkit@e0a11e94f56de979a5e9e97f5e1f3af874b8bbd0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/microsoft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e0a11e94f56de979a5e9e97f5e1f3af874b8bbd0 -
Trigger Event:
push
-
Statement type: