assets Loading last commit info...
bundle
.gitignore
LICENSE
README.md
example_conf.json
get_members.py
main.py
upload_data.py
README.md

What is this?

This is a small script that helps monitoring the activity of a guild's member by using the Wynncraft API and exporting the results to Google Sheet (for easy sharing)

Example:

Results in Google Sheets for an example guild

How can I use it?

For this script to be able to edit a Google Sheets, you will need to create a Google Service Account and an API key.
Note that Google is likely to offer you some plan with a free trial, YOU DO NOT NEED IT, just ignore it.
This blog post does a great job explaining how to get an API key, all the way from project creation. It also shows how to write your own script to use said API key, you do not need to read that part, that's what my script is for.

If you prefer using Google's official documentation (good luck, this is way overcomplicated for our needs), here you go:

  1. Create a Google Cloud project
  2. Create a Service Account
  3. Create an API key (I couldn't find a doc page for this):
    • From your project dashboard, go to Credentials
    • Select the service account you just created
    • Select the Keys tab
    • Add key -> Create new key
    • Use the JSON format and CREATE
    • You now have downloaded a .json file containing your API key! keep it for now.

Share a Google Sheets Spreadsheet with your service account

Once again, the previously mentionned blog post does a great job explaining it.

Here is my attempt anyway:

  1. Create a new Google Sheets Spreadsheet (you may create a copy of this template)
  2. Share it with the previously created service account
    • Open the Share menu
    • Copy the email address of the service account in the Add people,... field
    • Done
  3. Save the spreadsheet ID, it will be useful later
    • It's this part of the URL: Spreadsheet ID

Use the actual script

Option 1: I trust random strangers on the internet

I provide a bundled file for this script, that is a file you can execute just like an .exe file, without needing to install anything. Before you execute this file, make sure you trust me (a random stranger on the internet) to not include anything malicious within it. You give that trust whenever you use software you did not compile yourself, nothing special, but I believe that we should all be more aware of it.
If that's fine with you, then here you go:

  1. Download the content of the bundle folder
  2. Move the API key .json file you got earlier to the same folder where you downloaded the script
  3. Create a copy of the example_conf.json file and name it conf.json
  4. In conf.json, update
    • the name of the guild you want to follow in the guild_name field
    • the spreadsheet ID of the spreadsheet you shared with your service account (the one you saved earlier) in the spreadsheet_id
    • the name of your API key file in the credentials_file field The rest is optional and doesn't need to be changed.
  5. Execute the script (the wynncraft-guild-list file) by double clicking it, or executing it from command line.

If you are using Windows or MacOS, a terminal window should automatically open and display the progress/errors of the script.
If you are using Linux, you will only see the progress/errors if you execute the script from a command line.

Please be aware that the Wynncraft API as very low request rate limits, so it may take a few minutes if your guild has 40+ members.

Skip Option 2

Option 2: I want to edit the code / I don't trust you

Here, you will be using the python interpreter directly on the code, meaning you get to see exactly what it is you are running on your computer. You can also modify the code to your liking.
In this section I will assume you have some very basic knowledge of python/programming and/or are willing to look things up on your own.

1. Requirements

  • A somewhat recent version of Python3 (tested with python 3.14)

2. Installing dependencies

Install (using pip or any other method) the google-api-python-client dependency. I would recommend using a virtual environment for this.

3. Download the script

You need the following 3 files:

  • main.py
  • get_members.py
  • upload_data.py

Why is it split in 3 files and not just one?

Because I wanted to be able to query the Wynncraft API without updating the Google Sheet, and the other way around. This was the most convenient way.

4. Read and edit the code however you like

5. Edit the config file

Start by creating a copy of example_conf.json and name it conf.json.
Here is what each field means:

  • guild_name: the name of the guild you want to track
  • save_intermediate_file: whether you want to keep the data extracted from the Wynncraft API in a file after uploading it to Google Sheet (boolean)
  • intermediate_file_name: the name of the file where the data from the API will be stored
  • spreadsheet_id: the id of the spreadsheet you want to edit
  • sheet_name: the name of the specific sheet you want to edit within the spreadsheet
  • credentials_file: the name of the file where your Google API key is stored

Edit it appropriately.

6. Enjoy!

You can now run the script!
python3 get_members.py will fetch data from the API and store it in intermediate_file_name but won't upload it to the spreadsheet
python3 upload_data.py will look for prefetched data in intermediate_file_name and upload it to the spreadsheet
python3 main.py will fetch AND upload the data

Customize the spreadsheet

You should name the columns, create filters to order players by xp contributed, ...
Here is a template (filled with random values) that you can use as a starting point.

References

License

MIT

Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover