compile

# python -m compileall [*.py ...]
python -m compileall .

decompile

python3.7 or newer

pip install decompyle3
decompyle3 XX.pyc > xx.py

before python3.7

pip install uncompyle6
uncompyle6 *compiled-python-file-pyc-or-pyo*