{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/7"},{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/4"}],"enrichment":{"capability":"Provides functional programming primitives\u2014containers like Maybe, Result, and RequiresContext\u2014that let you write type-safe, composable functions that return meaningful values instead of raising exceptions or returning None.","skillfed_tags":["functional-programming","type-safety","monad-containers"],"use_cases":["Replace nested None checks with Maybe.from_optional and chained bind_optional calls for cleaner, more readable pipelines.","Handle operations that may fail (database queries, API calls) using Result to avoid exception-based control flow.","Implement typed functional dependency injection with RequiresContext to pass configuration through call stacks without polluting function signatures.","Structure async code with Future and FutureResult to compose coroutines and handle errors uniformly.","Write declarative business logic that is easier to test, reason about, and refactor because control flow is explicit in the type system."],"what_it_does":"Returns is a functional programming library that replaces common error-handling patterns (None checks, exceptions) with composable container types. It provides Maybe (for optional values), Result (for operations that may fail), RequiresContext (for dependency injection), and IO/Future variants for side effects and async code. All containers are fully typed and checked with mypy, supporting higher-kinded types and enforcing laws through its type system.\n\nThe library is designed to make business logic more declarative and testable by encoding control flow into the type system itself. Instead of scattering None checks or try-catch blocks throughout your code, you chain operations using methods like bind, map, and bind_optional, which short-circuit automatically on failure or absence. It works with both sync and async functions and is framework-agnostic.","worth_installing":"Yes. Returns is actively maintained, has no known vulnerabilities, minimal dependencies, and solves a real problem\u2014making error handling and composition more explicit and type-safe. It is worth installing if you value functional programming patterns, mypy integration, and reducing None/exception-related bugs. The learning curve is moderate; start with Maybe and Result before exploring advanced features."},"id":"returns","links":{"html":"https://skillfed.io/packages/returns","md":"https://skillfed.io/packages/returns.md","pypi":"https://pypi.org/project/returns/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-08-02","license_spdx":null,"license_treatment":"permissive","name":"returns","python_support":"supports_current","summary":"Make your functions return something meaningful, typed, and safe!"},"popularity":{"monthly_downloads":1208404,"position":4218,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.29.0"}
