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!
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
-
Create a GitHub Personal Access Token:
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Select scopes:
read:user - Copy the generated token
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gh_space_shooter-0.0.2.tar.gz.
File metadata
- Download URL: gh_space_shooter-0.0.2.tar.gz
- Upload date:
- Size: 10.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
204f95d3985a00a29e49b6f55bb330b2e4787980de33f9554ff513c002def754
|
|
| MD5 |
29009a34b7b11eab814ec6d8064eba12
|
|
| BLAKE2b-256 |
077989ee2fdd6268a42dcee5e1e4a699bbba53fecc081cb9dba06f753dad5c8f
|
File details
Details for the file gh_space_shooter-0.0.2-py3-none-any.whl.
File metadata
- Download URL: gh_space_shooter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a25f12c3fe6ec205f3a39e26900380c7ce91503b8de131966eb33e4a0f09cf
|
|
| MD5 |
1da56fa792095962ba913c8131bd264d
|
|
| BLAKE2b-256 |
1371ebb1dae38c3de144ef57e8412b4f2d57c0676e8eb60a712bfdf38dc09581
|