Skip to content

whellcome/tkextras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tkextras

Enhancing tkinter development with streamlined rendering and DataFrame-powered Treeview.

tkextras is a lightweight Python library that extends tkinter functionality, making GUI development easier and more efficient. It introduces a simplified widget rendering system and an extended Treeview component that integrates seamlessly with pandas DataFrames.

Features

  • WidgetsRender: Unified interface for rendering widgets with grid(), pack(), and place() methods.
  • TreeviewDataFrame: Extended ttk.Treeview that synchronizes with pandas.DataFrame.
  • Built-in Filtering: Interactive filtering and flagging for table-based data.
  • Event System Integration: Custom events for enhanced user interaction.
  • Sphinx Documentation: Full API documentation and usage examples.

Installation

  1. Install the module:

    pip install tkextras
  2. Clone the repository:

    git clone https://github.com/whellcome/tkextras.git
    cd tkextras

Usage

Rendering Widgets Easily

import tkinter as tk
from tkextras import WidgetsRender


class ExampleApp(WidgetsRender, tk.Tk, ):
  def __init__(self):
    super().__init__()
    lable = self.rgrid(tk.Label(self), dict(row=0, column=0))
    lable['text'] = "Hello, World!"

app = ExampleApp()
app.mainloop()

Advanced working example of WidgetsRender application

Working with Treeview and DataFrames

from tkextras import TreeviewDataFrame
import tkinter as tk

root = tk.Tk()
tree = TreeviewDataFrame(root, columns=["Name", "Married", "Employed"], show='headings')
tree.pack(fill="both", expand=True)

tree.insert("", "end", values=("Alice", " ", " "))  # Normal rows addition
tree.insert("", "end", values=("Bob", " ", " "))

tree.make_tree()  # Tree design, can include a Dataframe(transformed, with identical columns) to loading
tree.bind("<<TreeToggleCell>>", lambda x: print(tree.df))  # DataFrame synchronization

root.mainloop()

Advanced working example of TreeviewDataFrame application:

Example TreeviewDataFrame

Documentation

Complete documentation is available at:

📖 Project Documentation

Examples

For real-world applications, see the examples/ folder, or check out:

  • MS Access to SQL Export Tool (GitHub) - Uses tkextras for UI components.

Contributing

Contributions are welcome! Open an issue or submit a pull request if you have improvements or bug fixes.

Need support or have a suggestion? 🚀🔥
Please open an issue on GitHub.

License

This project is licensed under the MIT License.


🚀 Enhance your tkinter experience with tkextras!