littletree


Namelittletree JSON
Version 0.9.0 PyPI version JSON
download
home_pageNone
SummaryTree library
upload_time2025-08-07 23:26:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
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
  that still work on trees that are more than 10,000 layers deep.
- Extensible: either subclass from `Node` or `BaseNode`.
- Can be imported / exported to many different formats (nested dict, rows, relations, graphviz, mermaid, newick, networkx).
- Purely written in Python.

## Limitation ##
- Each node has at most one parent. (It's a tree not a graph!)

## 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_pillow().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": null,
    "name": "littletree",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "tree, datastructure, hierarchy, taxonomy, newick, graphviz, mermaid",
    "author": null,
    "author_email": "lverweijen <lauwerund@gmail.com>",
    "download_url": null,
    "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  that still work on trees that are more than 10,000 layers deep.\r\n- Extensible: either subclass from `Node` or `BaseNode`.\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## Limitation ##\r\n- Each node has at most one parent. (It's a tree not a graph!)\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_pillow().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",
    "bugtrack_url": null,
    "license": null,
    "summary": "Tree library",
    "version": "0.9.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": null,
            "digests": {
                "blake2b_256": "2ba61f79f0aa26d009d17c0d936e8e8ffad356ef747284b863dd0a64364d1c5f",
                "md5": "18bdc519a7ab6fd955e01ece5d9032fc",
                "sha256": "890560f7f2e01c03051ec81eee6d444e6caecd120a2dc6645069578b01a2a4b3"
            },
            "downloads": -1,
            "filename": "littletree-0.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "18bdc519a7ab6fd955e01ece5d9032fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 24120,
            "upload_time": "2025-08-07T23:26:38",
            "upload_time_iso_8601": "2025-08-07T23:26:38.002593Z",
            "url": "https://files.pythonhosted.org/packages/2b/a6/1f79f0aa26d009d17c0d936e8e8ffad356ef747284b863dd0a64364d1c5f/littletree-0.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-07 23:26:38",
    "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.47771s