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 pip:

$ sudo pip install blockdiag

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

$ sudo pip 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 3.5 or later

  • Pillow 3.0 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-2.0.1.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

blockdiag-2.0.1-py3-none-any.whl (2.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blockdiag-2.0.1.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.8.0

File hashes

Hashes for blockdiag-2.0.1.tar.gz
Algorithm Hash digest
SHA256 16a69dd9f3b44c9e0869999ce82aa968586698febc86ece9ca0c902dba772397
MD5 89898a6c32636ba2139502bfdb8eff12
BLAKE2b-256 b61beab880ae3e6c7e24ae5adecc40ee7dd05c9ebb0dff6c39b52472844ce9b7

See more details on using hashes here.

File details

Details for the file blockdiag-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: blockdiag-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.8.0

File hashes

Hashes for blockdiag-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa0b47cf25bfc4d546b7fc284c70c3bac875a066e744b4a6b1d9ba457e4ed077
MD5 0f33705e93e8fc35566b74a1d4bbac22
BLAKE2b-256 304b701205f976ae57beb5cc5cfb488019531d186aa33f81fa48d50ba40a38ea

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