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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fde5223f65fd4677387bb3de44623d92b518f9b063421df159187a238858923
|
|
| MD5 |
fef271a2f5e5b849f3c069fbbbe25d01
|
|
| BLAKE2b-256 |
9039521c06e0dff8e5d04e60122f98524d7ce8b82b82ff6ce9f9315c15aa4eaa
|
Provenance
The following attestation bundles were made for tk_flow-0.0.0.tar.gz:
Publisher:
python-publish.yml on ajcecil/tk_flow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tk_flow-0.0.0.tar.gz -
Subject digest:
7fde5223f65fd4677387bb3de44623d92b518f9b063421df159187a238858923 - Sigstore transparency entry: 155697556
- Sigstore integration time:
-
Permalink:
ajcecil/tk_flow@180cc2ec2d565d5a3fbb2a4a506c820861e4a012 -
Branch / Tag:
refs/tags/v0.0.0 - Owner: https://github.com/ajcecil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@180cc2ec2d565d5a3fbb2a4a506c820861e4a012 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
378580915e48a799833c0c9eda7a2d617f50dc0595d6d994466d022dbd779300
|
|
| MD5 |
9ecd366e8f89bf64ab01def8ae9fb56f
|
|
| BLAKE2b-256 |
df50403ee939c188881d54de8e7c84b56ed16f2fa203ec4378cce1535430181b
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tk_flow-0.0.0-py3-none-any.whl -
Subject digest:
378580915e48a799833c0c9eda7a2d617f50dc0595d6d994466d022dbd779300 - Sigstore transparency entry: 155697559
- Sigstore integration time:
-
Permalink:
ajcecil/tk_flow@180cc2ec2d565d5a3fbb2a4a506c820861e4a012 -
Branch / Tag:
refs/tags/v0.0.0 - Owner: https://github.com/ajcecil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@180cc2ec2d565d5a3fbb2a4a506c820861e4a012 -
Trigger Event:
release
-
Statement type: