======
Maybe
======
.. image:: https://img.shields.io/github/actions/workflow/status/rustedpy/maybe/ci.yml?branch=master
:alt: GitHub Workflow Status (branch)
:target: https://github.com/rustedpy/maybe/actions/workflows/ci.yml?query=branch%3Amaster
.. image:: https://codecov.io/gh/rustedpy/maybe/branch/master/graph/badge.svg
:alt: Coverage
:target: https://codecov.io/gh/rustedpy/maybe
A simple Maybe (Option) type for Python 3 `inspired by Rust
<https://doc.rust-lang.org/std/option/>`__, fully type annotated.
Installation
============
Not yet available on PyPI. PyPI package coming soon.
Latest GitHub ``master`` branch version:
.. sourcecode:: sh
$ pip install git+https://github.com/rustedpy/maybe
Summary
=======
**Experimental. API subject to change.**
The idea is that a possible value can be either ``Some(value)`` or
``Nothing()``, with a way to differentiate between the two. ``Some`` and
``Nothing`` are both classes encapsulating a possible value.
Example usage,
.. sourcecode:: Python
from rustedpy-maybe import Nothing, Some
o = Some('yay')
n = Nothing()
assert o.unwrap_or_else(str.upper) == 'yay'
assert n.unwrap_or_else(lambda: 'default') == 'default'
License
=======
MIT License
Raw data
{
"_id": null,
"home_page": "https://github.com/rustedpy/maybe",
"name": "rustedpy-maybe",
"maintainer": "rustedpy github org members (https://github.com/rustedpy)",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "rust,option,maybe,enum",
"author": "francium",
"author_email": "francium@francium.cc",
"download_url": "https://files.pythonhosted.org/packages/87/be/64ecd947c8a6016073c8748a5a4a828b45bda5b8887ed7b057c0771f455d/rustedpy-maybe-0.0.0.tar.gz",
"platform": null,
"description": "======\nMaybe\n======\n\n.. image:: https://img.shields.io/github/actions/workflow/status/rustedpy/maybe/ci.yml?branch=master\n :alt: GitHub Workflow Status (branch)\n :target: https://github.com/rustedpy/maybe/actions/workflows/ci.yml?query=branch%3Amaster\n\n.. image:: https://codecov.io/gh/rustedpy/maybe/branch/master/graph/badge.svg\n :alt: Coverage\n :target: https://codecov.io/gh/rustedpy/maybe\n\nA simple Maybe (Option) type for Python 3 `inspired by Rust\n<https://doc.rust-lang.org/std/option/>`__, fully type annotated.\n\nInstallation\n============\n\nNot yet available on PyPI. PyPI package coming soon.\n\nLatest GitHub ``master`` branch version:\n\n.. sourcecode:: sh\n\n $ pip install git+https://github.com/rustedpy/maybe\n\nSummary\n=======\n\n**Experimental. API subject to change.**\n\nThe idea is that a possible value can be either ``Some(value)`` or\n``Nothing()``, with a way to differentiate between the two. ``Some`` and\n``Nothing`` are both classes encapsulating a possible value.\n\nExample usage,\n\n.. sourcecode:: Python\n\n from rustedpy-maybe import Nothing, Some\n\n o = Some('yay')\n n = Nothing()\n assert o.unwrap_or_else(str.upper) == 'yay'\n assert n.unwrap_or_else(lambda: 'default') == 'default'\n\n\nLicense\n=======\n\nMIT License\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Rust-like option type for Python",
"version": "0.0.0",
"project_urls": {
"Homepage": "https://github.com/rustedpy/maybe"
},
"split_keywords": [
"rust",
"option",
"maybe",
"enum"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "80d880df2f0a2532216550272b8f58b47554e244efe195869a3071b2f7c42094",
"md5": "1064104ac34526cd08a8238585c87a57",
"sha256": "0808636203133c69c1573f8b07c0375dd72b6ab1e5f32ef3ed42295ee63d93d3"
},
"downloads": -1,
"filename": "rustedpy_maybe-0.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1064104ac34526cd08a8238585c87a57",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5442,
"upload_time": "2023-12-05T02:25:25",
"upload_time_iso_8601": "2023-12-05T02:25:25.443139Z",
"url": "https://files.pythonhosted.org/packages/80/d8/80df2f0a2532216550272b8f58b47554e244efe195869a3071b2f7c42094/rustedpy_maybe-0.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "87be64ecd947c8a6016073c8748a5a4a828b45bda5b8887ed7b057c0771f455d",
"md5": "989076ae4d52ee9a522670451ea68da2",
"sha256": "7737f67186a74ea50db4e2511f1238560047b38a61c5e49b7f7e755b31a6aace"
},
"downloads": -1,
"filename": "rustedpy-maybe-0.0.0.tar.gz",
"has_sig": false,
"md5_digest": "989076ae4d52ee9a522670451ea68da2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7033,
"upload_time": "2023-12-05T02:25:27",
"upload_time_iso_8601": "2023-12-05T02:25:27.125825Z",
"url": "https://files.pythonhosted.org/packages/87/be/64ecd947c8a6016073c8748a5a4a828b45bda5b8887ed7b057c0771f455d/rustedpy-maybe-0.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-05 02:25:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rustedpy",
"github_project": "maybe",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "rustedpy-maybe"
}