Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kstlib-3.5.0.tar.gz (449.2 kB view details)

Uploaded Source

Built Distribution

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

kstlib-3.5.0-py3-none-any.whl (533.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kstlib-3.5.0.tar.gz
Algorithm Hash digest
SHA256 d8a6a9dd8fe26afa53b9c43ac23c39226eb6aaed245542ed2dfe8fd4e367038b
MD5 5f9a04e679a048fb11db5b38e0d77553
BLAKE2b-256 2efbc1e6ef71ebb82c10af32a57f9bb53ca70b128b390a4468ed61a8ef0a8976

See more details on using hashes here.

Provenance

The following attestation bundles were made for kstlib-3.5.0.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-3.5.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for kstlib-3.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee214b1536534b103f337d5b395a7ac8f786c5fc7bb5804f5c0fcb20042213c
MD5 6d1c11a2807df5f9d5c4417043f7a8d9
BLAKE2b-256 54b331818bc18ce6a4d3c07a6d1689f14564dba0f0ca83c40f1aed9e756c0b03

See more details on using hashes here.

Provenance

The following attestation bundles were made for kstlib-3.5.0-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.

Release history Release notifications | RSS feed

3.7.1

2 files

3.7.0

2 files

3.6.2

2 files

3.6.1

2 files

3.6.0

2 files

This release

3.5.0 This release

2 files

3.4.2

2 files

3.4.1

2 files

3.4.0

2 files

3.3.1

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.0

2 files

2.7.1

2 files

2.7.0

2 files

2.6.0

2 files

2.5.0

2 files

2.4.0

2 files

2.3.1

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.4

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.7.8

2 files

1.7.7

2 files

1.7.6

2 files

1.7.5

2 files

1.7.4

2 files

1.7.3

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.0.1a0

2 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