{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/8"}],"enrichment":{"capability":"Lenses provides a functional approach to reading and modifying nested data structures without mutating the original data, using composable lens operations inspired by Haskell.","skillfed_tags":["functional-programming","immutable-data","data-transformation"],"use_cases":["Transform deeply nested JSON or dictionary structures (e.g., API responses) without writing nested loops.","Apply the same operation to all matching elements across multiple levels of nesting in a single expression.","Build reusable, composable data transformations that can be combined and tested independently.","Work with immutable data patterns in functional Python code or when mutation safety is required.","Extract and modify specific fields in complex object hierarchies without intermediate variable assignments."],"what_it_does":"Lenses is a Python library that implements functional lens patterns to safely navigate and transform nested data structures without mutating the original. It lets you compose operations like filtering, mapping, and method calls across arbitrary levels of nesting\u2014lists, dicts, custom objects\u2014in a single declarative expression. Instead of writing nested loops and conditionals to reach deep values and rebuild structures, you chain lens operations that describe the path and transformation, then apply them to your data.\n\nThe library is inspired by Haskell's lens ecosystem but adapted for Python's imperative style. It has no external runtime dependencies and works across modern Python versions (3.7\u20133.11). The main trade-off is that the lens syntax is unfamiliar to most Python developers and requires learning a new mental model; the payoff is cleaner, more composable code for complex data transformations that would otherwise require deeply nested loops.","worth_installing":"Yes, if you work regularly with nested data structures and want cleaner, more composable transformation code. The copyleft GPLv3+ license is a hard blocker for proprietary projects. The dormant maintenance status is a minor concern\u2014the library is stable and has no known vulnerabilities, but you should verify that its behavior matches your needs before adopting it for new projects."},"id":"lenses","links":{"html":"https://skillfed.io/packages/lenses","md":"https://skillfed.io/packages/lenses.md","pypi":"https://pypi.org/project/lenses/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2023-10-24","license_spdx":null,"license_treatment":"copyleft","name":"lenses","python_support":"supports_current","summary":"A lens library for python"},"popularity":{"monthly_downloads":163389,"position":10571,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.2.0"}
