tabledata
tabledata is a Python library designed to represent tabular data programmatically. It serves as a foundational component for other libraries by the same author, such as pytablewriter, pytablereader, and SimpleSQLite. The library is actively maintained, with its current version being 1.3.4, and receives regular updates.
Warnings
- breaking Support for Python 3.7 and 3.8 was dropped in version 1.3.4. Users on these Python versions must upgrade to Python 3.9+ to use the latest `tabledata` versions.
- breaking The minimum required version of the `DataProperty` library was bumped to 1.0.1 in `tabledata` v1.3.2. Older `DataProperty` versions may lead to incompatibility issues.
- breaking Support for Python 3.6 was dropped in version 1.3.2.
- breaking Python 2 support was entirely dropped in version 1.0.0. All versions from 1.0.0 onwards are Python 3 only.
Install
-
pip install tabledata
Imports
- TableData
from tabledata import TableData
- ColumnData
from tabledata import ColumnData
- DataRow
from tabledata import DataRow
Quickstart
from tabledata import TableData
table_name = "users"
headers = ["ID", "Name", "Email"]
rows = [
[1, "Alice", "alice@example.com"],
[2, "Bob", "bob@example.com"],
[3, "Charlie", "charlie@example.com"]
]
table = TableData(table_name, headers, rows)
print(f"Table Name: {table.table_name}")
print(f"Headers: {table.headers}")
for row in table.rows:
print(f"Row: {row.data}")
# Accessing data (example)
print(f"First user's name: {table.rows[0].get_value_by_name('Name')}")