How to get download stats of Python package from different countries?

I want to plot a geographic downloading distribution of some Python packages. However, I find it isn’t easy since PyPI stat only provides the total downloading times in different periods.

I found there is a website called “pepy tech” that can do this job but needs to pay for a subscription. (Now you are not even able to pay because of bugs.)

Is there an easier way to get these downloading data with location information? Thanks.

This question is also posted on stack overflow.
https://stackoverflow.com/staging-ground/79165425

You can do this analysis yourself using SQL and the bigquery dataset pypi provides. See here: Analyzing PyPI package downloads - Python Packaging User Guide

1 Like

Interesting! How does one find all fields for the table? This link https://console.cloud.google.com/bigquery?pli=1&p=bigquery-public-data&d=pypi&t=file_downloads&page=table just takes me to Google Big Query. I have not used it before and I’m not seeing a schema for the table OP wants.

Oh wait. I created a new project and it appears there’s a field called country_code.

1 Like

If you read a bit further on the page I linked, there is a short excerpt of the schema, and directly above that table there is a link to the full schema.

1 Like

Wow, there are all kinds of databases here.

1 Like