Registry / data / dataflows-tabulator

dataflows-tabulator

JSON →
library1.54.3pypypi✓ verified 86d ago

Tabulator is a Python library providing a consistent and robust interface for streaming and processing tabular data from various sources and formats, including CSV, Excel, JSON, and SQL databases. It serves as a foundational data reading component within the `dataflows` framework. Currently at version 1.54.3, the library maintains a stable release cadence with regular updates.

pip install dataflows-tabulator
INSTALL
IMPORT
SIG · DATAFLOWS-TABULATO
D
dataflows-tabulator
datapythonv1.54.3
Install
8.8s avg
Import
113ms
Disk
96MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.54.3 · 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.940 runs
installs and imports cleanly · install 0.0s · import 0.117s · 98.9MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 8.8s · import 0.110s · 98MB
96MB installed
● package 96MB
Code
Verified usage

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

tabulator
import tabulator
import dataflows_tabulator
The PyPI package is `dataflows-tabulator`, but the importable module is `tabulator`.
Stream
from tabulator import Stream

This quickstart demonstrates how to read a local CSV file using `tabulator.Stream`. It opens the stream, prints headers, iterates through rows as lists, and then closes the stream. `headers='first-row'` automatically infers headers from the first row of the data source.

import tabulator import os # Example CSV data (in-memory string for quickstart) csv_data = "id,name\n1,Alice\n2,Bob" # Create a simple CSV file for demonstration file_path = 'example.csv' with open(file_path, 'w', encoding='utf-8') as f: f.write(csv_data) # Read the data using tabulator # For local files, simply pass the path table = tabulator.Stream(file_path, headers='first-row') table.open() print("Headers:", table.headers) print("Rows:") for row in table: print(row) table.close() # Cleanup (optional) os.remove(file_path)
Debug
Known issues
gotchaThe PyPI package is named `dataflows-tabulator`, but the Python module you should `import` is simply `tabulator`. Attempting to `import dataflows_tabulator` will result in a `ModuleNotFoundError`.
fix
Always use `import tabulator` or `from tabulator import ...` in your code.
affects: All versions
gotchaWhile core formats like CSV, Excel, and ODS are supported out-of-the-box, reading/writing certain other formats (e.g., large JSON, HTML, SQL databases) requires installing additional 'extra' dependencies. Without these, `tabulator` will raise an error when attempting to use those formats.
fix
Install `dataflows-tabulator` with the necessary extras, for example: `pip install dataflows-tabulator[json,html,sql]`. Alternatively, install the specific dependency (e.g., `pip install ijson`) separately.
affects: All versions
gotchaWhen reading files, `tabulator` attempts to infer the file format and encoding. This inference is usually reliable but can fail with non-standard files or specific character encodings. Incorrect inference can lead to parsing errors or garbled text.
fix
Explicitly provide the `format` and `encoding` arguments to `tabulator.Stream()` when encountering issues, e.g., `tabulator.Stream('data.csv', format='csv', encoding='latin-1')`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dataflows_tabulator'
The Python package `dataflows-tabulator` is installed, but you tried to import it using its PyPI name with underscores, which is not the correct module name.
fix
Change your import statement from `import dataflows_tabulator` to `import tabulator`.
tabulator.errors.TabulatorException: Missing dependency for 'json' format. Please install 'ijson'.
You are attempting to read a JSON file, but the optional `ijson` dependency (needed for efficient JSON parsing) has not been installed.
fix
Install the `json` extra for `dataflows-tabulator`: `pip install dataflows-tabulator[json]` or `pip install ijson` directly.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x__ in position _: invalid start byte
The file you are trying to read is not encoded in UTF-8, but `tabulator` defaults to UTF-8 for text files.
fix
Specify the correct encoding when creating the stream, for example: `tabulator.Stream('data.csv', encoding='latin-1')`. Common alternative encodings include 'latin-1', 'cp1252', or 'iso-8859-1'.
Upgrade
Version history
1.54.3latest on PyPI · released Mar 24, 2024
Audit
Dependencies
datapackagerequiredCore dependency for data packaging concepts
jsonpath-rw-extrequiredRequired for JSON path operations
jsonschemarequiredRequired for JSON schema validation
tableschemarequiredCore dependency for table schema management
openpyxlrequiredRequired for reading/writing modern Excel files (.xlsx)
xlrdrequiredRequired for reading legacy Excel files (.xls)
xlwtrequiredRequired for writing legacy Excel files (.xls)
odfpyrequiredRequired for reading/writing Open Document Spreadsheet files (.ods)
clickrequiredCommand-line interface toolkit
mistunerequiredMarkdown parser (used for some internal documentation/rendering)
ijsonoptionalOptional: Required for efficient parsing of large JSON files
beautifulsoup4optionalOptional: Required for reading HTML tables
lxmloptionalOptional: Required for efficient HTML parsing
sqlalchemyoptionalOptional: Required for reading/writing SQL database tables
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
dataflows-tabulator — pip install dataflows-tabulator · libregistry