{"id":10278,"library":"tabulator","title":"Tabulator","description":"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.","status":"active","version":"1.53.5","language":"en","source_language":"en","source_url":"https://github.com/frictionlessdata/tabulator-py","tags":["data","tabular","csv","excel","json","data-processing","streaming"],"install":[{"cmd":"pip install tabulator","lang":"bash","label":"Base installation"},{"cmd":"pip install tabulator[xlsx,xls,jsonl,http]","lang":"bash","label":"With all common optional dependencies"}],"dependencies":[{"reason":"Required for reading data from HTTP/HTTPS URLs.","package":"requests","optional":true},{"reason":"Required for reading XLSX (Excel 2007+) files.","package":"openpyxl","optional":true},{"reason":"Required for reading XLS (Excel 97-2003) files.","package":"xlrd","optional":true},{"reason":"Required for reading JSON Lines (.jsonl) files.","package":"jsonlines","optional":true}],"imports":[{"note":"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.","wrong":"from tabulator import Table","symbol":"Stream","correct":"from tabulator import Stream"}],"quickstart":{"code":"import os\nfrom tabulator import Stream\n\n# Example: Read a CSV file from a URL\ncsv_url = \"https://raw.githubusercontent.com/frictionlessdata/tabulator-py/master/data/table.csv\"\n\n# Ensure the URL is accessible or provide a local path\ntry:\n    with Stream(csv_url) as stream:\n        print(f\"Headers: {stream.headers}\")\n        print(\"First 5 rows:\")\n        for i, row in enumerate(stream):\n            if i >= 5:\n                break\n            print(row)\nexcept Exception as e:\n    print(f\"Could not read data from {csv_url}: {e}\")\n\n# Example: Reading a local CSV file (ensure 'example.csv' exists)\n# You can create a dummy file for local testing:\n# with open('example.csv', 'w') as f:\n#     f.write('id,name\\n1,Alice\\n2,Bob')\n#\n# local_csv_path = 'example.csv'\n# if os.path.exists(local_csv_path):\n#     with Stream(local_csv_path) as stream:\n#         print(f\"\\nLocal CSV Headers: {stream.headers}\")\n#         print(f\"Local CSV First row: {next(iter(stream))}\")\n# else:\n#     print(f\"\\nSkipping local CSV example: {local_csv_path} not found.\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Migrate your code to use `from tabulator import Stream` and adapt to its API. All options are now passed to the `Stream` constructor.","message":"Tabulator 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.","severity":"breaking","affected_versions":">=1.0.0"},{"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]`.","message":"Reading certain file formats (e.g., Excel, JSON Lines, remote files) requires installing optional dependencies. Without them, you will encounter `ModuleNotFoundError`.","severity":"gotcha","affected_versions":"All versions"},{"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'.","message":"CSV files often have encoding issues. If you encounter `UnicodeDecodeError`, it's likely due to an incorrect character encoding.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Install the library: `pip install tabulator`","cause":"The tabulator library is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'tabulator'"},{"fix":"Install the required extra: `pip install tabulator[xlsx]`","cause":"You are trying to read an XLSX (Excel) file, but the `openpyxl` dependency is not installed.","error":"ModuleNotFoundError: No module named 'openpyxl'"},{"fix":"Specify the correct encoding for your file, e.g., `Stream('data.csv', encoding='latin-1')` or `encoding='cp1252'`.","cause":"Your CSV file is not encoded in UTF-8, but tabulator is trying to decode it as such by default.","error":"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x__ in position __: invalid start byte"},{"fix":"Verify the file path is absolute or relative to your script's working directory. Ensure the file actually exists.","cause":"The specified file path is incorrect or the file does not exist at that location.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'your_file.csv'"}]}