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

Template 8 - Commit Pattern

template8_default

Variants:

  • template8_increasing
  • template8_with_zeros

Template 9 - Contributors

template9_clustered

Variants:

  • template9_large
  • template9_small

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 Distribution

repogif-0.0.4.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

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

repogif-0.0.4-py3-none-any.whl (46.5 kB view details)

Uploaded Python 3

File details

Details for the file repogif-0.0.4.tar.gz.

File metadata

  • Download URL: repogif-0.0.4.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for repogif-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7136a8e2c2fb4f2f30f62df25ce8338a5934c632cac6a1372e96cc3ae02a6a9e
MD5 7b00e3fe3bab12b7566530857800c7d1
BLAKE2b-256 ad80f309a23e4beaa5e96799e476cae6aa41d32ed309fcebc869185a70273a31

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for repogif-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6457177bfd59421042d435dc527cac32a188dafdbcbb2ba491e8b8115885959f
MD5 30a65f3b1776a1c80b794cce9e808f1f
BLAKE2b-256 f1c1fa4267148145f91dded3e3453efe517cdb939106808f109e7f2a74b04b96

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