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. Useconfig.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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b9aa2f230572e302465d3cb0e9f6142fb78d361c953377164ec6f9889ceade0
|
|
| MD5 |
18accd42dd907a52749602741bb57a7a
|
|
| BLAKE2b-256 |
7e2812fe2ca243e0c502635a4999afdefbdbf5cf3649b8e1e2bd6113f1c44043
|
Provenance
The following attestation bundles were made for coffer_config-0.2.0.tar.gz:
Publisher:
publish.yml on sultano/coffer-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coffer_config-0.2.0.tar.gz -
Subject digest:
3b9aa2f230572e302465d3cb0e9f6142fb78d361c953377164ec6f9889ceade0 - Sigstore transparency entry: 1051440508
- Sigstore integration time:
-
Permalink:
sultano/coffer-py@1c65f34c8073c16deb67810dfd3890d3d65c2a7f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/sultano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c65f34c8073c16deb67810dfd3890d3d65c2a7f -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b94ddd86a133e85bae3f3e1ac7035ae8e35a977ac1ee840fb33fc7b540c5646
|
|
| MD5 |
451de1170707b9dcd8c853ef3ce7986a
|
|
| BLAKE2b-256 |
3c438eb5907ba2ba0491ea8bc210b5d93ff9869761d0848de6d65f3ad7bb7704
|
Provenance
The following attestation bundles were made for coffer_config-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on sultano/coffer-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coffer_config-0.2.0-py3-none-any.whl -
Subject digest:
1b94ddd86a133e85bae3f3e1ac7035ae8e35a977ac1ee840fb33fc7b540c5646 - Sigstore transparency entry: 1051440509
- Sigstore integration time:
-
Permalink:
sultano/coffer-py@1c65f34c8073c16deb67810dfd3890d3d65c2a7f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/sultano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c65f34c8073c16deb67810dfd3890d3d65c2a7f -
Trigger Event:
release
-
Statement type: