This is a repository of libraries designed to be useful for writing MicroPython applications.
 
 
Go to file
Jim Mussared f3cfc52ab0 unix-ffi: Move more unix-only packages to unix-ffi.
With the dependencies captured in manifest.py, several packages in
python-stdlib were still unix-only due to direct or transitive dependencies
on unix-only or ffi modules.  Or they just make no sense to run on
microcontroller targets.

In a few cases (e.g. base64) where possible, the unix dependency could be
removed.

Updates manifest.py to use the `unix_ffi=True` arg to `require()` for these
libraries.

Rename re-pcre to re now that unix-ffi is effectively its own namespace.

Update unix-ffi/README.md, and strengthen the wording that the unix
libraries are unmaintained.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-05 17:50:42 +10:00
.github/workflows workflows: Add initial GitHub workflows support, with code formatting. 2021-05-27 22:42:43 +10:00
micropython unix-ffi: Move more unix-only packages to unix-ffi. 2022-09-05 17:50:42 +10:00
python-ecosys all: Replace metadata.txt with manifest.py. 2022-09-05 17:50:28 +10:00
python-stdlib unix-ffi: Move more unix-only packages to unix-ffi. 2022-09-05 17:50:42 +10:00
tools tools/codeformat: Fix compatibility running from subfolder in repo. 2022-03-23 12:16:24 +11:00
unix-ffi unix-ffi: Move more unix-only packages to unix-ffi. 2022-09-05 17:50:42 +10:00
.gitignore .gitignore: Ignore local development files. 2014-05-31 15:18:48 +03:00
CONTRIBUTING.md CONTRIBUTING.md: Add file with a link to Contributor Guidelines. 2015-05-03 21:07:17 +03:00
LICENSE all: Update READMEs. 2021-05-27 15:41:08 +10:00
README.md python-ecosys: Move urequests to python-ecosys. 2021-05-27 16:53:02 +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)

  • Provide compiled .mpy distributions.
  • Develop a set of example programs using these libraries.
  • Develop more MicroPython libraries for common tasks.
  • Provide a replacement for the previous upip tool.