{"id":375,"library":"tabulate","title":"Tabulate","description":"Tabulate is a Python library for pretty-printing tabular data. The current version is 0.10.0, released three weeks ago. It is actively maintained and supports Python versions 3.10 and above. The release cadence is approximately every few weeks.","status":"active","version":"0.10.0","language":"python","source_language":"en","source_url":"https://github.com/astanin/python-tabulate","tags":["tabular data","pretty-printing","Python library"],"install":[{"cmd":"pip install tabulate","lang":"bash","label":"Install Tabulate"}],"dependencies":[{"reason":"Required for YAML export functionality","package":"pyyaml"},{"reason":"Required for Excel export functionality","package":"openpyxl"}],"imports":[{"note":"Ensure correct import path to access the 'tabulate' function","symbol":"tabulate","correct":"from tabulate import tabulate"}],"quickstart":{"code":"import os\nfrom tabulate import tabulate\n\ndata = [['Name', 'Age'], ['Alice', 30], ['Bob', 25]]\nprint(tabulate(data, headers='firstrow', tablefmt='grid'))","lang":"python","description":"A simple example demonstrating how to use the 'tabulate' function to print a table with headers and grid formatting."},"warnings":[{"fix":"Upgrade to Python 3.10 or later","message":"Dropped Python 2 support in version 1.0.0","severity":"breaking","affected_versions":"<=1.0.0"},{"fix":"Update code to use the new export method syntax","message":"The 'Dataset.export' method is deprecated; use 'Dataset.export('format')' instead","severity":"deprecated","affected_versions":">=0.12.1"}],"env_vars":null,"last_verified":"2026-05-12T13:23:59.450Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"pip install tabulate","cause":"The `tabulate` library has not been installed in the Python environment where the code is being executed.","error":"ModuleNotFoundError: No module named 'tabulate'"},{"fix":"Ensure your data is structured as a list of lists (for rows), a list of dictionaries (where keys are headers), or a dictionary of lists (where keys are headers and values are columns).","cause":"The data provided to the `tabulate()` function does not match any of the expected input formats required by the library.","error":"ValueError: Data must be a list of lists, list of dicts, or a dictionary of lists"},{"fix":"Adjust the `headers` list or the data to ensure that the number of headers precisely corresponds to the number of columns in your data.","cause":"The number of headers provided does not match the number of columns (elements in each row) in the data passed to `tabulate()`.","error":"ValueError: Data and headers must have the same number of columns"},{"fix":"Convert the dictionary into an iterable format `tabulate` can process, such as `my_dict.items()` for a two-column table (key, value), or transform it into a list of dictionaries for more complex structures.","cause":"A dictionary was directly passed as data to `tabulate()` which expects an iterable of rows (like a list or tuple), but a raw dictionary is not iterable in that context.","error":"TypeError: 'dict' object is not iterable"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":4.8,"disk_size":"18.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.15,"mem_mb":4.8,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.21,"mem_mb":5.7,"disk_size":"19.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":5.7,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":5.3,"disk_size":"11.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":5.3,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":5.4,"disk_size":"11.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.15,"mem_mb":5.4,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.03,"mem_mb":1.7,"disk_size":"17.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.03,"mem_mb":1.7,"disk_size":"18M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}