A little Python package to access popularity metrics for your package. Feel free to contribute!
- Downloads history from Pypi
- Stars history from GitHub
- Number of GitHub contributors
- GitHub traffic history from GitHub (See https://github.com/seladb/github-traffic-stats)
pip install https://github.com/DominiqueMakowski/popularipy/zipball/master
Example for the NeuroKit
package.
import popularipy
# Pypi downloads
downloads = popularipy.pypi_downloads("neurokit2")
downloads.plot(x="Date")
# GitHub stars
stars = popularipy.github_stars("neuropsychology/neurokit", "myaccesstoken")
stars.plot(x="Date")
Combine the data:
import pandas as pd
data = downloads.merge(stars)
data.plot.area(x="Date", y=["Downloads", "Stars"], subplots=True)
Number of contributors and amount of contributions:
# Get Contributors
contributors = popularipy.github_contributors("neuropsychology/neurokit", myaccesstoken)
contributors["Contributor"] = range(1, len(contributors) + 1) # Anonimize contributors
# Plot
contributors.plot(x="Contributor", y="Contributions")
plt.xlim(left=0)
plt.title("Number of contributors: " + str(len(contributors)))