Giter Club home page Giter Club logo

github-avatars-gallery-generator's Introduction

github-avatars-gallery-generator

Python PyPI

A naive implementation that collects the avatars of all contributors of a Github repo and makes a gallery SVG for you.

Install

pip install github-avatars-gallery-generator

I build and upload from my macOS and Ubuntu (docker container) myself without a CI service, so I cannot tell if this will work for other platforms yet.

Why?

The layout is inspired by Open Collective 's ability to display contributors as well as Github's own sponsors page.

Recently I need to generate such SVGs for some of my projects, which are not on Open Collective, so I spent some time writing this generator for my own requirements. It's an ugly solution and has certain known issues (slow, large SVG size, etc.), yet works for my needs.

How?

Using vuepress project as an example, either download the main.py or install it from PyPI, and run something like:

gh-gallery --organization vuejs --repo vuepress

after a couple seconds, it will generate an SVG file "contributors_vuejs_vuepress_10.svg" to the current directory. The 10 there means it will put 10 avatars per row in the resulting SVG. For all available options, use gh-gallery -h:

A CLI to generate a gallery visualization of contributors of a Github repo.

optional arguments:
  -h, --help            show this help message and exit
  -o ORGANIZATION, --organization ORGANIZATION
                        The Github organization of your repo
  -r REPO, --repo REPO  The Github repository
  -a AVATAR_SIZE, --avatar-size AVATAR_SIZE
                        The size of your avatars in the resulting SVG
  -n NUM_PER_ROW, --num-per-row NUM_PER_ROW
                        The number of avatars you want to display per row

Comparison

With gh-gallery --organization vuejs --repo vuepress -n 34 -a 24, I'm able to generate a contributors gallery of vuepress repo, I already converted the resulting SVG into PNG using cairosvg, here is how it looks:

You could compare it with their official one

By the way...

A few things to keep in mind:

  1. the resulting SVG may be very large and unsuitable to be stored/shared online, due to the fact this library stores all image contents in the SVG. To resolve it, you can use libraries such as cairosvg to convert your SVG into PNG or JPEG files.
  2. The avatars in the gallery are sorted by contributions at the time the library is querying Github API.
  3. The generated avatars are clickable and links to each contributor's Github profile page. However, once you convert it into PNG or JPEG, the links will get lost.

Thank you and feel free to submit an issue if you find any. Also welcome to submit a PR to improve it.

github-avatars-gallery-generator's People

Contributors

dependabot[bot] avatar rexwangcc avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.