Python Standard Library
The standard Python library, when “miniaturized”, becomes the MicroPython standard library. They only provide the core functionality of each module. Some modules do not use the standard Python names directly, but are prefixed with “u”, for example ujson instead of json. That is to say, the MicroPython standard library (= micro library) only implements a subset of module functionality.
Through their different names, users can selectively write a Python-level module to extend functionality, and also achieve better compatibility. (In fact, this is what the micropython-lib project mentioned above does).
On embedded platforms, Python-level wrapper libraries can be added to achieve naming compatibility with CPython. Micro modules can be called by their u-name or non-u-name. Files according to the non-u-name package path can be overridden.
For example, with import json, it first searches for a json.py file or json directory to load.
If not found, it falls back to loading the built-in ujson module.
Builtin– Built-in Functions and Exceptionsarray– arrays of numeric datagc– Garbage Collectionmath– mathematical functionssys– system specific functionsbinascii– binary/ASCII conversionsucollections– Container Data Typeserrno– system error codeshashlib– hashing algorithmsheapq– heap queue algorithmio– input/output streamsjson– JSON encoding and decodingos– basic “operating system” servicesre– simple regular expressionsselect– wait for events on a set of streamsusocket– Socket Modulessl– SSL/TLS modulestruct– pack and unpack primitive data typestime– time related functionszlib– zlib decompression