Skip to main content

No project description provided

Project description

Python library to generate nicely formatted trees, like the UNIX `tree`

## Example

Produce output like this:

├── bar
│ ├── a
│ └── b
├── baz
└── qux
└── c⏎

using code like this:

from operator import itemgetter

from tree_format import format_tree

tree = (
'foo', [
('bar', [
('a', []),
('b', []),
('baz', []),
('qux', [
('c\nd', []),

print format_tree(
tree, format_node=itemgetter(0), get_children=itemgetter(1))

## License

This is made available under the Apache Software License, version 2.0.

Copyright (c) 2015 - Jonathan M. Lange

## Testing

Run tests with:

python -m discover

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree-format-0.1.2.tar.gz (4.0 kB view hashes)

Uploaded source

Built Distribution

tree_format-0.1.2-py2-none-any.whl (6.7 kB view hashes)

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page