{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/2"}],"enrichment":{"capability":"OpTree provides optimized utilities for flattening, unflattening, and mapping over nested Python container structures (PyTrees) like dicts, lists, tuples, and custom types.","skillfed_tags":["tree-traversal","functional-programming","ml-infrastructure"],"use_cases":["Flatten nested model parameters or optimizer states in machine learning frameworks for batch processing.","Traverse and transform deeply nested configuration dictionaries or JSON-like structures uniformly.","Register custom container types (e.g., dataclasses) to participate in tree operations without manual recursion.","Build functional programming patterns that operate on entire tree structures with a single map call.","Implement library-specific PyTree utilities via the reexport API for downstream packages."],"what_it_does":"OpTree is a library for working with PyTrees\u2014arbitrarily nested Python containers and custom objects\u2014by providing efficient flatten, unflatten, and map operations. It treats built-in types like dict, list, tuple, namedtuple, and OrderedDict as non-leaf nodes that can be traversed, while custom objects are leaves unless explicitly registered. The core operations are tree flattening (which extracts leaves in deterministic order and captures structure) and unflattening (which reconstructs the tree from leaves and structure), with tree_map built from these primitives.\n\nThe package is written in C++ with Python bindings for performance, supports registration of custom container types, and includes a namespace system (optree.pytree) for creating library-specific PyTree utilities. It is actively maintained, has no known vulnerabilities, and provides prebuilt wheels for modern Python versions across multiple platforms, making installation straightforward in most cases.","worth_installing":"Yes. OpTree is worth installing if you work with nested Python structures in machine learning, scientific computing, or functional programming contexts. It is actively maintained, has no security issues, and provides significant convenience and performance over manual tree traversal. The permissive Apache-2.0 license poses no restriction. Medium install friction is acceptable given the availability of prebuilt wheels for common platforms."},"id":"optree","links":{"html":"https://skillfed.io/packages/optree","md":"https://skillfed.io/packages/optree.md","pypi":"https://pypi.org/project/optree/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-06","license_spdx":"Apache-2.0","license_treatment":"permissive","name":"optree","python_support":"supports_current","summary":"Optimized PyTree Utilities."},"popularity":{"monthly_downloads":10193965,"position":1471,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.19.1"}
