refactor: ♻️ commonise REDCap API and JSON logic#154
Open
martonvago wants to merge 2 commits into
Open
Conversation
1 task
martonvago
commented
Jul 6, 2026
| env_key="REDC_CPH_API_KEY", url="https://redcap.regionh.dk/api/" | ||
| ) | ||
| Odense = APIConfig(env_key="REDC_ODN_API_KEY", url="https://redcap.sdu.dk/api/") | ||
| Test = APIConfig(env_key="TEST_API_KEY", url="https://redcap.au.dk/api/") |
Collaborator
Author
There was a problem hiding this comment.
Can this live here?
martonvago
commented
Jul 6, 2026
| response.raise_for_status() | ||
| dictionary: list[dict[str, str]] = response.json() | ||
| return dictionary | ||
| def download_redcap_metadata(path: Path, content: str) -> None: |
Collaborator
Author
There was a problem hiding this comment.
Calling this metadata because it will be used to download different types of metadata (event info, field metadata, repeating instruments)
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.
Description
This PR pulls out shared logic for using the REDCap API and (relatedly) reading/writing JSON.
This can be treated as groundwork for #153 if it's more helpful to review this first.
Needs a thorough review.
Checklist
just run-all