{ "info": { "author": "sobolevn", "author_email": "mail@sobolevn.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "# dry-monads\n\n[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake.services) [![Build Status](https://travis-ci.org/sobolevn/dry-monads.svg?branch=master)](https://travis-ci.org/sobolevn/dry-monads) [![Coverage Status](https://coveralls.io/repos/github/sobolevn/dry-monads/badge.svg?branch=master)](https://coveralls.io/github/sobolevn/dry-monads?branch=master) [![Documentation Status](https://readthedocs.org/projects/dry-monads/badge/?version=latest)](https://dry-monads.readthedocs.io/en/latest/?badge=latest) [![Python Version](https://img.shields.io/pypi/pyversions/dry-monads.svg)](https://pypi.org/project/dry-monads/) [![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n\n\nMonads for `python` made simple and safe.\n\n\n## Features\n\n- Provides primitives to write declarative business logic\n- Fully typed with annotations and checked with `mypy`,\n allowing you to write type-safe code as well\n- No operator overloading or other unpythonic stuff that makes your eyes bleed\n\n\n## Installation\n\n\n```bash\npip install dry-monads\n```\n\n\n## What's inside?\n\nWe have several the most iconic monads inside:\n\n- [Result, Failure, and Success](https://dry-monads.readthedocs.io/en/latest/pages/either.html) (also known as `Either`, `Left`, and `Right`)\n- [Maybe, Some, and Nothing](https://dry-monads.readthedocs.io/en/latest/pages/maybe.html)\n\nWe also care about code readability and developer experience,\nso we have included some useful features to make your life easier:\n\n- [Do notation](https://dry-monads.readthedocs.io/en/latest/pages/do-notation.html)\n- [Helper functions](https://dry-monads.readthedocs.io/en/latest/pages/functions.html)\n\n\n## Example\n\n\n```python\nfrom dry_monads.do_notation import do_notation\nfrom dry_monads.either import Result, Success, Failure\n\nclass CreateAccountAndUser(object):\n \"\"\"Creates new Account-User pair.\"\"\"\n\n @do_notation\n def __call__(self, username: str, email: str) -> Result['User', str]:\n \"\"\"Can return a Success(user) or Failure(str_reason).\"\"\"\n user_schema = self._validate_user(username, email).unwrap()\n account = self._create_account(user_schema).unwrap()\n return self._create_user(account)\n\n # Protected methods\n # ...\n\n```\n\nWe are [covering what's going on in this example](https://dry-monads.readthedocs.io/en/latest/pages/do-notation.html) in the docs.\n\n## Inspirations\n\nThis module is heavily based on:\n\n- [dry-rb/dry-monads](https://github.com/dry-rb/dry-monads)\n- [\u00d8](https://github.com/dbrattli/OSlash)\n- [pymonad](https://bitbucket.org/jason_delaat/pymonad)\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://dry-monads.readthedocs.io", "keywords": "functional programming,fp,monads,monad,type-safety,mypy,railway-oriented-programming", "license": "MIT", "maintainer": "sobolevn", "maintainer_email": "mail@sobolevn.me", "name": "dry-monads", "package_url": "https://pypi.org/project/dry-monads/", "platform": "", "project_url": "https://pypi.org/project/dry-monads/", "project_urls": { "Homepage": "https://dry-monads.readthedocs.io", "Repository": "https://github.com/sobolevn/dry-monads" }, "release_url": "https://pypi.org/project/dry-monads/0.2.0/", "requires_dist": [ "typing-extensions (>=3.7,<4.0)" ], "requires_python": ">=3.6,<4.0", "summary": "Monads for python made simple and safe.", "version": "0.2.0" }, "last_serial": 4760987, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "249fe14b1dddd6678e0e27e403ea4a72", "sha256": "4950d38eb6989797603a0a43e9f087308cbc2dd69104021410e255d044245150" }, "downloads": -1, "filename": "dry_monads-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "249fe14b1dddd6678e0e27e403ea4a72", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 11410, "upload_time": "2019-01-28T12:23:49", "url": "https://files.pythonhosted.org/packages/21/6b/bbbd3a96c4c33d85750db4297a68f32a6ef6d247a30ed10b98e273db2fb8/dry_monads-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "90d7d5360ae4f538629edcc11e3cc4dc", "sha256": "a89d3261500cbe59c71f4208df500c5ef7cdd4f1762a3dae51bc52db82ffc1ce" }, "downloads": -1, "filename": "dry-monads-0.1.0.tar.gz", "has_sig": false, "md5_digest": "90d7d5360ae4f538629edcc11e3cc4dc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 4269, "upload_time": "2019-01-28T12:23:46", "url": "https://files.pythonhosted.org/packages/6b/64/864dfedfe64a0975d5893f1d173d7fde6a3cd4d607a36c6c20b3b4d8c5d4/dry-monads-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "9182688390d058e169e873b1908049bb", "sha256": "43ca6958145e2024ac940268db3a1a7a5ee787c2468463728dc0dc3bd206cb5c" }, "downloads": -1, "filename": "dry_monads-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9182688390d058e169e873b1908049bb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 12975, "upload_time": "2019-01-28T13:38:04", "url": "https://files.pythonhosted.org/packages/0e/26/dfd220f12762a03f5cdf1261f26fc3b9e2f4f86d223f40d6e2f4d3b8b600/dry_monads-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f488e94b956b4473c59974970d828bc0", "sha256": "fdc58902a95b667a59235246e7321a9bfa29428d4d9fde2a8a0213b4010d617e" }, "downloads": -1, "filename": "dry-monads-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f488e94b956b4473c59974970d828bc0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 6148, "upload_time": "2019-01-28T13:38:02", "url": "https://files.pythonhosted.org/packages/db/49/65a7966ce57b856aa5e7737b4ec779016028afe5b0f3514147406222d385/dry-monads-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "829d963dfaeaaf3b8e93ea860f21158f", "sha256": "64828e97d308052e95bd1233e7bf5b7a1f76c10e18a0d565b6f763a8c17f8cfe" }, "downloads": -1, "filename": "dry_monads-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "829d963dfaeaaf3b8e93ea860f21158f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 22900, "upload_time": "2019-01-30T18:54:12", "url": "https://files.pythonhosted.org/packages/b6/0e/5ad9a35e1c1b500637230416d13d69f723777973192e6e94102769abed47/dry_monads-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "25e0fa3156c5800d8c21a6b4c272e620", "sha256": "dde7d4160473b469032719cdf8449d716501de379de653d053b6909de4a84477" }, "downloads": -1, "filename": "dry-monads-0.2.0.tar.gz", "has_sig": false, "md5_digest": "25e0fa3156c5800d8c21a6b4c272e620", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8341, "upload_time": "2019-01-30T18:53:59", "url": "https://files.pythonhosted.org/packages/a8/b9/7eeb4827ea3f1c97020923263b4c3457a1fc8f6bbdb14f487392cb7705bb/dry-monads-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "829d963dfaeaaf3b8e93ea860f21158f", "sha256": "64828e97d308052e95bd1233e7bf5b7a1f76c10e18a0d565b6f763a8c17f8cfe" }, "downloads": -1, "filename": "dry_monads-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "829d963dfaeaaf3b8e93ea860f21158f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 22900, "upload_time": "2019-01-30T18:54:12", "url": "https://files.pythonhosted.org/packages/b6/0e/5ad9a35e1c1b500637230416d13d69f723777973192e6e94102769abed47/dry_monads-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "25e0fa3156c5800d8c21a6b4c272e620", "sha256": "dde7d4160473b469032719cdf8449d716501de379de653d053b6909de4a84477" }, "downloads": -1, "filename": "dry-monads-0.2.0.tar.gz", "has_sig": false, "md5_digest": "25e0fa3156c5800d8c21a6b4c272e620", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8341, "upload_time": "2019-01-30T18:53:59", "url": "https://files.pythonhosted.org/packages/a8/b9/7eeb4827ea3f1c97020923263b4c3457a1fc8f6bbdb14f487392cb7705bb/dry-monads-0.2.0.tar.gz" } ] }