Skip to main content

Tabular data display widget for Tkinter

Project description

tkDataCanvas is a tabular data display widget for Python + Tkinter. It is intended as a more efficient replacement for tkMagicGrid and tkScrolledFrame for displaying large amounts of static data.

tkDataCanvas is designed to be simple above all else. It has no dependencies outside the Python standard library. Its API is designed to let you accomplish tasks with as few method calls as possible.

Both Python 2 and 3 are supported, on Windows and Unix platforms.

Usage

tkDataCanvas consists of a single module, tkdatacanvas (note the module name is lowercase), which exports a single class, DataCanvas.

A brief example program:

#!/usr/bin/env python3

from tkinter import *
from tkdatacanvas import DataCanvas
import io
import csv

# Create a root window
root = Tk()

# Create a DataCanvas widget
dc = DataCanvas(root)
dc.pack(side="top", expand=1, fill="both")

# Display the contents of some CSV file
with io.open("test.csv", "r", newline="") as csv_file:
    reader = csv.reader(csv_file)
    parsed_rows = 0
    for row in reader:
        if parsed_rows == 0:
    	    # Display the first row as a header
    	    dc.add_header(*row)
        else:
    	    dc.add_row(*row)
        parsed_rows += 1
dc.display()

# Start Tk's event loop
root.mainloop()

For detailed documentation, try python -m pydoc tkdatacanvas.

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

tkDataCanvas-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

tkDataCanvas-0.1.1-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tkDataCanvas-0.1.1.tar.gz.

File metadata

  • Download URL: tkDataCanvas-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for tkDataCanvas-0.1.1.tar.gz
Algorithm Hash digest
SHA256 260d51e3e73d8ae6f489a8fcf5202ceed6e73df4fb283e78f8674abd4900a674
MD5 c53c1ce33325950434a3cf71359a058a
BLAKE2b-256 846b98f40fcb801183122f6fedf649603dad6b9a5d833864bbf742e508010b0c

See more details on using hashes here.

File details

Details for the file tkDataCanvas-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: tkDataCanvas-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for tkDataCanvas-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 075015cc407fc414b0037a52155b027ef99c3c35d7f741fff2aa5234be38d6df
MD5 72681b087163130aef4843b99e783c7c
BLAKE2b-256 1b61af5de417b0b2cedd137cc232536b9a847e72ab1d6da98702cf8b32966271

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page