{"id":13501505,"url":"https://github.com/MaT1g3R/option","last_synced_at":"2025-03-29T09:30:38.582Z","repository":{"id":32974188,"uuid":"148211433","full_name":"MaT1g3R/option","owner":"MaT1g3R","description":"Rust like Option and Result types in Python","archived":false,"fork":false,"pushed_at":"2024-01-01T17:03:27.000Z","size":807,"stargazers_count":91,"open_issues_count":8,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-17T09:09:19.870Z","etag":null,"topics":["mypy","option-type","optional","pep484","result","result-type","typing"],"latest_commit_sha":null,"homepage":"https://mat1g3r.github.io/option/","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/MaT1g3R.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-09-10T19:58:10.000Z","updated_at":"2025-03-14T16:35:51.000Z","dependencies_parsed_at":"2024-01-29T19:30:13.460Z","dependency_job_id":null,"html_url":"https://github.com/MaT1g3R/option","commit_stats":{"total_commits":124,"total_committers":3,"mean_commits":"41.333333333333336","dds":"0.10483870967741937","last_synced_commit":"be1fd503710f77137407d3afdbafeebe3c1edb59"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2Foption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2Foption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2Foption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaT1g3R%2Foption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaT1g3R","download_url":"https://codeload.github.com/MaT1g3R/option/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245245373,"owners_count":20583994,"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":["mypy","option-type","optional","pep484","result","result-type","typing"],"created_at":"2024-07-31T22:01:39.808Z","updated_at":"2025-03-29T09:30:38.542Z","avatar_url":"https://github.com/MaT1g3R.png","language":"Python","funding_links":[],"categories":["Python","Additional types","Awesome Functional Python"],"sub_categories":["Libraries"],"readme":"# Option\n[![CircleCI](https://circleci.com/gh/MaT1g3R/option/tree/master.svg?style=svg)](https://circleci.com/gh/MaT1g3R/option/tree/master)\n\nRust-like [Option](https://doc.rust-lang.org/std/option/enum.Option.html) and [Result](https://doc.rust-lang.org/std/result/enum.Result.html) types in Python, slotted and fully typed.\n\nAn `Option` type represents an optional value, every `Option` is either `Some` and contains Some value, or `NONE`\n\nA `Result` type represents a value that might be an error. Every `Result` is either `Ok` and contains a success value, or `Err` and contains an error value.\n\nUsing an `Option` type forces you to deal with `None` values in your code and increase type safety.\n\nUsing a `Result` type simplifies error handling and reduces `try` `except` blocks.\n\n## Quick Start\n```Python\nfrom option import Result, Option, Ok, Err\nfrom requests import get\n\n\ndef call_api(url, params) -\u003e Result[dict, int]:\n    result = get(url, params)\n    code = result.status_code\n    if code == 200:\n        return Ok(result.json())\n    return Err(code)\n\n\ndef calculate(url, params) -\u003e Option[int]:\n    return call_api(url, params).ok().map(len)\n\n\ndict_len = calculate('https://example.com', {})\n```\n\n## Install\nOption can be installed from PyPi:\n```bash\npip install option\n```\n\n## Documentation\nThe documentation lives at https://mat1g3r.github.io/option/\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaT1g3R%2Foption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMaT1g3R%2Foption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaT1g3R%2Foption/lists"}