Python Standard Library
MicroPython provides built-in modules with functionality similar to the Python standard library (for example os and time), as well as MicroPython-specific modules (for example bluetooth and machine). Most Python standard library modules implement a subset of the equivalent Python module’s functionality, and in a few cases provide some MicroPython-specific extensions (for example array and os).
Due to resource constraints or other limitations, some ports or firmware versions may not include all the functionality documented here.
To allow extension, some built-in modules can be extended from Python code loaded into the device’s file system.
The following are standard Python libraries that have been “miniaturized” to conform to the MicroPython philosophy. They provide the core functionality of the module and are intended as direct replacements for the standard Python libraries.
array– arrays of numeric dataasyncio— asynchronous I/O schedulerbinascii– Convert between binary and ASCIIBuiltin– Built-in functions and exceptionscmath— Complex math functionscollections– Container datatypeserrno– system error codesgc– control the garbage collectorgzip– gzip compression & decompressionhashlib– hashing algorithmsheapq– heap queue algorithmio– input/output streamsjson– JSON encoding and decodingmarshal— Serialize Python objectsmath– mathematical functionsos– Basic operating systemplatform— Access underlying platform identification datarandom— Generate random numbersre– simple regular expressionsselect– wait for events on a set of streamssocket– socket modulessl– SSL/TLS modulestruct– pack and unpack primitive data typessys– system specific functionstime– time related functionszlib– zlib compression & decompression_thread— Threading