With more time, and in future iterations, this project could be expanded to allow characters to level up. This project was an interesting experiment in random generation, and is a great starting point for streamlining the D&D character creation process. If that shell script doesn't work on a different OS, the Python scripts can still be run manually in order.
This script automatically runs all of the scripts in order and deletes the extra JSON files at the end of the process. I also created a shell script, which works for Mac OS to be run in the Terminal. At the end, the last Python script combines all of the generated data into one JSON file.
Then the next Python script reads that JSON file, creates new information, and exports more JSON data. The 'random' module includes functions and methods for randomly selecting items from lists and dictionaries in Python, which is what allows this random character generator to work.Įach step of the process consists of one Python script, which exports its generated data to a JSON file. This project uses the Python modules 'requests,' 'json,' and 'random.' The 'requests' module allows Python to parse information from the API, the 'json' module allows it to read and write JSON format, and the 'random' module is perhaps the most important to the process.