PypiMeter is a web application built using Streamlit that provides statistics and insights about Python packages from PyPI (Python Package Index). It fetches data from the PyPI Stats API and displays various statistics including recent downloads, overall downloads, system stats, and Python version stats for a given Python package.
Whenever a user searches for a package, under the "Recent Stats" Section, the data available are for
Last Day
Last Week
Last Month
It would be really useful, to get a total download count of the package till then, since its release!
Required Solution
The addition of a new row "Total Downloads", would be really useful. It can be placed right under the "Recent Stats" Section.
A Probable Approach
Currently, the app is using the PypiStats API. If one goes through the documentation, it can be found, that it does not have any way to return the "Total Download Count".
So, Is this unsolvable? Absolutely Not!
There are two options that I have thought of.
1: We directly try and fetch Data using Queries from the Google BigQuery PyPI downloads tables. This would require running a Cron-Job thing, to refresh the statistics at a particular time of the day, to prevent storage of stale data.
2: Another Approach would be to shift to a new API altogether! I have thought of using Pepy.tech API. This would require us to refactor the code base almost completely, as per the new documentation. We will still be using a Similar Caching Mechanism, to abide by the API Ethics.
Benefits of using Pepy API: One of the many other benefits is, that we get a separate download count for each separate version of the same package. That would make our charts more detailed for analysis!
Note:
Work on this would require quite some time! I am planning to implement these changes in v2.0. Any suggestions would be appreciated!
Description
Whenever a user searches for a package, under the "Recent Stats" Section, the data available are for
It would be really useful, to get a total download count of the package till then, since its release!
Required Solution
The addition of a new row "Total Downloads", would be really useful. It can be placed right under the "Recent Stats" Section.
A Probable Approach
Currently, the app is using the PypiStats API. If one goes through the documentation, it can be found, that it does not have any way to return the "Total Download Count".
So, Is this unsolvable? Absolutely Not!
There are two options that I have thought of.
1: We directly try and fetch Data using Queries from the Google BigQuery PyPI downloads tables. This would require running a Cron-Job thing, to refresh the statistics at a particular time of the day, to prevent storage of stale data.
2: Another Approach would be to shift to a new API altogether! I have thought of using Pepy.tech API. This would require us to refactor the code base almost completely, as per the new documentation. We will still be using a Similar Caching Mechanism, to abide by the API Ethics.
Benefits of using Pepy API: One of the many other benefits is, that we get a separate download count for each separate version of the same package. That would make our charts more detailed for analysis!
Note:
Work on this would require quite some time! I am planning to implement these changes in v2.0. Any suggestions would be appreciated!