skillfed

wraps

Meaningful and safe wrapping types.

wraps v0.15.0 80.8K downloads/30d#14,266 on PyPI4
Permissive 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) DORMANT released

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 on this page — 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

wraps on PyPI

pip

pip install wraps

uv

uv add wraps

poetry

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 the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 5 — attrs, funcs, named, typing-aliases, typing-extensions
Maintenance dormant — 719 days since the last release
Last repo commit
First released
Downloads 80,833/month — #14,266 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: wraps-0.15.0-py3-none-any.whl

Keywords: either, future, option, python, result

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: UtilitiesTyping :: Typed

Tags

option type pythonresult type error handlingeither monadfunctional wrapping typessafe value compositionrust-style resultoptional value wrapper
functional-programmingtype-safetyerror-handling

More Utilities packages