python wrapper for the xcures REST api.
- The auth functionality is working.
- Subject API query is working, but not tested extensively.
- Other API hooks, ie: query, are not implemented in a trusted way quite yet.
- TODO: I'll benefit from a quick discussion w/the Xcures tech team.
- Install Miniconda
- Create a new environment.
conda create -y -n XCDAY -c conda-forge python=3.10 ipython pytest pip pytz requests ipython && conda activate XCDAY && pip install yaml_config_day
- Activate the environment
conda activate XCDAY
- Located in
~/.config/xcures/xcures_$XCURES_ENV.yaml
, whereXCURES_ENV=
might beprod
ortest
. - Contents:
export XCURES_ENV=prod
more ~/.config/xcures/xcures_$XCURES_ENV.yaml
---
base_url: "https://partner.xcures.com"
base_auth_url: "https://xcures-patient-registry-prod.us.auth0.com"
project_id: "PROJECTIDHERE"
client_id: "CLIENTIDHERE"
client_secret: "SECRETKEYHERE"
given the env is set and the yaml file is configured
from xcures.xcures_api import XCuresAPI as xc_api
xc = xc_api()
print(xc)
# prints something like <xcures.xcures_api.XCuresAPI at 0x10cd814e0>
print(x.token)
# token printed
conda activate XCDAY
python xcures/xcures_api.py # just for quick dev, this will be moved to proper pytest.