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
```
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 | RSS feed
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)
Built Distribution
Close
Hashes for tree_format-0.1.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5056228dbedde1fb81b79f71fb0c23c98e9d365230df9b29af76e8d8003de11 |
|
MD5 | d0ff3956c7c0d0b23732460ea3800d97 |
|
BLAKE2b-256 | b1e5233f0665eba7d4fde8c841f927ceadb6a083c138bcc4762406c1945765d5 |