Standardize API responses across your stack
A Python library + CLI that enforces consistent API response envelopes, error formatting, pagination metadata, and serialization across all your microservices.
from api_formatter import ApiResponse
@ApiResponse.envelope
def get_user(user_id: str):
user = db.users.find_by_id(user_id)
if not user:
return ApiResponse.not_found(
"User not found",
details={"user_id": user_id}
)
return ApiResponse.ok(data=user.to_dict())
# Output:
# {
# "success": true,
# "data": { "id": "1", "name": "Alice" },
# "meta": { "request_id": "req_xyz" }
# }Secure checkout via Gumroad
Instant delivery after purchase
Lifetime access + updates