Skip to content

Scraper and CSV exporter for Substance Abuse and Mental Health Data Archive Restricted-use Data Analysis System

License

Notifications You must be signed in to change notification settings

Predict-This/samhsa-rdas-scraper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAMHSA Restricted-use Data Analysis System Scraper

Scraper built in NodeJS for SAMHSA's Restricted-use Data Analysis System. Created as an easier method of obtaining data opposed to running a crosstab.

Setup Instructions

  1. Clone or download this repo

  2. Extract the files to a location of your choice

  3. Install the latest version of node

  4. In Windows, search for 'cmd' to find command prompt, if in Mac OS, search for your terminal

  5. In command prompt type cd <FILEPATH OF EXTRACTED FILES HERE>, and press enter

  6. After the correct filepath is selected, type npm install and press enter to install all dependencies


Running Instructions

1. The in.csv

The in.csv file should contain the input variables for each call to the API

  • Data Years: The 2-Year data set you're targeting
  • Row Variable: The key row variable
  • Column Variable: The key column variable (optional)
  • Control Variable: The key control variable (optional)
  • Row, Column, and Control Filters: Filters for their respective variable. (must be a number, optional)

2. Execution

To execute the program run node main.js in command prompt / terminal or with npm npm start

You can also create a .bat file <FILENAME HERE>.bat and paste either of those commands as an easier single-click method of executing the code

Troubleshooting

For help understanding console commands in Windows: https://www.digitaltrends.com/computing/how-to-use-command-prompt/

For help completing these steps in a macOS: https://macpaw.com/how-to/use-terminal-on-mac

For help troubleshooting issues with NodeJS: https://nodejs.dev/learn/run-nodejs-scripts-from-the-command-line

Contributors

About

Scraper and CSV exporter for Substance Abuse and Mental Health Data Archive Restricted-use Data Analysis System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%