This is a repository of libraries designed to be useful for writing MicroPython applications.
 
 
Go to file
Jim Mussared a363ac6b21 micropython/mip: Add command-line functionality for the Unix port.
Moves mip.py to mip/__init__.py, so that the optional (added in this
commit) mip/__main__.py can exist to support:

`micropython -m mip install [--target,--index,--no-mpy] package@version`

"install" works by forwarding the arguments directly to mip.install.

Updates mip to v0.2.0 because of the change in directory structure.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-11-09 12:43:04 +11:00
.github/workflows workflows: Add initial GitHub workflows support, with code formatting. 2021-05-27 22:42:43 +10:00
micropython micropython/mip: Add command-line functionality for the Unix port. 2022-11-09 12:43:04 +11:00
python-ecosys all: Replace metadata.txt with manifest.py. 2022-09-05 17:50:28 +10:00
python-stdlib unittest: Make AssertRaisesContext store exception for later retrieval. 2022-10-04 12:28:43 +11:00
tools tools/build.py: Make build.py work without f-strings. 2022-09-29 23:51:03 +10:00
unix-ffi unittest: Move back to python-stdlib. 2022-09-13 09:57:04 +10:00
.gitignore
CONTRIBUTING.md
LICENSE
README.md micropython/mip: Add a new `mip` library for on-device installation. 2022-09-29 22:54:32 +10:00

README.md

micropython-lib

This is a repository of libraries designed to be useful for writing MicroPython applications.

The libraries here fall into four categories corresponding to the four top-level directories:

  • python-stdlib: Compatible versions of modules from the Python Standard Library. These should be drop-in replacements for the Python libraries, although many have reduced functionality or missing methods or classes (which may not be an issue for many most cases).

  • python-ecosys: Compatible, but reduced-functionality versions of modules from the larger Python ecosystem, for example that might be found in the Python Package Index.

  • micropython: MicroPython-specific modules that do not have equivalents in other Python environments. These are typically hardware drivers or highly-optimised alternative implementations of functionality available in other Python modules.

  • unix-ffi: These modules are specifically for the MicroPython Unix port and provide access to operating-system and third-party libraries via FFI.

Usage

Many libraries are self contained modules, and you can quickly get started by copying the relevant Python file to your device. For example, to add the base64 library, you can directly copy python-stdlib/base64/base64.py to the lib directory on your device.

Other libraries are packages, in which case you'll need to copy the directory instead. For example, to add collections.defaultdict, copy collections/collections/__init__.py and collections.defaultdict/collections/defaultdict.py to a directory named lib/collections on your device.

Future plans (and new contributor ideas)

  • Develop a set of example programs using these libraries.
  • Develop more MicroPython libraries for common tasks.