Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/microbit-foundation/micropython-microbit-stubs
Type stubs for MicroPython for micro:bit to support the micro:bit Python Editor V3
https://github.com/microbit-foundation/micropython-microbit-stubs
micropython python
Last synced: about 1 month ago
JSON representation
Type stubs for MicroPython for micro:bit to support the micro:bit Python Editor V3
- Host: GitHub
- URL: https://github.com/microbit-foundation/micropython-microbit-stubs
- Owner: microbit-foundation
- License: other
- Created: 2021-08-05T14:06:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T13:52:48.000Z (8 months ago)
- Last Synced: 2024-04-22T20:22:26.161Z (8 months ago)
- Topics: micropython, python
- Language: Python
- Homepage: https://python.microbit.org/
- Size: 1000 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# micro:bit MicroPython stubs for editor support
This project contains Python stub files for [MicroPython for micro:bit V2](https://github.com/microbit-foundation/micropython-microbit-v2).
The easiest way to try these type stubs is to use the online [micro:bit Python Editor](https://python.microbit.org) which uses them for its code intelligence features and the API documentation.
## Licensing
These stubs are MIT or Apache 2.0 licensed depending on their origin (typeshed or MicroPython).
See [LICENSE.md](./LICENSE.md) for details.## Translations
We maintain translations of these files in the [micro:bit Crowdin project](https://crowdin.com/project/microbitorg) in [this file](https://crowdin.com/translate/microbitorg/6422). Only changes to the English source should be made in this repository.
The source content is in English in `lang/en`.
The translated versions are periodically updated in this repository via a script.
We translate:
- First lines of all docstrings
- First lines of parameter documentation in `:param name:`-style
- The API name, e.g. function name, with underscores replaced with spaces to make clear it's a hint not the actual name. This is displayed alongside the English API name.
- Parameter names (again with underscores replaced). These are displayed alongside the English parameter name.## Scripts
`browser-package.py` packages the typeshed and a Pyright config file in a JSON format that can be consumed by the [Python Editor V3 project](https://github.com/microbit-foundation/python-editor-v3). A file is created per language.
## Testing
The stubs are tested against the code in the `examples/` folder using Pyright. To run the tests locally run `npm install` to install Pyright and then `npm test`.
## Code of Conduct
Trust, partnership, simplicity and passion are our core values we live and
breathe in our daily work life and within our projects. Our open-source
projects are no exception. We have an active community which spans the globe
and we welcome and encourage participation and contributions to our projects
by everyone. We work to foster a positive, open, inclusive and supportive
environment and trust that our community respects the micro:bit code of
conduct. Please see our [code of conduct](https://microbit.org/safeguarding/)
which outlines our expectations for all those that participate in our
community and details on how to report any concerns and what would happen
should breaches occur.