New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dry-monads

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dry-monads

Monads for python made simple and safe.

  • 0.2.0
  • PyPI
  • Socket score

Maintainers
1

dry-monads

wemake.services Build Status Coverage Status Documentation Status Python Version wemake-python-styleguide

Monads for python made simple and safe.

Features

  • 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

Installation

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:

Example

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

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

    @do_notation
    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.

Inspirations

This module is heavily based on:

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc