--- id: wraps version: "0.15.0" license: MIT License Copyright (c) 2022-present, Nikita Tikhonov (nekitdev) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) license_treatment: permissive maintenance: dormant --- # wraps — Meaningful and safe wrapping types. License: permissive · Maintenance: dormant · Downloads: 80.8K/mo ## What it is and what it does wraps provides a collection of type-safe wrapper types inspired by functional programming—Option, Result, Either, and Future—that encode absence, failure, and deferred computation directly in the type system. Instead of using None or raising exceptions, you wrap values and compose operations safely, making error paths explicit and testable. The library is built on top of attrs, funcs, named, typing-aliases, and typing-extensions to deliver typed, composable wrappers for modern Python. It targets developers familiar with functional patterns who want to bring that safety and clarity to Python codebases. Use it for: - Replace None checks with Option types to make absence explicit in function signatures. - Encode success or failure outcomes as Result types to propagate errors through operation chains. - Use Either to represent computations that can fail in two distinct ways with different error information. - Chain transformations on wrapped values using combinators for functional composition. - Write type-safe APIs where callers see at a glance whether a function returns a value or a fallible result. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides type-safe wrapper types for representing values that may be absent, failed, or deferred, enabling functional-style error handling and optional value composition in Python. Yes, if you are building a codebase that benefits from explicit error and absence handling and you are comfortable with functional programming patterns. The low install friction and permissive MIT license make adoption straightforward. However, note that the project is dormant (last release 719 days ago) and the README examples are incomplete, so verify that the current API meets your needs before committing to a dependency. ## Install pip install wraps uv add wraps poetry add wraps ## Installing wraps Before you install: Low install friction with a pure-Python wheel. Depends on attrs, funcs, named, typing-aliases, and typing-extensions—all lightweight utilities. Last release was 719 days ago; repository is not archived but shows dormant maintenance activity. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions. Suitable for both open-source and commercial projects. Quickstart: pip install wraps from wraps import Option, Result # Option wraps an optional value value: Option[int] = Option.some(value) result = value.map(lambda x: x) # Result wraps success or failure outcome: Result[int, str] = Result.ok(value) Requires Python 3.8 or above. Verify before relying: - Whether the package is actively maintained or seeking new maintainers given the 719-day gap since last release. - Concrete examples of Option, Result, Either, and Future usage beyond the README's TODO placeholder. - Performance characteristics or design trade-offs compared to similar functional typing libraries. - Specific API surface and method signatures for each wrapper type. ## Package facts - License: MIT License Copyright (c) 2022-present, Nikita Tikhonov (nekitdev) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 80.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags option type python, result type error handling, either monad, functional wrapping types, safe value composition, rust-style result, optional value wrapper, functional-programming, type-safety, error-handling [View on SkillFed](https://skillfed.io/packages/wraps) · [View on PyPI](https://pypi.org/project/wraps/)