Home

Awesome

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.

<table> <tr> <td><img src="statistics/month_port.png"></td> <td><img src="statistics/month_version.png"> </td> </tr> <tr> <td><img src="statistics/pie_port.png"> </td> <td><img src="statistics/board_version.png"> </td> </tr> </table>

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.

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Josverl"><img src="https://avatars2.githubusercontent.com/u/981654?v=4?s=100" width="100px;" alt="Jos Verlinde"/><br /><sub><b>Jos Verlinde</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubs/commits?author=josverl" title="Code">💻</a> <a href="#stubs-josverl" title="MicroPython stubs">📝</a> <a href="#test-josverl" title="Test">✔</a> <a href="#tool-josverl" title="Tools">🔧</a></td> <td align="center" valign="top" width="14.28%"><a href="https://micropython.org/"><img src="https://avatars1.githubusercontent.com/u/6298560?v=4?s=100" width="100px;" alt="MicroPython"/><br /><sub><b>MicroPython</b></sub></a><br /><a href="#data-micropython" title="Data">🔣</a> <a href="#stubs-micropython" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/loboris"><img src="https://avatars3.githubusercontent.com/u/6280349?v=4?s=100" width="100px;" alt="Boris Lovosevic"/><br /><sub><b>Boris Lovosevic</b></sub></a><br /><a href="#data-loboris" title="Data">🔣</a> <a href="#stubs-loboris" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/pfalcon"><img src="https://avatars3.githubusercontent.com/u/500451?v=4?s=100" width="100px;" alt="Paul Sokolovsky"/><br /><sub><b>Paul Sokolovsky</b></sub></a><br /><a href="#data-pfalcon" title="Data">🔣</a> <a href="#stubs-pfalcon" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/pycopy"><img src="https://avatars0.githubusercontent.com/u/67273174?v=4?s=100" width="100px;" alt="pycopy"/><br /><sub><b>pycopy</b></sub></a><br /><a href="#data-pycopy" title="Data">🔣</a> <a href="#stubs-pycopy" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/pycom"><img src="https://avatars2.githubusercontent.com/u/16415153?v=4?s=100" width="100px;" alt="Pycom"/><br /><sub><b>Pycom</b></sub></a><br /><a href="#infra-pycom" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/BradenM"><img src="https://avatars1.githubusercontent.com/u/5913808?v=4?s=100" width="100px;" alt="Braden Mars"/><br /><sub><b>Braden Mars</b></sub></a><br /><a href="#stubs-BradenM" title="MicroPython stubs">📝</a> <a href="#test-BradenM" title="Test">✔</a> <a href="#tool-BradenM" title="Tools">🔧</a> <a href="#platform-BradenM" title="Packaging/porting to new platform">📦</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/pfalcon"><img src="https://avatars3.githubusercontent.com/u/500451?v=4?s=100" width="100px;" alt="Paul Sokolovsky"/><br /><sub><b>Paul Sokolovsky</b></sub></a><br /><a href="#stubs-pfalcon" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/dastultz"><img src="https://avatars3.githubusercontent.com/u/4334042?v=4?s=100" width="100px;" alt="Daryl Stultz"/><br /><sub><b>Daryl Stultz</b></sub></a><br /><a href="#stubs-dastultz" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="http://patrickwalters.us/"><img src="https://avatars0.githubusercontent.com/u/4002194?v=4?s=100" width="100px;" alt="Patrick"/><br /><sub><b>Patrick</b></sub></a><br /><a href="#test-askpatrickw" title="Test">✔</a> <a href="#stubs-askpatrickw" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="http://comingsoon.tm/"><img src="https://avatars0.githubusercontent.com/u/13251689?v=4?s=100" width="100px;" alt="Callum Jacob Hays"/><br /><sub><b>Callum Jacob Hays</b></sub></a><br /><a href="#example-CallumJHays" title="Examples">💡</a> <a href="#research-CallumJHays" title="Research">🔬</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/RonaldHiemstra"><img src="https://avatars.githubusercontent.com/u/17012831?v=4?s=100" width="100px;" alt="Ronald Hiemstra"/><br /><sub><b>Ronald Hiemstra</b></sub></a><br /><a href="#stubs-ronaldHiemstra" title="MicroPython stubs">📝</a> <a href="#content-ronaldHiemstra" title="Content">🖋</a> <a href="https://github.com/Josverl/micropython-stubs/commits?author=ronaldHiemstra" title="Documentation">📖</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/cpwood"><img src="https://avatars.githubusercontent.com/u/13966104?v=4?s=100" width="100px;" alt="Chris Wood"/><br /><sub><b>Chris Wood</b></sub></a><br /><a href="#stubs-cpwood" title="MicroPython stubs">📝</a> <a href="#tool-cpwood" title="Tools">🔧</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/thingslu"><img src="https://avatars.githubusercontent.com/u/34967785?v=4?s=100" width="100px;" alt="thingslu"/><br /><sub><b>thingslu</b></sub></a><br /><a href="#stubs-thingslu" title="MicroPython stubs">📝</a> <a href="#test-thingslu" title="Test">✔</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/WerdoxDev"><img src="https://avatars.githubusercontent.com/u/32638453?v=4?s=100" width="100px;" alt="Matin Tat"/><br /><sub><b>Matin Tat</b></sub></a><br /><a href="#test-WerdoxDev" title="Test">✔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/robertoetcheverryr"><img src="https://avatars.githubusercontent.com/u/63941860?v=4?s=100" width="100px;" alt="Roberto Jose Etcheverry Romero"/><br /><sub><b>Roberto Jose Etcheverry Romero</b></sub></a><br /><a href="#test-robertoetcheverryr" title="Test">✔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/jdsmith"><img src="https://avatars.githubusercontent.com/u/1379246?v=4?s=100" width="100px;" alt="jdsmith"/><br /><sub><b>jdsmith</b></sub></a><br /><a href="#test-jdsmith" title="Test">✔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/mrkeuz"><img src="https://avatars.githubusercontent.com/u/6247921?v=4?s=100" width="100px;" alt="Mr Keuz"/><br /><sub><b>Mr Keuz</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubs/commits?author=mrkeuz" title="Code">💻</a> <a href="#test-mrkeuz" title="Test">✔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/mattytrentini"><img src="https://avatars.githubusercontent.com/u/194201?v=4?s=100" width="100px;" alt="Matt Trentini"/><br /><sub><b>Matt Trentini</b></sub></a><br /><a href="#stubs-mattytrentini" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="https://andrew-stclair.com/"><img src="https://avatars.githubusercontent.com/u/4944499?v=4?s=100" width="100px;" alt="Andrew St Clair"/><br /><sub><b>Andrew St Clair</b></sub></a><br /><a href="#stubs-andrew-stclair" title="MicroPython stubs">📝</a></td> <td align="center" valign="top" width="14.28%"><a href="https://gitlab.com/michal.moravec"><img src="https://avatars.githubusercontent.com/u/24276?v=4?s=100" width="100px;" alt="Michal Moravec"/><br /><sub><b>Michal Moravec</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubs/issues?q=author%3Amishal" title="Bug reports">🐛</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/paulober"><img src="https://avatars.githubusercontent.com/u/44974737?v=4?s=100" width="100px;" alt="Paul"/><br /><sub><b>Paul</b></sub></a><br /><a href="#tool-paulober" title="Tools">🔧</a> <a href="#stubs-paulober" title="MicroPython stubs">📝</a> <a href="https://github.com/Josverl/micropython-stubs/issues?q=author%3Apaulober" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/samskiter"><img src="https://avatars.githubusercontent.com/u/1271643?v=4?s=100" width="100px;" alt="Sam Duke"/><br /><sub><b>Sam Duke</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubs/issues?q=author%3Asamskiter" title="Bug reports">🐛</a></td> </tr> </tbody> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

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.