Skip to main content

Configuration library with field provenance and secret support

Project description

Cistell

Cistell

A powerful, transparent configuration library with provenance tracking and secret support for Rust and Python.

crates.io PyPI CI Status CodSpeed GitHub license


Overview

Cistell is a configuration resolution engine providing zero-boilerplate settings loading with robust accountability. Built heavily in Rust, it brings performance, type safety, and correctness across two ecosystems:

  • Rust (cistell-core, cistell-macros): Native library with a convenient #[derive(Config)] procedural macro.
  • Python (cistell): Performant bindings that serve as an idiomatic drop-in replacement for the original pure-Python cistell, extending its features with exact provenance APIs and fast resolution.

There's no more guessing where a config value came from. cistell tells you exactly how it resolved each field across 7 different possible priority layers, all while keeping secrets secure.

Features & Highlights

  • Field Provenance Tracking: Inquire exactly where any configuration state was materialized from.
  • Priority Resolution Chain: Values fall through an exact, strictly ordered 7-level priority chain.
  • Secret Management: Built-in Secret<T> wrapper (Rust) and secret=True kwargs (Python) natively redact sensitive config properties across logs and display operations.
  • Zero-Boilerplate Derivation: Simple attribute tagging configures fallback defaults and variable names.

Quick Start (Rust)

Add cistell-core to your Cargo.toml:

[dependencies]
cistell-core = "0.1.0"
use cistell_core::{Config, Secret};

#[derive(Config, Debug)]
struct ServerConfig {
    #[config(default = "127.0.0.1")]
    host: String,

    #[config(default = 8080)]
    port: u16,

    #[config(env = "API_KEY")]
    api_key: Secret<String>,
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cfg = ServerConfig::load()?;

    println!("Resolved Host: {}", cfg.host);
    // Explain the provenance
    println!("Provenance:\n{}", cistell_core::explain(&cfg));

    Ok(())
}

Quick Start (Python)

Install via pip or uv:

pip install cistell
from cistell import ConfigBase, ConfigField

class MySettings(ConfigBase):
    host = ConfigField("127.0.0.1")
    port = ConfigField(8080)
    api_key = ConfigField("default-key", secret=True)

cfg = MySettings()

print(cfg.host)
print(cfg.api_key) # prints 'default-key'

# Inspect how values were resolved
print(cfg.explain())

# Export a redacted immutable dictionary
print(cfg.safe_dict())

Priority Chain

When resolving a field, Cistell checks the following layers in exact descending order of priority.

Priority Level Source Description
1 Explicit/Overridden Programmatically set at runtime via instantiation or context overrides.
2 Environment Variable Matches PREFIX_FIELD_NAME (or specifically configured env key).
3 Environment File Value parsed statically from a .env file.
4 Selected Config File Value loaded from a specifically pointed config.toml, config.yaml, or .json.
5 pyproject.toml Defaults pulled directly from Python packaging [tool.yourapp] namespace (if applicable).
6 Default Config File The default generic configuration file found in the working directory.
7 Hardcoded Defaults Fallback static definition assigned via macro #[config(default = ...)] or python ConfigField(default).

Feature Flags (Rust)

You can opt-in to parsing requirements in your Cargo.toml for cistell-core:

Feature Default Description
toml TOML file support
yaml YAML file support
json JSON file support
serde Enable Serialize/Deserialize on Secret<T>
zeroize Enable zero-on-drop mapping for Secret<T>

Secret Fields

Keeping secrets out of crash reports and debug prints is critical. By using Secret<T> (Rust) or ConfigField(secret=True) (Python), any underlying representation correctly implements traits or __repr__ functions that output "***" rendering it harmless to standard printing vectors out of the box.

Provenance

Need to figure out if your port was configured by .env, Docker env injection, or fell-back to the code default?

Use cfg.explain() to log the materialized source configuration on startup. Use cfg.safe_dict() to retrieve an inert representation of configuration states. Both functions intrinsically hide secret parameters gracefully.

Python Compatibility

  • Minimum Version: Python 3.12+
  • Dependencies: No Python dependencies. All complex loading natively invokes Rust via PyO3.
  • Available natively via pre-built wheels across Linux (manylinux), macOS (x86_64, arm64), and Windows.

License

Cistell is distributed freely under the MIT License. CENSE).

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

cistell-0.1.2.tar.gz (64.2 kB view details)

Uploaded Source

Built Distributions

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

cistell-0.1.2-cp313-cp313-win_amd64.whl (380.3 kB view details)

Uploaded CPython 3.13Windows x86-64

cistell-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (554.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

cistell-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (532.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

cistell-0.1.2-cp313-cp313-macosx_11_0_arm64.whl (487.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cistell-0.1.2-cp313-cp313-macosx_10_12_x86_64.whl (503.0 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

cistell-0.1.2-cp312-cp312-win_amd64.whl (380.7 kB view details)

Uploaded CPython 3.12Windows x86-64

cistell-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (554.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cistell-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (533.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

cistell-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (488.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cistell-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl (503.5 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file cistell-0.1.2.tar.gz.

File metadata

  • Download URL: cistell-0.1.2.tar.gz
  • Upload date:
  • Size: 64.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cistell-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5c52a043dfae476cc26611d86fbac87320ecd0efa13882c17a7b4842f57a7f42
MD5 90cbcf6fb1708a4e27a5bcf9f12af3b2
BLAKE2b-256 15f75f61e097b8e42e560165a16780927905013d6c647032764c7f985d8e8102

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cistell-0.1.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 380.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cistell-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c3f2a2964cab33e66f2810dd8bdd21d4e71e737e1fdd20a66c7e357d3358d322
MD5 5b002d68f1de7bf0ebcd8163de3a7824
BLAKE2b-256 a89df3881d2606339ca1f8340444d5e8dc87b7b53bd2b120a8af4eca91895959

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e956ec8b5429555e92f2026f8e8d593c0130050aee2492e5fd917359589b75e8
MD5 0ab8837a917d0a7aeb44f0579b56c160
BLAKE2b-256 bc771b9b90aa0bf9be051c4e5c3fa466c2581c51ec1b32facfb53b3d5e060290

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7fe79b0f8ebab6cf11a801cb71cf5e8fcabfaf9ffefefc0f9e48c5fe567095c4
MD5 f8083107dd61e1a8d4cbc92e43d99a72
BLAKE2b-256 956370fe87e14eaa05918a817bbae58c0013725501522eb15fe0adb3f683d9d8

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a134393c288d809a9a88ca2ca389891f3ef70ca1d5197ac80ea043ee6b946c60
MD5 724a56776af7754d2282fc591b9acd47
BLAKE2b-256 391aa505281e86b491c2eeb82edcdc8a22e1452bf851a598fa631adac6ae1cf7

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3f6ae14eb63fd3460110a758371349f6e8f3b3218e8e061be00f21fb9e2e7809
MD5 ce31d541be8abd73bc0cca3b55cdc72a
BLAKE2b-256 7a71f457c23cb36418a0ed4973c1e41967f7f113c0bdefc16d40a30bf32de0ea

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cistell-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 380.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cistell-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 92369593799c5854aad5887dcbe77ca2f3091a752058dd079e64e44c589c6e4a
MD5 44853fb05462a46fd5888b9b3e420ec7
BLAKE2b-256 4390408fded608241343853516a3f8dd54c1df7f75f3efabdb731d19f008e9f8

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20d5ccb244326cc6d0d9cb14c5a000d4e5e9b73769e2613b21240e36f03e8531
MD5 3bceb5cade98c2d86c8a227d8ad046ed
BLAKE2b-256 d32a98363c20c5194c70641ba23010d643f4899f198372a39d2db544a853c80f

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1c2f20b72aa35adad68656119131871508dfabaf3b33a21f95c0331f6eec3ea6
MD5 846ce8d7303c819ed03bdb687f0cdb12
BLAKE2b-256 4b9ed3a15168268d24a1e4cbb93ccd4bdf033d724a20f92e1465733fed1f6adf

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83ce9fe60483662850b5e15dec13c185685d1a371adc6bf63ac292492948420d
MD5 2ac135a0a0c65a480bcf06d24b504c90
BLAKE2b-256 20041428e16aa927e9418dc6ee1f32f2e946aa8aa98d0fd7069ab97d4923e282

See more details on using hashes here.

File details

Details for the file cistell-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cistell-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 413cea81e9e71d6e1e898c3e57c7cf1bd91d65bb7f312a8177d38111b485823f
MD5 f5eb64d8c1886aa0808d13384402a15d
BLAKE2b-256 99bec4721f34183d8dd9013dbfcd8f0f835fc1fd4ca8a58d78746dfb7efed67f

See more details on using hashes here.

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