Using Castor in Python

Using Castor in Python

Introduction

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

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 (Python, Miniconda, Jupyterlab & Python Packages).
  3. Install the Castor EDC API package by following the instructions here: https://github.com/reiniervlinschoten/castoredc_api.
  4. Information on how to get your Castor client ID and secrets can be found below.
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.
    • Related Articles

    • Python, Miniconda, Jupyterlab & Python Packages

      Basic install Open Ports Anaconda In mydre.org, in tab: external access, add the following rules: Rule & Description IP-address Port conda.anaconda.org 104.17.93.24 443 repo.anaconda.com 104.16.131.3 443 docs.conda.io 188.114.96.7 443 ports might ...
    • Castor

      Setting up for Direct Access Castor is a cloud-based clinical data platform, enabling researchers to easily capture and integrate data from clinicians, patients, devices, wearables, and EHR systems. The Castor data capture system is available through ...
    • Castor R-Package

      Prerequisites DRE: Owner access to workspace, to install R / RStudio / Rtools in a virtual machine External access to CRAN in the workspace where you want to export the data to (open up port rule) External access to Castor in the workspace where you ...
    • Using the Azure Portal

      DRE is suitable for any type of user. However, perhaps you already have lots of IT experience and you know your way around Azure. That's when it might be interesting to know that you can also access your workspace resources through the Azure ...
    • CEDAR

      CEDAR Home page CEDAR https://more.metadatacenter.org/tools-training/orientation CEDAR APIs https://more.metadatacenter.org/tools-training/cedar-api CEDAR API and Python Prerequisites: Create file called: secret.py Add the following line of ...