Skip to content

Repository files navigation

krepis

License: MIT Python Typed Tests

krepis (Greek κρηπίς — the foundation course a structure stands on) is a small, typed library of general-purpose Python primitives for building production data and LLM pipelines on AWS.

Install

pip install krepis

What's inside

Module Purpose
logging Structured logging + the flow-doctor secret-seeding chokepoint
secrets SSM-backed secret resolution
alerts Telegram / SNS alert routing with S3-marker dedup (incl. CLI)
telegram Telegram transport
webpush Web Push (VAPID) transport — reaches an installed PWA/site regardless of tab state (webpush extra)
email_sender SES / SMTP email transport
http_retry Bounded-backoff HTTP retry with jitter
locks S3 conditional-PUT writer locks
cost LLM cost telemetry (token counts × price card → USD)
model_metadata ModelMetadata value object (per-invocation model + token cost)
anthropic_payload Anthropic request-payload construction + validation
metrics Typed metric records
trading_calendar NYSE trading-day calendar (pure stdlib)
dates Calendar / trading-day dual-track date helpers
ec2_spot EC2 spot-instance resilience helpers
ssm_dispatcher SSM command dispatch
ssm_log_capture SSM run-command log capture
usage_pacing Linear-pace short-circuit against a rolling reset-window quota

Development

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Run the test suite:

python -m pytest -q

A healthy result is all tests passing with coverage ≥ 90%. The CI matrix tests Python 3.9 through 3.13 on every PR and push to main.

License

MIT — see LICENSE and NOTICE. Contributions accepted under the DCO (git commit -s).

Part of the Nous Ergon project.

About

MIT foundation library for the Nous Ergon stack — edge-free primitives every higher layer depends down onto.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages