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.
- WidgetsRender: Unified interface for rendering widgets with
grid()
,pack()
, andplace()
methods. - TreeviewDataFrame: Extended
ttk.Treeview
that synchronizes withpandas.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.
-
Install the module:
pip install tkextras
-
Clone the repository:
git clone https://github.com/whellcome/tkextras.git cd tkextras
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
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:
Complete documentation is available at:
For real-world applications, see the examples/ folder, or check out:
- MS Access to SQL Export Tool (GitHub) - Uses tkextras for UI components.
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.
This project is licensed under the MIT License.
🚀 Enhance your tkinter experience with tkextras!