Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

No project description provided

Project description

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

## Example

Produce output like this:

```
foo
├── bar
│ ├── a
│ └── b
├── baz
└── qux
└── c⏎
d
```

using code like this:

```python
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 testtools.run discover
```



Project details


Release history Release notifications

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
tree_format-0.1.2-py2-none-any.whl (6.7 kB) Copy SHA256 hash SHA256 Wheel py2 Nov 6, 2017
tree-format-0.1.2.tar.gz (4.0 kB) Copy SHA256 hash SHA256 Source None Nov 6, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page