{"id":15580735,"url":"https://github.com/mar10/nutree","last_synced_at":"2025-04-05T17:03:43.219Z","repository":{"id":40514932,"uuid":"436971538","full_name":"mar10/nutree","owner":"mar10","description":"A Python library for tree data structures with an intuitive, yet powerful API.","archived":false,"fork":false,"pushed_at":"2025-02-27T21:09:26.000Z","size":2759,"stargazers_count":43,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T16:05:36.756Z","etag":null,"topics":["data-structures","digraph","graph","hierarchy","python","tree","treelib"],"latest_commit_sha":null,"homepage":"https://nutree.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mar10.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"mar10w","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.paypal.com/donate/?hosted_button_id=RA6G29AZRUD44"]}},"created_at":"2021-12-10T12:28:31.000Z","updated_at":"2025-03-20T01:32:28.000Z","dependencies_parsed_at":"2023-11-12T17:24:26.812Z","dependency_job_id":"0c0db0d9-ab80-4a09-a1ac-d04ed0f8b949","html_url":"https://github.com/mar10/nutree","commit_stats":{"total_commits":99,"total_committers":2,"mean_commits":49.5,"dds":"0.16161616161616166","last_synced_commit":"d431b7a3a411c105d22fec7342f31ff838da487f"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar10%2Fnutree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar10%2Fnutree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar10%2Fnutree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar10%2Fnutree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mar10","download_url":"https://codeload.github.com/mar10/nutree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369953,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structures","digraph","graph","hierarchy","python","tree","treelib"],"created_at":"2024-10-02T19:36:12.949Z","updated_at":"2025-04-05T17:03:43.194Z","avatar_url":"https://github.com/mar10.png","language":"Python","readme":"# ![logo](https://raw.githubusercontent.com/mar10/nutree/main/docs/nutree_48x48.png) nutree\n\n[![Latest Version](https://img.shields.io/pypi/v/nutree.svg)](https://pypi.python.org/pypi/nutree/)\n[![Tests](https://github.com/mar10/nutree/actions/workflows/tests.yml/badge.svg)](https://github.com/mar10/nutree/actions/workflows/tests.yml)\n[![codecov](https://codecov.io/github/mar10/nutree/branch/main/graph/badge.svg?token=9xmAFm8Icl)](https://codecov.io/github/mar10/nutree)\n[![License](https://img.shields.io/pypi/l/nutree.svg)](https://github.com/mar10/nutree/blob/main/LICENSE.txt)\n[![Documentation Status](https://readthedocs.org/projects/nutree/badge/?version=latest)](http://nutree.readthedocs.io/)\n[![Released with: Yabs](https://img.shields.io/badge/released%20with-yabs-yellowgreen)](https://github.com/mar10/yabs)\n[![StackOverflow: nutree](https://img.shields.io/badge/StackOverflow-nutree-blue.svg)](https://stackoverflow.com/questions/tagged/nutree)\n\n\u003e _Nutree_ is a Python library for tree data structures with an intuitive,\n\u003e yet powerful, API.\n\n**Nutree Facts**\n\nHandle multiple references of single objects ('clones') \u003cbr\u003e\nSearch by name pattern, id, or object reference \u003cbr\u003e\nCompare two trees and calculate patches \u003cbr\u003e\nUnobtrusive handling of arbitrary objects \u003cbr\u003e\nSave as DOT file and graphwiz diagram \u003cbr\u003e\nNodes can be plain strings or objects \u003cbr\u003e\n(De)Serialize to (compressed) JSON \u003cbr\u003e\nSave as Mermaid flow diagram \u003cbr\u003e\nDifferent traversal methods \u003cbr\u003e\nGenerate random trees \u003cbr\u003e\nConvert to RDF graph \u003cbr\u003e\nFully type annotated \u003cbr\u003e\nTyped child nodes \u003cbr\u003e\nPretty print \u003cbr\u003e\nNavigation \u003cbr\u003e\nFiltering \u003cbr\u003e\nFast \u003cbr\u003e\n\n**Example**\n\nA simple tree, with text nodes\n\n```py\nfrom nutree import Tree, Node\n\ntree = Tree(\"Store\")\n\nn = tree.add(\"Records\")\n\nn.add(\"Let It Be\")\nn.add(\"Get Yer Ya-Ya's Out!\")\n\nn = tree.add(\"Books\")\nn.add(\"The Little Prince\")\n\ntree.print()\n```\n\n```ascii\nTree\u003c'Store'\u003e\n├─── 'Records'\n│    ├─── 'Let It Be'\n│    ╰─── \"Get Yer Ya-Ya's Out!\"\n╰─── 'Books'\n     ╰─── 'The Little Prince'\n```\n\nTree nodes wrap the data and also expose methods for navigation, searching,\niteration, ...\n\n```py\nrecords_node = tree[\"Records\"]\nassert isinstance(records_node, Node)\nassert records_node.name == \"Records\"\n\nprint(records_node.first_child())\n```\n\n```ascii\nNode\u003c'Let It Be', data_id=510268653885439170\u003e\n```\n\nNodes may be strings or arbitrary objects:\n\n```py\nalice = Person(\"Alice\", age=23, guid=\"{123-456}\")\ntree.add(alice)\n\n# Lookup nodes by object, data_id, name pattern, ...\nassert isinstance(tree[alice].data, Person)\n\ndel tree[alice]\n```\n\n[Read the Docs](https://nutree.readthedocs.io/) for more.\n","funding_links":["https://ko-fi.com/mar10w","https://www.paypal.com/donate/?hosted_button_id=RA6G29AZRUD44"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar10%2Fnutree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmar10%2Fnutree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar10%2Fnutree/lists"}