All my download metrics in one place
Posted on:
less than a minute
I've been working with companies that have multiple libraries in different languages that get published to a bunch of repositories. At Cryptlex, I developed packages for 4 platforms out of the 12 or so that are supported. These get shipped to Crates.io, NuGet, npmjs, and Sonarqube repositories.
I wanted to understand how these packages are adopted and see a normalized view of this data so I could prioritize which of these to focus on based on adoption. As my projects often go, I wanted this to be a frontend only project.
After looking at the repositories, I found
- PyPI only provides stats for the top 100 packages on the repository. Alternatively, pypistats has download data and provides a JSON API for the same. The BigQuery tables are also open to be downloaded/queried.
- The NuGet API provides some statistics but the a) the CORS headers make it unfavorable for the application to be frontend only, and b) the data is only available for the past 6 weeks.
- The npmjs registry endpoint (https://registry.npmjs.org/package-name) was the most permissive out of the lot. No CORS, which is why it powers frontend applications like npmcharts.
Before I could get to crates.io or sonarqube, I found libraries.io, which seems to do exactly what I'm aiming to do here. I have yet to use it, I will write more when I do.