WojciechKusa / clinical-trials

Parsers for clinical trials data from clinicaltrials.gov

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clinical-trials

Set of parsers and classes for clinical trials data from ClinicalTrials.gov

Codacy Badge Unit tests

Installation

pip install -e .  

Tested on Python 3.8+.

Usage

This package is mainly intended for working with clinical trials data dump in xml files.

from CTnlp.parsers import parse_clinical_trials_from_folder

TRIALS_FOLDER = "PATH/TO/TRIALS/IN/XML/"
cts = parse_clinical_trials_from_folder(folder_name=TRIALS_FOLDER)

cts will be a list of ClinicalTrials objects.

In order to convert clinical trials to dictionary you can use asdict method from dataclasses:

from dataclasses import asdict

[asdict(ct) for ct in cts]

Data

To download data for your analysis, follow the description from here.

Description of the ClinicalTrials schema: https://prsinfo.clinicaltrials.gov/ProtocolRecordSchema.xsd

About

Parsers for clinical trials data from clinicaltrials.gov

License:GNU General Public License v3.0


Languages

Language:Python 100.0%