You may want to mimic the standard Anvil folder layout:
├──client_code
├──server_code
└──theme
└──assets
Edit 1: Which third-party YAML library are you using?
Edit 2: Here’s a tentative docstring for the top of the script:
"""Script: AnvilYamlUnpacker.py
Author: a.ercolani
Reference: https://anvil.works/forum/t/very-simple-anvil-yaml-code-unpacker/18524/2
Version: 1.0
Posted: 2023-09-05T14:13 EDT
This simple script parses the YAML file you can download from Anvil IDE,
and dumps the code under “modules”, “forms” and “server_modules” keys
to approprately named “.py” files under the respective directories.
Then, it is easy to use your favourite folder-comparer to check for the
differences (w.g. WinMerge).
Requires: PyYAML (https://pypi.org/project/pyaml/).
python -m pip install pyyaml
into your intended Python Virtual Environment.
Usage: py -m AnvilYamlUnpacker <yaml_file_name.yaml>
License: ????
"""
Edit 3: per @a.ercolani 's reply.