Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Josverl/micropython-stubs
Stubs of most MicroPython ports, boards and versions to make writing code that much simpler.
https://github.com/Josverl/micropython-stubs
awesome-micropython micropython mypy mypy-stubs pycharm-ide pylance pylint pyright pyscript static-typing type-checking type-stubs vscode
Last synced: 2 months ago
JSON representation
Stubs of most MicroPython ports, boards and versions to make writing code that much simpler.
- Host: GitHub
- URL: https://github.com/Josverl/micropython-stubs
- Owner: Josverl
- License: mit
- Created: 2020-10-17T21:11:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-05T05:03:00.000Z (3 months ago)
- Last Synced: 2024-04-06T02:43:31.750Z (3 months ago)
- Topics: awesome-micropython, micropython, mypy, mypy-stubs, pycharm-ide, pylance, pylint, pyright, pyscript, static-typing, type-checking, type-stubs, vscode
- Language: Python
- Homepage: https://micropython-stubs.readthedocs.io
- Size: 48.1 MB
- Stars: 112
- Watchers: 5
- Forks: 19
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Lists
- awesome-micropython - micropython-stubs - Stubs of most MicroPython ports, boards and versions to make writing code that much simpler. (Development / Code Generation)
README
# micropython-stubs
[![Documentation Status](https://readthedocs.org/projects/micropython-stubs/badge/?version=latest)](https://micropython-stubs.readthedocs.io/en/latest/?badge=latest "Document build status badge")
[![Star on GitHub](https://img.shields.io/github/stars/josverl/micropython-stubs.svg?style=social)](https://github.com/josverl/micropython-stubs/stargazers)
[![All Contributors](https://img.shields.io/badge/all_contributors-19-green.svg?style=flat-square)](#Contributions)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black "Black badge")
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
[![Checked with pyright](https://github.com/Josverl/micropython-stubs/actions/workflows/test_stub_quality.yml/badge.svg?branch=main)](https://microsoft.github.io/pyright/)
This repo stores stubs generated by the [MicroPython-Stubber](https://github.com/Josverl/micropython-stubber#readme) 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](https://micropython.org/).The stubs are packaged and published to PyPi as [Pep 561 stub-only](https://peps.python.org/pep-0561/#stub-only-packages) packages to allow them to be installed and used with ease.
**Demo using VSCode:**
![demo](docs/img/demo.gif)## To install
- Install in a typings folder (recommended)
`pip install -U micropython-[-]stubs --no-user --target ./typings`
- Install in a venv (after activating)
`pip install -U micropython-[-]stubs --no-user`Examples:
``` bash
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](https://micropython-stubs.readthedocs.io/en/latest/20_using.html)
## Current MicroPython stub packages
You can search for [Micropython stub packages on PyPI][PYPI]
For a full overview of all stubs check out [the documentation on read the docs](https://micropython-stubs.readthedocs.io/en/latest/firmware_grp.html), or in [docs/firmware_grp.md](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](https://marketplace.visualstudio.com/items?itemName=paulober.pico-w-go) 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
💻 📝 ✔ 🔧
MicroPython
🔣 📝
Boris Lovosevic
🔣 📝
Paul Sokolovsky
🔣 📝
pycopy
🔣 📝
Pycom
🚇
Braden Mars
📝 ✔ 🔧 📦
Paul Sokolovsky
📝
Daryl Stultz
📝
Patrick
✔ 📝
Callum Jacob Hays
💡 🔬
Ronald Hiemstra
📝 🖋 📖
Chris Wood
📝 🔧
thingslu
📝 ✔
Matin Tat
✔
Roberto Jose Etcheverry Romero
✔
jdsmith
✔
Mr Keuz
💻 ✔
Matt Trentini
📝
Andrew St Clair
📝
Michal Moravec
🐛
Paul
🔧 📝 🐛
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](https://github.com/all-contributors/all-contributors) specification.
[samples]: https://github.com/josverl/micropython-stubs/tree/main/docs/samples
[Discussions]: https://github.com/Josverl/micropython-stubs/discussions/categories/ideas
[PYPI]: https://pypi.org/search/?q=-stubs&o=&c=Programming+Language+%3A%3A+Python+%3A%3A+Implementation+%3A%3A+MicroPython