Skip to content

About

Dependency-free Python retry, rate-limit, and atomic-output delivery sample

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resilient HTTP client delivery sample

A dependency-free Python sample demonstrating bounded retries, Retry-After handling, deterministic tests, and atomic output replacement for scheduled API collectors.

Acceptance criteria

  • HTTP 429, selected 5xx, timeouts, transport failures, and malformed JSON can be retried.
  • Non-transient 4xx failures are raised immediately.
  • Exponential backoff is capped and supports bounded jitter.
  • Numeric Retry-After takes precedence over calculated backoff.
  • The previous output file survives an interrupted replacement.
  • Tests never call the network or actually sleep.

Verify

python3 -m unittest discover -v

Expected result: eight tests pass.

Integration sketch

import json
from src import JsonHttpClient, atomic_write_text

client = JsonHttpClient()
data = client.get_json("https://api.example.test/data")
atomic_write_text("daily.txt", json.dumps(data, indent=2))

See DELIVERY_REPORT.md for the verification and handoff format. A ready-to-copy GitHub Actions workflow is included at ci/python-tests.yml.example.

Commercial scope

This repository is a public capability sample, not customer code. Fixed-scope API reliability, CI, and QA engagements are available through LaborX escrow.

About

Dependency-free Python retry, rate-limit, and atomic-output delivery sample

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages