Skip to main content

krepis (Greek κρηπίς — the foundation a structure stands on): general-purpose Python primitives for production data and LLM pipelines on AWS — logging, SSM secrets, Telegram/SNS/Web Push alerts, bounded-backoff HTTP retry, S3 writer locks, the Anthropic payload chokepoint, LLM cost telemetry, the LLM-as-judge transport core, trading-calendar/date helpers, and EC2-spot/SSM resilience.

Project description

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.

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

krepis-0.32.0.tar.gz (321.9 kB view details)

Uploaded Source

Built Distribution

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

krepis-0.32.0-py3-none-any.whl (217.3 kB view details)

Uploaded Python 3

File details

Details for the file krepis-0.32.0.tar.gz.

File metadata

  • Download URL: krepis-0.32.0.tar.gz
  • Upload date:
  • Size: 321.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for krepis-0.32.0.tar.gz
Algorithm Hash digest
SHA256 1f92049d0962437c51dfe2e9acfefa09063be2c15b374e4c19cc2ad50bca4d78
MD5 eaf66a7dcf399c6168b311c2711bbe00
BLAKE2b-256 0588392b1fac69eebaaab7f5372400e9085e8517ee2224b0e703eadab1c55cfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for krepis-0.32.0.tar.gz:

Publisher: publish.yml on nousergon/krepis

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

File details

Details for the file krepis-0.32.0-py3-none-any.whl.

File metadata

  • Download URL: krepis-0.32.0-py3-none-any.whl
  • Upload date:
  • Size: 217.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for krepis-0.32.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e50757a99ce6ac584981492349bd614a7d4726277d1eab172348a7adb7f9b519
MD5 93521050e0d4b32ff10f52ac929801f5
BLAKE2b-256 34870dbaa80187e0da744c678fe3f60b4f1b90d5fbb68be40e423a54dfec1652

See more details on using hashes here.

Provenance

The following attestation bundles were made for krepis-0.32.0-py3-none-any.whl:

Publisher: publish.yml on nousergon/krepis

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