Skip to main content

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.
)

Release files for cdcwonderpy 0.0.1

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

Built distribution (wheel)

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

Release files / cdcwonderpy-0.0.1-py3-none-any.whl

Download URL cdcwonderpy-0.0.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef95dc6f014fa355b4b6625df66928efaea14863ea3738f9c7d6f6df656bb5c8
BLAKE2b-256 checksum
How to use checksums
4b5e07b2de385089d6cc63e5b21595ef1e70e0c183c16f91421a1a43fead54c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

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