Giter Club home page Giter Club logo

acs-data-scraper's Introduction

ACS-Data-Scraper

This program can be used to scrape most recent ACS 5-Year Data at the block group level. It intends to scrape different tables and export as separate .csv files. It also combines tables scraped and transforms for better use.

1. Select Variables

Variables are divided into two types: grouped variables and selected variables.

  • Grouped variables: refer to the whole group, like B01003
  • Selected variables: refer to a string of detailed columns like B01001_001E,B01001_002E,B01001_026E. Record them in separate dictionaries

2. Scrape Data

Since the census API only supports acquiring data of all block-groups for one county at one time, need to acquire the county list of the specified state and combine data for each county.

Functions defined and used:

  • get_group_data(state, var), get_select_data(state, var): Gets data related to one group variable/one slected variables string, for all block-groups in a specified state.
  • update_cols(df, var), update_select_cols(df, var): Decodes column names with actual meaning.
  • transform_group_data(state, var), transform_select_data(state, var): Downloads data and tranforms it.

3. Export Data

Define functions save_group_data(state, var) and save_select_data(state, var) to export each data set separately.

acs-data-scraper's People

Contributors

yuran-zhu avatar

Watchers

 avatar

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.