As an open-source project, pandas-dev/pandas-stubs has picked up 331 stars on GitHub (Python). Public type stubs for pandas
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
These are public type stubs for pandas, following the
convention of providing stubs in a separate package, as specified in PEP 561. The stubs cover the most typical use cases of
pandas. In general, these stubs are narrower than what is possibly allowed by pandas,
but follow a convention of suggesting best recommended practices for using pandas.
The stubs are likely incomplete in terms of covering the published API of pandas.
The stubs are tested with mypy,
pyright and
pyrefly, and are currently shipped with the Visual Studio Code extension
pylance.
Usage
Let’s take this example piece of code in file round.py
Mypy won't see any issues with that, but after installing pandas-stubs and running it again:
mypy round.py
we get the following error message:
round.py:6: error: Argument "decimals" to "round" of "DataFrame" has incompatible type "DataFrame"; expected "Union[int, Dict[Any, Any], Series]" [arg-type]
Found 1 error in 1 file (checked 1 source file)
And, if you use pyright:
pyright round.py
you get the following error message:
round.py:6:40 - error: Argument of type "DataFrame" cannot be assigned to parameter "decimals" of type "int | Dict[Unknown, Unknown] | Series[Unknown]" in function "round"
Type "DataFrame" cannot be assigned to type "int | Dict[Unknown, Unknown] | Series[Unknown]"
"DataFrame" is incompatible with "int"
"DataFrame" is incompatible with "Dict[Unknown, Unknown]"
"DataFrame" is incompatible with "Series[Unknown]" (reportGeneralTypeIssues)
And after confirming with the docs
we can fix the code:
decimals = pd.Series({'TSLA': 2, 'AMZN': 1})
Versioning
The version number of pandas-stubs follows the format x.y.z.yymmdd, where:
x.y.z: The version of pandas this release was tested against (e.g., 3.0.0 for pandas 3.0.0).
yymmdd: The release date of the stubs (year, month, day).
It is anticipated that the stubs will be released more frequently than pandas as the stubs are expected to evolve due to more
public visibility.
Compatibility with pandas
No strict dependency: pandas-stubs does not enforce a dependency on a specific pandas version. This allows you to use newer stubs with older pandas versions for forward compatibility.
Recommended usage:
Use the latest pandas-stubs to catch deprecations and API changes early, even if your pandas version is older.
If you pin pandas, pin pandas-stubs to the same major/minor version (e.g., pandas==2.3.3 → pandas-stubs==2.3.3.*) to avoid inconsistencies.
Why?
The stubs help you write code compatible with future pandas versions. Type checkers will flag deprecated or removed APIs based on the pandas version the stubs were tested against.
[!NOTE]
Using a newer version of the stubs in conjunction with an older version of pandas
Will cause type checkers to allow you to see which APIs will be deprecated or removed in a future version
Will cause type checkers to consider code to be acceptable that uses newer or changed API's in current versions of pandas, such that the code would fail at runtime with an older version of
pandas
Where to get it
The source code is currently hosted on GitHub at: https://github.com/pandas-dev/pandas-stubs
Binary installers for the latest released version are available at the Python
Package Index (PyPI) and on conda-forge.
# conda
conda install pandas-stubs
# or PyPI
pip install pandas-stubs
Dependencies
pandas: powerful Python data analysis toolkit
typing-extensions >= 4.5.0 - supporting the latest typing extensions
Installation from sources
Make sure you have python >= 3.11 installed.
Install poetry
# conda
conda install poetry
# or PyPI
pip install 'poetry>=2.0'
Install the project dependencies
poetry update -vvv
Build and install the distribution
poetry run poe build_dist
poetry run poe install_dist
License
BSD 3
Documentation
Documentation is a work-in-progress.
Background
These stubs are the result of a strategic effort led by the core pandas team to integrate Microsoft type stub repository with the VirtusLabs pandas_stubs repository.
These stubs were initially forked from the Microsoft project at https://github.com/microsoft/python-type-stubs as of this commit.
We are indebted to Microsoft and that project for providing the initial set of public type stubs. We are also grateful for the original pandas-stubs project at https://github.com/VirtusLab/pandas-stubs, which created the framework for testing the stubs.
Differences between type declarations in pandas and pandas-stubs
The https://github.com/pandas-dev/pandas/ project has type declarations for some parts of pandas, both for the internal and public API's. Those type declarations are used to make sure that the pandas code is internally consistent.
The https://github.com/pandas-dev/pandas-stubs/ project provides type declarations for the pandas public API. The philosophy of these stubs can be found at https://github.com/pandas-dev/pandas-stubs/blob/main/docs/philosophy.md/. While it would be ideal if the pyi files in this project would be part of the pandas distribution, this would require consistency between the internal type declarations and the public declarations, and the scope of a project to create that consistency is quite large. That is a long term goal. Finally, another goal is to do more frequent releases of the pandas-stubs than is done for pandas, in order to make the stubs more useful.
If issues are found with the public stubs, pull requests to correct those issues are welcome. In addition, pull requests on the pandas repository to fix the same issue are welcome there as well. However, since the goals of typing in the two projects are different (internal consistency vs. public usage), it may be a challenge to create consistent type declarations across both projects. See https://pandas.pydata.org/docs/development/contributing_codebase.html#type-hints for a discussion of typing standards used within the pandas code.
Getting help
Ask questions and report issues on the pandas-stubs repository.
Discussion and Development
Most development discussions take place on GitHub in the pandas-stubs repository.
Further, the pandas-dev mailing list can also be used for specialized discussions or design issues, and a Slack channel is available for quick development related questions.
There are also frequent community meetings for project maintainers open to the community as well as monthly new contributor meetings to help support new contributors.
Additional information on the communication channels can be found on the contributor community page.
Contributing to pandas-stubs
All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. See https://github.com/pandas-dev/pandas-stubs/tree/main/docs/ for instructions.
Does pandas-dev/pandas-stubs have a project website?
No homepage URL was recorded for pandas-dev/pandas-stubs in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Does pandas-dev/pandas-stubs have any tags?
TopGit's last sync did not record any GitHub topics for pandas-dev/pandas-stubs. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on pandas-dev/pandas-stubs?
The most recent commit recorded on pandas-dev/pandas-stubs was 13 days ago, based on the GitHub push timestamp. The repository has 211 forks — one of the better signals of community interest.
Is pandas-dev/pandas-stubs open source?
Yes — pandas-dev/pandas-stubs ships under the BSD-3-Clause license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/pandas-dev/pandas-stubs.
What license does pandas-dev/pandas-stubs use?
pandas-dev/pandas-stubs is released under the BSD-3-Clause license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about pandas-dev/pandas-stubs?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/pandas-dev/pandas-stubs is the definitive source.
Read full README in the tab above.
Curious whether pandas-stubs is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about pandas-stubs.