Skip to main content

A Python package to automatically fill out the CDC WONDER MCD form

Project description

cdcwonderpy: Use Python3 and Selenium to automatically complete the CDC WONDER Online Form

Disclaimer

This project is a work-in-progress. It works in some cases but may not work in many others (and may not be flexible enough for some users), and some extra code exists for functions that are not yet operational. This program has only been tested in Windows 10.

Description

The CDC's WONDER API does not allow users to collect subnational data -- users have to use the online form. This package automates that form. Note that this is still a work in progress.

This package is intended to be used with the R package "wondeR".

Installation

To use this package, you'll need to have Selenium set up for Chrome. This means you need to have Chrome, Chromedriver, and Selenium.

$ pip install cdcwonderpy

Usage

from cdcwonderpy.pulldata import wonder

wonder(
  ## wonderpy arguments
  RUN_NAME = "opioids", # Name of the run
  download_dir = "/path/to/downloads/folder", # Where to download the data
  existing_file = False, # True if the data file already exists on your local computer

  ## You want deaths matching the following ICD Codes
  MCD_CAUSE_CODE_1 = ["A10", "A20"], # Deaths that include ANY of these ICD Codes
  MCD_CAUSE_CODE_2 = ["A12", "A22"], # ...and ANY of these ICD Codes

  ## Group the deaths by these variables
  by_variables = ["sex", "age"], # Any of the following: "sex", "age", "race", "hispanic", "state", "year", "month"

  ## Only collect data of the following (None if all)
  AGEG = None, # age group
  GENDERG = None, # gender
  RACEG = None, # race
  HISPANICG = None, # hispanic status

  ## Other
  just_go = False # For use with more further and undeveloped cases. Keep as False.
)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cdcwonderpy-0.0.1-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page