micropython-lib/python-stdlib
Andrew Leech 5329ef5301 logging: Add full support for logging exception tracebacks.
This commit allows you to pass an exception object in as the exc_info kwarg
(CPython allows this), so logging exceptions can work even if the
MICROPY_PY_SYS_EXC_INFO option is disabled in the firmware.

Separately to that, currently even when sys.exc_info() is enabled, it's
only printing the traceback to _stream = sys.stderr - not to the configured
logging handlers.  This means for instance if you've got a file log
handler it misses out on the tracebacks.  That's also fixed in this commit.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2023-07-21 17:01:42 +10:00
..
__future__
abc
argparse
base64
binascii
bisect bisect: Add manifest file. 2023-07-21 16:58:48 +10:00
cmd cmd: Remove comments about using the string module. 2023-07-21 15:28:14 +10:00
collections collections: Rename collections.* to collections-*. 2022-09-13 14:31:24 +10:00
collections-defaultdict collections: Rename collections.* to collections-*. 2022-09-13 14:31:24 +10:00
collections-deque collections: Rename collections.* to collections-*. 2022-09-13 14:31:24 +10:00
contextlib top: Update Python formatting to black "2023 stable style". 2023-02-03 17:12:38 +11:00
copy top: Update Python formatting to black "2023 stable style". 2023-02-03 17:12:38 +11:00
curses.ascii
datetime
errno
fnmatch
functools
gzip
hashlib hashlib: Refactor, split, and optimise. 2023-07-20 23:28:08 +10:00
hashlib-core hashlib: Refactor, split, and optimise. 2023-07-20 23:28:08 +10:00
hashlib-sha224 hashlib: Refactor, split, and optimise. 2023-07-20 23:28:08 +10:00
hashlib-sha256 hashlib: Refactor, split, and optimise. 2023-07-20 23:28:08 +10:00
hashlib-sha384 hashlib: Refactor, split, and optimise. 2023-07-20 23:28:08 +10:00
hashlib-sha512 hashlib: Refactor, split, and optimise. 2023-07-20 23:28:08 +10:00
heapq
hmac
html
inspect
io
itertools
json json: Add manifest file. 2023-07-21 16:58:48 +10:00
keyword keyword: Add manifest file. 2023-07-21 16:58:48 +10:00
locale
logging logging: Add full support for logging exception tracebacks. 2023-07-21 17:01:42 +10:00
operator
os os: Import `path` automatically if available. 2022-09-13 14:31:24 +10:00
os-path os.path: Remove external / ffi dependencies in os.path. 2022-09-30 17:51:06 +10:00
pathlib pathlib: Add initial pathlib implementation. 2022-11-17 14:26:33 +11:00
pickle
pkg_resources
pkgutil
pprint
quopri
random
shutil shutil: Add unit tests for shutil. 2022-11-11 13:04:16 +11:00
ssl
stat
string
struct
tempfile tempfile: Add manifest.py file at version 0.0.1. 2022-11-11 13:05:04 +11:00
textwrap top: Update Python formatting to black "2023 stable style". 2023-02-03 17:12:38 +11:00
threading
time time: Add unit test for time.strftime. 2022-12-14 11:57:55 +11:00
traceback
types types: Add manifest file. 2023-07-21 16:58:48 +10:00
unittest unittest-discover: Print results when no tests are found/run. 2023-03-27 12:06:04 +11:00
unittest-discover unittest-discover: Print results when no tests are found/run. 2023-03-27 12:06:04 +11:00
uu uu: Fix dependency on os-path. 2022-09-28 00:58:35 +10:00
venv venv: Add a command-line package for creating virtual environments. 2022-11-09 12:52:03 +11:00
warnings
README.md top: Update top-level docs. 2022-12-16 17:16:03 +11:00

README.md

CPython Standard Library

The packages in this directory aim to provide compatible implementations of modules from the Python Standard Library, with the goal of allowing existing Python code to run un-modified on MicroPython.

Implementation

Many packages are implemented in pure Python, often based on the original CPython implementation. (e.g. collections.defaultdict)

Some packages are based on or extend from the built-in "micro" modules in the MicroPython firmware, providing additional functionality that didn't need to be written in C (e.g. collections, socket, struct).

Future plans (ideas for contributors):

  • Add README.md to each library explaining compatibility and limitations.