feat: examples: improve extra fields export compatibility and parsing#1
Open
MoustaphaCamara wants to merge 1 commit intoELN-uzun:patch-3from
Open
feat: examples: improve extra fields export compatibility and parsing#1MoustaphaCamara wants to merge 1 commit intoELN-uzun:patch-3from
MoustaphaCamara wants to merge 1 commit intoELN-uzun:patch-3from
Conversation
Enhance resource_extra_fields_export example script to support multiple API response formats and improve robustness. - Use `_preload_content=False` and manually decode JSON response. - Support metadata returned as either JSON string or object. - Normalize extra field keys for case/space-insensitive matching. - Add backward compatibility for different elabapi_python versions (dict-style and object-style access). - Use safe `.get()` access for item fields. - Ignore generated export files via `.gitignore` (export.*). This makes the example script more resilient across API versions and metadata formats.
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.
Enhance resource_extra_fields_export example script to support multiple API response formats and improve robustness.
_preload_content=Falseand manually decode JSON response..get()access for item fields..gitignore(export.*).This makes the example script more resilient across API versions and metadata formats.