Skip to main content

A Tkinter utility module for enhanced widgets rendering

Project description

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!

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

tkextras-1.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

tkextras-1.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file tkextras-1.1.0.tar.gz.

File metadata

  • Download URL: tkextras-1.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for tkextras-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3a794f038d0f664d25f7a4956b1d1dbc2833d1831adc5c844e5423ed17d5d3ea
MD5 fe94b1671d76ee8902f3e45f004e9687
BLAKE2b-256 7e17dbba93975b56606f52708882f015ab7fd6402a984e91335962d8c17fa30e

See more details on using hashes here.

File details

Details for the file tkextras-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tkextras-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for tkextras-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37014db41a58997acf0b517d34fcad11d34b90267b093ddabb1cbf499b7d2fcb
MD5 42859bff61c29998737b7e8fec8d9deb
BLAKE2b-256 eaefe2fbc46a2b0a6adc59f9bd010dada47392779849d59d48da7e0b208a69a4

See more details on using hashes here.

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