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
)
Metadata
Release files for tk-flow 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tk_flow-0.0.0.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tk_flow-0.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / tk_flow-0.0.0.tar.gz
| Download URL | tk_flow-0.0.0.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fde5223f65fd4677387bb3de44623d92b518f9b063421df159187a238858923
|
|
BLAKE2b-256 checksum How to use checksums |
9039521c06e0dff8e5d04e60122f98524d7ce8b82b82ff6ce9f9315c15aa4eaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 16, 2024.
Transparency logRelease files / tk_flow-0.0.0-py3-none-any.whl
| Download URL | tk_flow-0.0.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
378580915e48a799833c0c9eda7a2d617f50dc0595d6d994466d022dbd779300
|
|
BLAKE2b-256 checksum How to use checksums |
df50403ee939c188881d54de8e7c84b56ed16f2fa203ec4378cce1535430181b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 16, 2024.
Transparency log