SearchableTree


NameSearchableTree JSON
Version 1.0.4 PyPI version JSON
download
home_page
SummarySimple tree struct with search and traversal utilities
upload_time2023-11-21 11:51:50
maintainer
docs_urlNone
author
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SearchableTree


Simple list intended for simplifying traversal & node search
Does not support deletion

Example:
```python 
tree = SearchableTree("root", SearchableNode)
root = tree.root()
l1 = root.appendChild('l1')
l11 = root.appendChild('l11')
l12 = root.appendChild('l12')
l2 = root.appendChild('l2')
l21 = root.appendChild('l21')
l22 = root.appendChild('l22')
root.upsert("l1.l11.l111")
root.upsert("l1.l11.l112")

for el in root.traverse(): #Traverse all nodes
	print(el)

print(tree) #Pretty print tree
print(tree.find("l112")) #Get node by name
print(tree.find("root.l1.l11")) #Get node by path
for el in l2.ancestors(): #Get node ancestors
	print(el)
```

Extend *SearchableNode* to add custom funcionality

### Author
- [Spin](pnspin@gmail.com)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "SearchableTree",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Spin <pnspin@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/3e/59/1c3b0237b524e3d29d9535b56252f098152959c81906cfdbd835ae82f3b4/SearchableTree-1.0.4.tar.gz",
    "platform": null,
    "description": "# SearchableTree\n\n\nSimple list intended for simplifying traversal & node search\nDoes not support deletion\n\nExample:\n```python \ntree = SearchableTree(\"root\", SearchableNode)\nroot = tree.root()\nl1 = root.appendChild('l1')\nl11 = root.appendChild('l11')\nl12 = root.appendChild('l12')\nl2 = root.appendChild('l2')\nl21 = root.appendChild('l21')\nl22 = root.appendChild('l22')\nroot.upsert(\"l1.l11.l111\")\nroot.upsert(\"l1.l11.l112\")\n\nfor el in root.traverse(): #Traverse all nodes\n\tprint(el)\n\nprint(tree) #Pretty print tree\nprint(tree.find(\"l112\")) #Get node by name\nprint(tree.find(\"root.l1.l11\")) #Get node by path\nfor el in l2.ancestors(): #Get node ancestors\n\tprint(el)\n```\n\nExtend *SearchableNode* to add custom funcionality\n\n### Author\n- [Spin](pnspin@gmail.com)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Simple tree struct with search and traversal utilities",
    "version": "1.0.4",
    "project_urls": {
        "Repository": "https://github.com/pnspin/SearchableTree"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d88e3f3d0b0ccc6d4456e90a649ad24e32353b01a05ba52b793a3be1c3ee93c8",
                "md5": "d89becad3ff458f6e767c7ee65bd1100",
                "sha256": "e162a310ac68742ca909654ca09e96850503acd87da9c9d397c29cb450c0b504"
            },
            "downloads": -1,
            "filename": "SearchableTree-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d89becad3ff458f6e767c7ee65bd1100",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3568,
            "upload_time": "2023-11-21T11:51:48",
            "upload_time_iso_8601": "2023-11-21T11:51:48.479484Z",
            "url": "https://files.pythonhosted.org/packages/d8/8e/3f3d0b0ccc6d4456e90a649ad24e32353b01a05ba52b793a3be1c3ee93c8/SearchableTree-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e591c3b0237b524e3d29d9535b56252f098152959c81906cfdbd835ae82f3b4",
                "md5": "0decbd46fee33e8c245b39aee2775d8b",
                "sha256": "8c9c3eb82bc71400511fd41ec37637bc6f79056116fc8af5a4b7207f7b0b2661"
            },
            "downloads": -1,
            "filename": "SearchableTree-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "0decbd46fee33e8c245b39aee2775d8b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3167,
            "upload_time": "2023-11-21T11:51:50",
            "upload_time_iso_8601": "2023-11-21T11:51:50.171966Z",
            "url": "https://files.pythonhosted.org/packages/3e/59/1c3b0237b524e3d29d9535b56252f098152959c81906cfdbd835ae82f3b4/SearchableTree-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-21 11:51:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pnspin",
    "github_project": "SearchableTree",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "searchabletree"
}
        
Elapsed time: 0.15643s