Python standard libraries and micro-libraries¶
These libraries are inherited from MicroPython. They are similar to the standard Python libraries with the same name or with the “u” prefix dropped. They implement a subset of or a variant of the corresponding standard Python library.
Though these MicroPython-based libraries are available in CircuitPython, their functionality may change in the future, perhaps significantly. As CircuitPython continues to develop, new versions of these libraries will be created that are more compliant with the standard Python libraries. You may need to change your code later if you rely on any non-standard functionality they currently provide.
CircuitPython’s goal long-term goalis that code written in CircuitPython using Python standard libraries will be runnable on CPython without changes.
Some libraries below are not enabled on CircuitPython builds with
limited flash memory, usually on non-Express builds:
Some libraries are not currently enabled in any CircuitPython build, but may be in the future:
Some libraries are only enabled only WiFi-capable ports (ESP8266, nRF)
because they are typically used for network software:
Not all of these are enabled on all WiFi-capable ports.
- Builtin functions and exceptions
uheapq– heap queue algorithm
array– arrays of numeric data
binascii– binary/ASCII conversions
collections– collection and container types
gc– control the garbage collector
hashlib– hashing algorithms
sys– system specific functions
uerrno– system error codes
uio– input/output streams
ujson– JSON encoding and decoding
ure– simple regular expressions
uselect– wait for events on a set of streams
usocket– socket module
ussl– SSL/TLS module
uzlib– zlib decompression
Omitted functions in the
A few string operations are not enabled on CircuitPython
M0 non-Express builds, due to limited flash memory:
Functionality specific to the CircuitPython/MicroPython implementation is available in the following libraries. These libraries may change signficantly or be removed in future versions of CircuitPython.