Source to access data from Zenodo based on record ID or DOI - #933
Source to access data from Zenodo based on record ID or DOI#933chpolste wants to merge 8 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #933 +/- ##
===========================================
+ Coverage 82.27% 82.35% +0.08%
===========================================
Files 239 240 +1
Lines 17018 17120 +102
Branches 823 829 +6
===========================================
+ Hits 14001 14099 +98
- Misses 2770 2773 +3
- Partials 247 248 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0e00edc to
a4225dd
Compare
a4225dd to
f74f651
Compare
There was a problem hiding this comment.
Pull request overview
Adds a Zenodo data source that resolves record IDs and DOIs into downloadable file URLs.
Changes:
- Adds Zenodo identifier parsing, API access, and file filtering.
- Adds offline tests for supported identifiers and API failures.
- Documents the source and declares
requestsas a dependency.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/earthkit/data/sources/zenodo.py |
Implements the Zenodo source. |
tests/sources/test_zenodo.py |
Tests parsing, selection, and failures. |
docs/source/concepts/inputs/from_source.rst |
Documents Zenodo usage. |
pyproject.toml |
Adds the requests dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@chpolste, thanks for adding this new source! Yes, it is important to have a real test like that. It should be protected by Tests marked like that are skipped in the CI and are only active when pytest is run with the |
| ---------- | ||
| identifier : int | str | ||
| Record ID, Zenodo URL or DOI. A DOI may also be given as a doi.org URL. | ||
| only : str | Sequence[str] | None, optional |
There was a problem hiding this comment.
Maybe filter is a better name thanonly for this kwargs. The "file" source already has a filter kwarg with a similar meaning.
Description
MultiUrlsource for accessing the files.fnmatch, so users can select, e.g., all netcdf files of a record conveniently. Files can also be selected explicitly by providing a list of files.requestsas an explicit dependency. As far as I can tell, it was already pulled in by themultiurldependency previously.docs preview
Usage
Tests
The current test suite only checks that the Zenodo source produces correct URLs. It mocks the
requestsmodule and produces responses as expected from the Zenodo API to avoid spamming API requests to the actual Zenodo API.Questions
onlya good name for the file selection argument?Contributor Declaration
By opening this pull request, I affirm the following: