Skip to main content

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

essex_config-0.0.6.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

essex_config-0.0.6-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

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

Hashes for essex_config-0.0.6.tar.gz
Algorithm Hash digest
SHA256 cd8b1859cbb2628a93af16b8edb297f7a608aba53a9a05d776b4834e2f484ded
MD5 a7f3402398b03efa19cc23cc6b4948ca
BLAKE2b-256 c81b1776b4950fb21b10e3112adce8deef433f20fc1d5c72545884bef90adefb

See more details on using hashes here.

Provenance

The following attestation bundles were made for essex_config-0.0.6.tar.gz:

Publisher: python-publish.yml on microsoft/essex-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for essex_config-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5ad1be9e989f2e3f2582079d0232bb9d4ba3cf0d216cb8e0062f243c49a1f0a4
MD5 0c37aa9e28d52137ff9650a8c12dc83e
BLAKE2b-256 3a510dfa69971d0f71da4be70e644ca855b3e83334dc6775816db455f7b714c8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page