2017-25 © Pedro Peláez
 

library cber-data-grabber

CBER Data Grabber

image

ballstatecber/cber-data-grabber

CBER Data Grabber

  • Friday, August 18, 2017
  • by PhantomWatson
  • Repository
  • 2 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

CBER Data Grabber

A set of classes used by the Ball State University Center for Business and Economic Research County Profiles website for pulling data from US federal data APIs., (*1)

Installing via Composer

composer require ballstatecber/cber-data-grabber:dev-master

ACS Updater (American Community Survey, US Census Bureau)

Make sure you first have a US Census Bureau API Key., (*2)

Getting processed data and saving it to a CSV file:, (*3)

ACSUpdater::setAPIKey('api key goes here');
$year = '2013';
$stateId = '18'; // Indiana
$category = ACSUpdater::$POPULATION_AGE;
$processedData = ACSUpdater::getCountyData($year, $stateId, $category);
$fileName = date('Y-m-d').'_processed_county_'.$categoryName.'_'.$stateId.'_'.$year.'-00-00.csv';
ACSUpdater::writeProcessedCSV($processedData, $fileName);

Getting raw data and saving it to a CSV file:, (*4)

ACSUpdater::setAPIKey('api key goes here');
$year = '2013';
$stateId = '18'; // Indiana
$category = ACSUpdater::$POPULATION_AGE;
$rawData = ACSUpdater::getRawCountyData($year, $stateId, $category);
$fileName = date('Y-m-d').'_raw_county_'.$categoryName.'_data_'.$stateId.'_'.$year.'-00-00.csv';
ACSUpdater::writeRawCSV($rawData, $fileName, $map);

CSV files are saved in the same directory that executes this script., (*5)

Available data categories:, (*6)

  • ACSUpdater::$POPULATION_AGE
  • ACSUpdater::$HOUSEHOLD_INCOME
  • ACSUpdater::$ETHNIC_MAKEUP
  • ACSUpdater::$EDUCATIONAL_ATTAINMENT
  • ACSUpdater::$INEQUALITY_INDEX

BEA Updater (Bureau of Economic Analysis)

Example for saving data to a CSV file:, (*7)

BEAUpdater::setAPIKey('api key goes here');
$year = '2014';
$stateId = '18'; // Indiana
BEAUpdater::updateAllCountyData($year, $stateId);
BEAUpdater::updateCountyData($year, $stateID, BEAUpdater::$WAGES, true);

BLS Updater (Bureau of Labor Statistics)

Example for saving data to a CSV file:, (*8)

$endYear = '2013';
$stateID = '18'; // Indiana
BLSUpdater::updateAllCountyData($stateID, $endYear);

The Versions

18/08 2017

dev-master

9999999-dev https://github.com/BallStateCBER/cber-data-grabber

CBER Data Grabber

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Brandon Patterson

api php

18/08 2017

dev-development

dev-development https://github.com/BallStateCBER/cber-data-grabber

CBER Data Grabber

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Brandon Patterson

api php