MicroPython libraries¶
Python standard libraries and micro-libraries¶
The libraries below are inherited from MicroPython. They are similar to the standard Python libraries with the same name. They implement a subset of or a variant of the corresponding standard Python library.
CircuitPython’s long-term goal is that code written in CircuitPython using Python standard libraries will be runnable on CPython without changes.
These libraries are not enabled on CircuitPython builds with
limited flash memory, usually on non-Express builds:
binascii
, errno
, json
, re
.
These libraries are not currently enabled in any CircuitPython build, but may be in the future:
ctypes
, hashlib
, zlib
.
builtins
– builtin functions and exceptionsheapq
– heap queue algorithmarray
– arrays of numeric databinascii
– binary/ASCII conversionscollections
– collection and container typeserrno
– system error codesgc
– control the garbage collectorhashlib
– hashing algorithmsio
– input/output streamsjson
– JSON encoding and decodingre
– simple regular expressionssys
– system specific functionsuasyncio
— asynchronous I/O scheduleructypes
– access binary data in a structured wayselect
– wait for events on a set of streamszlib
– zlib decompression
Omitted functions in the string
library¶
A few string operations are not enabled on small builds
(usually non-Express), due to limited flash memory:
string.center()
, string.partition()
, string.splitlines()
,
string.reversed()
.
CircuitPython/MicroPython-specific libraries¶
Functionality specific to the CircuitPython/MicroPython implementation is available in the following libraries. These libraries may change significantly or be removed in future versions of CircuitPython.