Skip to content

A collection of stub files for some python projects. Can be used with VSCode to get better language service experience.

License

Notifications You must be signed in to change notification settings

hamdanal/python-stubs

Repository files navigation

python-stubs

This repository provides stubs for some python packages that do not offer proper type hints and have no stubs available. The main goal is to provide helpers for VSCode's Pylance language server to offer better autocompletion. Another goal is to improve the performance of VSCode's python extension where it suffers from slow downs with some packages (For example, installing pandapower without the stubs, python analysis in VSCode takes up to 7 seconds to complete on every change).

Usage

  1. Clone the repository:
    git clone https://github.com/hamdanal/python-stubs /path/to/python-stubs
  2. Add the stubs to "extraPaths" in your VSCode's settings.json:
    "python.analysis.extraPaths": ["/path/to/python-stubs/stubs"]

Contributing

Contributions of any kind are welcome. Please open an issue or a send pull request.

To set up a development environment:

  1. Create a virtual environment: python -m .venv venv
  2. Activate the virtual environment:
    • Unix: . .venv/bin/activate
    • Windows: .venv\Scripts\activate
  3. Install the dependencies: python -m pip install -r requirements-tests.txt

Run python run.py --help for more.

License

This project is licensed under the MIT License.

List of available stubs

Project Import name Links Status Type-checked Tested
django-netfields netfields PyPI, GitHub Complete Yes No
django-postgres-extra psqlextra PyPI, GitHub Incomplete Yes No
pandapower pandapower PyPI, GitHub Incomplete Yes No
geopandas geopandas PyPI, GitHub Complete Yes Yes

Upstreamed stubs

These stubs were included here in the past and have been moved to typeshed or to the their libraries.

Project Moved to Installation
seaborn typeshed pip install types-seaborn
shapely typeshed pip install types-shapely

About

A collection of stub files for some python projects. Can be used with VSCode to get better language service experience.

Topics

Resources

License

Stars

Watchers

Forks

Languages