scriptc
scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.
它将多种错误处理模式(多种退避策略的重试、断路器、条件重试、有状态重试)以及现代特性(同步/异步、指标、性能分析、模拟错误注入)整合到一致的 API 中,大幅减少样板代码。
Calm error handling for Python – decorator-based, zero boilerplate.
Writing repetitive try / except blocks clutters your code and hides the business logic.
tranq gives you declarative error handling with decorators, context managers, and a rich set of retry strategies – so you can focus on what your code does, not how it recovers from failures.
| Feature | Description |
|---|---|
| 🧘 Tranquil | Clean, readable, and maintainable. |
| 🔁 Smart retries | Exponential, linear, Fibonacci backoff, jitter, and max delay. |
| 🚦 Circuit Breaker | Prevent cascading failures (sync & async). |
| 🧪 Conditional retry | On specific exceptions or result values. |
| 📦 Retry groups | All-or-nothing execution for multiple functions. |
| 📊 Built‑in metrics & profiling | Monitor performance and error rates. |
| 📝 Pluggable reporters | Send errors to files, Sentry, Slack, or custom destinations. |
| 🧩 Context manager API | Use tranq.retry(...) when decorators aren't ideal. |
| 🔧 Stateful retry | Persist attempt count across calls. |
| 🎭 Mock error injection | Test your error handling with ease. |
pip install tranq
Requires Python 3.9 or later.
@handle)import tranq
@tranq.handle(on=ValueError, retry=3, delay=0.5, backoff=2.0)
def risky():
# This will be retried up to 3 times with exponential backoff
...
@handle_async)@tranq.handle_async(on=ConnectionError, retry=2, fallback=lambda: "offline")
async def fetch_data():
...
cb = tranq.CircuitBreaker(failure_threshold=5, timeout=60)
@tranq.handle(circuit_breaker=cb)
def call_unstable_service():
...
with tranq.retry(on=ValueError, retry=2) as ctx:
result = ctx.run(my_function, arg1, arg2)
group = tranq.retry_group(step1, step2, step3, on=Exception, retry=1)
results = group.run() # if any step fails, all are retried together
Choose from exponential, linear, or Fibonacci backoff. Add jitter to avoid thundering herds.
@tranq.handle(
on=TimeoutError,
ret
Calm error handling for Python
根据分类、Topic 和编程语言匹配的相似项目。
scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

flow is a minimalist terminal dashboard that displays real-time network throughput with smooth animations, multiple responsive modes, and zero configuration.

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.