Coder Social home page Coder Social logo

edgarrmondragon / tap-clinicaltrials Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 64 KB

Singer tap for ClinicalTrials.gov study records data.

Home Page: https://pypi.org/p/tap-clinicaltrials

License: Apache License 2.0

Python 100.00%
clinical-trials meltano pharma singer-io singer-sdk data-mining elt

tap-clinicaltrials's Introduction

tap-clinicaltrials

Singer tap for ClinicalTrials.gov study records data.

Built with the Meltano Tap SDK for Singer Taps.

Capabilities

  • catalog
  • state
  • discover
  • about
  • stream-maps

Settings

Setting Required Default Description
start_date False None Earliest datetime to get data from
condition False None Conditions or disease query
sponsor False None Sponsor query
stream_maps False None Config object for stream maps capability. For more information check out Stream Maps.
stream_map_config False None User-defined config values to be used within map expressions.
flattening_enabled False None 'True' to enable schema flattening and automatically expand nested properties.
flattening_max_depth False None The max depth to flatten schemas.
batch_config False None

A full list of supported settings and capabilities is available by running: tap-clinicaltrials --about

Installation

In a Meltano project

Using a direct reference

meltano add extractor tap-clinicaltrials --from-ref=https://raw.githubusercontent.com/edgarrmondragon/tap-clinicaltrials/main/plugin.yaml

Requires Meltano v3.1.0+.

From MeltanoHub

Not yet available.

From PyPI

python3 -m pip install --upgrade tap-clinicaltrials

With pipx

pipx install tap-clinicaltrials

From source

git clone https://github.com/edgarrmondragon/tap-clinicaltrials
cd tap-clinicaltrials
python3 -m pip install .

Usage

You can easily run tap-clinicaltrials by itself or in a pipeline using Meltano.

With Meltano

  1. Clone the repo and cd into it:

    git clone https://github.com/edgarrmondragon/tap-clinicaltrials.git
    cd tap-clinicaltrials
  2. Make sure you have Meltano installed

  3. Install all plugins

    meltano install
  4. Configure the tap-clinicaltrials tap:

    meltano config tap-clinicaltrials set start_date '2020-01-01'
    meltano config tap-clinicaltrials set condition 'COVID-19'
    meltano config tap-clinicaltrials set sponsor 'Pfizer'
  5. Run a test tap-clinicaltrials extraction

    meltano run tap-clinicaltrials target-duckdb
  6. That's it! Check the data

    $ duckdb output/warehouse.duckdb -c "select nctid, lastUpdateSubmitDate, protocolsection->>'$.identificationModule.briefTitle' from clinicaltrials.studies limit 5;
    ┌─────────────┬──────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │    nctid    │ lastupdatesubmitdate │                      (protocolsection ->> '$.identificationModule.briefTitle')                      │
    │   varchar   │       varchar        │                                               varchar                                               │
    ├─────────────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┤
    │ NCT06156215 │ 2023-12-06           │ PROmotion of COVID-19 BOOSTer VA(X)Ccination in the Emergency Department - PROBOOSTVAXED            │
    │ NCT05487040 │ 2023-12-06           │ A Study to Measure the Amount of Study Medicine in Blood in Adult Participants With COVID-19 and …  │
    │ NCT06163677 │ 2023-12-07           │ A Study to Look at the Health Outcomes of Patients With COVID-19 and Influenza.                     │
    │ NCT05032976 │ 2023-12-07           │ Korea Comirnaty Post-marketing Surveillance                                                         │
    │ NCT05596734 │ 2023-12-11           │ A Study to Evaluate the Safety, Tolerability, and Immunogenicity of Combined Modified RNA Vaccine…  │
    └─────────────┴──────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────┘

Executing the Tap Directly

tap-clinicaltrials --version
tap-clinicaltrials --help
tap-clinicaltrials --config CONFIG --discover > ./catalog.json

Developer Resources

Initialize your Development Environment

pipx install hatch

Create and Run Tests

Run integration tests:

hatch run test:integration

You can also test the tap-clinicaltrials CLI interface directly:

hatch run sync:console -- --about --format=json

SDK Dev Guide

See the dev guide for more instructions on how to use the SDK to develop your own taps and targets.

tap-clinicaltrials's People

Contributors

dependabot[bot] avatar edgarrmondragon avatar pre-commit-ci[bot] avatar

Watchers

 avatar  avatar

tap-clinicaltrials's Issues

Support native field selection

The API supports querying specific fields with the fields query parameter, which is a comma-separated list of fully-qualified field names, e.g. protocolSection.identificationModule.nctId.

Problem is this might result in URL that's too long (status 414).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.