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 |
| pipeline | Declarative sequential workflows (shell/python/callable steps), error policies, conditional execution |
| 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.
Metadata
Release files for kstlib 3.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kstlib-3.8.0.tar.gz | 461.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kstlib-3.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.0 MB
Release files / kstlib-3.8.0.tar.gz
| Download URL | kstlib-3.8.0.tar.gz |
|---|---|
| Size | 461.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
728ed039f167659b816e82c8f0355bab981e808dc93c4e5df211fe1527a3b396
|
|
BLAKE2b-256 checksum How to use checksums |
9ff3d3d2d1b8021173f1b69da76825bbae0811a6b0c8384f90727571e9bafd4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.
Transparency logRelease files / kstlib-3.8.0-py3-none-any.whl
| Download URL | kstlib-3.8.0-py3-none-any.whl |
|---|---|
| Size | 545.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e4d684b163ce581183a377764770ddcf5287dc2da7d53359b4c648d92582c47
|
|
BLAKE2b-256 checksum How to use checksums |
2c9ca2fd0d7f3c90d2a98da501cc08103f0f9512c00d65901e3895f83d343906
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.
Transparency log