{"id":1143,"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":"python","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":[{"wrong":"from tabulate_stubs import tabulate","symbol":"tabulate","correct":"from tabulate_stubs 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,"search_vec":"'0.10':117 '0.11.0':36 '2026':40 'accur':108 'ad':94 'aim':105 'align':101 'analyz':83 'annot':109 'check':21,122 'checker':86 'code':77 'correct':92 'current':34,114 'customiz':61 'data':46,49 'datafram':58 'dictionari':55 'e.g':66 'ensur':75 'format':65 'grid':69 'high':60 'html':71 'human':63 'human-read':62 'inform':22 'librari':26,33 'like':51,87 'list':52,54 'march':39 'markdown':70 'mypi':88 'overhead':96 'packag':12,98 'panda':57 'part':13 'plain':67 'popular':31 'pretti':43 'pretty-print':42 'print':44 'project':17 'provid':18,107 'pyright':90 'python':32 'readabl':64 'releas':37,99 'runtim':95 'specif':111 'static':19,82 'structur':50 'stub':2,11,119 'tabul':4,7,25,27,74,79,112,116,123 'tabular':45 'target':115 'text':68 'type':1,6,10,20,73,85,118,121 'type-check':120 'types-tabul':5,72 'typesh':16,103,124 'use':78 'various':48 'version':35,113 'without':93","created_at":"2026-04-05T13:07:32.467951+00:00","updated_at":"2026-04-16T23:46:25.949406+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'tabulate_stubs'"},"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.10.0.20260508","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/typeshed-internal/stub_uploader","docs":null,"changelog":"https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/tabulate.md","pypi":"https://pypi.org/project/types-tabulate/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-27","next_check":"2026-07-10","install_tag":"verified"}}