A set of type stubs for popular Python packages. These are works in progress from the Microsoft Python team and others, with the intent that they are contributed to typeshed or to the associated packages once sufficiently complete.
Перейти к файлу
Graham Wheeler 9789ff0ca8 skimage stubs 2022-12-19 15:29:43 -08:00
.vscode Ran black and isort on pygame and fixed a few other errors caught by pyright. 2020-08-21 17:25:13 -07:00
cv2 [cv2] Completed type stubs for the following functions and their shared parameters: (#112) 2022-04-12 10:01:31 -07:00
django update stubs with latest from pylance (#175) 2022-03-23 09:45:13 -07:00
jmespath update stubs with latest from pylance (#175) 2022-03-23 09:45:13 -07:00
matplotlib Delete README.md 2022-11-30 16:17:27 -08:00
netaddr Create README.md 2020-12-03 13:05:13 -08:00
openpyxl update stubs with latest from pylance (#175) 2022-03-23 09:45:13 -07:00
pendulum Changed from copying original package licenses to READMEs that reference original package locations. 2020-10-30 14:45:30 -07:00
pygame Pandas stub fixes (#129) 2022-01-31 15:39:45 -08:00
scipy-stubs update stubs with latest from pylance (#175) 2022-03-23 09:45:13 -07:00
seaborn-stubs update stubs with latest from pylance (#175) 2022-03-23 09:45:13 -07:00
skimage skimage stubs 2022-12-19 15:29:43 -08:00
sklearn-stubs update stubs with latest from pylance (#175) 2022-03-23 09:45:13 -07:00
sqlalchemy update stubs with latest from pylance (#175) 2022-03-23 09:45:13 -07:00
sympy-stubs Added initial partial sympy-stubs 2021-06-16 15:50:56 -07:00
tenacity Pandas stub fixes (#129) 2022-01-31 15:39:45 -08:00
tests Retire the pandas stubs (#208) 2022-06-02 18:30:05 -07:00
transformers-stubs adding partial stubs for huggingface transformers due to poor perform… (#86) 2021-08-04 21:57:55 -07:00
utils pywin32 upstreamed to typeshed 2022-10-10 13:18:43 -04:00
.gitignore New doc merge tool and stub bundle builder (#142) 2022-02-04 16:29:02 -08:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-07-27 16:50:19 -07:00
CONTRIBUTING.md Create CONTRIBUTING.md 2020-09-21 11:19:46 -07:00
LICENSE Initial LICENSE commit 2020-07-27 16:50:18 -07:00
README.md Alphabetize list of upstreamed libraries 2022-10-10 11:43:16 -07:00
SECURITY.md Initial SECURITY.md commit 2020-07-27 16:50:21 -07:00
pyproject.toml pandas - fixes to 2 methods - change testing paradigm (#171) 2022-02-28 16:45:17 -08:00
pyrighttestconfig.json fix various issues with unknown methods in pandas (#166) 2022-02-22 16:43:07 -08:00

README.md

Python Type Stubs

Introduction

As the Python team, we are helping to ensure that packages have high-quality type annotations. In cases where this must be done through type stubs, we are contributing stubs to typeshed. This repository contains our “work in progress”. Once the stubs for a package meet the requirements of typeshed, we will contribute them to typeshed and delete them from this repository. We also support partial stubs in our tooling in which case the stubs may never graduate from here, but we want to share them publicly so that others can contribute to or make use of what coverage we have.

Our Use of Type Stubs

Microsoft's Python Language Server Pylance uses type information to implement useful features like autocompletion and type checking. For best results, type annotations must be provided for functions, methods and variables.

There are two ways type annotations can be provided — through inline type annotations and through .pyi type stub files, which may be bundled with the package or installed separately from some other source such as typeshed or PyPI. We believe that the best approach for package authors is to have explicit inline type annotations that accurately and completely describe their public interface contract. This allows tools to validate the types for the package authors themselves and reduces the maintenance burden of keeping two separate API definitions in sync. In cases where inline type annotations are not possible (e.g. for compiled libraries), packages should include stub files that describe those portions of the interface.

We recognize that there may be cases where type stubs are more appropriate, such as:

  • Package authors who do not want to include type annotations, and
  • Large, complex packages where adding type annotations can take time, and stubs may be an appropriate intermediate step.

Upstreamed libraries

The following libraries have been contributed upstream (to typeshed or the libraries themselves) and are no longer maintained here:

  • aiofiles
  • cachetools
  • deprecated
  • filelock
  • freezegun
  • markdown
  • packaging
  • pandas (see https://github.com/pandas-dev/pandas-stubs; please open pandas stub issues there)
  • PIL
  • pywin32 (pythonwin, win32 and win32com pakcages)
  • retry
  • slugify

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.