{"id":29308618,"url":"https://github.com/simwai/rustico","last_synced_at":"2026-05-16T21:11:08.064Z","repository":{"id":302519902,"uuid":"1012582023","full_name":"simwai/rustico","owner":"simwai","description":"A battle-tested Rust like Result type for Python 3.8+. Fully type annotated. 🤘","archived":false,"fork":false,"pushed_at":"2025-07-02T20:34:01.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-02T20:55:05.345Z","etag":null,"topics":["exception-handling","monad","neverthrow","result","result-type","rust","rustic","rusty"],"latest_commit_sha":null,"homepage":"","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/simwai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-02T14:51:09.000Z","updated_at":"2025-07-02T20:42:18.000Z","dependencies_parsed_at":"2025-07-02T20:55:07.558Z","dependency_job_id":"a1445852-ade4-4f16-a63b-c0b7e19d779a","html_url":"https://github.com/simwai/rustico","commit_stats":null,"previous_names":["simwai/rustico"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simwai/rustico","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simwai%2Frustico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simwai%2Frustico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simwai%2Frustico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simwai%2Frustico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simwai","download_url":"https://codeload.github.com/simwai/rustico/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simwai%2Frustico/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264032346,"owners_count":23546811,"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":["exception-handling","monad","neverthrow","result","result-type","rust","rustic","rusty"],"created_at":"2025-07-07T07:14:18.038Z","updated_at":"2026-05-16T21:11:03.044Z","avatar_url":"https://github.com/simwai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rustico\n\n[![PyPI - Version](https://img.shields.io/pypi/v/rustico.svg?color=purple)](https://pypi.org/project/rustico/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rustico.svg?color=purple)](https://pypi.org/project/rustico/)\n[![License](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT)\n\n\u003e **A Schrödinger's Cat for Python error handling: your result is both alive and dead—until you unwrap it.**\n\n## What is `rustico`?\n\n`rustico` brings the power and elegance of Rust's `Result` type to Python. Every operation is either a success (`Ok`) or a failure (`Err`), and you must explicitly handle both. No more try/except hell—just beautiful, predictable, and composable error handling.\n\n## Schrödinger's Cat: The Metaphor\n\nImagine every function call as a box containing Schrödinger's cat. Until you open (unwrap) the box, the cat is both alive (`Ok`) and dead (`Err`). With `rustico`, you don't have to guess or hope—when you unwrap the result, you'll know exactly what you got, and you'll handle both cases explicitly.\n\n## Key Features\n\n- 🔒 **Can't Forget Error Handling**: The type system forces you to handle both cases\n- 📍 **Precise Error Information**: Know exactly what and where things failed\n- 🧩 **Composable**: Chain operations without nested try/except blocks\n- 🎯 **Early Exit**: Stop processing on first error automatically\n- 🔍 **Type Safe**: Your IDE knows about both success and error cases\n- ⚡ **Async Support**: First-class support for async/await\n- 🧪 **Test Friendly**: Easily mock and test error conditions\n\n## Installation\n\nPython 3.8+ is required.\n\nYou can install `rustico` using pip:\n\n```bash\npip install rustico\n```\n\n## Quick Example\n\nHere's a taste of how `rustico` simplifies error handling:\n\n```python\nfrom rustico import Ok, Err, Result\n\ndef divide(numerator: float, denominator: float) -\u003e Result[float, str]:\n    \"\"\"Divides two numbers, returning an Ok result or an Err if division by zero occurs.\"\"\"\n    if denominator == 0:\n        return Err(\"Cannot divide by zero!\")\n    return Ok(numerator / denominator)\n\n# --- Usage Examples ---\n\n# Successful division\nresult_success = divide(10, 2)\nif result_success.is_ok():\n    print(f\"Success: {result_success.unwrap()}\") # Output: Success: 5.0\n\n# Failed division\nresult_failure = divide(10, 0)\nif result_failure.is_err():\n    print(f\"Error: {result_failure.unwrap_err()}\") # Output: Error: Cannot divide by zero!\n\n# Chaining operations\ndef multiply_by_two(value: float) -\u003e Result[float, str]:\n    return Ok(value * 2)\n\nchained_result = divide(20, 4).and_then(multiply_by_two)\nif chained_result.is_ok():\n    print(f\"Chained Success: {chained_result.unwrap()}\") # Output: Chained Success: 10.0\n\nfailed_chained_result = divide(20, 0).and_then(multiply_by_two)\nif failed_chained_result.is_err():\n    print(f\"Chained Error: {failed_chained_result.unwrap_err()}\") # Output: Chained Error: Cannot divide by zero!\n```\n\nFor detailed documentation, see the [full documentation](docs/index.md).\n\n## License\n\n`rustico` is distributed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimwai%2Frustico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimwai%2Frustico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimwai%2Frustico/lists"}