Skip to main content

Generate beautiful animated GIFs that mimic GitHub repo stars/forks with realistic visuals. Perfect for social sharing, repo previews, documentation, or just for fun.

Project description

RepoGif 🎥⭐

Generate beautiful animated GIFs that mimic GitHub repo stars/forks with realistic visuals.
Perfect for social sharing, repo previews, documentation, or just for fun.

Features

  • 🌈 Gradient backgrounds with authentic GitHub styling
  • 🎨 Web-based animation with HTML/CSS/JS for high-quality visuals
  • ⚙️ Customizable repository name, star count, and fork count
  • 🔍 High-fidelity captures using Puppeteer

[!TIP] Starring this repo helps more developers discover RepoGif 🎥

template1_1k


Install

git clone https://github.com/yourname/RepoGif.git
cd RepoGif
pip install -e .
playwright install

Dependencies

  • Pillow - Image processing
  • imageio - GIF creation
  • imageio-ffmpeg - Video encoding support
  • numpy - Numerical operations
  • playwright - Browser automation

Usage

Call from Python:

from repogif.generator import generate_repo_gif

generate_repo_gif(repo_name="RepoGif", stars=250, forks=30, out="output.gif")

Run from CLI (after install):

repogif

Advanced Options

You can customize various aspects of the generated GIF:

generate_repo_gif(
    repo_name="MyAwesomeProject",
    stars="5.8k",  # Supports string format for larger numbers
    forks=397,
    out="custom_animation.gif"
)

How It Works

RepoGif uses a multi-step process to create high-quality animations:

  1. Uses static HTML templates with customizable parameters via URL query strings
  2. Uses Playwright to capture two frames (unstarred and starred states)
  3. Creates final GIF using PIL with 1-second duration per frame

The template-based approach allows for visually appealing animations with:

  • Gradient backgrounds
  • Proper GitHub styling and iconography
  • Realistic cursor positioning
  • Star button interactions with visual feedback

Customization

The templates are located in repogif/templates/, with each template in its own directory:

  • Each template has its own template.html file and necessary assets
  • Templates can be customized via URL parameters:
    • Repository name
    • Star count
    • Fork count
    • Display dimensions
  • You can also create new templates following the existing structure

👉 This repo is fully usable right now. Just run:

python examples/example.py

and you'll get a RepoGif output in the examples/ folder 🎥.

Templates

RepoGif offers a variety of templates to showcase your repository in different styles and formats. Choose the one that best suits your needs.

Template 1 - Simple Star Animation

A simple 2-frame GIF showing star button animation with authentic GitHub styling.

template1_1k

Default Dimensions: Variable based on content

Variants:

  • template1_no_forks
  • template1_100stars

Template 2 - Square Badge

A square badge displaying repository statistics with clean, modern design.

square_badge_test

Default Dimensions: 250x250 pixels

Template 3 - Horizontal Banner

A wide banner perfect for repository headers or documentation pages.

horizontal_banner_test

Default Dimensions: 600x120 pixels

Template 4 - Circular Badge

A circular badge with focused repository statistics in a compact form.

circular_badge_test

Default Dimensions: 250x250 pixels

Template 5 - Vertical Card

A vertical card layout with gradient background for an elegant presentation.

vertical_card_test

Default Dimensions: 300x400 pixels

Template 6 - Minimalist Tile

A clean, monochrome design focusing on essential repository information.

minimalist_tile_test

Default Dimensions: 320x200 pixels

Template 7 - Animated Badge

An eye-catching badge with pulsing star effect animation.

animated_badge_test

Default Dimensions: 280x280 pixels

Troubleshooting

Common Issues

Blank or Corrupted GIF

This could be due to:

  • Frame capture issues - Check for browser compatibility
  • Puppeteer configuration - Try running with different arguments
  • File path problems - Ensure all paths are correct

Example Output

When run, this package generates an animated GIF showing a GitHub repository with stars and forks, along with a realistic cursor animation.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

repogif-0.0.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: repogif-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for repogif-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fce0fa953c4745f7b3373b3cc9a92b6f9b4756c30d2f75c72f2a34a3d7aa679
MD5 67f9a404dfc2d7fb842a014e9d1b1bb9
BLAKE2b-256 1212c7879d3f049791f9fbc6d9120ebdde26fe34b36595b62fc80e15da2f88c2

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