Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 1.19 KB

File metadata and controls

28 lines (24 loc) · 1.19 KB
id add-a-python-api
type playbook
title Add or Change a Python API
summary Define the public contract first, then implement and verify success, error, and compatibility behavior.
lang en-US
content_version 1
status reviewed
reviewed_on 2026-09-02

Add or Change a Python API

  1. Write request, response, status, authentication, idempotency, and error contracts before selecting implementation details.
  2. Separate domain logic from transport code; validate data at the boundary.
  3. Add contract tests for one success, each meaningful failure, permissions, and malformed input. Test generated schemas when clients depend on them.
  4. Decide whether the change is additive, deprecating, or breaking. Document a migration path for every breaking change.
  5. Apply explicit timeouts and cancellation to downstream calls. Do not expose provider errors or secrets directly to clients.
  6. Verify the API through the same network boundary a real client uses, then inspect logs and state changes.

Continue this task on flypython.com: the full playbook directory, the guide behind each checklist, and the reviewed source catalog.