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.1.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file tree-format-0.1.1.tar.gz
.
File metadata
- Download URL: tree-format-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65b3383ae66ceef8d5e467e51269ba66171c629aa24ddfae859e1a5e38ba778b |
|
MD5 | d1ba56202574a3b7e7e27f50446bd020 |
|
BLAKE2b-256 | 935f8f85caa5846d781f96a3ea60c942e5a8a58dcdf5d62089915e99ea5e38c6 |
File details
Details for the file tree_format-0.1.1-py2-none-any.whl
.
File metadata
- Download URL: tree_format-0.1.1-py2-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 498675b97b7b0d746294a3b273fd25217a8700b6045f5792fd753c2dbe25c678 |
|
MD5 | dea2f2832ad1bafc1a595767d6f3670e |
|
BLAKE2b-256 | 50a4ea87a1808a130ccd5b9a47b1cfe82d4f75bc630c094a62179a46da7209c4 |