I put together a full party generator in Google Sheets, for NPC encounters and hiring situations; I realize that my generator has some extra classes, and understanding it requires an advanced degree in insanity... but, just in case it helps anyone, have a look:
https://docs.google.com/spreadsheets/d/1RWOxlYVnUfDUk_r3XPkoJ2bIgw1N3jkz1qqPJX02660
You'll have to make a copy to get it to actally generate anything. Also, in case you're interested, a quick summary of pages:
Select: this has the drop-down selectors to choose what kind of party you want, and how many.
Class: the list of classes, and how often they show up (ie, Barbarians have a 3/108 chance of showing up in a random party, or 2/35 in a party of fighters)
ClassInfo: a list of main stats, seconday stats, HD, and what equipment each class can use.
Builder: takes each piece of info and builds it into a lsit of stuff the character is carrying.
Stuff: list of weapons, equipment, and other stuf
Magic items: a list of each magic item, and wich (if any) a character will have. Doesn't take into account class at all.
Stats: generates and tweaks stats and HP
Profs: generates class and general proficiencies; "+1" means "and one more"; as GM, I usually pick a stats that matches the character. I'll automate this someday, probably.
Names: A list of first and last names for various cultures.
Eventually, I plan on making this into an online generator... but this works really well for now. It's not python, or even a real programming language, but hopefully some of the methods I used will be helpful!