littletree


Namelittletree JSON
Version 0.8.0 PyPI version JSON
download
home_page
SummaryTree library
upload_time2024-03-18 20:46:37
maintainer
docs_urlNone
author
requires_python>=3.10
licenseApache License 2.0
keywords tree datastructure hierarchy taxonomy newick graphviz mermaid
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            LittleTree is a library that provides a tree data structure to python,
which is both fast and flexible.
It can be used to represent file systems, taxonomies and much more.

## Features ##

- Intuitive basic creation and modification of trees.
- Efficient implementation of common tree operations and traversals.
  Works on trees that are 10 000 layers deep.
- Extensible. Subclass from `BaseNode` if you need more freedom.
- Can be imported / exported to many different formats (nested dict, rows, relations, graphviz, mermaid, newick, networkx).
- Purely written in Python.

## Limitations ##
- Each node has at most one parent. (It's a tree not a graph!)
- Nodes cannot be their own ancestor.

## Installing ##

- Use [pip](https://pip.pypa.io/en/stable/getting-started/) to install littletree:

```sh
$ pip install --upgrade littletree
```
## Usage ##

A tree can be used in a similar way as a `dict`:

```python
from littletree import Node

tree = Node(identifier="World")
tree["Asia"] = Node()
tree["Africa"] = Node()
tree["America"] = Node()
tree["Europe"] = Node()

# Print tree to console
tree.show()

# Show tree as an image
tree.to_image().show()
```

The resulting tree is printed like this:

```
World
├─ Asia
├─ Africa
├─ America
└─ Europe
```

If [Pillow](https://pypi.org/project/pillow/) and [graphviz](https://graphviz.org/) are installed,
it will also display the following image:

![world](images/world.png)

See [tutorial](https://github.com/lverweijen/littletree/blob/main/tutorial.md) for more information.

See further:
[Pypi](https://pypi.org/project/littletree/) |
[Github](https://github.com/lverweijen/littletree) |
[Issues](https://github.com/lverweijen/littletree/issues)


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "littletree",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "tree,datastructure,hierarchy,taxonomy,newick,graphviz,mermaid",
    "author": "",
    "author_email": "lverweijen <lauwerund@gmail.com>",
    "download_url": "",
    "platform": null,
    "description": "LittleTree is a library that provides a tree data structure to python,\r\nwhich is both fast and flexible.\r\nIt can be used to represent file systems, taxonomies and much more.\r\n\r\n## Features ##\r\n\r\n- Intuitive basic creation and modification of trees.\r\n- Efficient implementation of common tree operations and traversals.\r\n  Works on trees that are 10 000 layers deep.\r\n- Extensible. Subclass from `BaseNode` if you need more freedom.\r\n- Can be imported / exported to many different formats (nested dict, rows, relations, graphviz, mermaid, newick, networkx).\r\n- Purely written in Python.\r\n\r\n## Limitations ##\r\n- Each node has at most one parent. (It's a tree not a graph!)\r\n- Nodes cannot be their own ancestor.\r\n\r\n## Installing ##\r\n\r\n- Use [pip](https://pip.pypa.io/en/stable/getting-started/) to install littletree:\r\n\r\n```sh\r\n$ pip install --upgrade littletree\r\n```\r\n## Usage ##\r\n\r\nA tree can be used in a similar way as a `dict`:\r\n\r\n```python\r\nfrom littletree import Node\r\n\r\ntree = Node(identifier=\"World\")\r\ntree[\"Asia\"] = Node()\r\ntree[\"Africa\"] = Node()\r\ntree[\"America\"] = Node()\r\ntree[\"Europe\"] = Node()\r\n\r\n# Print tree to console\r\ntree.show()\r\n\r\n# Show tree as an image\r\ntree.to_image().show()\r\n```\r\n\r\nThe resulting tree is printed like this:\r\n\r\n```\r\nWorld\r\n\u251c\u2500 Asia\r\n\u251c\u2500 Africa\r\n\u251c\u2500 America\r\n\u2514\u2500 Europe\r\n```\r\n\r\nIf [Pillow](https://pypi.org/project/pillow/) and [graphviz](https://graphviz.org/) are installed,\r\nit will also display the following image:\r\n\r\n![world](images/world.png)\r\n\r\nSee [tutorial](https://github.com/lverweijen/littletree/blob/main/tutorial.md) for more information.\r\n\r\nSee further:\r\n[Pypi](https://pypi.org/project/littletree/) |\r\n[Github](https://github.com/lverweijen/littletree) |\r\n[Issues](https://github.com/lverweijen/littletree/issues)\r\n\r\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Tree library",
    "version": "0.8.0",
    "project_urls": {
        "Changelog": "https://github.com/lverweijen/littletree/blob/main/changes.md",
        "Documentation": "https://github.com/lverweijen/littletree/blob/main/tutorial.md",
        "Homepage": "https://github.com/lverweijen/littletree",
        "Issues": "https://github.com/lverweijen/littletree/issues",
        "Repository": "https://github.com/lverweijen/littletree"
    },
    "split_keywords": [
        "tree",
        "datastructure",
        "hierarchy",
        "taxonomy",
        "newick",
        "graphviz",
        "mermaid"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22e687eb04ae91c68b013ae33f2cadb747ae5194e6be15df6d050fd19c821e66",
                "md5": "81d77c704e0c70578f0f7d40ee220323",
                "sha256": "e3f7bfa7551cbf66529c309179f03b1f86f0e2c495a75d417417d48a9562e9ae"
            },
            "downloads": -1,
            "filename": "littletree-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81d77c704e0c70578f0f7d40ee220323",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 24046,
            "upload_time": "2024-03-18T20:46:37",
            "upload_time_iso_8601": "2024-03-18T20:46:37.909923Z",
            "url": "https://files.pythonhosted.org/packages/22/e6/87eb04ae91c68b013ae33f2cadb747ae5194e6be15df6d050fd19c821e66/littletree-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 20:46:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lverweijen",
    "github_project": "littletree",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "littletree"
}
        
Elapsed time: 0.25428s