{"library":"types-tabulate","title":"Typing stubs for tabulate","description":"types-tabulate is a type stub package part of the `typeshed` project, providing static type checking information for the `tabulate` library. `tabulate` itself is a popular Python library (current version 0.11.0, released in March 2026) that pretty-prints tabular data from various data structures like lists of lists, dictionaries, or Pandas DataFrames into highly customizable, human-readable formats (e.g., plain text, grid, Markdown, HTML). `types-tabulate` ensures that code using `tabulate` can be statically analyzed by type checkers like MyPy and Pyright for correctness, without adding runtime overhead. The package releases are aligned with `typeshed` and aim to provide accurate annotations for specific `tabulate` versions, currently targeting `tabulate==0.10.*`.","status":"active","version":"0.10.0.20260308","language":"en","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing","stubs","type-checking","tabulate","typeshed"],"install":[{"cmd":"pip install types-tabulate","lang":"bash","label":"Install types-tabulate"},{"cmd":"pip install tabulate","lang":"bash","label":"Install runtime dependency tabulate"}],"dependencies":[{"reason":"This package provides type stubs for the `tabulate` runtime library. `tabulate` must be installed separately for actual program execution.","package":"tabulate","optional":false}],"imports":[{"symbol":"tabulate","correct":"from tabulate import tabulate"}],"quickstart":{"code":"from tabulate import tabulate\n\ndata = [\n    [\"Name\", \"Age\", \"City\"],\n    [\"Alice\", 30, \"New York\"],\n    [\"Bob\", 24, \"Los Angeles\"],\n    [\"Charlie\", 35, \"Chicago\"]\n]\n\n# Print with headers from the first row\nprint(tabulate(data, headers=\"firstrow\", tablefmt=\"grid\"))\n\nprint(\"\\n---\\n\")\n\n# Or from a list of dictionaries\ndata_dicts = [\n    {\"Item\": \"Pizza\", \"Price\": 850},\n    {\"Item\": \"Burger\", \"Price\": 500},\n    {\"Item\": \"Salad\", \"Price\": 475}\n]\nprint(tabulate(data_dicts, headers=\"keys\", tablefmt=\"fancy_grid\"))","lang":"python","description":"This quickstart demonstrates basic usage of the `tabulate` library for which `types-tabulate` provides typing information. It shows how to create a formatted table from a list of lists and a list of dictionaries, using different table formats like 'grid' and 'fancy_grid'."},"warnings":[{"fix":"Always check the `types-tabulate` PyPI page or `typeshed` project for the exact `tabulate` version range it targets. Ensure your installed `tabulate` runtime package's major version is compatible with the `types-tabulate` stubs you are using. If using a newer `tabulate` version than officially supported by the latest `types-tabulate`, you might need to wait for an update to `types-tabulate` or consider temporary type ignore comments.","message":"`types-tabulate` is designed to provide accurate type annotations for a specific major version range of the runtime `tabulate` library. For example, `types-tabulate==0.10.0.20260308` targets `tabulate==0.10.*`. However, the `tabulate` library itself released version `0.11.0` in March 2026, which includes API changes (e.g., dropping the `youtrack` format, adding `Decimal` support). Previous major version `0.10.0` dropped Python 3.7-3.9 support and replaced the `PRESERVE_STERILITY` global with a function argument. If your installed `tabulate` runtime version (e.g., `0.11.0`) differs from the version `types-tabulate` is designed for (e.g., `0.10.*`), your type checker may report incorrect errors or fail to catch actual runtime type issues.","severity":"breaking","affected_versions":"All `types-tabulate` versions when `tabulate` runtime version is mismatched (e.g., `types-tabulate==0.10.*` with `tabulate>=0.11.0`)."},{"fix":"Always import `tabulate` (e.g., `from tabulate import tabulate`) for runtime functionality. `types-tabulate` is implicitly used by your type checker and does not need to be explicitly imported or referenced in your runtime code.","message":"`types-tabulate` is a stub-only package (`.pyi` files) and contains no runtime code. It's solely for static type checking purposes (e.g., with MyPy or Pyright). Attempting to import or use `types-tabulate` directly at runtime will result in an `ImportError` or `AttributeError` if you try to call functions from it, as the actual executable code resides in the `tabulate` package.","severity":"gotcha","affected_versions":"All versions of `types-tabulate`."},{"fix":"Keep your type checker (e.g., `mypy`, `pyright`) updated to its latest stable version to ensure full compatibility with the latest `types-tabulate` stubs. If issues persist, consider explicitly specifying the `types-tabulate` version or using features like `mypy`'s `--package` flag to manage `typeshed`'s usage.","message":"Older versions of type checkers (like MyPy or Pyright) might bundle an older copy of `typeshed`, the repository where `types-tabulate` stubs originate. This can lead to them not recognizing newer typing features or annotations introduced in more recent `types-tabulate` releases. As a result, your type checker might silently infer `Any` types for parts of `tabulate`'s API or produce unexpected type errors, reducing the effectiveness of static analysis.","severity":"gotcha","affected_versions":"All `types-tabulate` versions when used with outdated type checkers."}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}