Skip to content

Josverl/micropython-stubs

Repository files navigation

micropython-stubs

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

pencil stubs

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.

Demo using VSCode: demo

To install

  • 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

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.