dry-python/returns

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

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 16 minutes ago
Added to GitGenius on September 15th, 2026
Created on January 26th, 2019
Open Issues & Pull Requests: 81 (-2)
GitHub issues: Enabled
Number of forks: 154
Total Stargazers: 4,365 (+0)
Total Subscribers: 41 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 3.4 hours
Mean response time: 110.9 days
90th percentile: 299.3 days
Tracked items: 27

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 14
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 718 days
Stale 30+ days: 14
Stale 90+ days: 12

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (11)
  • enhancement (4)
  • help wanted (3)
  • documentation (1)
  • good first issue (1)
  • question (1)

Most active issues this week

Sign in to see which issues are moving.

Detailed Description

returns is a Python library that brings functional programming patterns and type-safe return types to Python development.

The library addresses the problem of functions returning ambiguous or unsafe values by implementing railway-oriented programming and functional composition patterns. It provides container types like Result, Maybe, and IO that encode success and failure states directly in return values, eliminating the need for exceptions or None checks. This approach makes error handling explicit and composable, allowing developers to chain operations safely and let failures propagate through the pipeline without intermediate error handling at each step.

Developers considering adoption should know that returns is designed for teams prioritizing type safety and functional programming practices in Python. It works well in codebases where explicit error handling and predictable function behavior matter more than brevity. The library integrates with mypy through custom plugins and stubs, enabling static type checking of container operations. It suits projects building APIs, data processing pipelines, or business logic where distinguishing between success and failure states is central to correctness. The library is particularly valuable when working with teams that value railway-oriented programming as a design pattern.

The project maintains active engagement with its codebase through regular updates and refinements to its type system integration. Development includes ongoing work to improve mypy plugin compatibility and expand the functional programming abstractions available to users. The maintainers actively address issues and incorporate feedback from the functional programming community. Documentation receives consistent attention, with the project maintaining comprehensive guides and examples for users learning the patterns. The project demonstrates sustained commitment to both the core library functionality and the ecosystem of tools that support type-safe functional Python development.