Generate random wildlife bingo cards for safaris with data from Wikipedia.
Go to file
Alan Orth 2e17220ad6
data/animals.csv: add new animals
Add common dwarf mongoose and grey crowned crane, seen in Ol Pejeta.
2024-06-16 16:53:07 +03:00
data data/animals.csv: add new animals 2024-06-16 16:53:07 +03:00
.gitignore .gitignore: add more ignores 2024-02-24 10:43:45 +03:00
example.jpg Add a new example.jpg 2024-03-01 17:09:22 +03:00
generate.py generate.py: run rye fmt 2024-06-14 21:31:50 +03:00
LICENSE Use rye to manage Python 2024-06-14 21:30:45 +03:00
pyproject.toml Use rye to manage Python 2024-06-14 21:30:45 +03:00
README.md Use rye to manage Python 2024-06-14 21:30:45 +03:00
requirements-dev.lock Use rye to manage Python 2024-06-14 21:30:45 +03:00
requirements.lock Use rye to manage Python 2024-06-14 21:30:45 +03:00

Safari Bingo Cards

Fun proof of concept to generate random wildlife bingo cards for safaris with data from Wikipedia.

Example bingo card showing a 4x4 grid of Sub-Saharan African wildlife

Usage

Once the requirements are satisfied you can generate a card. By default it generates a 4x4 grid with 16 images:

$ ./generate.py -i data/animals.csv -o out.jpg
[INFO] Generated random sample of 32 animals...
[INFO] > Creating thumbnail for Helmeted guineafowl...
[INFO] Generated card with a 4x4 grid of animals...
[INFO] Wrote out.jpg

The script will download the images from Wikipedia, generate thumbnails for the sampled animals, and output a bingo card as a JPEG file.

Requirements

Set up a Python 3.10+ virtual environment and install the requirements:

$ python3 -m .venv
$ source .venv/bin/activate
$ pip install -r requirements.lock

TODO

  • Credit photographers — these photos are all some variation of CC-BY so we need to give attribution
  • Add filtering by region — the metadata already exists, though perhaps needs to be adjusted
  • Refactor — perhaps needs to be more object oriented
  • Make a web frontend — I can imagine a light frontend that would shuffle the images in realtime and allow generation of a number of cards

License

This work is licensed under the GPLv3.

The license allows you to use and modify the work for personal and commercial purposes, but if you distribute the work you must provide users with a means to access the source code for the version you are distributing. Read more about the GPLv3 at TL;DR Legal.