{ "info": { "author": "SnakeCoder012", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Simpletree3 module\n==================\n\nOffers classes implementing basic tree-like\nfunctionality, as well as iterators for walking\nthe trees and node search functionality. Requires Python3.4 or later.\nOptional cython compilation is performed if the environment variable\n'use_cython' is set to True.\n\nThe design goal is to provide a basic class implementing the\nessential tree structure and functionality. Practical applications will\nwant to inherit from one of the provided classes\nin order to provide custom functionality. Tree walking\nalgorithms are implemented as generators, in order to\nminimize the use of temporary objects and focus on\nspeed and efficiency.\n\nClasses\n-------\n\nTwo classes are provided: *SimpleNode* and\n*FlexibleNode*.\n\nSimpleNode\n^^^^^^^^^^\n\nThis is the base class that provides the\ntree node functionality by connecting\nparents to children. Additional functionality\ncan be added by deriving from *SimpleNode*.\n\nEach node is identified by a *key* parameter\nof an arbitrary hashable type. Node keys must be unique\namong the direct children of a node, since node\nchildren are held in a dict using the key attribute as\ndictionary keys (hence the hashable requirement).\n\nConnections with nodes up and down the tree are\naccessed through the parent and children properties\n(children offers an iterator for the child nodes,\nsorted by node key).\nThe root node of a tree is the node with parent\nequal to None. Setting the parent of a node\nchecks that no loops are inserted and adds\nthe current node to the parent's children (if needed).\nDeleting a parent sets it to None and removes\nthe node from the parent's children.\n\nSome additional convenience properties are defined -\nsiblings, ancestors, depth, height - as well as\nmethods for adding and removing child nodes.\n\nFlexibleNode\n^^^^^^^^^^^^\nThis is a convenience class that add hooks to\nsetting and deleting a parent. The motivation for\nproviding it is that currently Python does not\noffer a simple syntax for calling a base class\nproperty from a derived class when that property is\noverriden, so by inheriting from *FlexibleNode*\ninstead of *SimpleNode* one only has to override\nthe hooks to perform any desired operations.\nAdding and deleting children can be\ndirectly overriden, since they are not implemented\nas properties. The design decision of having the\nhook functionality implemented in a separate class\nallows one to choose the trade-off between\nspeed and flexibility of tree building\n(important for very large trees).\n\n\nIterators\n---------\n\nThe module implements preorder, postorder, level\nand leaf iterators. Each comes in two flavors - a simple\none, iterating through all nodes, and a filtered\none, where specific nodes can be selected\nor specific subtrees can be ignored.\n\nSearch functionality\n--------------------\n\nThe simplest search is done using a preorder iteration\nprocedure that yields nodes with the specified key.\nA separate find function returns the first node matching\nthat key.\n\nA common use case when building trees is that\nsubsequent nodes are added in a subtree containing the last\ninserted node. To optimize for this case, a separate\nsearch procedure is implemented, which walks up the\ntree from the start node and searches for the\nspecified key in the subtree rooted in each ancestor.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SnakeCoder012/simpletree3.git", "keywords": "tree,tree structure,python3 tree class", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "simpletree3", "package_url": "https://pypi.org/project/simpletree3/", "platform": "", "project_url": "https://pypi.org/project/simpletree3/", "project_urls": { "Homepage": "https://github.com/SnakeCoder012/simpletree3.git" }, "release_url": "https://pypi.org/project/simpletree3/1.0.5/", "requires_dist": null, "requires_python": ">= 3.4", "summary": "A simple tree structure and associated search/iteration tools for python 3.4+. Optionally uses cython for compilation (if 'use_cython' env variable is set).", "version": "1.0.5" }, "last_serial": 5138560, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "03704bc6daf026d98af5bd8656c3a970", "sha256": "c22ce7387f4b7ac53bd5c87234499638ba9cb623705f32c000617beddf4888c1" }, "downloads": -1, "filename": "simpletree3-1.0.0.tar.gz", "has_sig": false, "md5_digest": "03704bc6daf026d98af5bd8656c3a970", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 169999, "upload_time": "2019-04-09T14:57:44", "url": "https://files.pythonhosted.org/packages/e7/7a/f27e1e3d0863cabf9e89bbedda0354cf628ad5a304391d3e3e920808234d/simpletree3-1.0.0.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "376ffb80feb883469bc0acb5c5223b33", "sha256": "a04f14deef50a327c81884566ab9e1cf59b2ace815c8effe20fbd608fd382ecd" }, "downloads": -1, "filename": "simpletree3-1.0.4.tar.gz", "has_sig": false, "md5_digest": "376ffb80feb883469bc0acb5c5223b33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 149970, "upload_time": "2019-04-13T13:01:08", "url": "https://files.pythonhosted.org/packages/40/b5/2e1c2701fe168493c907c4e70682667251a890da7211c3f5990369a7988c/simpletree3-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "876065be6fe489de9e61dcceebe61639", "sha256": "c8fd3c3ca80819868b064225e4f65440b08d3c303b71361904bdb341792f03fb" }, "downloads": -1, "filename": "simpletree3-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "876065be6fe489de9e61dcceebe61639", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.4", "size": 11173, "upload_time": "2019-04-13T16:38:55", "url": "https://files.pythonhosted.org/packages/1e/ed/52df846eb47e601f1da6dabfb04bef8a6b38f704a49b51ad3962c64d9fb9/simpletree3-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61b3b085f25c31c79e6e1b8b5e5e24a7", "sha256": "2beaf724dd407969f9462cf04aa5cdd840851c50e549bdcdea6daade304b077a" }, "downloads": -1, "filename": "simpletree3-1.0.5.tar.gz", "has_sig": false, "md5_digest": "61b3b085f25c31c79e6e1b8b5e5e24a7", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.4", "size": 150070, "upload_time": "2019-04-13T16:31:42", "url": "https://files.pythonhosted.org/packages/40/67/b0d5110e78b508b19d05f30179954854a294e29b555bda0cea12735bf78f/simpletree3-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "876065be6fe489de9e61dcceebe61639", "sha256": "c8fd3c3ca80819868b064225e4f65440b08d3c303b71361904bdb341792f03fb" }, "downloads": -1, "filename": "simpletree3-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "876065be6fe489de9e61dcceebe61639", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.4", "size": 11173, "upload_time": "2019-04-13T16:38:55", "url": "https://files.pythonhosted.org/packages/1e/ed/52df846eb47e601f1da6dabfb04bef8a6b38f704a49b51ad3962c64d9fb9/simpletree3-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61b3b085f25c31c79e6e1b8b5e5e24a7", "sha256": "2beaf724dd407969f9462cf04aa5cdd840851c50e549bdcdea6daade304b077a" }, "downloads": -1, "filename": "simpletree3-1.0.5.tar.gz", "has_sig": false, "md5_digest": "61b3b085f25c31c79e6e1b8b5e5e24a7", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.4", "size": 150070, "upload_time": "2019-04-13T16:31:42", "url": "https://files.pythonhosted.org/packages/40/67/b0d5110e78b508b19d05f30179954854a294e29b555bda0cea12735bf78f/simpletree3-1.0.5.tar.gz" } ] }