Skip to content

API to fetch and process puzzle statistics from discord channel. Handles miscellaneous daily puzzles such as wordle, nerdle etc.

License

Notifications You must be signed in to change notification settings

eliassr/Puzzle-Stats-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puzzle Stats Parser

Collect messages from discord channel to log statistics on daily puzzles games, e.g. Wordle.

Currently supported games

The games currently supported are:

More games might be added in the future.

Notes on mini crossword

Mini crossword does not have a useable share-function. To correctly parse Mini crossword, results (the time spent solving) must be manually written to discord channel on the form:

Mini1: 1m23s

Python installation & required modules

Code is tested with Python version 3.11.2. A python installation later than 3.8 is required, but not guaranteed to be stable.

Required modules:

  • numpy >1.24.2
  • pandas >1.5.3
  • requests >2.31.0

Virtual environment

It is always good practice to run the code in a virtual environment. With your venv active, run

$ pip install -r requirements.txt

to install the necessary dependencies.

How to use

Below follows a rough guide on how to use the included functionality.

Firstly, clone the repository. Make sure to use the most recent stable release (use dev branches at your own risk!).

  1. The result text for each game (e.g. from share button) should be posted in your favorite discord channel. See notes below on some caveats.

  2. Collect authentication token and channel id for your discord channel of choice.

  3. Save token and channel id in a local file tokens.txt on a path accessible to the python module (such as the root directory of the repository).

  4. The message_parser module can be imported in a python environment of your choice, such as

    • Regular python script
    • Jupyter notebook
    • The python environment for your own discord bot

    by running the import statement

    import message_parser as MP
    
  5. Use the internal functions, such as MP.collect_data() or MP.update_df() to get a pandas dataframe with your game data.

  6. Some additional functionality and utilities can be found in util.py, such as numerical parsing of scores. Refer to docstrings in the scripts for more info.

Notes on discord channel

It is recommended to have a dedicated text-channel for posting scores. While the parser will handle (most) other messages fine, they will add extra time to the query process, and might clutter the final dataset with unneccesary messages. In particular, do avoid posting messages where the first word corresponds to the individual game-keywords, as this might cause errors (particularly in the case of Quordle, whose identifier is the word "Daily").

License

Project is licensed under the MIT License. See LICENSE.md for more info.

About

API to fetch and process puzzle statistics from discord channel. Handles miscellaneous daily puzzles such as wordle, nerdle etc.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages