Metadata-Version: 2.1
Name: cans
Version: 0.0.2
Summary: Robust, composable, functional containers
Home-page: https://github.com/ariebovenberg/cans
License: MIT
Author: Arie Bovenberg
Author-email: a.c.bovenberg@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: docs
Requires-Dist: importlib-metadata (>=1.0,<2.0); python_version < "3.8"
Requires-Dist: sphinx (>=3.5.3,<4.0.0); extra == "docs"
Requires-Dist: sphinx-material (>=0.0.32,<0.0.33)
Requires-Dist: typing-extensions (>=3.7.4,<4.0.0)
Project-URL: Repository, https://github.com/ariebovenberg/cans
Description-Content-Type: text/x-rst

🥫 Cans
=======

.. image:: https://img.shields.io/pypi/v/cans.svg?style=flat-square
   :target: https://pypi.python.org/pypi/cans

.. image:: https://img.shields.io/pypi/l/cans.svg?style=flat-square
   :target: https://pypi.python.org/pypi/cans

.. image:: https://img.shields.io/pypi/pyversions/cans.svg?style=flat-square
   :target: https://pypi.python.org/pypi/cans

.. image:: https://img.shields.io/readthedocs/cans.svg?style=flat-square
   :target: http://cans.readthedocs.io/

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square
   :target: https://github.com/psf/black

Composable, robust, functional containers like ``Maybe``.
Properly typed and supports pattern matching on Python 3.10+.

Quickstart
----------

.. code-block:: python3

   >>> from cans import Just, Nothing
   >>> greeting = Just("hello")
   >>> greeting.map(str.upper)
   Just("HELLO")
   ...
   >>> # Python 3.10+ only
   >>> match greeting:
   ...     case Just(n):
   ...         print(f"{greeting.title()} world!")
   ...     case Nothing():
   ...         print("Hi world!")
   Hello world!

Among the supported methods are ``flatmap``, ``filter``, ``zip``,
as well as the relevant
`collection APIs <https://docs.python.org/3/library/collections.abc.html>`_.

Todo
----

- Other containers

