Skip to main content

A CLI tool that visualizes GitHub contribution graphs as gamified GIFs

Project description

gh-space-shooter 🚀

Transform your GitHub contribution graph into an epic space shooter game!

Example Game

Features

  • 🚀 Galaga-style space shooter - Classic arcade gameplay with your contribution data
  • 📊 GitHub integration - Fetches your last 52 weeks of contributions automatically
  • 🎮 Smart enemy AI - Multiple attack strategies (columns, rows, random patterns)
  • 💥 Particle effects - Explosions with randomized particles and smooth animations
  • 🎨 Polished graphics - Rounded enemies, smooth ship design, starfield background
  • 📈 Contribution stats - View your coding activity statistics
  • 💾 Export options - Save both the GIF and raw JSON data

Installation

From PyPI (Recommended)

pip install gh-space-shooter

From Source

# Clone the repository
git clone https://github.com/yourusername/gh-space-shooter.git
cd gh-space-shooter

# Install with uv
uv sync

# Or with pip
pip install -e .

Setup

  1. Create a GitHub Personal Access Token:

  2. Set up your environment:

    # Copy the example env file
    touch .env
    echo "GH_TOKEN=your_token_here" >> .env
    

    Alternatively, export the token directly:

    export GH_TOKEN=your_token_here
    

Usage

Generate Your Game GIF

Transform your GitHub contributions into an epic space shooter!

# Basic usage - generates username-gh-space-shooter.gif
gh-space-shooter <username>

# Examples
gh-space-shooter torvalds
gh-space-shooter octocat

# Specify custom output filename
gh-space-shooter torvalds --output my-epic-game.gif
gh-space-shooter torvalds -o my-game.gif

# Choose enemy attack strategy
gh-space-shooter torvalds --strategy column   # Enemies attack in columns
gh-space-shooter torvalds --strategy row      # Enemies attack in rows
gh-space-shooter torvalds -s random           # Random chaos (default)

This creates an animated GIF showing:

  • Your contribution graph as enemies (more contributions = stronger enemies)
  • A Galaga-style spaceship battling through your coding history
  • Enemy attack patterns based on your chosen strategy
  • Smooth animations with randomized particle effects
  • Your contribution stats displayed in the console

Advanced Options

# Save raw contribution data to JSON
gh-space-shooter torvalds --raw-output data.json

# Load from previously saved JSON (saves API rate limits)
gh-space-shooter --raw-input data.json --output game.gif

# Combine options
gh-space-shooter torvalds -o game.gif -ro data.json -s column

Data Format

When saved to JSON, the data includes:

{
  "username": "torvalds",
  "total_contributions": 1234,
  "weeks": [
    {
      "days": [
        {
          "date": "2024-01-01",
          "count": 5,
          "level": 2
        }
      ]
    }
  ],
  "fetched_at": "2024-12-30T12:00:00"
}

License

MIT

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

gh_space_shooter-0.0.1.tar.gz (10.3 MB view details)

Uploaded Source

Built Distribution

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

gh_space_shooter-0.0.1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file gh_space_shooter-0.0.1.tar.gz.

File metadata

  • Download URL: gh_space_shooter-0.0.1.tar.gz
  • Upload date:
  • Size: 10.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for gh_space_shooter-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1a1416e65d64fcba3420237fb16fe1afbb46cdc142ed64fca572cf02075d376c
MD5 cad42d1ec7285f0e6a353484242126e5
BLAKE2b-256 695df679591f6ea4f26f56d337934b857671a730e5cb2635f8ec44f2486522b9

See more details on using hashes here.

File details

Details for the file gh_space_shooter-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gh_space_shooter-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 361b09d5add0d42b50826f241fec05ae6b693a20a2670292ee8c44c060498797
MD5 acaba96c7493bbff7b8fe18b594bdc7d
BLAKE2b-256 639acd4216373cfd8dbb84cbe27bce41b16d560fb1310f56eda4057e5cc64a49

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