{"id":5863,"library":"bigtree","title":"Bigtree","description":"Bigtree is a Python library that provides a performant, flexible, and intuitive implementation for tree data structures. It supports various tree types (Tree, Binary Tree, Directed Acyclic Graph) and offers a rich API for traversal, search, modification, and export. It integrates seamlessly with Python lists, dictionaries, pandas, and polars DataFrames, making it suitable for a wide range of hierarchical data workflows. The library is actively maintained with frequent releases, currently at version 1.4.0.","status":"active","version":"1.4.0","language":"en","source_language":"en","source_url":"https://github.com/kayjan/bigtree","tags":["tree","data-structure","hierarchy","graph","dataframe"],"install":[{"cmd":"pip install bigtree","lang":"bash","label":"Core library"},{"cmd":"pip install 'bigtree[pandas,polars,rich]'","lang":"bash","label":"With common optional dependencies"}],"dependencies":[{"reason":"Required Python version","package":"python","minimum_version":"3.10"},{"reason":"For DataFrame integration (optional)","package":"pandas","optional":true},{"reason":"For Polars DataFrame integration (optional)","package":"polars","optional":true},{"reason":"For enhanced tree printing in rich format (optional)","package":"rich","optional":true}],"imports":[{"symbol":"Node","correct":"from bigtree import Node"},{"symbol":"print_tree","correct":"from bigtree import print_tree"},{"note":"Used for Directed Acyclic Graph structures where nodes can have multiple parents.","symbol":"DAGNode","correct":"from bigtree import DAGNode"},{"note":"Used for binary tree structures.","symbol":"BinaryNode","correct":"from bigtree import BinaryNode"}],"quickstart":{"code":"from bigtree import Node, print_tree\n\n# Create nodes\nroot = Node(\"a\")\nb = Node(\"b\", parent=root)\nc = Node(\"c\", parent=root)\nd = Node(\"d\", parent=b)\ne = Node(\"e\", parent=b)\nf = Node(\"f\", parent=c)\n\n# Print the tree\nprint_tree(root)\n\n# Access node attributes\nprint(f\"Node 'd' is a leaf: {d.is_leaf}\")\nprint(f\"Root node name: {root.node_name}\")","lang":"python","description":"This example demonstrates how to create a basic tree using `Node` objects and print its structure to the console using `print_tree`. It also shows how to access built-in node attributes like `is_leaf` and `node_name`."},"warnings":[{"fix":"Ensure node names do not contain path separator characters (e.g., '/', '\\\\', or custom separators if configured).","message":"Node names cannot contain the separator symbol (default '/'). While it won't immediately raise an error, it can lead to issues with certain functions like tree export/import or path-based operations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review existing `get_attr` calls. If you previously handled `AttributeError` for missing attributes, consider using the `default` parameter of `get_attr` (e.g., `node.get_attr('missing_attr', None)`). Be aware of new nested attribute access capabilities.","message":"The `get_attr` method, especially for `BaseNode`/`DAGNode`, was enhanced in v1.3.0 to support chained and nested attributes and to return a default value instead of raising an error if the attribute is not found. Code relying on an `AttributeError` for missing attributes or expecting simple attribute access might need adjustments.","severity":"gotcha","affected_versions":">=1.3.0"},{"fix":"Consult the official `bigtree` documentation and changelog, particularly for versions 1.0.0 and 1.0.2, if you experience unexpected behavior or `AttributeError` when upgrading from pre-1.0.0 versions, especially for advanced use cases or custom node extensions.","message":"Version 1.0.0 and subsequent releases (e.g., 1.0.2) introduced significant API improvements and a plugin architecture. While core usage remains largely compatible, users with highly customized node types or those directly interacting with internal components might need to refactor their code to align with the new plugin-based structure.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}