Skip to main content

Using the tkinter UI library to build flowcharts.

Project description

tk_flow

tk_flow is a python library structure to have the simplest flowchart capabilities using the existing tkinter library to produce the imagery and containing the ability to export the generated graphics to a pdf format.

Function Usage

Currently this function can create different flowchart block shapes:

  • rectangle
  • oval
  • diamond
  • hexagon

The current shapes are the core flowchart items, each shape can be modified uniformly, with two rectangle options to have variants of the rectangle.

from tk_flow import Flowchart
import tkinter as tk

# Set up window
root = tk.Tk()
example_flowchart = Flowchart() 


# Node Creation
start = example_flowchart.node(col = 2, row = 0, text = 'Start', shape = 'terminal_start')
end = example_flowchart.node(col = 2,row = 4, text = 'End', shape = 'terminal_end')

example_flowchart.connect(node1 = start, direction1 = 's' , node2 = end, direction2 = 'n' , style = 'arrow' )

Shapes/NodeTypes

  • point (blank space to anchor lines in the flow)
  • title
  • label
  • terminal_start (oval type node, designated as start node, by default filled green)
  • terminal_end (oval type node, designated as end node, by default filled red)
  • rectangle
  • rectangle2
  • diamond
  • hexagon
  • oval

Formatting

Most of the formating Items are stored in a dictionary and can be edited individually.

default_colors = {
            "oval": "lightblue",
            "rectangle": "lightgrey",
            "rectangle2": "lightbrown",
            "diamond": "lightgreen",
            "hexagon": "lightyellow",
            "terminal_start": "green",
            "terminal_end": "red"
        }

default_outlines = {
            "oval": {"color": "black", "thickness": 2},
            "rectangle": {"color": "black", "thickness": 2},
            "rectangle2": {"color": "black", "thickness": 2},
            "diamond": {"color": "black", "thickness": 2},
            "hexagon": {"color": "black", "thickness": 2},
            "terminal_start": {"color": "black", "thickness": 2},
            "terminal_end": {"color": "black", "thickness": 2}
        }

default_fonts = {
            "oval": {"font": "Courier", "size": 24, "color": "black", "weight": "normal", "underline" : False},
            "rectangle": {"font": "Courier", "size": 24, "color": "black", "weight": "normal", "underline" : False},
            "rectangle2": {"font": "Courier", "size": 24, "color": "black", "weight": "bold", "underline" : False},
            "diamond": {"font": "Courier", "size": 24, "color": "black", "weight": "normal", "underline" : False},
            "hexagon": {"font": "Courier", "size": 24, "color": "black", "weight": "normal", "underline" : False},
            "label": {"font": "Courier", "size": 18, "color": "black", "weight": "bold", "underline" : False},
            "terminal_start": {"font": "Courier", "size": 66, "color": "black", "weight": "bold", "underline" : False},
            "terminal_end": {"font": "Courier", "size": 66, "color": "black", "weight": "bold", "underline" : False},
            "title": {"font": "Courier", "size": 72, "color": "black", "weight": "bold", "underline" : False}
        }

default_connectors = {
            "color": "black",
            "thickness": 2
        }

Input Variables

#input variable options
Flowchart(
   root,
   title="Flowchart Creator",
   grid_width=100,
   grid_height=100,
   grid_pad=0.15,
   colors=None,
   outlines=None,
   fonts=None,
   connectors=None,
   spacing=50,
   node_width=150,
   node_height=90,
   label_width=25,
   label_height=10
)

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

tk_flow-0.0.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

tk_flow-0.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file tk_flow-0.0.0.tar.gz.

File metadata

  • Download URL: tk_flow-0.0.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tk_flow-0.0.0.tar.gz
Algorithm Hash digest
SHA256 7fde5223f65fd4677387bb3de44623d92b518f9b063421df159187a238858923
MD5 fef271a2f5e5b849f3c069fbbbe25d01
BLAKE2b-256 9039521c06e0dff8e5d04e60122f98524d7ce8b82b82ff6ce9f9315c15aa4eaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for tk_flow-0.0.0.tar.gz:

Publisher: python-publish.yml on ajcecil/tk_flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tk_flow-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: tk_flow-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tk_flow-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 378580915e48a799833c0c9eda7a2d617f50dc0595d6d994466d022dbd779300
MD5 9ecd366e8f89bf64ab01def8ae9fb56f
BLAKE2b-256 df50403ee939c188881d54de8e7c84b56ed16f2fa203ec4378cce1535430181b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tk_flow-0.0.0-py3-none-any.whl:

Publisher: python-publish.yml on ajcecil/tk_flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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