Skip to content

A basic tool for fetching total download statistics from PePy for custom Shields badges. Runs daily. Statistics hosted by GitHub Pages.

Notifications You must be signed in to change notification settings

michaelthomasletts/pepy-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  _  _   _    
 /_//_' /_//_/
/      /   _/ 
               
  __/_ _ _/_  _
_\ /  /_|/  _\ 

What is pepy-stats?

pepy-stats is a repository that, on a daily schedule at approximately 8 AM UTC:

The purpose of this software is to make customizable Shields badges possible with download statistics from PePy.

Unfortunately, the badge offered by PePy is not highly customizable. Even after recent updates following a GitHub issue I opened. And Shield's badge doesn't offer total downloads. Only daily, weekly, and monthly are available. 😏 This is irksome for me, as I enjoy customizing markdown documents with Shields badges using consistent colors, styles, and logos! 🎨

. . . Feeling lazy?

If anyone finds themselves in a similar predicament as me regarding the lack of badges that combine total downloads + customizability, but don't feel like building their own mini-service for hosting download statistics, then open an issue. I totally get it! 😃 I'll happily add your Python package and host those statistics for you. If you like, open a pull request which updates this line with your package name in the CLI command! 😎

Installation

You may also install pepy-stats yourself using the following command if you prefer to host statistics yourself!

pip install "git+https://github.com/michaelthomasletts/pepy-stats.git"

If you're wondering why this project isn't indexed on PyPi, that's because the name of this package is too similar to other projects already on PyPi (and I'm too lazy to change it)! 😬 Sorry -- you will need to install it from git instead!

Usage

pepy-stats includes a CLI! 😎 Just install the package and you're good to go. In the below example, we pretend abcd1234 is an API key for illustrative purposes.

# Fetch stats for one package
pepy-stats boto3-refresh-session -k abcd1234

# Multiple packages, custom folder, no abbreviation
pepy-stats boto3-refresh-session uv requests -k abcd1234 -o ~/Desktop -no-a

Badging

So you successfully added your Python package(s) to this repository or installed the CLI and published some total download statistics to wherever you're hosting them. Great! But now what . . . ?

Well, the total download statistics collected by this repository are published to a webpage, which can be found using the below URL pattern.

https://michaelthomasletts.github.io/pepy-stats/<package name>.json.

If you are self-hosting statistics then, of course, I cannot help you with what your URL pattern will look like 😬 . . . but I digress . . .

Anyway, the markdown for creating a Shields badge using one of those URLs may look something like this:

[![Downloads](https://img.shields.io/endpoint?url=https%3A%2F%2Fmichaelthomasletts.github.io%2Fpepy-stats%2Fboto3-refresh-session.json)](https://pepy.tech/projects/boto3-refresh-session)

Which, using the above markdown code, returns a Shields badge like this:

Downloads

But with a little magic . . . 🪄

[![Downloads](https://img.shields.io/endpoint?url=https%3A%2F%2Fmichaelthomasletts.github.io%2Fpepy-stats%2Fboto3-refresh-session.json&style=social&logo=python&labelColor=555&color=FF0000)](https://pepy.tech/projects/boto3-refresh-session)

We could get something like this! 😌

Downloads

About

A basic tool for fetching total download statistics from PePy for custom Shields badges. Runs daily. Statistics hosted by GitHub Pages.

Topics

Resources

Stars

Watchers

Forks

Languages