Using Castor in Python

Using Castor in Python

Introduction

Info
anDREa would like to thank Reinier van Linschoten for bringing this package and description to our attention.

This is a Python package for interacting with the API of Castor Electronic Data Capture (EDC). The package contains functions to interact with all the endpoints defined on https://data.castoredc.com/api#/. Within the package are functions for easy export and import of your data through the API.

Export
Supported export formats are
  1. Pandas
  2. CSV
  3. R (using Feather)
Import
Import currently only supports .xlsx files with limited configuration.

Install the Castor EDC API package

Info
To install software and to open internet ports, you need Owner rights in a workspace.
  1. Connect to a VM.
  2. Install and configure the appropriate tools such as Python and Anaconda 
  3. Install the Castor EDC API package (https://github.com/reiniervlinschoten/castoredc_api-R)
  4. Information on how to get your Castor client ID and secrets can be found below.
Info
We advise to use conda install rather than pip install when working in a myDRE workspace.  VMs on myDRE do not have internet access by default. Owners of workspaces can create external access rules to access certain IP addresses, however, these are limited to static IP addresses. PIP uses PyPi which makes use of dynamic IP addresses. Conversely, Anaconda is hosting their package repositories on a static IP address.

Castor EDC API in R

The same package can also be used in R. Please visit https://github.com/reiniervlinschoten/castoredc_api-R for more information. Please refer to Python, Miniconda, Jupyterlab & Python Packages on how to install Miniconda.