$npx skillfedfor your agent

purify

Pythonic object-mutator transforms as pure functions

With conditionsPyPI Software DevelopmentReleased Mar 2026120.3K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — purify-0.3.0-py3-none-any.whl
v0.3.0 · released 2026-03-26 · Python <3.15,>=3.10

Yes, if you regularly write object-transform functions and want to enforce purity without deep-copy overhead. The package is actively maintained, has no dependencies, and works on current Python versions. It's a narrow but well-defined tool—install it when you recognize the pattern it solves in your own code, not as a general utility.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python, no runtime dependencies, and supports modern Python versions 3.10 through 3.14.
  • Repository is active with recent commits.

License · maintenance · safety

permissive license (permissive) — Apache License 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

last release 2026-03-26 (141 days) · last repo commit 2026-03-26 · 3 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 120,297 downloads/mo, #12,034 on PyPI

Verify before relying

pip install purify

from purify import purify

@purify
def rename_tree(name: str, tree):
    tree.name = name
    return tree

original = Tree('Old')
modified = rename_tree('New', original)
# original.name is still 'Old', modified.name is 'New'
  • Whether the shallow-copy approach is sufficient for nested mutable structures in typical use cases beyond the documented examples
  • Performance characteristics and memory overhead compared to standard mutation in real-world codebases
Same gist for agents: .md · .json

What it is and what it does

Purify is a decorator that solves a common Python pattern problem: writing functions that transform objects while maintaining functional purity. Normally, Python encourages mutating an object in place and returning it for efficiency, but this breaks referential transparency when the original object is needed elsewhere. Deepcopy is the pure alternative but is orders of magnitude slower. Purify uses shallow copy by default, making the decorated function pure without the performance cost of deep copying.

The decorator works by automatically shallow-copying the target argument before the function executes, so mutations inside the function only affect the copy. You specify which argument to copy either by position (last argument by default) or by name. For complex nested structures, the documentation recommends decomposing your transforms into multiple shallow-copy layers rather than using deep copy, which often yields both purer and more reusable functions.

Use it for

  • Transform tree or graph structures where you need the original unchanged but want to write natural mutation-style code
  • Build pipelines of object modifications where intermediate results must not affect earlier stages
  • Write testable functions that don't have hidden side effects on their inputs
  • Refactor existing mutation-based codebases toward functional style without rewriting to use expensive deepcopy

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you regularly write object-transform functions and want to enforce purity without deep-copy overhead.

The package is actively maintained, has no dependencies, and works on current Python versions. It's a narrow but well-defined tool—install it when you recognize the pattern it solves in your own code, not as a general utility.

Install

purify on PyPI

Before you install

Low friction: pure Python, no runtime dependencies, and supports modern Python versions 3.10 through 3.14. Repository is active with recent commits.

License in practice

Apache License 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install purify

from purify import purify

@purify
def rename_tree(name: str, tree):
    tree.name = name
    return tree

original = Tree('Old')
modified = rename_tree('New', original)
# original.name is still 'Old', modified.name is 'New'

Verify before relying

  • Whether the shallow-copy approach is sufficient for nested mutable structures in typical use cases beyond the documented examples
  • Performance characteristics and memory overhead compared to standard mutation in real-world codebases

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release <3.15,>=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 141 days since the last release
Last repo commit
First released
Downloads120,297 / month, #12,034 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Evidence: purify-0.3.0-py3-none-any.whl

Tags

Capabilities
pure function decorator pythonimmutable object transformsshallow copy decoratorfunctional programming object mutationpure function object modificationpythonic immutability patternobject transform without mutation
Topics
functional-programmingdecoratorimmutability

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pure function decorator python”

  • purifyA decorator that makes object-mutating functions pure by…
  • cachettlcachettl provides LRU TTL cache decorators for both synchronous and…
  • ratelimRatelim enforces rate limits on function calls by decorating them to…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also decopatch · lenses · legacy-api-wrap · wrapt · mutmut · flake8-functions · makefun · ConfigUpdater · singleton-decorator · decorator