Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

# castorapi Python API wrapper for Castor EDC to fetch data from or post data to your clinical study.

## Install Using conda and the conda-forge channel (recommended):

conda install -c conda-forge castorapi

But, you can also install using pip (https://pypi.org/project/castorapi/):

pip install castorapi

## Update Using conda and the conda-forge channel:

conda update -c conda-forge castorapi

Using pip (https://pypi.org/project/castorapi/):

pip install castorapi –upgrade

## Usage First, make sure that save the client and secret from your Castor account in seperate client and secret files (without line endings) in a private folder on your PC. Do not share these files with anyone.

![image](https://user-images.githubusercontent.com/981436/130036568-6209334a-2a8b-4948-9387-7c6c74e0ef08.png)

See also https://data.castoredc.com/api and https://helpdesk.castoredc.com/article/124-application-programming-interface-api

## Example code

import castorapi as ca c = ca.CastorApi(‘/path/to/folder/with/secret_client’) c.select_study_by_name(‘<CASTOR_STUDY_NAME>’) # all following commands use this study selection stats = c.request_statistics() print(stats) df_study, df_structure_study, df_report, df_structure_report, df_optiongroups_structure = c.records_reports_all() users_in_study = c.request_studyuser() print(users_in_study)

# Getting data from castor about patients in a study c.request_study_records(record_id=’CASTOR00010’)

# Posting data to castor to create a new patient # add institute_id and , request_method=’POST’ to use this functionality. c.request_study_records(record_id=’CASTOR00010’, institute_id=<instituteID>, request_method=’POST’)

## Known issues 1. The documentation is sparse. Feel free to contribute. 2. Not all Castor API functions are implemented (I implement them on a need-to-use basis), feel free to contribute. 3. See https://github.com/wouterpotters/castorapi/issues for an overview of all open issues.

## NOTE I am not affiliated with Castor EDC in any way. Use this software at your own risk. If this API tool does not suffice - take a look at the work from Reinier van Linschoten, who also created a Python package for two-way communication Castor EDC (2021). (https://github.com/reiniervlinschoten/castoredc_api)

Metadata

Release files for castorapi 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for castorapi 0.3
File Size Uploaded Provenance Actions
castorapi-0.3.tar.gz 12.4 kB Without provenance Details for castorapi-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for castorapi 0.3
File Interpreter ABI Platform Actions
castorapi-0.3-py3-none-any.whl Python 3 none any Details for castorapi-0.3-py3-none-any.whl

Total release size: 23.7 kB

Release files / castorapi-0.3.tar.gz

Download URL castorapi-0.3.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f9172707bd53bac3a84bf38f801541f7096fd5b1122883ab068c2093259cc04a
BLAKE2b-256 checksum
How to use checksums
c26b82a586535ee71995234d006ffed2bb68da1504160c6eb9f79464430a32b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / castorapi-0.3-py3-none-any.whl

Download URL castorapi-0.3-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abc4729548390162be00ece471690b08a7382e09606cef34db9a8314fc566168
BLAKE2b-256 checksum
How to use checksums
14ef80c630151d48152b3eaf68d42b826d5756fd06e8ec65f2335f1797e83aa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for castorapi 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page