Getting Started: Python for Forma and ACC
Episode 1 gave this one clause: if the work touches Forma or ACC data management, you will want Python. That deserves the rest of an episode, the same as the .NET clause did.
The interpreter
One download, from python.org. Nothing here is version-pinned the way Civil 3D pins a .NET release: Forma and ACC data management work does not care which recent release you run, so take whatever the site currently offers.
The dependencies
A project like this lists what it needs in a file named requirements.txt, and one command reads that list and installs everything on it: pip install -r requirements.txt. There is no separate setup step past that. The list is the whole setup.
The credentials
Forma and ACC both sit behind a login, and code talking to either one needs a client ID and a secret to get past it, the same idea as a username and password. Typing those two values straight into the code looks like the obvious shortcut, and it is the mistake this whole section exists to head off: code gets shared, posted, and eventually read by more than one person, and a secret typed into it travels wherever the code goes.
The fix is a second file, named exactly .env, sitting right next to the project's other files. It is nothing more than plain text, one value per line: CLIENT_ID=..., CLIENT_SECRET=.... No code in it at all. One line near the top of the project's own code reads that file when the program starts and pulls the values in from there, so each credential exists in exactly one place. Everywhere else, only a name like CLIENT_ID ever shows up, never the value.
The .env file itself never gets checked into the project's history. A separate list, .gitignore, tells Git to skip it every time, on purpose. Losing the file just means re-entering two values by hand. Committing it by accident is worse: the values are now public and have to be changed, which is the more common way this goes wrong and the whole reason the separate file exists.
Running it
A project like this starts with one command, python <name>.py, and opens a small server on this machine. Closing the terminal window stops it. There is no separate deploy step for trying something out.
What I leave off
Every Forma and ACC project on this machine shares one Python install. None of them get their own isolated environment, which runs against most Python advice, since the usual guidance is a fresh one per project. I have not needed one here, because none of these projects have yet wanted two different versions of the same dependency at once. The day that happens, the newer project gets its own environment. Until then, one install is one less thing to manage.
Be Better - Keep the key in the file, not the code.