Skip to main content

A pixel art guessing quiz game

Project description

Pixel Puzzle

A pixel art guessing quiz game. The server reads image files from a folder you point it at, exposes a small JSON API listing them, and ships a static front-end that turns those images into a guess-the-pixel-art quiz.

Features

  • FastAPI backend with a single /api/images JSON endpoint.
  • Static front-end (vanilla HTML/CSS/JS) bundled with the package.
  • Long-lived cache headers for versioned assets, no-cache for index.html.
  • GZip middleware for text payloads.
  • Image-folder caching keyed on directory mtime.
  • Environment-driven configuration (HOST, PORT, IMAGE_FOLDER).

Requirements

  • Python 3.14 or newer.

Installation

Install with uv as a standalone tool:

uv tool install pixel-puzzle

Or, alternatively, run it ephemerally:

uvx pixel-puzzle

Or, install it into a project virtual environment with:

uv add pixel-puzzle

Usage

Drop pixel art images (.png, .jpg, .jpeg) into a directory, then point the server at it via the IMAGE_FOLDER environment variable (default: a folder named images in the current working directory):

IMAGE_FOLDER=/path/to/pixel-art pixel-puzzle

Open http://localhost:8000 and start guessing.

Configuration

Variable Default Description
HOST 0.0.0.0 Interface for uvicorn to bind.
PORT 8000 TCP port for the HTTP server.
IMAGE_FOLDER ./images Directory scanned for image files.

Development

Clone the repository and sync the dev environment:

git clone https://github.com/luca/Pixel-Puzzle.git
cd Pixel-Puzzle
uv sync --extra dev

Run the test suite:

uv run pytest

Run the server from a working copy:

uv run pixel-puzzle

Project layout

src/pixel_puzzle/
    __init__.py
    __main__.py        # console-script entry point
    app.py             # FastAPI application
    static/            # HTML, JS, CSS, fonts
tests/
pyproject.toml

License

MIT. See the project metadata in pyproject.toml for the canonical notice.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pixel_puzzle_game-0.4.0.tar.gz (100.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pixel_puzzle_game-0.4.0-py3-none-any.whl (103.0 kB view details)

Uploaded Python 3

File details

Details for the file pixel_puzzle_game-0.4.0.tar.gz.

File metadata

  • Download URL: pixel_puzzle_game-0.4.0.tar.gz
  • Upload date:
  • Size: 100.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pixel_puzzle_game-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cff147734efe9856f994b55bbae5d285abd3a02662b0feeb9c2d571d25954cc1
MD5 b427715fcf1dd881c372d5c75f2e57fb
BLAKE2b-256 43bf56f8c23345ebba6d548340ae73962dcf31b125b4c3eede23eea919a85a8d

See more details on using hashes here.

File details

Details for the file pixel_puzzle_game-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pixel_puzzle_game-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 103.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pixel_puzzle_game-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f93188a53883a7ebeaaf345685874b8d22df80a94794394eea46a0edd5049975
MD5 a61a591f49444617083a4cf0a02c3600
BLAKE2b-256 2788328cf1530befef6b959c7577fe84de3531bf0d67154f67346d791441c4aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page