Skip to main content

Typed config reader for resolved Coffer config files

Project description

coffer

Typed config reader for resolved Coffer config files.

Coffer is a Go CLI that merges YAML configs, resolves secrets from GCP Secret Manager, and outputs a resolved config file. This library reads those pre-resolved files and provides ergonomic, type-safe access. No secret resolution, no GCP dependency.

Install

pip install coffer-config

Usage

from coffer import Config

# Load from a resolved config file (JSON or YAML)
config = Config.from_file("config.json")

# Dot-notation access
host = config.get("database.host")
port = config.get("database.port", type=int)
debug = config.get("debug", default=False, type=bool)

# Dict-style access (nested dicts become Config objects)
db = config["database"]
db["host"]  # "localhost"

# Membership and iteration
"database.host" in config  # True
list(config)               # top-level keys

# Raw dict
config.to_dict()

Development

pip install -e ".[dev]"
pre-commit install

Limitations

  • Dot-separated keys: Keys containing literal dots (e.g. {"a.b": 1}) are not accessible via dot-notation. Use config.to_dict() to access them directly.

Type coercion

The type= parameter on get() coerces values:

type= Behavior
int int(value)
float float(value)
bool "true"/"1"/"yes" -> True, "false"/"0"/"no" -> False (case-insensitive)
str str(value)
list If string, splits on , and strips whitespace. Lists pass through.

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

coffer_config-0.2.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

coffer_config-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file coffer_config-0.2.0.tar.gz.

File metadata

  • Download URL: coffer_config-0.2.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coffer_config-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3b9aa2f230572e302465d3cb0e9f6142fb78d361c953377164ec6f9889ceade0
MD5 18accd42dd907a52749602741bb57a7a
BLAKE2b-256 7e2812fe2ca243e0c502635a4999afdefbdbf5cf3649b8e1e2bd6113f1c44043

See more details on using hashes here.

Provenance

The following attestation bundles were made for coffer_config-0.2.0.tar.gz:

Publisher: publish.yml on sultano/coffer-py

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

File details

Details for the file coffer_config-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: coffer_config-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coffer_config-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b94ddd86a133e85bae3f3e1ac7035ae8e35a977ac1ee840fb33fc7b540c5646
MD5 451de1170707b9dcd8c853ef3ce7986a
BLAKE2b-256 3c438eb5907ba2ba0491ea8bc210b5d93ff9869761d0848de6d65f3ad7bb7704

See more details on using hashes here.

Provenance

The following attestation bundles were made for coffer_config-0.2.0-py3-none-any.whl:

Publisher: publish.yml on sultano/coffer-py

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