# dry-python/returns

Make your functions return something meaningful, typed, and safe!

Repository: https://github.com/dry-python/returns
Canonical: https://ross.abutalabs.com/products/returns
Homepage: https://returns.rtfd.io
Language: Python
License: BSD-2-Clause
License Family: permissive
Topics: python, python3, functional-programming, fp, type-safety, mypy, railway-oriented-programming, dry-python, mypy-plugins, mypy-stubs, hacktoberfest
Last push: 2026-08-25T05:42:43+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 72, longevity 100
- inputs: {"age_days": 2776, "days_push": 8, "days_rel": 31, "gap_med": 109, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4355, forks 155 (observed 2026-08-28T04:08:46.429306+00:00)

## What it is
A Python library providing typed functional programming primitives like Result, Maybe, and IO containers with full mypy support and a custom mypy plugin. It enables railway-oriented programming and safe, declarative error handling in Python.

## Use cases
- handle errors without exceptions using Result types
- make mypy enforce null-safety with Maybe
- write declarative business logic pipelines in Python
- compose async and sync functions safely
- add functional programming patterns to a Python codebase

## When to choose
- you want type-safe error handling instead of exceptions
- your team uses mypy and wants stronger type guarantees
- you prefer functional composition and railway-oriented design

## When to avoid
- your codebase is plain Python without static type checking
- the team is unfamiliar with functional programming concepts
- you need minimal dependencies and simple imperative style

## Facets
- artifact type: library
- maturity: active
- function: type-system, error-handling, serialization
- domain: programming-languages, developer-tools
- platform: python, cross-platform
- tags: functional-programming, monads, mypy-plugin, railway-oriented-programming, result-types, higher-kinded-types, algorithms

## Member repositories
- dry-python/returns (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:46.429306+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:21:30.295191+00:00, confidence not recorded.
  - readme: https://github.com/dry-python/returns (fetched 2026-08-28T04:08:46.429306+00:00, sha 61317e8dfff6)
  - registry_pypi: https://pypi.org/pypi/returns/json (fetched 2026-08-29T09:10:45.882729+00:00, sha 376d210d4e4d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
