Skip to content

feat: examples: improve extra fields export compatibility and parsing#1

Open
MoustaphaCamara wants to merge 1 commit intoELN-uzun:patch-3from
elabftw:mouss-suggestions
Open

feat: examples: improve extra fields export compatibility and parsing#1
MoustaphaCamara wants to merge 1 commit intoELN-uzun:patch-3from
elabftw:mouss-suggestions

Conversation

@MoustaphaCamara
Copy link

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.

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.
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

Successfully merging this pull request may close these issues.

1 participant