Skip to main content

A gentle, story-driven supervision and recovery framework for Python — because every error deserves a story.

Project description

🌿 Beautiful Oops

Because every error deserves a graceful story.

Beautiful Oops is a lightweight adventure-style supervision and recovery framework for Python.
It turns error handling into storytelling — each Moment can fail, retry, or succeed,
and all outcomes are recorded in a StoryBook.

✨ Features

  • 🪄 @oops_moment decorator for automatic retry / timeout / rollback
  • 🧙‍♀️ Elf & Hero – pluggable decision-makers for handling Oops
  • 📖 StoryBook Plugin – records every success and failure
  • 🔁 Backoff Policy – exponential with jitter
  • ⚙️ Plugin Architecture – easy to extend (logging, monitoring, circuit-breaker)
  • 🧩 Works in both sync and async modes

🚀 Quickstart

from beautiful_oops import oops_moment, Adventure, StorybookPlugin

@oops_moment(chapter="Chapter I", stage="decode_scroll")
def decode_scroll():
    return "ancient wisdom"

adv = Adventure(name="demo", plugins=[StorybookPlugin()])
with Adventure.auto(adv):
    print("Scroll:", decode_scroll())

🧠 Philosophy

⚡ Resilience is not about avoiding errors, but about facing them gracefully.

Adventure builds the story, Elf gives advice, Hero decides, StoryBook remembers.

🌌 Roadmap

🧩 Short-term (v0.2.x)

  • Fallback Plugin
  • Circuit Breaker Plugin
  • Sink System (Console / File / Prometheus / Loki)

🤖 Mid-term (v0.3–0.5)

  • Agent-based Error Decision Engine
    – let an intelligent agent decide whether to retry, ignore, or fallback

🕊️ Long-term (v1.0)

  • Visual Dashboard (Adventure Timeline)
  • Community Plugin Ecosystem

🧪 Testing & CI

pip install -e .[dev]
pytest -q
ruff check .
mypy beautiful_oops

or

uv run --extra dev pytest

MIT License © 2025 Sean Liu

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

beautiful_oops-0.1.4.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

beautiful_oops-0.1.4-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file beautiful_oops-0.1.4.tar.gz.

File metadata

  • Download URL: beautiful_oops-0.1.4.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for beautiful_oops-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9ff8ee58b0c42850c1f51a3d710a531259672b9bd8df9e2804f5812f65e2efcf
MD5 0972c024aec98639221293ca0619cec3
BLAKE2b-256 9c592e4a3ea58f33360d1661a41121454bbcd1bbb8d77f73b9aa044cfb9d0deb

See more details on using hashes here.

File details

Details for the file beautiful_oops-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for beautiful_oops-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 08ad8fe298d6c026c0df04c593d1c9c7b8ab0b52124ddceb24a4835b7aeaedf6
MD5 ca107a2730d6d4bc13799bdc4541742e
BLAKE2b-256 301de67763c6489cc7e7577f459fcd531008c2bb3cf903d6f7b83248cda7dc8e

See more details on using hashes here.

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