This repo stores stubs generated by the MicroPython-Stubber tool. Currently over 3.000 stubfiles of multiple MicroPython versionas and modules are available to help you :
- write code quicker
- with less errors,
- get help from code completion,
- use static type checking,
- and improve the overall development experience while writing MicroPython.
The stubs are packaged and published to PyPi as Pep 561 stub-only packages to allow them to be installed and used with ease.
- Install in a typings folder (recommended)
pip install -U micropython-<port>[-<board>]stubs --no-user --target ./typings
- Install in a venv (after activating)
pip install -U micropython-<port>[-<board>]stubs --no-user
Examples:
pip install -U micropython-stm32-stubs
# Install stubs for a specific version.
pip install -U micropython-esp32-stubs==1.20.0.*
# Install stubs for a specific board.
pip install -U micropython-rp2-pico_w-stubs
# install to a typings folder (for use without a .venv by pyright or pylance)
pip install -U micropython-rp2-stubs --target typings --no-user
For more details how to use the stubs please refer to the documentation on RTD
You can search for Micropython stub packages on PyPI
For a full overview of all stubs check out the documentation on read the docs, or in docs/firmware_grp.md
The following graph shows the number of downloads of the stubs from PyPi over time. Im not sure what causes the spikes in downloads, but it is interesting to see that the number of downloads is increasing over time, and some of the spikes have corrolation to the publication of new MicroPython versions.
In addition some tools such as the MicroPico VSCode extension bundle a version of the stubs with their distribution, so the actual usage is higher than the number of downloads.
Thanks to everyone that has submitted stubs or other relevant pieces of code and information, or published relevant stubs on pypi or github.
I invite everyone that has generated stubs for a board or port not on the current list, or has another contribution, to submit the stubs via a pull request or by just zipping up your stubs and creating an issue.
This project follows the all-contributors specification.