PyDocs

Python Language Services

compileall

not WASI

Module/script to byte-compile all .py files to .pyc files.

When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.

Without arguments, it compiles all modules on sys.path, without
recursing into subdirectories.  (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.
Symbols in compileall

c

compile_dir
Byte-compile all modules in the given directory tree.
compile_file
Byte-compile one file.
compile_path
Byte-compile all module on sys.path.