Skip to main content

pytrials

https://img.shields.io/pypi/v/pytrials.svg https://github.com/jvfe/pytrials/workflows/pytest/badge.svg https://img.shields.io/pypi/l/pytrials Documentation Status

Python wrapper around the clinicaltrials.gov API. Documentation for the API can be found here: https://clinicaltrials.gov/api/

Tutorial

To install:

$ pip install pytrials

Basic Usage

from pytrials.client import ClinicalTrials

ct = ClinicalTrials()

# Get 50 full studies related to Coronavirus and COVID in csv format.
ct.get_full_studies(search_expr="Coronavirus+COVID", max_studies=50)

# Get the NCTId, Condition and Brief title fields from 1000 studies related to Coronavirus and Covid, in csv format.
corona_fields = ct.get_study_fields(
    search_expr="Coronavirus+COVID",
    fields=["NCT Number", "Conditions", "Study Title"],
    max_studies=1000,
    fmt="csv",
)

# Read the csv data in Pandas
import pandas as pd

pd.DataFrame.from_records(corona_fields[1:], columns=corona_fields[0])

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2020-07-06)

  • First release on PyPI.

0.1.2 (2020-07-11)

  • Minor fixes

0.2.0 (2021-04-24)

  • Improved test suite

  • Added get_study_count function

0.2.1 (2023-07-09)

  • Add classic prefix to url - #10

  • Raise error if API status is not ok - #11

0.3.0 (2023-07-09)

  • Add min_rnk option to get_study_fields - #12

1.0.0 (2024-05-01)

Migrates to version 2.0 of the ClinicalTrials API

  • Add support for the new API version

  • Add support for the new API fields

  • Remove get_study_count function

  • Allow CSV format in full_studies

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytrials-1.0.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytrials-1.0.0-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytrials-1.0.0.tar.gz.

File metadata

  • Download URL: pytrials-1.0.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for pytrials-1.0.0.tar.gz
Algorithm Hash digest
SHA256 15caa3a8d2485c12808aba775ea45c14836772c6fa9c5f6b87e400a829eb7b0e
MD5 8f7556773638e3204e9a978b9f2e6435
BLAKE2b-256 4225cfce60e8420ab506d06b8bbaff12969c75edf4b8c667b0a5701575970f39

See more details on using hashes here.

File details

Details for the file pytrials-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pytrials-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for pytrials-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0bc23462c6840a7229b6e8b1ae48ade50ded2621687a64d11302699f15d299ae
MD5 96f118a58d458c024b36f1011108530b
BLAKE2b-256 7da44fb8d2cec56a2e8a304c62943016c8a17301523510a3225276c4e50dc1e5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page