Registry / data / tabulator

tabulator

JSON →
library1.53.5pypypi✓ verified 85d ago

Tabulator provides a consistent interface for reading and writing tabular data from various sources (e.g., CSV, Excel, JSON, Google Sheets) in a streaming fashion. It aims to simplify data integration by abstracting away the underlying file formats. The current version is 1.53.5, and it maintains a regular release cadence with minor updates and bug fixes.

pip install tabulator
INSTALL
IMPORT
SIG · TABULATOR
T
tabulator
datapythonv1.53.5
Install
8.5s avg
Import
113ms
Disk
86MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.53.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.119s · 86.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 8.5s · import 0.107s · 86MB
86MB installed
● package 86MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Stream
from tabulator import Stream
from tabulator import Table
The 'Table' class was removed in Tabulator v1.0.0 as part of a major API refactor; 'Stream' is the current and recommended class for data processing.

This quickstart demonstrates how to use `tabulator.Stream` to read tabular data from a remote CSV file. It iterates through the rows, printing the headers and the first few data rows. The Stream object handles opening and closing the data source automatically.

import os from tabulator import Stream # Example: Read a CSV file from a URL csv_url = "https://raw.githubusercontent.com/frictionlessdata/tabulator-py/master/data/table.csv" # Ensure the URL is accessible or provide a local path try: with Stream(csv_url) as stream: print(f"Headers: {stream.headers}") print("First 5 rows:") for i, row in enumerate(stream): if i >= 5: break print(row) except Exception as e: print(f"Could not read data from {csv_url}: {e}") # Example: Reading a local CSV file (ensure 'example.csv' exists) # You can create a dummy file for local testing: # with open('example.csv', 'w') as f: # f.write('id,name\n1,Alice\n2,Bob') # # local_csv_path = 'example.csv' # if os.path.exists(local_csv_path): # with Stream(local_csv_path) as stream: # print(f"\nLocal CSV Headers: {stream.headers}") # print(f"Local CSV First row: {next(iter(stream))}") # else: # print(f"\nSkipping local CSV example: {local_csv_path} not found.")
Debug
Known issues
breakingTabulator v1.0.0 introduced a major API refactor. The 'Table' class was removed and replaced entirely by the 'Stream' class. Older code using 'Table' will no longer work.
fix
Migrate your code to use `from tabulator import Stream` and adapt to its API. All options are now passed to the `Stream` constructor.
affects: >=1.0.0
gotchaReading certain file formats (e.g., Excel, JSON Lines, remote files) requires installing optional dependencies. Without them, you will encounter `ModuleNotFoundError`.
fix
Install the necessary extra dependencies, e.g., `pip install tabulator[xlsx]`, `pip install tabulator[xls]`, `pip install tabulator[jsonl]`, or `pip install tabulator[http]` for remote files. For all common extras, use `pip install tabulator[xlsx,xls,jsonl,http]`.
affects: All versions
gotchaCSV files often have encoding issues. If you encounter `UnicodeDecodeError`, it's likely due to an incorrect character encoding.
fix
Explicitly specify the encoding when creating the Stream, e.g., `Stream('data.csv', encoding='latin-1')`. Common encodings include 'utf-8', 'latin-1', 'cp1252'.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tabulator'
The tabulator library is not installed in your current Python environment.
fix
Install the library: `pip install tabulator`
ModuleNotFoundError: No module named 'openpyxl'
You are trying to read an XLSX (Excel) file, but the `openpyxl` dependency is not installed.
fix
Install the required extra: `pip install tabulator[xlsx]`
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x__ in position __: invalid start byte
Your CSV file is not encoded in UTF-8, but tabulator is trying to decode it as such by default.
fix
Specify the correct encoding for your file, e.g., `Stream('data.csv', encoding='latin-1')` or `encoding='cp1252'`.
FileNotFoundError: [Errno 2] No such file or directory: 'your_file.csv'
The specified file path is incorrect or the file does not exist at that location.
fix
Verify the file path is absolute or relative to your script's working directory. Ensure the file actually exists.
Upgrade
Version history
1.53.5latest on PyPI · released Mar 21, 2021
Audit
Dependencies
requestsoptionalRequired for reading data from HTTP/HTTPS URLs.
openpyxloptionalRequired for reading XLSX (Excel 2007+) files.
xlrdoptionalRequired for reading XLS (Excel 97-2003) files.
jsonlinesoptionalRequired for reading JSON Lines (.jsonl) files.
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
tabulator — pip install tabulator · libregistry