A bot that randomly generates Sonic OCs, fanfictions, and Sonic Says segments.
- Python 3.9+ (only tested on 3.9 and 3.10 but any higher version should work)
- A Chromium-based browser (for
html2image
module)
Install the requirements from /requirements
and you should be good to go:
cd SonicOCBot # ... wherever you have the repo stored
python -m venv .venv
source .venv/bin/activate
pip install -r requirements/minimal.txt # or full.txt if running notebooks
This repo uses mypy
, black
, and unimport
to check typing, formatting, and unused imports on a PR. All are installed during the above requirements installation and you can run all the checks using quality-check.sh
.
This repo requires some data to generate images. Please see each of the following guides to see what files are required:
Note that the models
directory requires trained models to be put into it. These are generated from text files using train.py
.
- The
html2image
module might not detect your Chromium browser, especially if it's not Chromium or Chrome. If this happens, set theCHROME_BIN
environment variable to the path of the executable when runningmain.py
. - Running
main.py
as root (e.g. in the Docker image) causes Chrome to not open; set theCHROME_ARGS
environment variable to--no-sandbox
to resolve this.
Documentation for the code itself lives here and is automatically generated on push to master
. It's generated using pdoc, which uses docstrings in the functions to create documentation. (This repo is documented using numpydoc format.)