When you start splitting out into more than one hacky python script, that's when you know you need a repo
scrape-scriptfiles.py
will scrape the contents of a workshop directory and output various breakdowns into output/
.
$ cd Documents # Or whever you want to download this repo
$ git clone https://github.com/pmelanson/zomboid-scripts.git
$ cd zomboid-scripts
$ pip install -r requirements.txt
$ python3 scrape-scriptfiles.py --help
Check python3 scrape-scriptfiles.py --help
for usage.
Examples:
For Linux-On-Windows, you can use
python3 scrape-scriptfiles.py -d '/mnt/c/Program Files (x86)/Steam/steamapps/workshop'
For Windows, you can use
python3 scrape-scriptfiles.py -d '\Program Files (x86)\Steam\steamapps\workshop'
There is a partner spreadsheet to these python scripts! Here's how you (yes, you git user!) can update it:
-
Run
scrape-scriptfiles.py
and get an output -
Make a pull request to this repository to update the files in
output/
-
Get the pull request accepted and merged
-
Click the "🧟♀️ Import Zomboid Modded Data 🧟♂️" button in the spreadsheet--the new data will be imported into the spreadsheet! Hey presto!
The parse_scriptfile
module will take a Zomboid scriptfile (as a string) and parse it as a JSON object (a dict, in python lingo). This is used by the scrape-scriptfiles.py
scraper.