|
3 | 3 | MicroPython libraries |
4 | 4 | ===================== |
5 | 5 |
|
| 6 | +Python standard libraries and micro-libraries |
| 7 | +--------------------------------------------- |
| 8 | + |
| 9 | +These libraries are inherited from MicroPython. |
| 10 | +They are similar to the standard Python libraries with the same name |
| 11 | +or with the "u" prefix dropped. |
| 12 | +They implement a subset of or a variant of the corresponding |
| 13 | +standard Python library. |
| 14 | + |
6 | 15 | .. warning:: |
7 | 16 |
|
8 | | - These modules are inherited from MicroPython and may not work in CircuitPython |
9 | | - as documented or at all! If they do work, they may change at any time. |
| 17 | + Though these MicroPython-based libraries are available in CircuitPython, |
| 18 | + their functionality may change in the future, perhaps significantly. |
| 19 | + As CircuitPython continues to develop, new versions of these libraries will |
| 20 | + be created that are more compliant with the standard Python libraries. |
| 21 | + You may need to change your code later if you rely |
| 22 | + on any non-standard functionality they currently provide. |
10 | 23 |
|
| 24 | +CircuitPython's goal long-term goalis that code written in CircuitPython |
| 25 | +using Python standard libraries will be runnable on CPython without changes. |
11 | 26 |
|
12 | | -Python standard libraries and micro-libraries |
13 | | ---------------------------------------------- |
| 27 | +Some libraries below are not enabled on CircuitPython builds with |
| 28 | +limited flash memory, usually on non-Express builds: |
| 29 | +``uerrno``, ``ure``. |
| 30 | + |
| 31 | +Some libraries are not currently enabled in any CircuitPython build, but may be in the future: |
| 32 | +``uio``, ``ujson``, ``uzlib``. |
14 | 33 |
|
| 34 | +Some libraries are only enabled only WiFi-capable ports (ESP8266, nRF) |
| 35 | +because they are typically used for network software: |
| 36 | +``binascii``, ``hashlib``, ``uheapq``, ``uselect``, ``ussl``. |
| 37 | +Not all of these are enabled on all WiFi-capable ports. |
15 | 38 |
|
16 | 39 | .. toctree:: |
17 | 40 | :maxdepth: 1 |
18 | 41 |
|
19 | 42 | builtins.rst |
| 43 | + uheapq.rst |
20 | 44 | array.rst |
21 | | - gc.rst |
22 | | - sys.rst |
23 | 45 | binascii.rst |
24 | 46 | collections.rst |
25 | | - uerrno.rst |
| 47 | + gc.rst |
26 | 48 | hashlib.rst |
27 | | - uheapq.rst |
| 49 | + sys.rst |
| 50 | + uerrno.rst |
28 | 51 | uio.rst |
29 | 52 | ujson.rst |
30 | 53 | ure.rst |
31 | 54 | uselect.rst |
32 | 55 | usocket.rst |
33 | 56 | ussl.rst |
34 | | - ustruct.rst |
35 | 57 | uzlib.rst |
36 | 58 |
|
| 59 | +Omitted functions in the ``string`` library |
| 60 | +------------------------------------------- |
| 61 | + |
| 62 | +A few string operations are not enabled on CircuitPython |
| 63 | +M0 non-Express builds, due to limited flash memory: |
| 64 | +``string.center()``, ``string.partition()``, ``string.splitlines()``, |
| 65 | +``string.reversed()``. |
| 66 | + |
37 | 67 |
|
38 | | -MicroPython-specific libraries |
39 | | ------------------------------- |
| 68 | +CircuitPython/MicroPython-specific libraries |
| 69 | +-------------------------------------------- |
40 | 70 |
|
41 | | -Functionality specific to the MicroPython implementation is available in |
42 | | -the following libraries. |
| 71 | +Functionality specific to the CircuitPython/MicroPython implementation is available in |
| 72 | +the following libraries. These libraries may change signficantly or be removed in future |
| 73 | +versions of CircuitPtyon. |
43 | 74 |
|
44 | 75 | .. toctree:: |
45 | 76 | :maxdepth: 1 |
|
0 commit comments