BasicReturns gives every function in your Python codebase a predictable return structure. Instead of scattered tuples, naked exceptions, or ad-hoc dictionaries, you get two Pydantic-backed models —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Dev2Forge/BasicReturns/llms.txt
Use this file to discover all available pages before exploring further.
BasicReturn and DataAndMsgReturn — that express success, failure, messages, and payloads in one unified interface.
Introduction
Understand the problem BasicReturns solves and how its two return types work together.
Quickstart
Install the package and write your first function with a unified return in under five minutes.
Guides
Practical patterns for error handling, chaining operations, and API integration.
API Reference
Full class documentation for BasicReturn and DataAndMsgReturn with all fields and methods.
Why BasicReturns?
Python functions can return anything — a value, a tuple,None, or raise an exception. When a codebase mixes all of these patterns, every call site must guess what it might get back. BasicReturns solves this by providing two lightweight Pydantic models that every function can return instead.
Consistent Shape
Every function returns the same fields — callers always know what to expect.
No Unhandled Exceptions
Capture errors in the
error field instead of letting exceptions bubble unpredictably.Type Safe
Full MyPy compatibility and Pydantic v2 validation out of the box.