Skip to main content

Monads for python made simple and safe.

Project description

dry-monads Build Status Coverage Status Documentation Status Python Version wemake-python-styleguide

Monads for python made simple and safe.


  • Provides primitives to write declarative business logic
  • Fully typed with annotations and checked with mypy, allowing you to write type-safe code as well
  • No operator overloading or other unpythonic stuff that makes your eyes bleed


pip install dry-monads

What's inside?

We have several the most iconic monads inside:

We also care about code readability and developer experience, so we have included some useful features to make your life easier:


from dry_monads.do_notation import do_notation
from dry_monads.either import Result, Success, Failure

class CreateAccountAndUser(object):
    """Creates new Account-User pair."""

    def __call__(self, username: str, email: str) -> Result['User', str]:
        """Can return a Success(user) or Failure(str_reason)."""
        user_schema = self._validate_user(username, email).unwrap()
        account = self._create_account(user_schema).unwrap()
        return self._create_user(account)

    # Protected methods
    # ...

We are covering what's going on in this example in the docs.


This module is heavily based on:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dry-monads, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size dry_monads-0.2.0-py3-none-any.whl (22.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dry-monads-0.2.0.tar.gz (8.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page