bigtree


Namebigtree JSON
Version 0.17.2 PyPI version JSON
download
home_pageNone
SummaryTree Implementation and Methods for Python, integrated with Python list, dictionary, and pandas DataFrame.
upload_time2024-04-23 19:17:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT
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 Python list, dictionary, and pandas DataFrame.

It is pythonic, making it easy to learn and extendable to many types of workflows.

----

Related Links:
- [Documentation](https://bigtree.readthedocs.io/en/latest/)
- [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/latest/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/latest/bigtree/node/)
   1. ``BaseNode``, extendable class
   2. ``Node``, BaseNode with node name attribute
2. [**✨ Constructing Tree**](https://bigtree.readthedocs.io/en/latest/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. Add nodes to existing tree using path string
   7. Add nodes and attributes to existing tree using *dictionary* or *pandas DataFrame*, using path
   8. Add only attributes to existing tree using *dictionary* or *pandas DataFrame*, using node name
3. [**➰ Traversing Tree**](https://bigtree.readthedocs.io/en/latest/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/latest/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/latest/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/latest/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/latest/bigtree/utils/plot/)
   1. Enhanced Reingold Tilford Algorithm to retrieve (x, y) coordinates for a tree structure
8. [**🔨 Exporting Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/tree/export/)
   1. Print to console, in vertical or horizontal orientation
   2. Export to *Newick string notation*, *dictionary*, *nested dictionary*, or *pandas 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/latest/demo/workflow/)
   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/latest/bigtree/node/)
   1. ``BinaryNode``, Node with binary tree rules
2. [**✨ Constructing Binary Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/binarytree/construct/)
   1. From *list*, using flattened list structure
3. [**➰ Traversing Binary Tree**](https://bigtree.readthedocs.io/en/latest/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/latest/bigtree/node/)
   1. ``DAGNode``, extendable class for constructing Directed Acyclic Graph (DAG)
2. [**✨ Constructing DAG**](https://bigtree.readthedocs.io/en/latest/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/latest/bigtree/utils/iterators/)
   1. Generic traversal method
4. [**🔨 Exporting DAG**](https://bigtree.readthedocs.io/en/latest/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

There are two ways to install `bigtree`, with pip (recommended) or conda.

### a) Installation with pip

To install `bigtree`, run the following line in command prompt:

```console
$ pip install bigtree
```

If tree needs to use pandas methods, it requires additional dependencies.
Run the following line in command prompt:

```console
$ pip install 'bigtree[pandas]'
```

If tree needs to be exported to image, it requires additional dependencies.
Run the following lines in command prompt:

```console
$ pip install 'bigtree[image]'
$ brew install gprof2dot  # for MacOS
$ conda install graphviz  # for Windows
```

Alternatively, install all optional dependencies with the following line in command prompt:

```console
$ pip install 'bigtree[all]'
```

### b) Installation with conda

To install `bigtree` with conda, run the following line in command prompt:

```console
$ conda install -c conda-forge bigtree
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bigtree",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "bigtree, tree",
    "author": null,
    "author_email": "Kay Jan <kayjanw@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/40/97/071829252863c54f1ac40b4bf90e6c41a210235472bfae24a64809fb5ef7/bigtree-0.17.2.tar.gz",
    "platform": null,
    "description": "# Big Tree Python Package\n\nTree Implementation and Methods for Python, integrated with Python list, dictionary, and pandas 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/en/latest/)\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/latest/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/latest/bigtree/node/)\n   1. ``BaseNode``, extendable class\n   2. ``Node``, BaseNode with node name attribute\n2. [**\u2728 Constructing Tree**](https://bigtree.readthedocs.io/en/latest/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. Add nodes to existing tree using path string\n   7. Add nodes and attributes to existing tree using *dictionary* or *pandas DataFrame*, using path\n   8. Add only attributes to existing tree using *dictionary* or *pandas DataFrame*, using node name\n3. [**\u27b0 Traversing Tree**](https://bigtree.readthedocs.io/en/latest/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/latest/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/latest/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/latest/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/latest/bigtree/utils/plot/)\n   1. Enhanced Reingold Tilford Algorithm to retrieve (x, y) coordinates for a tree structure\n8. [**\ud83d\udd28 Exporting Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/tree/export/)\n   1. Print to console, in vertical or horizontal orientation\n   2. Export to *Newick string notation*, *dictionary*, *nested dictionary*, or *pandas 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/latest/demo/workflow/)\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/latest/bigtree/node/)\n   1. ``BinaryNode``, Node with binary tree rules\n2. [**\u2728 Constructing Binary Tree**](https://bigtree.readthedocs.io/en/latest/bigtree/binarytree/construct/)\n   1. From *list*, using flattened list structure\n3. [**\u27b0 Traversing Binary Tree**](https://bigtree.readthedocs.io/en/latest/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/latest/bigtree/node/)\n   1. ``DAGNode``, extendable class for constructing Directed Acyclic Graph (DAG)\n2. [**\u2728 Constructing DAG**](https://bigtree.readthedocs.io/en/latest/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/latest/bigtree/utils/iterators/)\n   1. Generic traversal method\n4. [**\ud83d\udd28 Exporting DAG**](https://bigtree.readthedocs.io/en/latest/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\nThere are two ways to install `bigtree`, with pip (recommended) or conda.\n\n### a) Installation with pip\n\nTo install `bigtree`, run the following line in command prompt:\n\n```console\n$ pip install bigtree\n```\n\nIf tree needs to use pandas methods, it requires additional dependencies.\nRun the following line in command prompt:\n\n```console\n$ pip install 'bigtree[pandas]'\n```\n\nIf tree needs to be exported to image, it requires additional dependencies.\nRun the following lines in command prompt:\n\n```console\n$ pip install 'bigtree[image]'\n$ brew install gprof2dot  # for MacOS\n$ conda install graphviz  # for Windows\n```\n\nAlternatively, install all optional dependencies with the following line in command prompt:\n\n```console\n$ pip install 'bigtree[all]'\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",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tree Implementation and Methods for Python, integrated with Python list, dictionary, and pandas DataFrame.",
    "version": "0.17.2",
    "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": "0fdad49a2a095dd5b1ca8931f1441dab1f43375af1a969e6b157e88325eec162",
                "md5": "6846e2ed3f60f977cd691b84c251bb8e",
                "sha256": "5a3b442b0448cd02f1adfaed7ceb5b1ef10778e8f2618480f3b1c042f61286f3"
            },
            "downloads": -1,
            "filename": "bigtree-0.17.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6846e2ed3f60f977cd691b84c251bb8e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 74584,
            "upload_time": "2024-04-23T19:17:56",
            "upload_time_iso_8601": "2024-04-23T19:17:56.541683Z",
            "url": "https://files.pythonhosted.org/packages/0f/da/d49a2a095dd5b1ca8931f1441dab1f43375af1a969e6b157e88325eec162/bigtree-0.17.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4097071829252863c54f1ac40b4bf90e6c41a210235472bfae24a64809fb5ef7",
                "md5": "da7326fa1707aedcedfdfc6df0d6f594",
                "sha256": "00d798e027a8873f069b1289fcaf5f2b387fffa8e6acfd3dc28481feaa10f0ee"
            },
            "downloads": -1,
            "filename": "bigtree-0.17.2.tar.gz",
            "has_sig": false,
            "md5_digest": "da7326fa1707aedcedfdfc6df0d6f594",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 1186417,
            "upload_time": "2024-04-23T19:17:54",
            "upload_time_iso_8601": "2024-04-23T19:17:54.462067Z",
            "url": "https://files.pythonhosted.org/packages/40/97/071829252863c54f1ac40b4bf90e6c41a210235472bfae24a64809fb5ef7/bigtree-0.17.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-23 19:17:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kayjan",
    "github_project": "bigtree",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bigtree"
}
        
Elapsed time: 0.24220s