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.1.0.tar.gz (6.4 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.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coffer_config-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 66013c7c0ce84e8b6574f86d07fc70f774f1539908eb2bda1f0979af18210ee7
MD5 ac7683c58edfd4a038b000fecda034a9
BLAKE2b-256 47c43e97d7479d884919f36193e70e5749dc81e72afc7cc9018f0e0d3f54dcbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for coffer_config-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: coffer_config-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f527e0438572cc36fc3f09ca4b92025b6894f345c2a8fa589ea0d969a34870f8
MD5 0c128b44d0b20073697b301e7f950783
BLAKE2b-256 0bbffa1f4f3198f5f6fd6e655e55e1c1ec460f98627707b8190bae5d5c7b3c25

See more details on using hashes here.

Provenance

The following attestation bundles were made for coffer_config-0.1.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