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.
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:
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:
To install the stubs for a specific port , such as the ESP32 UM-TinyPico:
Note: PyPi transforms all names to smallcaps and kebab-case, not snake_case.
Simple overview of the published ports and boards.
STM32 | ESP32 | ESP8266 | RP2040 | |
---|---|---|---|---|
GENERIC | ||||
|
Notes:
- Not all possible ports/boards are published as I do not have access to hardware to run all ports.
- newly published stubs may show as 'not found', please check PyPi directly
- Please let me know if you would like to see a port or board added, and are willing to help in validation. Discussions
-
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
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
To learn how to use the stubs please refer to the documentation on RTD
The name of the default branch has been changed to main
.
For more info see Renaming a branch
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.