Skip to main content

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).

Metadata

Release files for cistell 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cistell 0.1.2
File Size Uploaded
cistell-0.1.2.tar.gz 64.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for cistell 0.1.2
File
cistell-0.1.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
cistell-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
cistell-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
cistell-0.1.2-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
cistell-0.1.2-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details
cistell-0.1.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
cistell-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
cistell-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
cistell-0.1.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
cistell-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details

Total release size: 5.0 MB

Release files / cistell-0.1.2.tar.gz

Download URL cistell-0.1.2.tar.gz
Size 64.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5c52a043dfae476cc26611d86fbac87320ecd0efa13882c17a7b4842f57a7f42
BLAKE2b-256 checksum
How to use checksums
15f75f61e097b8e42e560165a16780927905013d6c647032764c7f985d8e8102
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp313-cp313-win_amd64.whl

Download URL cistell-0.1.2-cp313-cp313-win_amd64.whl
Size 380.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
c3f2a2964cab33e66f2810dd8bdd21d4e71e737e1fdd20a66c7e357d3358d322
BLAKE2b-256 checksum
How to use checksums
a89df3881d2606339ca1f8340444d5e8dc87b7b53bd2b120a8af4eca91895959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cistell-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 554.5 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e956ec8b5429555e92f2026f8e8d593c0130050aee2492e5fd917359589b75e8
BLAKE2b-256 checksum
How to use checksums
bc771b9b90aa0bf9be051c4e5c3fa466c2581c51ec1b32facfb53b3d5e060290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL cistell-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 532.7 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
7fe79b0f8ebab6cf11a801cb71cf5e8fcabfaf9ffefefc0f9e48c5fe567095c4
BLAKE2b-256 checksum
How to use checksums
956370fe87e14eaa05918a817bbae58c0013725501522eb15fe0adb3f683d9d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp313-cp313-macosx_11_0_arm64.whl

Download URL cistell-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Size 487.9 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a134393c288d809a9a88ca2ca389891f3ef70ca1d5197ac80ea043ee6b946c60
BLAKE2b-256 checksum
How to use checksums
391aa505281e86b491c2eeb82edcdc8a22e1452bf851a598fa631adac6ae1cf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp313-cp313-macosx_10_12_x86_64.whl

Download URL cistell-0.1.2-cp313-cp313-macosx_10_12_x86_64.whl
Size 503.0 kB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3f6ae14eb63fd3460110a758371349f6e8f3b3218e8e061be00f21fb9e2e7809
BLAKE2b-256 checksum
How to use checksums
7a71f457c23cb36418a0ed4973c1e41967f7f113c0bdefc16d40a30bf32de0ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp312-cp312-win_amd64.whl

Download URL cistell-0.1.2-cp312-cp312-win_amd64.whl
Size 380.7 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
92369593799c5854aad5887dcbe77ca2f3091a752058dd079e64e44c589c6e4a
BLAKE2b-256 checksum
How to use checksums
4390408fded608241343853516a3f8dd54c1df7f75f3efabdb731d19f008e9f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cistell-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 554.9 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
20d5ccb244326cc6d0d9cb14c5a000d4e5e9b73769e2613b21240e36f03e8531
BLAKE2b-256 checksum
How to use checksums
d32a98363c20c5194c70641ba23010d643f4899f198372a39d2db544a853c80f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL cistell-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 533.3 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
1c2f20b72aa35adad68656119131871508dfabaf3b33a21f95c0331f6eec3ea6
BLAKE2b-256 checksum
How to use checksums
4b9ed3a15168268d24a1e4cbb93ccd4bdf033d724a20f92e1465733fed1f6adf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL cistell-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Size 488.5 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
83ce9fe60483662850b5e15dec13c185685d1a371adc6bf63ac292492948420d
BLAKE2b-256 checksum
How to use checksums
20041428e16aa927e9418dc6ee1f32f2e946aa8aa98d0fd7069ab97d4923e282
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cistell-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl

Download URL cistell-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl
Size 503.5 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
413cea81e9e71d6e1e898c3e57c7cf1bd91d65bb7f312a8177d38111b485823f
BLAKE2b-256 checksum
How to use checksums
99bec4721f34183d8dd9013dbfcd8f0f835fc1fd4ca8a58d78746dfb7efed67f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.2 This release

11 release files

0.0.7

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page