pypi-download-stats

GitHub Forks GitHub Open Issues Code Health travis-ci for master branch coverage report for master branch sphinx documentation for latest release Project Status: Active - The project has reached a stable, usable state and is being actively developed.

Introduction

This package retrieves download statistics from Google BigQuery for one or more PyPI packages, caches them locally, and then generates download count badges as well as an HTML page of raw data and graphs (generated by bokeh ). It’s intended to be run on a schedule (i.e. daily) and have the results uploaded somewhere.

It would certainly be nice to make this into a real service (and some extension points for that have been included), but at the moment I have neither the time to dedicate to that, the money to cover some sort of hosting and bandwidth, nor the desire to handle how to architect this for over 85,000 projects as opposed to my few.

Hopefully stats like these will eventually end up in the official PyPI; see warehouse #699, #188 and #787 for reference on that work. For the time being, I want to (a) give myself a way to get simple download stats and badges like the old PyPI legacy (downloads per day, week and month) as well as (b) enable some higher-granularity analysis.

Note this package is very young; I wrote it as an evening/weekend project, hoping to only take a few days on it. Though writing this makes me want to bathe immediately, it has no tests. If people start using it, I’ll change that.

For a live example of exactly how the output looks, you can see the download stats page for my awslimitchecker project, generated by a cronjob on my desktop, at: http://jantman-personal-public.s3-website-us-east-1.amazonaws.com/pypi-stats/awslimitchecker/index.html.

Background

Sometime in February 2016, download stats stopped working on pypi.python.org. As I later learned, what we currently (August 2016) know as pypi is really the pypi-legacy codebase, and is far from a stable hands-off service. The small team of interpid souls who keep it running have their hands full simply keeping it online, while also working on its replacement, warehouse (which as of August 2016 is available online at https://pypi.io/). While the actual pypi.python.org web UI hasn’t been switched over to the warehouse code yet (it’s still under development), the current Warehouse service does provide full access to pypi. It’s completely understandable that, given all this and the “life support” status of the legacy pypi codebase, download stats in a legacy codebase are their last concern.

However, current download statistics (actually the raw log information) since January 22, 2016 are available in a Google BigQuery public dataset and being updated in near-real-time. There may be download statistics functionality

Requirements

  • Python 2.7+ (currently tested with 2.7, 3.2, 3.3, 3.4)
  • Python VirtualEnv and pip (recommended installation method; your OS/distribution should have packages for these)

pypi-download-stats relies on bokeh to generate pretty SVG charts that work offline, and google-api-python-client for querying BigQuery. Each of those have additional dependencies.

Installation

It’s recommended that you install into a virtual environment (virtualenv / venv). See the virtualenv usage documentation for information on how to create a venv.

This isn’t on pypi yet, ironically. Until it is:

$ pip install git+https://github.com/jantman/pypi-download-stats.git

Configuration

You’ll need Google Cloud credentials for a project that has the BigQuery API enabled. The recommended method is to generate system account credentials; download the JSON file for the credentials and export the path to it as the GOOGLE_APPLICATION_CREDENTIALS environment variable. The system account will need to be added as a Project Member.

Usage

Run with -h for command-line help:

usage: pypi-download-stats [-h] [-V] [-v] [-Q | -G] [-o OUT_DIR]
                           [-p PROJECT_ID] [-c CACHE_DIR] [-B BACKFILL_DAYS]
                           [-P PROJECT | -U USER]

pypi-download-stats - Calculate detailed download stats and generate HTML and
badges for PyPI packages - <https://github.com/jantman/pypi-download-stats>

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -v, --verbose         verbose output. specify twice for debug-level output.
  -Q, --no-query        do not query; just generate output from cached data
  -G, --no-generate     do not generate output; just query data and cache
                        results
  -o OUT_DIR, --out-dir OUT_DIR
                        output directory (default: ./pypi-stats
  -p PROJECT_ID, --project-id PROJECT_ID
                        ProjectID for your Google Cloud user, if not using
                        service account credentials JSON file
  -c CACHE_DIR, --cache-dir CACHE_DIR
                        stats cache directory (default: ./pypi-stats-cache)
  -B BACKFILL_DAYS, --backfill-num-days BACKFILL_DAYS
                        number of days of historical data to backfill, if
                        missing (defaut: 7). Note this may incur BigQuery
                        charges. Set to -1 to backfill all available history.
  -P PROJECT, --project PROJECT
                        project name to query/generate stats for (can be
                        specified more than once; this will reduce query cost
                        for multiple projects)
  -U USER, --user USER  Run for all PyPI projects owned by the specifieduser.

To run queries and generate reports for PyPI projects “foo” and “bar”, using a Google Cloud credentials JSON file at foo.json:

$ export GOOGLE_APPLICATION_CREDENTIALS=/foo.json
$ pypi-download-stats -P foo -P bar

To run queries but not generate reports for all PyPI projects owned by user “myname”:

$ export GOOGLE_APPLICATION_CREDENTIALS=/foo.json
$ pypi-download-stats -G -U myname

To generate reports against cached query data for the project “foo”:

$ export GOOGLE_APPLICATION_CREDENTIALS=/foo.json
$ pypi-download-stats -Q -P foo

To run nightly and upload results to a website-hosting S3 bucket, I use the following script via cron (note the paths are specific to my purpose; also note the two commands, as s3cmd does not seem to set the MIME type for the SVG images correctly):

#!/bin/bash -x

export GOOGLE_APPLICATION_CREDENTIALS=/home/jantman/.ssh/pypi-bigquery.json
cd /home/jantman/GIT/pypi-download-stats
bin/pypi-download-stats -vv -U jantman

# sync html files
~/venvs/foo/bin/s3cmd -r --delete-removed --stats --exclude='*.svg' sync pypi-stats s3://jantman-personal-public/
# sync SVG and set mime-type, since s3cmd gets it wrong
~/venvs/foo/bin/s3cmd -r --delete-removed --stats --exclude='*.html' --mime-type='image/svg+xml' sync pypi-stats s3://jantman-personal-public/

Cost

At this point… I have no idea. Some of the download tables are 3+ GB per day. I imagine that backfilling historical data from the beginning of what’s currently there (20160122) might incur quite a bit of data cost.

Bugs and Feature Requests

Bug reports and feature requests are happily accepted via the GitHub Issue Tracker. Pull requests are welcome. Issues that don’t have an accompanying pull request will be worked on as my time and priority allows.

Development

To install for development:

  1. Fork the pypi-download-stats repository on GitHub
  2. Create a new branch off of master in your fork.
$ virtualenv pypi-download-stats
$ cd pypi-download-stats && source bin/activate
$ pip install -e git+git@github.com:YOURNAME/pypi-download-stats.git@BRANCHNAME#egg=pypi-download-stats
$ cd src/pypi-download-stats

The git clone you’re now in will probably be checked out to a specific commit, so you may want to git checkout BRANCHNAME.

Guidelines

  • pep8 compliant with some exceptions (see pytest.ini)

Testing

There isn’t any right now. I’m bad. If people actually start using this, I’ll refactor and add tests, but for now this started as a one-night project.

Release Checklist

  1. Open an issue for the release; cut a branch off master for that issue.
  2. Confirm that there are CHANGES.rst entries for all major changes.
  3. Ensure that Travis tests passing in all environments.
  4. Ensure that test coverage is no less than the last release (ideally, 100%).
  5. Increment the version number in pypi-download-stats/version.py and add version and release date to CHANGES.rst, then push to GitHub.
  6. Confirm that README.rst renders correctly on GitHub.
  7. Upload package to testpypi:
  8. Create a pull request for the release to be merged into master. Upon successful Travis build, merge it.
  9. Tag the release in Git, push tag to GitHub:
    • tag the release. for now the message is quite simple: git tag -a X.Y.Z -m 'X.Y.Z released YYYY-MM-DD'
    • push the tag to GitHub: git push origin X.Y.Z
  1. Upload package to live pypi:
    • twine upload dist/*
  1. make sure any GH issues fixed in the release were closed.

Contents

Example Output:

For a live example of exactly how the output looks, you can see the download stats page for my awslimitchecker project, generated by a cronjob on my desktop, at: http://jantman-personal-public.s3-website-us-east-1.amazonaws.com/pypi-stats/awslimitchecker/index.html.


Download Report for PyPI project awslimitchecker

Download Report for PyPI project awslimitchecker

As of 2016-09-01 16:10:05-0400 (EDT)

DownloadsDownloads8477/month8477/month DownloadsDownloads1701/week1701/week DownloadsDownloads243/day243/day 

Downloads by Version (hide)

Show Data Table

Date 0.1.00.1.10.1.20.1.30.2.00.2.10.2.20.2.30.3.00.3.10.3.20.4.00.4.10.4.20.4.30.4.40.5.0
2016-05-22 3 2 2 2 3 2 2 2 4 4 4 4 149 6 11
2016-05-23 6 5 5 6 7 5 5 5 9 9 9 9 159 15 50
2016-05-24 3 2 2 2 3 2 2 2 4 4 4 4 156 19 85
2016-05-25 9 8 8 8 9 8 8 8 16 16 16 16 173 24 96
2016-05-26 5 4 4 4 5 4 4 4 8 8 8 8 156 11 173
2016-05-27 3 2 2 2 3 2 2 2 4 4 4 4 153 7 59
2016-05-28 3 3 3 3 3 3 3 3 6 6 6 6 150 7 6
2016-05-29 2 2 2 2 2 2 2 2 4 4 4 4 148 4 4
2016-05-30 4 3 3 3 4 3 3 3 6 6 6 6 151 7 9
2016-05-31 1 1 1 1 1 1 1 1 2 3 2 2 176 17 71
2016-06-01 9 8 8 8 9 8 8 8 16 16 16 16 230 42 55
2016-06-02 8 7 7 7 8 7 7 7 14 15 14 14 219 32 149
2016-06-03 6 5 5 5 6 5 5 5 10 10 10 10 210 29 54
2016-06-04 6 5 5 5 6 5 5 5 10 10 10 10 155 11 16
2016-06-05 1 1 1 145 1 15
2016-06-06 4 3 3 3 4 3 3 3 6 6 6 6 173 24 88
2016-06-07 6 5 5 5 6 5 5 5 10 10 10 10 194 23 56
2016-06-08 5 4 4 4 5 4 4 4 8 8 8 8 181 38 48
2016-06-09 1 1 1 1 1 1 1 1 2 2 2 2 173 28 59
2016-06-10 3 2 2 2 3 2 2 2 4 4 4 4 298 12 91
2016-06-11 4 3 3 3 4 3 3 3 7 6 6 6 151 6 19
2016-06-12 3 2 2 2 3 2 2 2 5 5 5 5 149 5 12
2016-06-13 6 5 5 5 6 5 5 5 11 10 10 10 205 20 52
2016-06-14 3 2 2 2 3 2 2 2 4 4 4 4 250 19 38
2016-06-15 5 4 4 4 5 4 4 4 8 8 8 8 184 13 190
2016-06-16 3 3 3 3 4 3 3 3 6 6 6 6 214 9 117
2016-06-17 6 5 5 5 6 5 5 5 10 10 10 10 12 25 240
2016-06-18 3 2 2 2 3 2 2 2 4 4 4 4 5 8 155
2016-06-19 2 1 1 1 2 1 1 1 2 2 2 2 3 2 148
2016-06-20 5 4 4 4 5 4 4 4 8 8 8 8 15 38 364
2016-06-21 5 4 4 4 5 4 4 4 8 8 8 8 16 22 250
2016-06-22 7 6 6 6 7 6 6 6 12 12 12 12 17 17 238
2016-06-23 8 7 7 7 8 7 7 7 14 14 14 14 25 19 118
2016-06-24 2 1 1 1 2 1 1 1 2 2 2 2 4 4 89
2016-06-25 1 1 3 2
2016-06-26 3 1 1 1 2 1 1 1 2 2 2 2 3 2 3
2016-06-27 3 2 2 2 3 2 2 2 4 4 4 4 11 13 92
2016-06-28 3 2 2 2 3 2 2 2 4 4 4 4 6 9 60 342
2016-06-29 10 9 9 9 10 9 9 9 18 18 18 18 21 19 32 88
2016-06-30 2 1 1 1 2 1 1 1 2 2 2 2 6 3 73 96
2016-07-01 7 6 6 6 7 6 6 6 12 12 12 12 13 16 62 75
2016-07-02 4 2 2 2 4 3 3 3 6 6 6 4 8 6 4 15
2016-07-03 2 1 1 1 2 1 1 1 2 2 2 2 4 2 2 11
2016-07-04 2 1 1 1 2 1 1 1 2 2 2 2 3 7 3 39
2016-07-05 3 2 2 2 3 2 2 2 4 4 4 4 11 19 55 75
2016-07-06 4 3 3 3 4 3 3 3 6 6 6 6 8 17 71 56 259
2016-07-07 1 1 1 3 18 75 8 317
2016-07-08 7 6 6 6 7 6 6 6 12 12 12 12 15 27 53 19 217
2016-07-09 4 3 3 3 4 3 3 3 6 6 7 6 7 17 6 12 137
2016-07-10 2 1 1 1 2 1 1 1 2 2 2 2 4 12 2 8 123
2016-07-11 3 2 2 2 3 2 2 2 4 4 4 4 8 18 85 8 181
2016-07-12 4 3 3 4 4 3 3 3 6 6 6 6 11 26 98 6 200
2016-07-13 5 4 4 4 5 4 4 4 8 8 8 8 10 26 111 8 212
2016-07-14 3 2 2 2 3 2 2 2 4 4 4 4 5 18 98 9 219
2016-07-15 5 4 4 4 5 4 4 4 9 8 8 8 10 22 84 12 159
2016-07-16 2 1 1 1 2 1 1 1 2 2 2 2 3 12 2 2 117
2016-07-17 2 1 1 1 2 1 1 1 2 2 2 2 3 12 2 3 119
2016-07-18 5 4 4 4 5 4 4 4 8 8 8 8 10 22 82 12 163
2016-07-19 7 6 6 6 7 6 6 6 12 12 12 12 14 25 73 14 207
2016-07-20 4 3 3 3 4 3 5 4 8 8 8 6 9 28 44 10 190
2016-07-21 7 6 6 6 6 6 4 5 9 10 10 12 12 32 44 11 185
2016-07-22 2 1 1 1 2 1 2 1 2 2 2 2 4 28 39 8 188
2016-07-23 2 2 2 2 2 2 2 2 4 4 4 4 4 15 4 4 118
2016-07-24 1 1 1 1 12 53
2016-07-25 1 1 1 1 1 1 1 1 2 2 2 2 3 17 49 4 122
2016-07-26 4 4 4 4 4 4 4 4 8 8 8 8 8 22 48 8 167
2016-07-27 6 6 6 6 6 6 6 6 13 12 12 12 14 27 50 14 182
2016-07-28 6 6 6 6 6 6 6 6 12 12 12 12 16 41 67 12 206
2016-07-29 7 7 7 7 7 7 7 7 14 14 14 14 14 25 34 14 175
2016-07-30 4 4 4 4 4 4 4 4 8 8 8 8 8 20 12 8 134
2016-07-31 6 5 4 5 6 5 5 4 9 9 9 8 11 21 9 9 121
2016-08-01 8 8 8 8 8 8 8 8 16 16 16 16 16 38 61 18 193
2016-08-02 5 5 5 5 5 5 5 5 10 10 10 10 12 28 36 13 165
2016-08-03 4 5 5 5 5 5 5 5 10 9 9 10 10 25 43 9 171
2016-08-04 6 6 6 6 6 6 6 6 12 12 12 12 15 41 47 12 178
2016-08-05 5 5 5 5 5 5 5 5 10 10 10 10 10 23 61 10 194
2016-08-06 4 4 4 4 4 4 4 4 8 8 8 8 8 20 8 9 120
2016-08-07 5 4 4 4 5 4 4 4 8 8 8 8 9 17 8 8 125
2016-08-08 6 6 6 6 7 7 7 7 14 14 14 12 18 30 59 14 163
2016-08-09 3 3 3 3 3 3 3 3 6 6 6 6 9 37 30 8 159
2016-08-10 4 4 4 4 4 4 4 4 8 8 8 8 9 32 48 11 160
2016-08-11 8 8 8 8 8 8 8 8 17 16 18 16 16 30 64 16 166
2016-08-12 3 3 3 3 3 3 3 3 6 6 6 6 6 19 60 6 155
2016-08-13 2 2 2 2 2 2 2 2 4 4 4 4 4 18 4 4 122
2016-08-14 1 1 1 9 3 125
2016-08-15 15 41 161
2016-08-16 6 6 6 6 6 6 6 6 12 12 12 12 13 23 25 14 160
2016-08-17 5 5 5 5 5 5 5 5 10 10 10 10 12 33 36 12 159
2016-08-18 7 7 7 7 7 7 7 7 14 14 12 14 15 32 60 16 167
2016-08-19 4 5 5 5 5 4 4 5 10 8 10 10 11 19 35 10 152
2016-08-20 6 6 6 6 6 6 6 6 12 12 12 12 12 20 12 12 127
2016-08-21 3 2 2 2 3 2 2 2 4 4 4 4 5 13 4 4 115
2016-08-22 3 3 3 3 3 3 3 3 6 6 6 6 10 27 34 6 182
2016-08-23 1 1 1 1 1 1 1 1 2 2 2 2 3 29 29 2 146
2016-08-24 2 2 2 2 2 2 2 2 4 4 4 4 6 18 27 6 182
2016-08-25 6 6 6 6 6 6 6 6 12 12 12 12 12 22 29 12 156
2016-08-26 4 4 4 4 4 4 4 4 8 8 8 9 8 20 22 10 169
2016-08-27 2 2 2 2 2 2 2 2 5 5 4 4 7 12 4 4 115
2016-08-28 1 1 1 10 114
2016-08-29 2 16 12 1 167
2016-08-30 8 8 8 8 8 8 9 8 16 16 16 16 16 33 32 17 188
2016-08-31 3 3 3 4 3 3 3 3 6 6 6 6 10 17 10 6 184
2016-09-01 1 2 1 1 2 3 1 2 2 4 2 2 4 17 9 5 157

Downloads by File Type (hide)

Show Data Table

Date bdist_wheelsdist
2016-05-22 164 36
2016-05-23 218 86
2016-05-24 251 43
2016-05-25 296 127
2016-05-26 339 67
2016-05-27 213 40
2016-05-28 166 45
2016-05-29 158 30
2016-05-30 167 50
2016-05-31 260 21
2016-06-01 330 127
2016-06-02 404 111
2016-06-03 294 81
2016-06-04 184 80
2016-06-05 157 7
2016-06-06 279 56
2016-06-07 270 85
2016-06-08 268 65
2016-06-09 260 16
2016-06-10 399 36
2016-06-11 177 50
2016-06-12 162 42
2016-06-13 279 81
2016-06-14 305 36
2016-06-15 387 66
2016-06-16 339 50
2016-06-17 279 80
2016-06-18 169 33
2016-06-19 153 18
2016-06-20 417 66
2016-06-21 285 69
2016-06-22 276 94
2016-06-23 166 110
2016-06-24 94 21
2016-06-25 4 3
2016-06-26 8 19
2016-06-27 114 36
2016-06-28 261 190
2016-06-29 127 179
2016-06-30 164 32
2016-07-01 156 108
2016-07-02 28 50
2016-07-03 13 24
2016-07-04 48 22
2016-07-05 150 44
2016-07-06 290 171
2016-07-07 339 85
2016-07-08 287 142
2016-07-09 161 69
2016-07-10 136 31
2016-07-11 289 45
2016-07-12 319 73
2016-07-13 357 76
2016-07-14 317 66
2016-07-15 265 89
2016-07-16 133 21
2016-07-17 134 23
2016-07-18 275 80
2016-07-19 313 118
2016-07-20 257 83
2016-07-21 255 116
2016-07-22 235 51
2016-07-23 143 34
2016-07-24 65 4
2016-07-25 173 38
2016-07-26 239 78
2016-07-27 271 113
2016-07-28 320 118
2016-07-29 248 126
2016-07-30 177 69
2016-07-31 166 80
2016-08-01 306 148
2016-08-02 233 101
2016-08-03 245 90
2016-08-04 270 119
2016-08-05 278 100
2016-08-06 160 69
2016-08-07 159 74
2016-08-08 266 124
2016-08-09 217 74
2016-08-10 236 88
2016-08-11 272 151
2016-08-12 229 65
2016-08-13 150 34
2016-08-14 137 3
2016-08-15 195 22
2016-08-16 209 122
2016-08-17 234 98
2016-08-18 278 122
2016-08-19 212 90
2016-08-20 177 102
2016-08-21 138 37
2016-08-22 253 54
2016-08-23 207 18
2016-08-24 228 43
2016-08-25 221 106
2016-08-26 218 76
2016-08-27 142 34
2016-08-28 123 4
2016-08-29 197 1
2016-08-30 266 149
2016-08-31 195 81
2016-09-01 165 50

Downloads by Installer (hide)

Show Data Table

Date Artifactory 4.2Artifactory 4.5Browser unknownbandersnatch 0.1bandersnatch 1.0bandersnatch 1.10bandersnatch 1.11bandersnatch 1.4bandersnatch 1.5bandersnatch 1.7bandersnatch 1.8bandersnatch 1.9devpi 3.1devpi 4.0devpi 4.1pep381client 1.5pip 1.4pip 1.5pip 6.0pip 6.1pip 7.0pip 7.1pip 8.0pip 8.1requests 2.10requests 2.5requests 2.6requests 2.7requests 2.9setuptools 1.1setuptools 22.0setuptools 26.0setuptools 26.1unknownz3c.pypimirror 1.0
2016-05-22 1 3 22 1 22 143 3 1 3 1
2016-05-23 3 22 22 44 5 144 32 1 1 15 3
2016-05-24 5 44 2 7 149 50 1 2 1 3 3
2016-05-25 132 44 4 145 58 2 3 10 3
2016-05-26 1 66 22 4 145 48 3 3
2016-05-27 44 7 145 28 4 1 3
2016-05-28 66 144 1
2016-05-29 22 22 144
2016-05-30 66 2 1 144 1 3
2016-05-31 2 22 4 150 30 1 24 4
2016-06-01 22 110 44 4 150 15 2 2 3
2016-06-02 4 132 22 1 1 87 1 3
2016-06-03 1 88 22 3 2 18 3 2 3
2016-06-04 26 88 144 1 2 3
2016-06-05 1 144 1 12 3 3
2016-06-06 22 44 8 152 18 2 2 1 3
2016-06-07 4 110 3 3 13 3 5 3 1
2016-06-08 66 21 2 149 2 12 9 3
2016-06-09 22 1 23 26 2 3 7
2016-06-10 44 2 7 8 10 215 3 1
2016-06-11 1 66 1 144 1 10 3 1
2016-06-12 1 44 143 4 3 9
2016-06-13 1 88 22 2 2 10 4 4 1 3
2016-06-14 2 44 1 1 15 7 1 3 1
2016-06-15 66 2 2 126 5 1 2 224 3 22
2016-06-16 1 44 22 3 105 3 1 1 1 1
2016-06-17 1 88 22 1 1 15 1 77 3
2016-06-18 1 44 144 4 1 5 3
2016-06-19 22 144 2 3
2016-06-20 66 22 3 145 1 2 1 3
2016-06-21 22 44 22 4 150 14 3 5 3 2
2016-06-22 110 22 1 124 5 2 100 3
2016-06-23 1 132 22 2 10 5 1 1 3
2016-06-24 4 22 1 2 2 1 1 2 3
2016-06-25 2 1 3
2016-06-26 1 22 1 3
2016-06-27 23 22 3 7 1 1 7 1 4 3
2016-06-28 4 22 116 5 170 10 4 1 4 1 1 3 2 7 1
2016-06-29 1 2 204 43 2 2 2 1 1 1 24 3
2016-06-30 2 34 5 4 1 1 1 6 5 1
2016-07-01 2 104 28 2 1 4 1 1 1 5 27
2016-07-02 1 45 4 1 27
2016-07-03 26 6 1 3 1
2016-07-04 28 5 1 1 31 3
2016-07-05 50 9 2 7 15 6 102 3
2016-07-06 16 132 11 111 12 9 43 1 3 2 5 1 4
2016-07-07 4 2 34 9 4 88 2 8 123 2 2 1 4 2 7 1
2016-07-08 1 2 154 8 50 2 9 117 2 3 30 1 2 3 1
2016-07-09 1 92 11 14 2 107 3
2016-07-10 28 10 16 4 105 1 3
2016-07-11 4 2 54 11 2 4 1 142 3 48 1 3
2016-07-12 1 82 10 2 15 147 10 69 1 2 3
2016-07-13 24 26 56 12 4 1 6 66 108 3
2016-07-14 1 60 10 8 21 128 4 55 2 3
2016-07-15 2 84 10 4 12 125 4 64 1 3
2016-07-16 1 26 10 112 1 1 3
2016-07-17 3 28 9 112 1 1 3
2016-07-18 114 11 5 123 1 56 2 40 3
2016-07-19 132 8 6 9 118 5 37 2 3
2016-07-20 2 96 9 17 116 11 23 4 3
2016-07-21 4 113 9 26 19 116 13 9 59 3
2016-07-22 4 5 12 30 23 5 14 28 1 1 2 3
2016-07-23 52 10 113 1 1
2016-07-24 3 12 1 21 1 28 3
2016-07-25 1 4 26 10 1 18 63 1 34 1 45
2016-07-26 1 78 10 26 1 10 95 3 26 1 2
2016-07-27 2 78 9 78 4 1 8 1 6 17 1
2016-07-28 104 11 16 121 18 35 2
2016-07-29 156 10 26 7 122 1 8 43
2016-07-30 78 12 28 112 16
2016-07-31 68 11 26 111 1 3
2016-08-01 166 11 26 7 128 9 19 3
2016-08-02 1 106 11 30 13 117 7 21 1 1
2016-08-03 1 100 10 26 8 125 5 17 1
2016-08-04 1 132 9 26 15 124 20 1 1 1 1
2016-08-05 104 10 26 15 126 3 11 1
2016-08-06 1 78 12 26 112
2016-08-07 78 9 26 3 112 2 3
2016-08-08 146 10 26 12 119 6 19 1
2016-08-09 56 11 26 21 117 20 2 8 28
2016-08-10 2 58 11 52 15 125 13 26 1 18
2016-08-11 30 187 10 11 1 2 32 1 31
2016-08-12 1 78 10 13 118 2 35 2
2016-08-13 26 26 12 112 2 6
2016-08-14 9 112 3 3
2016-08-15 12 22 117 3 23 1 36
2016-08-16 156 10 4 18 117 1 1 10 13
2016-08-17 134 10 11 128 13 21 4
2016-08-18 26 4 126 11 26 2 2 9 34 42 1
2016-08-19 97 9 9 1 1 14 2
2016-08-20 26 130 8 1 1 1 2
2016-08-21 26 26 9 110 1 3
2016-08-22 52 12 26 1 3 123 9 16 1
2016-08-23 26 11 1 115 16 1 2
2016-08-24 1 56 7 4 121 7 8 1 3
2016-08-25 130 9 26 2 1 1 6 36 2
2016-08-26 27 78 10 4 6 1 1 1
2016-08-27 2 52 8 114
2016-08-28 2 10 112 3
2016-08-29 4 9 123 7 55
2016-08-30 7 208 10 2 7 116 7 1
2016-08-31 3 52 8 26 3 120 3 3 33 1 24
2016-09-01 3 30 9 9 3 4 4 1 1 28 19

Downloads by Python Implementation/Version (hide)

Show Data Table

Date CPython 2.6CPython 2.7CPython 3.3CPython 3.4CPython 3.5unknown
2016-05-22 142 1 53
2016-05-23 149 1 1 109
2016-05-24 151 9 5 54
2016-05-25 149 4 179
2016-05-26 148 3 1 92
2016-05-27 151 1 48
2016-05-28 144 1 66
2016-05-29 144 44
2016-05-30 145 1 71
2016-05-31 148 2 28
2016-06-01 148 2 1 179
2016-06-02 145 102 161
2016-06-03 147 4 1 114
2016-06-04 144 2 117
2016-06-05 144 12 7
2016-06-06 151 6 1 2 70
2016-06-07 147 2 118
2016-06-08 146 10 90
2016-06-09 94 4 1 22
2016-06-10 146 2 2 48
2016-06-11 144 10 72
2016-06-12 143 4 57
2016-06-13 145 4 115
2016-06-14 144 129 50
2016-06-15 126 1 93
2016-06-16 107 3 1 1 69
2016-06-17 145 6 1 114
2016-06-18 144 6 48
2016-06-19 144 2 25
2016-06-20 146 2 1 2 91
2016-06-21 149 8 1 93
2016-06-22 123 4 6 135
2016-06-23 2 1 15 11 158
2016-06-24 1 4 1 9 29
2016-06-25 1 3
2016-06-26 1 26
2016-06-27 4 5 4 1 48
2016-06-28 2 8 3 5 353
2016-06-29 2 1 1 279
2016-06-30 5 4 1 1 42
2016-07-01 2 4 7 19 161
2016-07-02 1 77
2016-07-03 1 36
2016-07-04 1 1 6 12 36
2016-07-05 7 10 2 13 64
2016-07-06 8 4 1 3 308
2016-07-07 7 13 4 19 157
2016-07-08 9 7 2 6 223
2016-07-09 107 123
2016-07-10 104 1 61
2016-07-11 1 1 80
2016-07-12 15 3 3 98
2016-07-13 4 46 7 121
2016-07-14 21 9 1 6 82
2016-07-15 12 2 129
2016-07-16 1 41
2016-07-17 1 43
2016-07-18 8 1 128
2016-07-19 9 4 175
2016-07-20 17 7 1 110
2016-07-21 19 1 155
2016-07-22 23 1 56
2016-07-23 1 62
2016-07-24 28 19
2016-07-25 18 5 42
2016-07-26 10 23 116
2016-07-27 8 1 1 172
2016-07-28 16 19 1 167
2016-07-29 8 48 192
2016-07-30 16 118
2016-07-31 111 134
2016-08-01 7 5 1 229
2016-08-02 13 1 149
2016-08-03 8 1 1 137
2016-08-04 16 5 169
2016-08-05 16 2 140
2016-08-06 112 117
2016-08-07 3 1 116
2016-08-08 12 1 182
2016-08-09 17 6 93
2016-08-10 11 1 123
2016-08-11 10 2 1 227
2016-08-12 4 2 89
2016-08-13 2 1 64
2016-08-14 12 1 12
2016-08-15 8 4 12
2016-08-16 2 1 1 170
2016-08-17 13 1 2 144
2016-08-18 2 194
2016-08-19 4 132
2016-08-20 4 164
2016-08-21 1 64
2016-08-22 9 91
2016-08-23 1 2 37
2016-08-24 1 1 67
2016-08-25 1 1 167
2016-08-26 2 2 1 119
2016-08-27 3 62
2016-08-28 112 15
2016-08-29 24 13
2016-08-30 8 2 227
2016-08-31 2 3 114
2016-09-01 1 3 2 70

Downloads by System Type (hide)

Show Data Table

Date CYGWIN_NT-6.3DarwinLinuxWindowsunknown
2016-05-22 1 146 53
2016-05-23 2 193 109
2016-05-24 12 228 54
2016-05-25 2 242 179
2016-05-26 5 309 92
2016-05-27 1 203 1 48
2016-05-28 145 66
2016-05-29 144 44
2016-05-30 146 71
2016-05-31 2 251 28
2016-06-01 2 276 179
2016-06-02 353 1 161
2016-06-03 7 254 114
2016-06-04 147 117
2016-06-05 157 7
2016-06-06 10 255 70
2016-06-07 4 233 118
2016-06-08 11 232 90
2016-06-09 4 250 22
2016-06-10 5 382 48
2016-06-11 155 72
2016-06-12 147 57
2016-06-13 5 240 115
2016-06-14 1 289 1 50
2016-06-15 360 93
2016-06-16 4 316 69
2016-06-17 9 236 114
2016-06-18 154 48
2016-06-19 146 25
2016-06-20 3 388 1 91
2016-06-21 8 253 93
2016-06-22 5 230 135
2016-06-23 2 116 158
2016-06-24 8 78 29
2016-06-25 1 3 3
2016-06-26 1 26
2016-06-27 6 96 48
2016-06-28 9 89 353
2016-06-29 2 25 279
2016-06-30 8 146 42
2016-07-01 6 96 1 161
2016-07-02 1 77
2016-07-03 1 36
2016-07-04 1 33 36
2016-07-05 129 1 64
2016-07-06 4 149 308
2016-07-07 12 254 1 157
2016-07-08 205 1 223
2016-07-09 107 123
2016-07-10 1 105 61
2016-07-11 1 253 80
2016-07-12 3 291 98
2016-07-13 50 262 121
2016-07-14 10 290 1 82
2016-07-15 2 223 129
2016-07-16 113 41
2016-07-17 113 1 43
2016-07-18 227 128
2016-07-19 4 252 175
2016-07-20 12 218 110
2016-07-21 1 215 155
2016-07-22 3 227 56
2016-07-23 1 114 62
2016-07-24 28 22 19
2016-07-25 6 162 1 42
2016-07-26 25 175 1 116
2016-07-27 3 207 2 172
2016-07-28 1 20 249 1 167
2016-07-29 182 192
2016-07-30 128 118
2016-07-31 111 1 134
2016-08-01 6 219 229
2016-08-02 1 184 149
2016-08-03 3 195 137
2016-08-04 4 216 169
2016-08-05 3 235 140
2016-08-06 112 117
2016-08-07 117 116
2016-08-08 1 206 1 182
2016-08-09 5 193 93
2016-08-10 3 198 123
2016-08-11 4 192 227
2016-08-12 4 201 89
2016-08-13 120 64
2016-08-14 1 126 1 12
2016-08-15 5 199 1 12
2016-08-16 4 157 170
2016-08-17 3 185 144
2016-08-18 3 203 194
2016-08-19 4 166 132
2016-08-20 3 112 164
2016-08-21 111 64
2016-08-22 4 212 91
2016-08-23 2 185 1 37
2016-08-24 2 202 67
2016-08-25 3 157 167
2016-08-26 1 174 119
2016-08-27 114 62
2016-08-28 112 15
2016-08-29 185 13
2016-08-30 13 173 2 227
2016-08-31 3 159 114
2016-09-01 6 139 70

Downloads by Country (hide)

Show Data Table

Date A1 (A1)Argentina (AR)Australia (AU)Austria (AT)Belgium (BE)Brazil (BR)Bulgaria (BG)Cambodia (KH)Canada (CA)Chile (CL)China (CN)Cuba (CU)Czech Republic (CZ)Denmark (DK)EU (EU)Finland (FI)France (FR)Germany (DE)Hong Kong (HK)Hungary (HU)India (IN)Indonesia (ID)Ireland (IE)Israel (IL)Italy (IT)Japan (JP)Korea, Republic of (KR)Mexico (MX)Netherlands (NL)New Zealand (NZ)Nigeria (NG)Norway (NO)Philippines (PH)Poland (PL)Romania (RO)Russian Federation (RU)Serbia (RS)Singapore (SG)Slovakia (SK)South Africa (ZA)Spain (ES)Sweden (SE)Switzerland (CH)Taiwan, Province of China (TW)Ukraine (UA)United Arab Emirates (AE)United Kingdom (GB)United States (US)null (null)
2016-05-22 23 1 22 154
2016-05-23 1 1 22 280
2016-05-24 2 1 22 1 1 267
2016-05-25 22 22 22 3 44 22 22 266
2016-05-26 22 1 1 22 22 338
2016-05-27 22 1 1 1 228
2016-05-28 22 22 167
2016-05-29 22 166
2016-05-30 22 2 22 22 149
2016-05-31 4 22 1 254
2016-06-01 1 22 22 22 22 22 346
2016-06-02 44 22 24 1 44 380
2016-06-03 44 1 22 1 22 285
2016-06-04 22 44 22 22 2 152
2016-06-05 1 163
2016-06-06 1 1 333
2016-06-07 1 22 2 22 308
2016-06-08 22 1 1 1 308
2016-06-09 22 254
2016-06-10 22 1 22 390
2016-06-11 22 22 22 161
2016-06-12 22 7 22 153
2016-06-13 2 22 1 335
2016-06-14 44 297
2016-06-15 22 22 1 22 386
2016-06-16 44 1 1 343
2016-06-17 1 22 22 22 292
2016-06-18 22 22 158
2016-06-19 22 149
2016-06-20 1 22 22 1 2 2 433
2016-06-21 1 2 22 25 304
2016-06-22 1 22 22 3 6 1 22 22 271
2016-06-23 44 22 10 44 14 142
2016-06-24 24 10 1 9 71
2016-06-25 7
2016-06-26 22 5
2016-06-27 14 23 2 111
2016-06-28 2 2 1 4 52 2 2 2 10 12 4 7 2 2 12 6 2 2 4 10 2 2 4 4 4 7 288
2016-06-29 2 2 2 2 2 54 26 1 24 2 1 2 2 1 183
2016-06-30 6 1 2 30 1 2 1 153
2016-07-01 2 54 24 27 26 24 3 104
2016-07-02 41 2 24 2 9
2016-07-03 4 26 7
2016-07-04 2 1 2 18 2 5 7 33
2016-07-05 1 18 9 2 164
2016-07-06 4 59 2 2 2 37 10 4 7 2 2 6 2 2 6 14 2 2 15 2 29 250
2016-07-07 6 2 1 2 8 2 2 4 23 4 5 4 4 4 11 8 334
2016-07-08 6 32 2 2 9 26 31 26 2 8 4 1 280
2016-07-09 2 4 4 52 2 4 2 11 4 145
2016-07-10 30 2 5 2 4 10 2 112
2016-07-11 8 1 26 26 11 2 2 258
2016-07-12 2 2 26 30 10 322
2016-07-13 38 22 1 10 32 12 318
2016-07-14 8 4 2 1 7 1 10 2 348
2016-07-15 26 1 6 2 10 309
2016-07-16 2 26 10 116
2016-07-17 2 1 2 9 26 117
2016-07-18 26 1 26 26 4 12 26 234
2016-07-19 26 54 30 1 8 2 310
2016-07-20 52 4 3 9 272
2016-07-21 26 2 1 9 306 27
2016-07-22 27 2 3 1 12 241
2016-07-23 10 167
2016-07-24 27 1 1 12 27 1
2016-07-25 4 1 1 12 2 190 1
2016-07-26 20 26 1 1 1 1 10 255 2
2016-07-27 52 26 27 2 1 9 1 265 1
2016-07-28 15 2 27 26 26 26 11 26 279
2016-07-29 26 26 1 52 26 10 233
2016-07-30 2 26 26 12 180
2016-07-31 42 26 26 26 11 114 1
2016-08-01 1 2 1 1 1 26 78 26 1 26 11 26 254
2016-08-02 26 52 26 1 26 2 11 190
2016-08-03 1 22 26 26 1 26 10 223
2016-08-04 26 26 26 26 1 1 9 1 273
2016-08-05 26 26 3 10 313
2016-08-06 26 26 26 12 139
2016-08-07 26 26 27 9 145
2016-08-08 94 26 1 10 233 26
2016-08-09 3 1 26 26 4 1 11 193 26
2016-08-10 1 27 26 11 1 258
2016-08-11 1 83 52 1 2 10 52 196 26
2016-08-12 1 26 27 27 10 203
2016-08-13 26 12 120 26
2016-08-14 1 9 130
2016-08-15 12 204 1
2016-08-16 1 26 1 10 293
2016-08-17 52 4 1 26 10 239
2016-08-18 26 52 2 1 1 11 280 27
2016-08-19 1 26 26 9 240
2016-08-20 1 8 244 26
2016-08-21 1 26 9 139
2016-08-22 1 26 1 1 26 12 2 238
2016-08-23 1 1 2 11 210
2016-08-24 52 1 7 211
2016-08-25 26 1 52 26 1 26 9 185 1
2016-08-26 3 26 4 1 26 26 10 198
2016-08-27 26 8 142
2016-08-28 1 10 116
2016-08-29 17 9 172
2016-08-30 1 2 26 7 2 26 10 26 314 1
2016-08-31 1 13 26 1 26 8 201
2016-09-01 30 1 9 175

Downloads by Distro (hide)

Show Data Table

Date CentOS 6CentOS Linux 7Fedora 22Fedora 23Fedora 24Gentoo Base System 2OS X 10.10OS X 10.11OS X 10.12OS X 10.8OS X 10.9RHEL 5RHEL 6RHEL 7Slackware 14Ubuntu 12Ubuntu 14Ubuntu 15Ubuntu 16arch unknowndebian 7debian 8debian jessie/siddebian stretch/sidopenSUSE 13unknown
2016-05-22 1 199
2016-05-23 5 1 6 290
2016-05-24 1 2 1 4 6 15 261
2016-05-25 21 1 1 1 8 388
2016-05-26 107 2 1 1 2 289
2016-05-27 18 1 1 3 229
2016-05-28 1 210
2016-05-29 188
2016-05-30 1 216
2016-05-31 53 1 1 13 212
2016-06-01 1 79 1 1 26 348
2016-06-02 102 18 395
2016-06-03 79 1 1 20 1 267
2016-06-04 2 1 261
2016-06-05 12 1 151
2016-06-06 72 1 1 1 19 3 230
2016-06-07 65 1 1 13 273
2016-06-08 47 1 30 245
2016-06-09 104 1 26 142
2016-06-10 219 2 1 8 202
2016-06-11 10 1 216
2016-06-12 4 200
2016-06-13 75 5 10 1 265
2016-06-14 115 1 4 15 196
2016-06-15 184 5 1 5 222
2016-06-16 114 1 1 3 2 177
2016-06-17 15 1 3 15 263
2016-06-18 1 4 192
2016-06-19 2 169
2016-06-20 183 1 1 30 1 242
2016-06-21 1 40 1 8 1 14 1 248
2016-06-22 14 3 2 7 6 260
2016-06-23 33 1 1 5 24 1 170
2016-06-24 24 2 1 1 2 16 33
2016-06-25 1 6
2016-06-26 1 26
2016-06-27 1 30 3 3 8 7 14 59
2016-06-28 29 1 7 1 4 2 7 359
2016-06-29 8 2 1 1 1 283
2016-06-30 1 61 1 2 1 1 29 52
2016-07-01 29 4 4 26 166
2016-07-02 78
2016-07-03 37
2016-07-04 5 1 2 1 17 37
2016-07-05 46 6 20 87
2016-07-06 1 45 1 1 3 4 363
2016-07-07 1 28 1 1 1 1 9 22 291
2016-07-08 25 7 8 356
2016-07-09 230
2016-07-10 1 166
2016-07-11 58 1 3 223
2016-07-12 45 1 1 2 2 11 3 260
2016-07-13 56 38 5 4 7 5 249
2016-07-14 70 9 1 6 1 8 232
2016-07-15 1 18 1 5 266
2016-07-16 1 153
2016-07-17 1 156
2016-07-18 37 3 1 1 257
2016-07-19 83 3 1 5 302
2016-07-20 50 1 2 11 243
2016-07-21 56 1 13 1 291
2016-07-22 33 1 1 14 207
2016-07-23 1 1 175
2016-07-24 27 1 41
2016-07-25 47 1 1 5 126
2016-07-26 64 21 1 3 222
2016-07-27 72 1 6 303
2016-07-28 93 15 1 18 306
2016-07-29 47 1 1 3 321
2016-07-30 16 230
2016-07-31 246
2016-08-01 71 5 1 9 1 2 364
2016-08-02 1 46 1 7 279
2016-08-03 56 2 5 270
2016-08-04 1 52 1 1 20 2 309
2016-08-05 1 90 2 3 281
2016-08-06 229
2016-08-07 1 1 231
2016-08-08 67 1 7 314
2016-08-09 29 2 3 1 20 1 1 233
2016-08-10 1 42 2 1 13 1 1 263
2016-08-11 57 1 2 4 357
2016-08-12 67 2 2 220
2016-08-13 5 2 1 176
2016-08-14 12 1 2 125
2016-08-15 55 1 5 152
2016-08-16 1 19 3 1 1 305
2016-08-17 30 3 1 13 2 283
2016-08-18 72 1 9 315
2016-08-19 41 2 2 1 253
2016-08-20 3 276
2016-08-21 175
2016-08-22 75 3 9 1 217
2016-08-23 1 48 2 2 16 2 154
2016-08-24 67 1 1 1 7 1 192
2016-08-25 36 1 3 1 1 1 284
2016-08-26 43 1 1 2 1 245
2016-08-27 176
2016-08-28 127
2016-08-29 38 24 136
2016-08-30 42 4 1 8 352
2016-08-31 2 18 1 2 16 237
2016-09-01 1 23 1 3 2 4 2 179

pypi_download_stats

pypi_download_stats package

Submodules

pypi_download_stats.dataquery module
pypi_download_stats.diskdatacache module
class pypi_download_stats.diskdatacache.DiskDataCache(cache_path)[source]

Bases: object

_path_for_file(project_name, date)[source]

Generate the path on disk for a specified project and date.

Parameters:
  • project_name – the PyPI project name for the data
  • date (datetime.datetime) – the date for the data
Returns:

path for where to store this data on disk

Return type:

str

get(project, date)[source]

Get the cache data for a specified project for the specified date. Returns None if the data cannot be found in the cache.

Parameters:
  • project (str) – PyPi project name to get data for
  • date (datetime.datetime) – date to get data for
Returns:

dict of per-date data for project

Return type:

dict or None

get_dates_for_project(project)[source]

Return a list of the dates we have in cache for the specified project, sorted in ascending date order.

Parameters:project (str) – project name
Returns:list of datetime.datetime objects
Return type:datetime.datetime
set(project, date, data, data_ts)[source]

Set the cache data for a specified project for the specified date.

Parameters:
  • project (str) – project name to set data for
  • date (datetime.datetime) – date to set data for
  • data (dict) – data to cache
  • data_ts (int) – maximum timestamp in the BigQuery data table
pypi_download_stats.graphs module
pypi_download_stats.outputgenerator module
pypi_download_stats.projectstats module
pypi_download_stats.runner module
pypi_download_stats.version module

Changelog

0.2.1 (2016-09-18)

  • Fix example cron S3 upload script in README.

0.2.0 (2016-09-18)

  • Fix packaging bug where HTML templates weren’t included in package (making this entire tool pretty useless)
  • Fix unicode output error.

0.1.0 (2016-08-28)

  • Initial release

Indices and tables

License

pypi-download-stats is licensed under the GNU Affero General Public License, version 3 or later. This shouldn’t be much of a concern to most people.