{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/16"}],"enrichment":{"capability":"A decorator that makes object-mutating functions pure by automatically shallow-copying the target argument, allowing you to write mutation-style code that doesn't modify the original object.","skillfed_tags":["functional-programming","decorator","immutability"],"use_cases":["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"],"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.\n\nThe 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.","worth_installing":"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\u2014install it when you recognize the pattern it solves in your own code, not as a general utility."},"id":"purify","links":{"html":"https://skillfed.io/packages/purify","md":"https://skillfed.io/packages/purify.md","pypi":"https://pypi.org/project/purify/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-26","license_spdx":null,"license_treatment":"permissive","name":"purify","python_support":"supports_current","summary":"Pythonic object-mutator transforms as pure functions"},"popularity":{"monthly_downloads":120297,"position":12034,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.3.0"}
