Skip to main content

QtDataTable

QtDataTable is a reusable PySide6 widget for displaying and editing business data. Pass column definitions and rows to get a table with sorting, search, selection and optional filters. QtDataTable handles the Qt model, proxy and delegate internally.

Install

Use Python 3.11 or newer in a virtual environment. QtDataTable installs PySide6 Essentials as a dependency.

python -m pip install QtDataTable

Use "QtDataTable[excel]" to add Excel export. To install from a source checkout, run python -m pip install . in the project directory.

Quick start

from PySide6.QtWidgets import QApplication
from qtdatatable import DataTable

app = QApplication([])
table = DataTable(columns=["Name", "Age"], data=[["Alice", 30], ["Bob", 25]])
table.resize(480, 260)
table.show()
app.exec()

In an existing app, pass the parent widget to DataTable(parent, ...) and add the table to the parent's layout. Reuse your application's QApplication.

Work with records

Use dictionary rows when the data has stable keys. Column titles are independent of those keys, and a record can carry extra fields such as a job ID.

from decimal import Decimal

table = DataTable(
    columns=[
        {"key": "customer", "title": "Customer", "stretch": True},
        {"key": "status", "title": "Status", "type": "badge"},
        {"key": "value", "title": "Job value", "type": "currency"},
    ],
    data=[{"job": "J-42", "customer": "Afon", "status": "Pending", "value": Decimal("12.50")}],
    row_key="job",
    filterable=True,
    alternating_rows=True,
)

job_id = table.add_row({"job": "J-43", "customer": "Meridian", "status": "Pending"})
table.update_rows({job_id: {"status": "Completed"}})
table.search("meridian")
table.set_filter("status", "Completed")
table.sort_by("value", ascending=False)
table.select_row(job_id)
job = table.get_row(job_id)
table.row_double_clicked.connect(lambda ident, row: print(ident, row["customer"]))

get_data() returns independent dictionaries in source order. get_data("visible") returns matching rows in display order. Call set_data(rows) to replace the dataset and delete_row(job_id) to remove one record. Use get_row_ids() to enumerate IDs, including IDs generated by the table, and delete_rows(ids) to remove a batch.

Features and examples

  • Click a sortable header to change its sort direction. Use Ctrl or Shift for multi-row selection when selection_mode="multiple". Press Alt+Down for table actions or Ctrl+Shift+C to copy selected rows.
  • Search matches raw text and formatted cell text, ignoring case. Clear a column filter with set_filter(key, None). Pass mode="contains" for substring filtering, or use set_null_filter() and set_range_filter() for explicit predicates.
  • Use native Python values with the text, integer, number, currency, percentage, date, datetime, boolean and badge types. Currency uses major units. Percentages use fractions by default, so 0.25 displays as 25%. Set percentage_input="points" to store 25 for 25%.
  • Set editable=True and double-click a cell or press F2 to edit. Connect data_changed to receive the row ID, field key, old and new values. Invalid input remains available for correction.
  • Use export_csv("jobs.csv", scope="visible") for the current view. export_excel() requires the excel extra.
  • Set theme="light", "dark", "auto" or "system", or pass a ThemeConfig for custom colours, fonts and density.

Run any example from the checkout after installing the package.

Example Demonstrates
python examples/basic_table.py A table using positional rows
python examples/business_table.py A job register with badges, value, due date and progress
python examples/search_filter.py Combined search and column filters
python examples/editable_table.py Validated edits and feedback
python examples/theme_showcase.py Switching themes at runtime
python examples/large_dataset.py Browsing 50,000 records
python examples/worker_fetch.py Background fetching, cancellation and stale-result handling

Troubleshooting

  • If you see “Must construct a QApplication before a QWidget,” create QApplication before the table and retain it for the application's lifetime.
  • If values sort alphabetically, check their Python types. Pass 10 and 2 for numeric ordering. Convert numbers and dates from file or database strings before passing them to the table.
  • If a row disappears after an edit, check the active search and column filters. Use get_data() to inspect all records.
  • If an edit is unavailable, check the table and column editable settings. A configured row-key field is read-only in the UI.

Getting started · API reference · Customisation · Architecture · Benchmarks · Publishing

QtDataTable is MIT-licensed. PySide6 has its own distribution terms. QtDataTable licence · Qt for Python licensing

Metadata

Release files for QtDataTable 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QtDataTable 1.0.0
File Size Uploaded Provenance Actions
qtdatatable-1.0.0.tar.gz 74.9 kB With provenance Details for qtdatatable-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for QtDataTable 1.0.0
File Interpreter ABI Platform Actions
qtdatatable-1.0.0-py3-none-any.whl Python 3 none any Details for qtdatatable-1.0.0-py3-none-any.whl

Total release size: 118.5 kB

Release files / qtdatatable-1.0.0.tar.gz

Download URL qtdatatable-1.0.0.tar.gz
Size 74.9 kB
Tags Source
SHA-256 checksum
How to use checksums
134fd0abdd784c1c774af903ad3083d93eeacc142cc0cf8df3f0a71e74185c6d
BLAKE2b-256 checksum
How to use checksums
d0814e0c448066d5c7459a62a6a1b297361a01f9455dda20f9c8bb69ed0a7abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / qtdatatable-1.0.0-py3-none-any.whl

Download URL qtdatatable-1.0.0-py3-none-any.whl
Size 43.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b2e6c8fa93563e44351c81df0f651f99853138c634fe672482986337ef7e4d6
BLAKE2b-256 checksum
How to use checksums
bf9f9413aa0f31e107e18bbb023e79c99c7925a3a1ac83668d5e5888e7d1189a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for QtDataTable 1.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qtdatatable-1.0.0.tar.gz

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 Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page