Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add an AUTHORS file

Fixes #150.

Also added a script to regenerate this based on git contributions ;)
  • Loading branch information...
commit f5f431e2224793e8ff2c5b9a64d285508fb3806f 1 parent 347d115
@SmileyChris authored
Showing with 95 additions and 1 deletion.
  1. +25 −0 AUTHORS
  2. +2 −1  MANIFEST.in
  3. +68 −0 authors.py
View
25 AUTHORS
@@ -0,0 +1,25 @@
+Daniel Sokolowski <daniel.sokolowski@klinsight.com>
+Jannis Leidel <jannis@leidel.info>
+Graham King <graham@gkgk.org>
+Fabian Topfstedt <fabian@topfstedt.de>
+philomat <philomat@popkultur.net>
+Tom Wardill <tom@howrandom.net>
+Jonas <jvp@jonasundderwolf.de>
+Mitar <mitar@tnode.com>
+vicalloy <zbirder@gmail.com>
+smacker <max@smacker.ru>
+stefanfoulis <stefan.foulis@gmail.com>
+Pascal Hartig <phartig@weluse.de>
+Jean-Nicolas Jolivet <jeannicolascocoa@gmail.com>
+Selwin Ong <selwin@ui.co.id>
+Peter Pistorius <peterp@ucm.co.za>
+Anthony Menasse <amenasse@gmail.com>
+Richard Frankel <frankel@cs.stanford.edu>
+artscoop <artscoop93.info@gmail.com>
+Jaap Roes <jaap@u-e-h.net>
+Daniel Gatis Carrazzoni <danielgatis@gmail.com>
+Simon Meers <simon@simonmeers.com>
+Paulo Roberto <proberto.macedo@gmail.com>
+evildmp <daniele@apple-juice.co.uk>
+Brandon Konkle <brandon.konkle@gmail.com>
+Matt Croydon <mcroydon@ubuntu.ubuntu-domain>
View
3  MANIFEST.in
@@ -1,5 +1,6 @@
include LICENSE
+include AUTHORS
include README.rst
include CHANGES.rst
recursive-include docs *
-prune docs/_build
+prune docs/_build
View
68 authors.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+"""
+Get a git project's authors (ordered by most contributions).
+"""
+
+import re
+import subprocess
+from operator import itemgetter
+
+re_line = re.compile(r'(\d+)\s+(\d+)\s+[^<]+$')
+re_author = re.compile(r'.+<(.+)>$')
+
+
+def get_authors(exclude_primary_author=True):
+ git_log = subprocess.Popen(["git", "log", "--format=%aN <%aE>",
+ "--numstat"], stdout=subprocess.PIPE)
+
+ output = git_log.communicate()[0]
+
+ authors = {}
+ author = None
+ for line in output.splitlines():
+ match = re_line.match(line)
+ if not match:
+ if line:
+ author = line
+ continue
+ authors[author] = authors.get(author, 0) + max([int(num)
+ for num in match.groups()])
+
+ # Combine duplicate authors (by email).
+ emails = {}
+ for author, changes in authors.items():
+ match = re_author.match(author)
+ if not match:
+ continue
+ author_emails = match.group(1)
+ for email in author_emails.split(','):
+ if '@' not in email:
+ continue
+ if email in emails:
+ remove_author = emails[email]
+ if remove_author not in authors:
+ continue
+ if changes < authors[remove_author]:
+ author, remove_author = remove_author, author
+ authors[author] = authors[author] + authors[remove_author]
+ del authors[remove_author]
+ else:
+ emails[email] = author
+
+ # Sort authors list.
+ list_authors = authors.items()
+ list_authors.sort(key=itemgetter(1), reverse=True)
+
+ total = float(sum(authors.values()))
+
+ if exclude_primary_author:
+ top_author = list_authors.pop(0)
+ total -= top_author[1]
+
+ return [(author, changes, changes / total * 100)
+ for author, changes in list_authors]
+
+
+if __name__ == '__main__':
+ for author, changes, percent in get_authors():
+ print author
Please sign in to comment.
Something went wrong with that request. Please try again.