Update to newest version of ESS-DIVE Dataset API#21
Merged
caufieldjh merged 2 commits intoMay 9, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the handling of authentication for ESS-DIVE metadata access, making public metadata retrieval possible without a token and clarifying related documentation and error handling. The code now gracefully supports both anonymous and authenticated requests, and the test suite has been expanded to verify these behaviors.
Authentication and API request handling:
essdive.py) to allow anonymous public metadata access by omitting theAuthorizationheader when no valid token is provided. Added helper functionsnormalize_essdive_tokenand_essdive_headersfor robust token normalization and header construction. The API now accepts both DOI and ESS-DIVE package identifiers and correctly encodes them for requests. [1] [2] [3] [4]CLI and error handling improvements:
cli.py), so commands no longer fail ifESSDIVE_TOKENis unset, enabling public metadata retrieval without authentication. [1] [2]Documentation updates:
README.mdto clarify that a token is only needed for non-public datasets, revised environment variable instructions, and improved troubleshooting guidance for authenticated access. [1] [2] [3] [4]Testing enhancements:
test_essdive_api.py) to cover anonymous access, token normalization, inclusion/omission of theAuthorizationheader, and support for both DOI and ESS-DIVE package identifiers. [1] [2] [3]