{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/2"},{"label":"Mathematics","url":"https://skillfed.io/packages/category/scientific-engineering-mathematics"}],"enrichment":{"capability":"Provides utilities for working with nested data structures\u2014flattening, mapping functions across leaves, and traversing trees while preserving structure\u2014backed by an optimized C++ implementation.","skillfed_tags":["nested-structures","tree-traversal","machine-learning"],"use_cases":["Flatten nested parameter dictionaries in machine learning models for batch processing or serialization.","Apply transformations uniformly across all leaves of a nested tensor structure while preserving hierarchy.","Traverse and validate deeply nested configuration or data structures in data pipelines.","Convert between nested and flat representations when interfacing with APIs that expect one or the other.","Implement recursive operations on tree-like data without manual recursion boilerplate."],"what_it_does":"dm-tree is a library for manipulating nested data structures\u2014dictionaries, lists, tuples, and their combinations\u2014by applying operations uniformly to leaf values while preserving the overall container structure. It generalizes Python's built-in `map` function from flat sequences to arbitrarily nested hierarchies. The core operations are `flatten` (convert a nested structure to a flat list), `map_structure` (apply a function to each leaf), and traversal utilities. The implementation is backed by optimized C++ code designed for performance-critical applications like machine learning pipelines that process large nested tensors or parameter trees.\n\nThe package depends on absl-py, attrs, numpy, and wrapt, and targets modern Python (3.10+). It is actively maintained, with recent releases and no known security vulnerabilities. The library is particularly useful in machine learning frameworks where nested structures of tensors or parameters are common, though it applies to any domain working with complex hierarchical data.","worth_installing":"Yes. dm-tree is actively maintained, has no security vulnerabilities, carries a permissive Apache 2.0 license, and solves a genuine problem in working with nested structures. The medium install friction (compiled wheels) is well-mitigated by broad platform coverage and modern Python support. Install it if your code regularly manipulates nested dicts, lists, or mixed hierarchies\u2014especially in machine learning or data processing contexts."},"id":"dm-tree","links":{"html":"https://skillfed.io/packages/dm-tree","md":"https://skillfed.io/packages/dm-tree.md","pypi":"https://pypi.org/project/dm-tree/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-31","license_spdx":null,"license_treatment":"permissive","name":"dm-tree","python_support":"supports_current","summary":"Tree is a library for working with nested data structures."},"popularity":{"monthly_downloads":5699060,"position":2050,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.1.10"}
