Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for "last updated" dates by package #161

Open
jaraco opened this issue Aug 23, 2024 · 1 comment
Open

Support for "last updated" dates by package #161

jaraco opened this issue Aug 23, 2024 · 1 comment

Comments

@jaraco
Copy link

jaraco commented Aug 23, 2024

I know this project focuses on "downloads", but I wonder if the Bigtable also has info on when a package was last uploaded. I'd like to be able to query for all packages that were updated in a given time horizon in order to efficiently refresh a database mapping import names to packages.

Is that in the scope of this project? Is there a good way to explore the data schema to see what data might already be available?

Thanks for any advice.

@hugovk
Copy link
Collaborator

hugovk commented Aug 24, 2024

You can get this directly from the PyPI JSON API without needing to set up or use BigQuery quota:

https://pypi.org/pypi/norwegianblue/json

For example:

>>> import json, requests
>>> package = "norwegianblue"
>>> url = f"https://pypi.org/pypi/{package}/json"
>>> response = requests.get(url)
>>> response.raise_for_status()
>>> data = json.loads(response.content)
>>> for url in data["urls"]:
...     print(url["upload_time"])
...
2024-02-14T21:34:37
2024-02-14T21:34:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants