Name | bigtree JSON |
Version |
0.22.1
JSON |
| download |
home_page | None |
Summary | Tree Implementation and Methods for Python, integrated with list, dictionary, pandas and polars DataFrame. |
upload_time | 2024-11-03 05:23:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
bigtree
tree
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Big Tree Python Package
Tree Implementation and Methods for Python, integrated with list, dictionary, pandas and polars DataFrame.
It is pythonic, making it easy to learn and extendable to many types of workflows.
----
Related Links:
- [Documentation](https://bigtree.readthedocs.io/)
- [GitHub](https://github.com/kayjan/bigtree/)
- Community
- [Issues](https://github.com/kayjan/bigtree/issues)
/ [Discussions](https://github.com/kayjan/bigtree/discussions)
/ [Changelog](https://github.com/kayjan/bigtree/blob/master/CHANGELOG.md)
/ [Contributing](https://bigtree.readthedocs.io/en/stable/home/contributing/)
- Package
- [PyPI](https://pypi.org/project/bigtree/)
/ [Conda](https://anaconda.org/conda-forge/bigtree)
- Articles
- [Python Tree Implementation with BigTree](https://towardsdatascience.com/python-tree-implementation-with-bigtree-13cdabd77adc#245a-94ae81f0b3f1)
- [The Reingold Tilford Algorithm Explained, with Walkthrough](https://towardsdatascience.com/reingold-tilford-algorithm-explained-with-walkthrough-be5810e8ed93?sk=2db8e10398cee76c486c4b06b0b33322)
- <div><p>If you want to support bigtree, <a href="https://www.buymeacoffee.com/kayjan"><img src="https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me a Coffee" style="vertical-align:middle"></a></p></div>
-----
## Components
There are 3 segments to Big Tree consisting of Tree, Binary Tree, and Directed Acyclic Graph (DAG) implementation.
For **Tree** implementation, there are 9 main components.
1. [**🌺 Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/node)
1. ``BaseNode``, extendable class
2. ``Node``, BaseNode with node name attribute
2. [**✨ Constructing Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/construct/)
1. From `Node`, using parent and children constructors
2. From *str*, using tree display or Newick string notation
3. From *list*, using paths or parent-child tuples
4. From *nested dictionary*, using path-attribute key-value pairs or recursive structure
5. From *pandas DataFrame*, using paths or parent-child columns
6. From *polars DataFrame*, using paths or parent-child columns
7. Add nodes to existing tree using path string
8. Add nodes and attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using path
9. Add only attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using node name
3. [**➰ Traversing Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)
1. Pre-Order Traversal
2. Post-Order Traversal
3. Level-Order Traversal
4. Level-Order-Group Traversal
5. ZigZag Traversal
6. ZigZag-Group Traversal
4. [**📝 Modifying Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/modify/)
1. Copy nodes from location to destination
2. Shift nodes from location to destination
3. Shift and replace nodes from location to destination
4. Copy nodes from one tree to another
5. Copy and replace nodes from one tree to another
5. [**🔍 Tree Search**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/search/)
1. Find multiple nodes based on name, partial path, relative path, attribute value, user-defined condition
2. Find single nodes based on name, partial path, relative path, full path, attribute value, user-defined condition
3. Find multiple child nodes based on user-defined condition
4. Find single child node based on name, user-defined condition
6. [**🔧 Helper Function**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/helper/)
1. Cloning tree to another `Node` type
2. Get subtree (smaller tree with different root)
3. Prune tree (smaller tree with same root)
4. Get difference between two trees
7. [**📊 Plotting Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/plot/)
1. Enhanced Reingold Tilford Algorithm to retrieve (x, y) coordinates for a tree structure
2. Plot tree using matplotlib (optional dependency)
8. [**🔨 Exporting Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/export/)
1. Print to console, in vertical or horizontal orientation
2. Export to *Newick string notation*, *dictionary*, *nested dictionary*, *pandas DataFrame*, or *polars DataFrame*
3. Export tree to *dot* (can save to .dot, .png, .svg, .jpeg files)
4. Export tree to *Pillow* (can save to .png, .jpg)
5. Export tree to *Mermaid Flowchart* (can display on .md)
9. [**✔️ Workflows**](https://bigtree.readthedocs.io/en/stable/bigtree/workflows/app_todo)
1. Sample workflows for tree demonstration!
--------
For **Binary Tree** implementation, there are 3 main components.
Binary Node inherits from Node, so the components in Tree implementation are also available in Binary Tree.
1. [**🌿 Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/binarynode)
1. ``BinaryNode``, Node with binary tree rules
2. [**✨ Constructing Binary Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/binarytree/construct/)
1. From *list*, using flattened list structure
3. [**➰ Traversing Binary Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)
1. In-Order Traversal
-----
For **Directed Acyclic Graph (DAG)** implementation, there are 4 main components.
1. [**🌼 Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/dagnode)
1. ``DAGNode``, extendable class for constructing Directed Acyclic Graph (DAG)
2. [**✨ Constructing DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/dag/construct/)
1. From *list*, containing parent-child tuples
2. From *nested dictionary*
3. From *pandas DataFrame*
3. [**➰ Traversing DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)
1. Generic traversal method
4. [**🔨 Exporting DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/dag/export/)
1. Export to *list*, *dictionary*, or *pandas DataFrame*
2. Export DAG to *dot* (can save to .dot, .png, .svg, .jpeg files)
-----
## Installation
`bigtree` requires Python 3.8+. There are two ways to install `bigtree`, with pip (recommended) or conda.
### a) Installation with pip
#### Basic Installation
To install `bigtree`, run the following line in command prompt:
```console
$ pip install bigtree
```
#### Installing optional dependencies
`bigtree` have a number of optional dependencies, which can be installed using "extras" syntax.
```console
$ pip install 'bigtree[extra_1, extra_2]'
```
Examples of extra packages include:
- `all`: include all optional dependencies
- `image`: for exporting tree to image
- `matplotlib`: for plotting trees
- `pandas`: for pandas methods
- `polars`: for polars methods
For `image` extra dependency, you may need to install more plugins.
```console
$ brew install gprof2dot # for MacOS
$ conda install graphviz # for Windows
```
### b) Installation with conda
To install `bigtree` with conda, run the following line in command prompt:
```console
$ conda install -c conda-forge bigtree
```
-----
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=kayjan/bigtree&type=Date)](https://star-history.com/#kayjan/bigtree&Date)
Raw data
{
"_id": null,
"home_page": null,
"name": "bigtree",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "bigtree, tree",
"author": null,
"author_email": "Kay Jan <kayjanw@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d5/6f/650831f3a81cd50723d5ddfc54a9a4a962bf2bbe7648b51a622245651713/bigtree-0.22.1.tar.gz",
"platform": null,
"description": "# Big Tree Python Package\n\nTree Implementation and Methods for Python, integrated with list, dictionary, pandas and polars DataFrame.\n\nIt is pythonic, making it easy to learn and extendable to many types of workflows.\n\n----\n\nRelated Links:\n- [Documentation](https://bigtree.readthedocs.io/)\n- [GitHub](https://github.com/kayjan/bigtree/)\n- Community\n - [Issues](https://github.com/kayjan/bigtree/issues)\n / [Discussions](https://github.com/kayjan/bigtree/discussions)\n / [Changelog](https://github.com/kayjan/bigtree/blob/master/CHANGELOG.md)\n / [Contributing](https://bigtree.readthedocs.io/en/stable/home/contributing/)\n- Package\n - [PyPI](https://pypi.org/project/bigtree/)\n / [Conda](https://anaconda.org/conda-forge/bigtree)\n- Articles\n - [Python Tree Implementation with BigTree](https://towardsdatascience.com/python-tree-implementation-with-bigtree-13cdabd77adc#245a-94ae81f0b3f1)\n - [The Reingold Tilford Algorithm Explained, with Walkthrough](https://towardsdatascience.com/reingold-tilford-algorithm-explained-with-walkthrough-be5810e8ed93?sk=2db8e10398cee76c486c4b06b0b33322)\n- <div><p>If you want to support bigtree, <a href=\"https://www.buymeacoffee.com/kayjan\"><img src=\"https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black\" alt=\"Buy Me a Coffee\" style=\"vertical-align:middle\"></a></p></div>\n\n-----\n\n## Components\nThere are 3 segments to Big Tree consisting of Tree, Binary Tree, and Directed Acyclic Graph (DAG) implementation.\n\nFor **Tree** implementation, there are 9 main components.\n\n1. [**\ud83c\udf3a Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/node)\n 1. ``BaseNode``, extendable class\n 2. ``Node``, BaseNode with node name attribute\n2. [**\u2728 Constructing Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/construct/)\n 1. From `Node`, using parent and children constructors\n 2. From *str*, using tree display or Newick string notation\n 3. From *list*, using paths or parent-child tuples\n 4. From *nested dictionary*, using path-attribute key-value pairs or recursive structure\n 5. From *pandas DataFrame*, using paths or parent-child columns\n 6. From *polars DataFrame*, using paths or parent-child columns\n 7. Add nodes to existing tree using path string\n 8. Add nodes and attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using path\n 9. Add only attributes to existing tree using *dictionary*, *pandas DataFrame*, or *polars DataFrame*, using node name\n3. [**\u27b0 Traversing Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)\n 1. Pre-Order Traversal\n 2. Post-Order Traversal\n 3. Level-Order Traversal\n 4. Level-Order-Group Traversal\n 5. ZigZag Traversal\n 6. ZigZag-Group Traversal\n4. [**\ud83d\udcdd Modifying Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/modify/)\n 1. Copy nodes from location to destination\n 2. Shift nodes from location to destination\n 3. Shift and replace nodes from location to destination\n 4. Copy nodes from one tree to another\n 5. Copy and replace nodes from one tree to another\n5. [**\ud83d\udd0d Tree Search**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/search/)\n 1. Find multiple nodes based on name, partial path, relative path, attribute value, user-defined condition\n 2. Find single nodes based on name, partial path, relative path, full path, attribute value, user-defined condition\n 3. Find multiple child nodes based on user-defined condition\n 4. Find single child node based on name, user-defined condition\n6. [**\ud83d\udd27 Helper Function**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/helper/)\n 1. Cloning tree to another `Node` type\n 2. Get subtree (smaller tree with different root)\n 3. Prune tree (smaller tree with same root)\n 4. Get difference between two trees\n7. [**\ud83d\udcca Plotting Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/plot/)\n 1. Enhanced Reingold Tilford Algorithm to retrieve (x, y) coordinates for a tree structure\n 2. Plot tree using matplotlib (optional dependency)\n8. [**\ud83d\udd28 Exporting Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/tree/export/)\n 1. Print to console, in vertical or horizontal orientation\n 2. Export to *Newick string notation*, *dictionary*, *nested dictionary*, *pandas DataFrame*, or *polars DataFrame*\n 3. Export tree to *dot* (can save to .dot, .png, .svg, .jpeg files)\n 4. Export tree to *Pillow* (can save to .png, .jpg)\n 5. Export tree to *Mermaid Flowchart* (can display on .md)\n9. [**\u2714\ufe0f Workflows**](https://bigtree.readthedocs.io/en/stable/bigtree/workflows/app_todo)\n 1. Sample workflows for tree demonstration!\n\n--------\n\nFor **Binary Tree** implementation, there are 3 main components.\nBinary Node inherits from Node, so the components in Tree implementation are also available in Binary Tree.\n\n1. [**\ud83c\udf3f Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/binarynode)\n 1. ``BinaryNode``, Node with binary tree rules\n2. [**\u2728 Constructing Binary Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/binarytree/construct/)\n 1. From *list*, using flattened list structure\n3. [**\u27b0 Traversing Binary Tree**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)\n 1. In-Order Traversal\n\n-----\n\nFor **Directed Acyclic Graph (DAG)** implementation, there are 4 main components.\n\n1. [**\ud83c\udf3c Node**](https://bigtree.readthedocs.io/en/stable/bigtree/node/dagnode)\n 1. ``DAGNode``, extendable class for constructing Directed Acyclic Graph (DAG)\n2. [**\u2728 Constructing DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/dag/construct/)\n 1. From *list*, containing parent-child tuples\n 2. From *nested dictionary*\n 3. From *pandas DataFrame*\n3. [**\u27b0 Traversing DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/utils/iterators/)\n 1. Generic traversal method\n4. [**\ud83d\udd28 Exporting DAG**](https://bigtree.readthedocs.io/en/stable/bigtree/dag/export/)\n 1. Export to *list*, *dictionary*, or *pandas DataFrame*\n 2. Export DAG to *dot* (can save to .dot, .png, .svg, .jpeg files)\n\n-----\n\n## Installation\n\n`bigtree` requires Python 3.8+. There are two ways to install `bigtree`, with pip (recommended) or conda.\n\n### a) Installation with pip\n\n#### Basic Installation\n\nTo install `bigtree`, run the following line in command prompt:\n\n```console\n$ pip install bigtree\n```\n\n#### Installing optional dependencies\n\n`bigtree` have a number of optional dependencies, which can be installed using \"extras\" syntax.\n\n```console\n$ pip install 'bigtree[extra_1, extra_2]'\n```\n\nExamples of extra packages include:\n\n- `all`: include all optional dependencies\n- `image`: for exporting tree to image\n- `matplotlib`: for plotting trees\n- `pandas`: for pandas methods\n- `polars`: for polars methods\n\nFor `image` extra dependency, you may need to install more plugins.\n\n```console\n$ brew install gprof2dot # for MacOS\n$ conda install graphviz # for Windows\n```\n\n### b) Installation with conda\n\nTo install `bigtree` with conda, run the following line in command prompt:\n\n```console\n$ conda install -c conda-forge bigtree\n```\n\n-----\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=kayjan/bigtree&type=Date)](https://star-history.com/#kayjan/bigtree&Date)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Tree Implementation and Methods for Python, integrated with list, dictionary, pandas and polars DataFrame.",
"version": "0.22.1",
"project_urls": {
"Discussions": "https://github.com/kayjan/bigtree/discussions",
"Documentation": "https://bigtree.readthedocs.io",
"Issues": "https://github.com/kayjan/bigtree/issues",
"Source": "https://github.com/kayjan/bigtree"
},
"split_keywords": [
"bigtree",
" tree"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f93360911630a8a0631328cd1a34c4122dc09b87cb76ccd1254ead8451b11b24",
"md5": "19813ec3219849b73504f8bec8114e24",
"sha256": "e7ff90cdcba326def9046847cc2e51ec035f783e0e2370a893ad6fc5d3da9ffa"
},
"downloads": -1,
"filename": "bigtree-0.22.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "19813ec3219849b73504f8bec8114e24",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 78830,
"upload_time": "2024-11-03T05:23:05",
"upload_time_iso_8601": "2024-11-03T05:23:05.060885Z",
"url": "https://files.pythonhosted.org/packages/f9/33/60911630a8a0631328cd1a34c4122dc09b87cb76ccd1254ead8451b11b24/bigtree-0.22.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d56f650831f3a81cd50723d5ddfc54a9a4a962bf2bbe7648b51a622245651713",
"md5": "f4a7ca5dfd18462bb60c57bca038b0ed",
"sha256": "2672d8b864a2dba6330a92bda805507556f77805f85920f7986238a01d89559d"
},
"downloads": -1,
"filename": "bigtree-0.22.1.tar.gz",
"has_sig": false,
"md5_digest": "f4a7ca5dfd18462bb60c57bca038b0ed",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 1268214,
"upload_time": "2024-11-03T05:23:06",
"upload_time_iso_8601": "2024-11-03T05:23:06.678691Z",
"url": "https://files.pythonhosted.org/packages/d5/6f/650831f3a81cd50723d5ddfc54a9a4a962bf2bbe7648b51a622245651713/bigtree-0.22.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-03 05:23:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kayjan",
"github_project": "bigtree",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bigtree"
}