Skip to main content

blockdiag generates block-diagram image from text

Project description

blockdiag generate block-diagram image file from spec-text file.

drone.io CI build status Latest PyPI version Number of PyPI downloads

Features

  • Generate block-diagram from dot like text (basic feature).

  • Multilingualization for node-label (utf-8 only).

You can get some examples and generated images on blockdiag.com .

Setup

Use easy_install or pip:

$ sudo easy_install blockdiag

Or

$ sudo pip install blockdiag

If you want to export as PDF format, give pdf arguments:

$ sudo easy_install "blockdiag[pdf]"

Copy and modify ini file. example:

$ cp <blockdiag installed path>/blockdiag/examples/simple.diag .
$ vi simple.diag

Please refer to spec-text setting sample section for the format of the simpla.diag configuration file.

spec-text setting sample

Few examples are available. You can get more examples at blockdiag.com .

simple.diag

simple.diag is simply define nodes and transitions by dot-like text format:

diagram admin {
  top_page -> config -> config_edit -> config_confirm -> top_page;
}

screen.diag

screen.diag is more complexly sample. diaglam nodes have a alternative label and some transitions:

diagram admin {
  top_page [label = "Top page"];

  foo_index [label = "List of FOOs"];
  foo_detail [label = "Detail FOO"];
  foo_add [label = "Add FOO"];
  foo_add_confirm [label = "Add FOO (confirm)"];
  foo_edit [label = "Edit FOO"];
  foo_edit_confirm [label = "Edit FOO (confirm)"];
  foo_delete_confirm [label = "Delete FOO (confirm)"];

  bar_detail [label = "Detail of BAR"];
  bar_edit [label = "Edit BAR"];
  bar_edit_confirm [label = "Edit BAR (confirm)"];

  logout;

  top_page -> foo_index;
  top_page -> bar_detail;

  foo_index -> foo_detail;
               foo_detail -> foo_edit;
               foo_detail -> foo_delete_confirm;
  foo_index -> foo_add -> foo_add_confirm -> foo_index;
  foo_index -> foo_edit -> foo_edit_confirm -> foo_index;
  foo_index -> foo_delete_confirm -> foo_index;

  bar_detail -> bar_edit -> bar_edit_confirm -> bar_detail;
}

Usage

Execute blockdiag command:

$ blockdiag simple.diag
$ ls simple.png
simple.png

Requirements

  • Python 2.6, 2.7, 3.2, 3.3, 3.4

  • Pillow 2.2.1 or later

  • funcparserlib 0.3.6 or later

  • reportlab (optional)

  • wand and imagemagick (optional)

  • setuptools

License

Apache License 2.0

Project details


Download files

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

Source Distribution

blockdiag-1.4.7.tar.gz (136.8 kB view details)

Uploaded Source

Built Distribution

blockdiag-1.4.7-py2.py3-none-any.whl (163.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file blockdiag-1.4.7.tar.gz.

File metadata

  • Download URL: blockdiag-1.4.7.tar.gz
  • Upload date:
  • Size: 136.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for blockdiag-1.4.7.tar.gz
Algorithm Hash digest
SHA256 6e91a295cc0a702f697567f5c913bde26d63815f01ba4819ac704888a04e822d
MD5 8b07f286de73ccb42cf3f286ce7364b4
BLAKE2b-256 fcb39fa914913da6ab998f0ac244205025e236b7581b7dd8c3575e557f18ce83

See more details on using hashes here.

File details

Details for the file blockdiag-1.4.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for blockdiag-1.4.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 67a485bdae8787cc4bb9ab254746bd9401989121a81cd4719bce73b3641bf7b2
MD5 cf15676b989c27c7b99f7e21ec107a70
BLAKE2b-256 95ed1d8ab2d3f495d31950d3334c75ff61bf4aa151f322cb0a8fea55caedbe5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page