Draw DAGs (directed acyclic graphs) as ASCII art, à la git log --graph
Project description
Overview
This is a direct port of the Git log graphing code, which draws directed acyclic commit graphs as ASCII art. It was done very mechanically and quickly, so the code is not Pythonic. Dependencies on Git specifics should be gone but look and feel remains.
This project is alpha quality and subject to breaking API changes.
Installation
Available for install/upgrade from PyPI:
pip install -U asciidag
As usual, it is best to install your packages into a virtual environment.
Usage
examples/demo.py is included in the installation directory and is executable. The core functionality is:
from asciidag.graph import Graph
from asciidag.node import Node
graph = Graph()
root = Node('root')
grandpa = Node('grandpa', parents=[root])
tips = [
Node('child', parents=[
Node('mom', parents=[
Node('grandma', parents=[
Node('greatgrandma', parents=[]),
]),
grandpa,
]),
Node('dad', parents=[
Node('bill', parents=[
Node('martin'),
Node('james'),
Node('paul'),
Node('jon'),
])]),
Node('stepdad', parents=[grandpa]),
]),
Node('foo', [Node('bar')]),
]
graph.show_nodes(tips)
Output:
- copyright:
© 2016 Sam Brightman
- license:
GNU General Public License v2.0, see LICENSE for more details.
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
Built Distribution
File details
Details for the file asciidag-0.2.0.tar.gz
.
File metadata
- Download URL: asciidag-0.2.0.tar.gz
- Upload date:
- Size: 133.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acf4df123fc222322467d9bdb2020e44b4e1af37d38129092a080c3cda54a788 |
|
MD5 | 82f0f3be67dd88ab3e62d277f04436b3 |
|
BLAKE2b-256 | 877a2241c6cc1cd1c34b10ba8ced7cd4b9b47c6609fcb186f4bf2826a2f0b43c |
File details
Details for the file asciidag-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: asciidag-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7ea1e6a867ab4c3a2537ff03bc0f25d8fccc2d5109f9f329220ba4fbb1b3e02 |
|
MD5 | 844cb9a0b479e97f78ed9f1ba3265735 |
|
BLAKE2b-256 | 109b00885406d04e6bcad4c51a5bff2a92b6d73ef322d8b30916fe3d28bb2c48 |