Skip to main content

Pyagram: Diagram Generator

Project description

Diagram Generator

This is a command line tool, which generates finite state machine diagram for web and mobile application development from a source file through graphviz.

The finite state machine diagram is a kind of diagram, which describes screen transitions and flows of the processes.

The source file is written in a specific format, which enables us to write a code easier than using only graphviz, since Pyagram generates graphviz code as an intermediate file.

Since graphviz provides 3 kinds of image formats, such as gif, png and svg, Pyagram provides these kinds of file format as well.

There are several kinds of objects in the diagram.

  • Title of a diagram

  • Double circle represents a view.

  • Gray background circle represents a server side process including action.

  • Dashed arrow represents a screen transition between views.

  • Straight arrow represents flow of the process, such as accepting a request, validation, database access and so on.

  • Straight arrow is able to have an label, which describes an action and a result of the process, such as clicking a button, success, error and so on.

How to write source file

Firstly you can define a title of the diagram with @ sign.

@[title] CRUD View Diagram

Next you can define views with # sign and its screen transitions with –> sign.

Now we have 3 views, such as List View, Add View and Server Error View.

List View and Add View are connected one another.

You can define its own path below the view name as well.

I highly recommend you to define those views first, since that would help you when you are trying to define server processes as a guide.

#[List View] /index

—> Add View

#[Add View] /add

—> List View

–> Add View

#[Server Error]

Then you can define server processes with ==> sign connecting source process and destination process.

As you can see, process is able to have multiple flows. Each flow has its own destination.

You can add results of the processes, such as Valid, Invalid, Success, Database Error and so on. It will be used as labels placed beside the straight arrows.

$[GET /index] ==> List View

$[GET /add] ==> Add View

$[POST /add] ==> Validate

$[Validate] Valid ==> Save

Invalid ==> Add View

$[Save] ==> Add View

$[Save] Success ==> List View

Database error ==> Server Error

Now that you can define the flows between the views and the processes with ==> sign.

#[List View] /index

—> Add View

Click add button ==> GET /add

#[Add View] /add

—> List View

–> Add View

Click back button ==> GET /index

Click submit button ==> POST /add

How to install

pip3 command installs depending library, such as pyparsing automatically.

After the installation, executable pyagram command will be placed in a bin directory, such as /usr/local/bin/pyagram.

pip3 install pyagram

How to execute

pyagram command accepts 2 kinds of options.

t option represents image type, which accepts gif, png and svg.

d option represents diagram type, which accepts std and erd.

f option represents font name, which accepts font names in your operation system if it exists or uses default font.

o option represents output path, which accepts path.

i option represents source file, which accepts text file.

v option represents verbose mode, which prints various information useful for debugging.

Output file is placed in the same place as the source file.

pyagram -t {image type} -d {diagram type} -f {font name} -o {output path} -i {source file}

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

pyagram-1.4.3.tar.gz (6.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyagram-1.4.3.macosx-10.11-x86_64.tar.gz (11.1 kB view details)

Uploaded Source

pyagram-1.4.3-py3.5.egg (14.4 kB view details)

Uploaded Egg

File details

Details for the file pyagram-1.4.3.tar.gz.

File metadata

  • Download URL: pyagram-1.4.3.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyagram-1.4.3.tar.gz
Algorithm Hash digest
SHA256 883507cd58ca6c12453aa86dcc88355fe3906228d3a893a84af5330cb98f255a
MD5 35a7fdaa673e3d1d241fa21bd21000e7
BLAKE2b-256 55c9a0d1b3bf501688ae53489f6c149517189a01beb5d0b7972b1e63a5f3fe3f

See more details on using hashes here.

File details

Details for the file pyagram-1.4.3.macosx-10.11-x86_64.tar.gz.

File metadata

File hashes

Hashes for pyagram-1.4.3.macosx-10.11-x86_64.tar.gz
Algorithm Hash digest
SHA256 26968a590f6bd6df8484d2964df7c12466fc0ad3ee3e651be6ebe423150de3d2
MD5 5516de7ab3feb0f1064245b7b346fac6
BLAKE2b-256 be06eb48b1b61641174a08f248e3bccda8765668d9f85650e4d3591b4234fe1f

See more details on using hashes here.

File details

Details for the file pyagram-1.4.3-py3.5.egg.

File metadata

  • Download URL: pyagram-1.4.3-py3.5.egg
  • Upload date:
  • Size: 14.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyagram-1.4.3-py3.5.egg
Algorithm Hash digest
SHA256 ed406864fa78d35121d81011e13ded7f5a5cbfa20f4f274dfef4a3f7a64e61e6
MD5 6b08f81902ec77edbefe4729fa809c99
BLAKE2b-256 ab0a949dd28e7e2bac61bc2133ece1933ee5001f30d2f98192e7338f081ade34

See more details on using hashes here.

Supported by

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