Skip to main content

Config-driven helpers for Python projects (dynamic config, secure secrets, preset logging, and more…)

Project description

Kstlib Logo

Config-driven Python toolkit for resilient applications

CI Documentation PyPI Python License


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

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

kstlib-1.6.2.tar.gz (335.1 kB view details)

Uploaded Source

Built Distribution

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

kstlib-1.6.2-py3-none-any.whl (412.7 kB view details)

Uploaded Python 3

File details

Details for the file kstlib-1.6.2.tar.gz.

File metadata

  • Download URL: kstlib-1.6.2.tar.gz
  • Upload date:
  • Size: 335.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kstlib-1.6.2.tar.gz
Algorithm Hash digest
SHA256 5c6fbb028ca928c411bd009c7a78eddf78126bfe623afdcd23534b3a137fea41
MD5 2bb390310fdabc82ad7de31ab20e5bc3
BLAKE2b-256 d9f45a7337bb6d1bd425e90b4fd3a12472c654cf750a276a5485e06fdf4458a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for kstlib-1.6.2.tar.gz:

Publisher: ci.yml on KaminoU/kstlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kstlib-1.6.2-py3-none-any.whl.

File metadata

  • Download URL: kstlib-1.6.2-py3-none-any.whl
  • Upload date:
  • Size: 412.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kstlib-1.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb680370d8a0ae5c57ef66b655b95909a6b292a24fb56f4e453d82043954ccf9
MD5 0dadafe59814a4c673b1da7fe6a4ddea
BLAKE2b-256 a989a6f20df6ff540013a6951702d3ef5d5203c86d5532f451035ed1fb44c407

See more details on using hashes here.

Provenance

The following attestation bundles were made for kstlib-1.6.2-py3-none-any.whl:

Publisher: ci.yml on KaminoU/kstlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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