--- id: nutree version: "1.1.0" license: MIT license_treatment: permissive maintenance: active --- # nutree — A Python library for tree data structures with an intuitive, yet powerful, API. License: permissive · Maintenance: active · Downloads: 1.0M/mo ## What it is and what it does Nutree is a tree data structure library that lets you build and work with hierarchical node structures in Python. It supports both simple string nodes and arbitrary Python objects, with a navigation API for accessing, searching, and iterating through trees. The library handles common tree operations like pattern-based search, node filtering, and traversal in multiple ways. The package is designed for unobtrusive integration—you can wrap existing objects as tree nodes without modification. It offers serialization to JSON (with compression support), export to graph formats like DOT and Mermaid diagrams, RDF conversion, and tree comparison with patch generation. All code is fully type-annotated and supports typed child nodes. Use it for: - Build hierarchical file system or organizational structure representations in memory - Search and filter tree nodes by name pattern, object reference, or ID across large hierarchies - Serialize tree structures to JSON for storage or API transmission, with optional compression - Generate visual diagrams of tree structures using Graphviz or Mermaid for documentation - Compare two trees and compute structural differences or patches for version control - Wrap arbitrary Python objects as tree nodes without modifying the original classes ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Nutree provides a Python library for creating, navigating, and manipulating tree data structures with support for searching, serialization, and visualization. Yes. Nutree is a well-maintained, actively developed library with no known vulnerabilities, permissive MIT licensing, and low installation friction. It's suitable for any Python project needing tree data structures—from simple hierarchies to complex object graphs—with a mature API and comprehensive feature set. ## Install pip install nutree uv add nutree poetry add nutree ## Installing nutree Before you install: Low friction installation with a single pure-Python wheel dependency on typing_extensions. The package is actively maintained with a recent release on 2025-02-09 and an active repository. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and commercial projects. Quickstart: from nutree import Tree, Node tree = Tree("Root") node = tree.add("Child") node.add("Grandchild") tree.print() Verify before relying: - Whether the package supports Python versions older than 3.9 despite classifiers listing 3.9 as minimum - Performance characteristics and scalability limits for very large trees ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags tree data structure library, hierarchical node navigation, tree traversal and search, serialize tree to json, tree visualization graphviz, python tree library, arbitrary object tree nodes, data-structures, tree-algorithms, graph-visualization [View on SkillFed](https://skillfed.io/packages/nutree) · [View on PyPI](https://pypi.org/project/nutree/)