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
```
Release files for tree-format 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tree-format-0.1.2.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tree_format-0.1.2-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 10.7 kB
Release files / tree-format-0.1.2.tar.gz
| Download URL | tree-format-0.1.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a538523aa78ae7a4b10003b04f3e1b37708e0e089d99c9d3b9e1c71384c9a7f9
|
|
BLAKE2b-256 checksum How to use checksums |
0d918d860c75c3e70e6bbec7b898b5f753bf5da404be9296e245034360759645
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tree_format-0.1.2-py2-none-any.whl
| Download URL | tree_format-0.1.2-py2-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
b5056228dbedde1fb81b79f71fb0c23c98e9d365230df9b29af76e8d8003de11
|
|
BLAKE2b-256 checksum How to use checksums |
b1e5233f0665eba7d4fde8c841f927ceadb6a083c138bcc4762406c1945765d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |