Command line Application for automating Micropython project setup and management in Visual Studio Code.
Project description
Micropy Cli
Micropy Cli is a project management/generation tool for writing Micropython code in modern IDEs such as VSCode. Its primary goal is to automate the process of creating a workspace complete with:
- Linting compatible with Micropython
- VSCode Intellisense
- Autocompletion
- Dependency Management (WIP)
- VCS Compatibility
Installation
You can download and install the latest version of this software from the Python package index (PyPI) as follows:
pip install --upgrade micropy-cli
Usage
Usage: micropy [OPTIONS] COMMAND [ARGS]...
CLI Application for creating/managing Micropython Projects.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
init Create new Micropython Project
stubs Manage Micropy Stubs
Creating a Project
Creating a new project folder is as simple as:
- Executing
micropy init <PROJECT NAME>
- Selecting your target device/firmware
- Boom. Your workspace is ready.
Stub Management
Stub files are the magic behind how micropy allows features such as linting, Intellisense, and autocompletion to work. To achieve the best results with MicropyCli, its important that you first add the appropriate stubs for the device/firmware your project uses.
Adding Stubs
Adding stubs to Micropy is a breeze. Simply run: micropy stubs add <STUB_NAME>
By sourcing micropy-stubs, MicroPy has several premade stub packages to choose from.
These packages generally use the following naming schema:
<device>-<firmware>-<version>
For example, running micropy stubs add esp32-micropython-1.11.0
will install the following:
- Micropython Specific Stubs
- ESP32 Micropython v1.11 Device Specific Stubs
- Frozen Modules for both device and firmware
You can search stubs that are made available to Micropy via micropy stubs search <QUERY>
Alternatively, using micropy stubs add <PATH>
, you can manually add stubs to Micropy.
For manual stub generation, please see Josvel/micropython-stubber.
Creating Stubs
Using micropy stubs create <PORT/IP_ADDRESS>
, MicropyCli can automatically generate and add stubs from any Micropython device you have on hand. This can be done over both USB and WiFi.
Viewing Stubs
To list stubs you have installed, simply run micropy stubs list
.
To search for stubs for your device, use micropy stubs search <QUERY>
.
Acknowledgements
Micropython-Stubber
Josverl's Repo is full of information regarding Micropython compatibility with VSCode and more. To find out more about how this process works, take a look at it.
micropy-cli and micropy-stubs depend on micropython-stubber for its ability to generate frozen modules, create stubs on a pyboard, and more.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for micropy_cli-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bf7a86a60eb202f7350e9757cad81ba94942e5b18357e8efb33ee20f60b7e51 |
|
MD5 | 3c52c0852f57678f9901d79886f9aef3 |
|
BLAKE2b-256 | f65046d18463b15fe398683bcd0576a7ee1a7f58abc907bae0ccb4b59a69f7a9 |