Josverl / micropython-stubs

Stubs of most MicroPython ports, boards and versions to make writing code that much simpler.
https://micropython-stubs.readthedocs.io
MIT License
133 stars 21 forks source link
awesome-micropython micropython mypy mypy-stubs pycharm-ide pylance pylint pyright pyscript static-typing type-checking type-stubs vscode

micropython-stubs

Documentation Status Star on GitHub All Contributors Black Checked with pyright Checked with pyright

<img src="docs/img/colorstubs.jpg" alt="pencil stubs" width=0% height=20% style="float: right; margin-right: 10px;" />

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 :

The stubs are packaged and published to PyPi as Pep 561 stub-only packages to allow them to be installed and used with ease.

Demo using VSCode: demo

To install

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

Current MicroPython stub packages

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

Usage statistics

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.

Contributors

Thanks to everyone that has submitted stubs or other relevant pieces of code and information, or published relevant stubs on pypi or github.

Jos Verlinde
Jos Verlinde

💻 📝 🔧
MicroPython
MicroPython

🔣 📝
Boris Lovosevic
Boris Lovosevic

🔣 📝
Paul Sokolovsky
Paul Sokolovsky

🔣 📝
pycopy
pycopy

🔣 📝
Pycom
Pycom

🚇
Braden Mars
Braden Mars

📝 🔧 📦
Paul Sokolovsky
Paul Sokolovsky

📝
Daryl Stultz
Daryl Stultz

📝
Patrick
Patrick

📝
Callum Jacob Hays
Callum Jacob Hays

💡 🔬
Ronald Hiemstra
Ronald Hiemstra

📝 🖋 📖
Chris Wood
Chris Wood

📝 🔧
thingslu
thingslu

📝
Matin Tat
Matin Tat

Roberto Jose Etcheverry Romero
Roberto Jose Etcheverry Romero

jdsmith
jdsmith

Mr Keuz
Mr Keuz

💻
Matt Trentini
Matt Trentini

📝
Andrew St Clair
Andrew St Clair

📝
Michal Moravec
Michal Moravec

🐛
Paul
Paul

🔧 📝 🐛
Sam Duke
Sam Duke

🐛

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.