Return to site

Flowchart Generator Python

broken image


Introduction

In 2006, I created Flowchart Python, a Python-based language that uses a flowchart for high-level language structure. I released it on pygame.org. A workmate was recently searching for something related to Python and flowcharts, and stumbled across my project. After trying to show him the project in action, I decided it was time to upload a cleaner version of Flowchart Python to the Internet.

What is Flowchart Python NOT?

Flowchart for python code - Create a secure password using our generator tool. This form allows you to generate random passwords. First of all Flowchart for python code allows you to make Strong Password Generator to create secure passwords. Python does not have such a code-to-flowchart converter. As answered by Jason, one possible way to convert a Python code into a flowchart may be to: Convert the Python code into a C code. Apply doxygen to create UML class diagrams from C source.

Flowchart Python is not:

  • a tool for editing .py files as flowcharts;
  • a tool for viewing .py files as flowcharts; or
  • a tool for generating .py files from flowcharts.

Perhaps Flowchart Python would be more useful if it were one of those things, and in the future I may add tools which do such things, but those were not my design goals when I wrote the software.

What is Flowchart Python?

Flowchart Python lets you design and edit flowcharts. At the lowest level (variable assignment, function calls, etc.) you enter Python code. When you run a flowchart, the flowchart will be compiled to a .pyc file and run. This means that flowcharts can import normal Python modules and normal Python modules can import (compiled) flowcharts. But there is currently no mechanism for converting a Python source file to a flowchart or vice versa.

What Have I Changed in Version 1.1?

I have just uploaded version 1.1 of Flowchart Python. Despite all temptations I have been careful not to make any large changes in this upload. All that I have done is:

  • update Flowchart Python to work with the latest Python 2 library code;
  • used Python's traceback module to display tracebacks rather than a home-rolled version;
  • fixed a spurious traceback;
  • fixed issues revealed by pyflakes (e.g. useless imports and assignments);
  • changed the code to use Unix line endings;
  • removed trailing whitespace from source code;
  • added __init__.py, setup.py etc.; and
  • called pygame.display.quit() before pygame.quit() to give the illusion of snappiness on exit.

The upshot is that Flowchart Python is now cross-platform and tested on Python 2.7.

How Do I Use It?

Flowchart Python was designed to be used by programmers. This meant that my priority in writing the software was to give hotkeys for everything useful rather than making obvious buttons in the UI. Below are a few pointers on use. In my notes below I haven't specified the hotkeys for everything but in general if you can find a feature in the menu, the hotkey will be listed beside the command name.

Navigation

  • space zooms the view to the selected block
  • ctrl+mouse drag pans and zooms
  • alt+mouse drag pans only
  • S, F, E, D to move selection left, right, up, down
  • R to move selection to child of current block
  • W to move selection to parent of current block

Adding Blocks

To insert control structures, you first add an empty block, then use the ‘Substitute' menu option (or hotkey) to set up the desired kind of block.

Atari 2600 track and field controller. A flowchart containing nothing but a bunch of empty blocks.

There are two ways to add blocks. You can use the insert command (either from the menu or use the hotkey). Alternatively, if you move the mouse over the border of a given block, it will highlight the edge under the mouse in pink. This means that clicking will insert a new block at that position in the flowchart.

An edge highlighted in pink indicates that clicking will insert a new empty block at that location.

Editing Blocks

To add a control structure, select an empty block and choose ‘Substitute' from the menu. The different kinds of blocks are:

  • Execute – executes a chunk of Python code.
  • If – tests the condition.
  • Loop – surprisingly enough, this loops.
  • For Loop – behaves like a Python for loop.
  • Loop Escape – exits the loop (I don't know why I didn't call this break. I'll probably change it to that in a future version of the software).
  • Function Def – defines a function.
  • Class – defines a class.
  • Procedure – defines a funny flowcharty thing which can have multiple input and output routes, and cannot return a value.
  • Procedure call – calls a procedure.
  • Try – error checking.
  • Bottleneck – from multiple strands of execution, the same thing(s) will be run, then the original strand will be resumed.
  • Group – allows you to group blocks and give explanatory comments.

A bottleneck block allows multiple strands of execution to be temporarily combined.

Editing Mappings

Between blocks are mappings. These are denoted by blue circles joined by coloured lines. You can remap any of these by either clicking on the nodes to join, or pressing ‘m' to enter mapping mode, using e, s, d, f to navigate and enter to select nodes to connect.

Keyboard Layouts

I currently develop on Linux. When I originally wrote Flowchart Python I developed in Windows. On Windows, the keycodes returned by pygame do not respect the keyboard layout selected in your operating system. I'm a dvorak user, so this annoyed me. If you are running Flowchart Python on Windows and want to use it in dvorak mode, find the comment near the start of main.py which says 'To start in dvorak keyboard layout, comment out the following line.', and do what it says.

Another note on keyboard layouts: even when typing in text fields, Flowchart Python uses the physical keystrokes to decide what letters you've typed. I guess I wasn't aware that Pygame key events have a unicode character associated with them. Consequently you'll find it very hard to insert special characters into the text fields.

How Do I Get It?

Flowchart Python is licensed under version 2 of the GNU General Public License. You may not download, distribute, edit or use the software unless you agree to the terms of the license.

If you accept the license, you can obtain version 1.1 of Flowchart Python on PyPI by following this link.

Future Work

Now that I've dug this code out, I like the idea of doing some more work on it. My coding style has improved in the last six years, so there's plenty of refactoring I could do. It would also be nice to rename some things to names more familiar to Python developers, and to provide some way of viewing .py files as flowcharts. That said, I also have many other interesting projects to work on, and I can't say how much time I'll chose to spend on Flowchart Python.

Latest version

Released:

Generating flowchart for PyPPL

Project description

Amule dmg. Flowchart generator for PyPPL.

Installation

Usage

Generating flowchart for your pipeline

Python Flowchart Maker

Hiding some processes from flowchart

Theming

Flowchart Generator Python

In your configuration:

We have two builtin themes: default and dark:

You can also default your own theme in the configuration:

Release historyRelease notifications | RSS feed

0.1.5

0.1.4

0.1.3

0.1.2

0.1.1

0.1.0

Python To Flowchart Converter

Code

0.0.3

0.0.2.post2

Download files

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

Files for pyppl-flowchart, version 0.1.5
Filename, sizeFile typePython versionUpload dateHashes
Filename, size pyppl_flowchart-0.1.5-py3-none-any.whl (5.5 kB) File type Wheel Python version py3 Upload dateHashes
Filename, size pyppl_flowchart-0.1.5.tar.gz (5.2 kB) File type Source Python version None Upload dateHashes
Close

Hashes for pyppl_flowchart-0.1.5-py3-none-any.whl

Hashes for pyppl_flowchart-0.1.5-py3-none-any.whl
AlgorithmHash digest
SHA256a5a68287f79c44d9342772b54f1eece065acc706eae672fb0c3344b995288bce
MD5e81ad391e1b7327a8e76482bbf118362
BLAKE2-2567bd1f3fb2e3468cbb153394d1e1f00d1886573ada5b50070f39581fac199b3d8
Close

Hashes for pyppl_flowchart-0.1.5.tar.gz

Hashes for pyppl_flowchart-0.1.5.tar.gz
AlgorithmHash digest
SHA25641447a9f28f2b1e6f9ca29e68eb334bbf3de720595b6a153d384fff9da2b1c26
MD5d672385d35953d9589f66e21fdb1c881
BLAKE2-256b7c82d01e336ccc0251fcb16244986b858451150fcf262c5467401452b2f04cf




broken image