Config-driven helpers for Python projects (dynamic config, secure secrets, preset logging, and more…)
Project description
Config-driven Python toolkit for resilient applications
kstlib is a personal Python toolkit built over 7 years of learning and experimentation.
It started as a way to explore Python best practices, evolved into utilities for personal automation, and now serves as the foundation for study projects in algorithmic trading and market analysis.
The focus has always been on building resilient, secure, and performant systems.
Note: Everything works via Python, but since kstlib is heavily config-driven, the Examples Gallery showcases a YAML-first approach.
Core Modules
| Module | Purpose |
|---|---|
| config | Cascading config files, includes, SOPS encryption, Box access |
| secrets | Multi-provider resolver (env, keyring, SOPS, KMS) with guardrails |
| logging | Rich console, rotating files, TRACE level, structlog integration |
| auth | OIDC/OAuth2 with PKCE, token storage, auto-refresh |
| Jinja templates, transports (SMTP, Gmail API, Resend, AWS SES) | |
| alerts | Multi-channel (Slack, Email), throttling, severity levels |
| websocket | Resilient connections, auto-reconnect, heartbeat, watchdog |
| rapi | Config-driven REST client with HMAC signing |
| monitoring | Collectors + Jinja rendering + delivery (file, mail) |
| resilience | Circuit breaker, rate limiter, graceful shutdown |
| ops | Session manager (tmux), containers (Docker/Podman) |
| helpers | TimeTrigger, formatting, secure delete, validators |
Quick Start
Installation
pip install kstlib
Basic Usage
from kstlib.config import load_from_file
from kstlib import cache
config = load_from_file("config.yml")
@cache(ttl=300)
def expensive_computation(x: int) -> int:
return x ** 2
result = expensive_computation(5)
Minimal Configuration
app:
name: "My Application"
debug: true
database:
host: "localhost"
port: 5432
Documentation
Full documentation available at kstlib.readthedocs.io
Installation Options
# Standard install
pip install kstlib
# With uv (faster)
uv pip install kstlib
# Development install
pip install "kstlib[dev]"
# All extras
pip install "kstlib[all]"
# From GitHub (latest)
pip install "git+https://github.com/KaminoU/kstlib.git"
License
MIT License - Copyright 2025 Michel TRUONG
See LICENSE for full text.
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 kstlib-1.3.0.tar.gz.
File metadata
- Download URL: kstlib-1.3.0.tar.gz
- Upload date:
- Size: 312.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2ec729c36f65e5268247ff3c88d2046a77714cf84ffaafb21945f827e78e91c
|
|
| MD5 |
0bf899a93d259ed145ea163f69b38f5a
|
|
| BLAKE2b-256 |
e33e4c33fa89003960699633ac948d6ffd16fca2b4532ee614d0dd63f67639d9
|
Provenance
The following attestation bundles were made for kstlib-1.3.0.tar.gz:
Publisher:
ci.yml on KaminoU/kstlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kstlib-1.3.0.tar.gz -
Subject digest:
d2ec729c36f65e5268247ff3c88d2046a77714cf84ffaafb21945f827e78e91c - Sigstore transparency entry: 927238497
- Sigstore integration time:
-
Permalink:
KaminoU/kstlib@545d2be3c3e2840a31a1385488eae2d55198368e -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/KaminoU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@545d2be3c3e2840a31a1385488eae2d55198368e -
Trigger Event:
push
-
Statement type:
File details
Details for the file kstlib-1.3.0-py3-none-any.whl.
File metadata
- Download URL: kstlib-1.3.0-py3-none-any.whl
- Upload date:
- Size: 384.4 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 |
3ec4418e8dd4c2cb24f8ed1d8578658649da48fe341e0ad1911ef57bc1e6ccb9
|
|
| MD5 |
6b482dcba4faabb7ce0d448fdd1b5b4f
|
|
| BLAKE2b-256 |
9bea9aac07e613edb36b65f0de088ef3d301a36d3c7729c5c652330733317293
|
Provenance
The following attestation bundles were made for kstlib-1.3.0-py3-none-any.whl:
Publisher:
ci.yml on KaminoU/kstlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kstlib-1.3.0-py3-none-any.whl -
Subject digest:
3ec4418e8dd4c2cb24f8ed1d8578658649da48fe341e0ad1911ef57bc1e6ccb9 - Sigstore transparency entry: 927238499
- Sigstore integration time:
-
Permalink:
KaminoU/kstlib@545d2be3c3e2840a31a1385488eae2d55198368e -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/KaminoU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@545d2be3c3e2840a31a1385488eae2d55198368e -
Trigger Event:
push
-
Statement type: