micropython-stubs
This repo stores stubs generated by the MicroPython-Stubber tool. Currently over 3.000 stubfiles of common MicroPython modules are available in this repo 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.
Using the MicroPython stubs
in order to get the most out of the MicroPython stubs, you should follow these steps:
- determine which Micropython version and port you are using.
To install the latest stubs:
pip install micropython-<port>-stubs
where port is the port of the MicroPython firmware. ( stm32, eps32,rp2...)
To install the stubs for an older version, such as MicroPython 1.17:
pip install micropython-stm32-stubs==1.17.*
Note that not all ports are published as I do not have access to hardware to run all ports. Please let me know if you would like to see a port added, and are willing to help. Discussions
port | downloads |
---|---|
micropython-stm32-stubs | |
micropython-esp32-stubs | |
micropython-esp8266-stubs | |
micropython-rp2-stubs |
What do you get
-
micropython-<port>[-<board>]-stubs
The stubs for a specific version port and board of the MicroPython firmware. These are built by combining:- The 'Firmware stubs' generated on a generic board for the port
- The 'Frozen stubs' from the Micropython repository for that specific version and that port & board combination
- The 'Core Stubs' to provide a common interface for the Micropython firmware and the CPython core.
Note: board is omitted if it is
GENERIC
Examples:
- micropython-stm32-stubs
- micropython-esp32-stubs
- micropython-rp2-stubs
- micropython-esp8266-stubs
Then in VSCode press : F1
and select Python: Restart language server
(only needed once)
You can search for Micropython stub packages on PyPI
List of current firmwares and stubs
The list of the current included firmwares, ports and boards includes stubs from the following micropython families:
-
MicroPython
-
Pycopy
-
Loboris port (ESP32)
-
LVGL
-
EV3 / Lego
-
M5Stack
For a full overview of all stubs check out the documentation on read the docs, or in docs/firmware_grp.md
Using the stubs
To learn how to use the stubs please refer to the documentation on RTD
Branch Main
The name of the default branch has been changed to main
.
For more info see Renaming a branch
Contributors
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.