{"id":16482606,"url":"https://github.com/ariebovenberg/cans","last_synced_at":"2025-10-27T17:31:56.926Z","repository":{"id":51080358,"uuid":"354523466","full_name":"ariebovenberg/cans","owner":"ariebovenberg","description":"Simple, functional, composable containers","archived":false,"fork":false,"pushed_at":"2022-09-07T07:46:21.000Z","size":93,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-01T07:23:07.806Z","etag":null,"topics":["functional-programming","maybe-monad","mypy","pattern-matching","python"],"latest_commit_sha":null,"homepage":"https://cans.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ariebovenberg.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-04T11:13:26.000Z","updated_at":"2022-02-02T14:07:56.000Z","dependencies_parsed_at":"2022-09-03T13:00:42.140Z","dependency_job_id":null,"html_url":"https://github.com/ariebovenberg/cans","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fcans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fcans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fcans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fcans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ariebovenberg","download_url":"https://codeload.github.com/ariebovenberg/cans/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238535877,"owners_count":19488612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional-programming","maybe-monad","mypy","pattern-matching","python"],"created_at":"2024-10-11T13:11:25.418Z","updated_at":"2025-10-27T17:31:56.562Z","avatar_url":"https://github.com/ariebovenberg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"🥫 Cans\n=======\n\n.. image:: https://img.shields.io/pypi/v/cans.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/cans\n\n.. image:: https://img.shields.io/pypi/l/cans.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/cans\n\n.. image:: https://img.shields.io/pypi/pyversions/cans.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/cans\n\n.. image:: https://img.shields.io/readthedocs/cans.svg?style=flat-square\n   :target: http://cans.readthedocs.io/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square\n   :target: https://github.com/psf/black\n\nSimple, functional, composable containers like ``Maybe``.\nProperly **typed** and supports **pattern matching** on Python 3.10+.\nInspired by the containers in the `Rust standard library \u003chttps://doc.rust-lang.org/std/option/\u003e`_.\n\nQuickstart\n----------\n\n.. code-block:: python3\n\n   \u003e\u003e\u003e from cans import Just, Nothing, Maybe\n   \u003e\u003e\u003e greeting: Maybe[str] = Just(\"Hello\")\n   ...\n   \u003e\u003e\u003e def first(m: list[str]) -\u003e Maybe[str]:\n   ...     return Just(m[0]) if m else Nothing()\n   ...\n   \u003e\u003e\u003e first([\"howdy\", \"hi\", \"hello\"]).map(str.title).unwrap()\n   \"Howdy\"\n   ...\n   \u003e\u003e\u003e # Python 3.10+ only\n   \u003e\u003e\u003e match greeting:\n   ...     case Just(n):\n   ...         print(f\"{greeting} world!\")\n   ...     case Nothing():\n   ...         print(\"Hi world!\")\n   Hello world!\n\nAmong the supported methods are ``flatmap``, ``filter``, ``zip``,\nas well as the relevant\n`collection APIs \u003chttps://docs.python.org/3/library/collections.abc.html\u003e`_.\nSee `the documentation \u003chttps://cans.readthedocs.io\u003e`_ for a complete overview.\n\nTodo\n----\n\n- Other containers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariebovenberg%2Fcans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fariebovenberg%2Fcans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariebovenberg%2Fcans/lists"}