census

A wrapper for the US Census Bureau's API
Download

census Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Jeremy Carbaugh

census Tags


census Description

census is a simple Python wrapper for the United States Census Bureau's API.Provides access to both the ACS and SF1 data sets.UsageFirst, get yourself a `Census API key http://www.census.gov/developers/. from census import Census, states c = Census("MY_API_KEY") c.acs.get(('NAME', 'B25034_010E'), {'for': 'state:%s' % states.MD})The call above will return the name of the geographic area and the number of homes that were built before 1939 for the state of Maryland. Helper methods have been created to simplify common geometry calls:: c.acs.state(('NAME', 'B25034_010E'), states.MD)Full details on geometries and the states module can be found below.The get method is the core data access method on both the ACS and SF1 data sets.The first parameter is either a single string column or a tuple of columns. The second parameter is a geoemtry dict with a `for` key and on option `in` key. The `for` argument accepts a `"*"` wildcard character or `Census.ALL`. The wildcard is not valid for the `in` parameter.Valid columns by data set:* ACS http://www.census.gov/developers/data/2010acs5_variables.xml* SF1 http://www.census.gov/developers/data/sf1.xmlGeometriesThe API supports a wide range of geographic regions. The specification of these can be quite complicated so a number of convenience methods are provided.Full geometry specifications are available for ACS http://thedataweb.rm.census.gov/data/acs5geo.html and SF1 http://thedataweb.rm.census.gov/data/sf1geo.html.ACS Geometries* state(fields, state_fips)* state_county(fields, state_fips, county_fips)* state_county_subdivision(fields, state_fips, county_fips, subdiv_fips)* state_county_tract(fields, state_fips, county_fips, tract)* state_place(fields, state_fips, place)* state_district(fields, state_fips, district)* us(fields)SF1 Geometries* state(fields, state_fips)* state_county(fields, state_fips, county_fips)* state_county_subdivision(fields, state_fips, county_fips, subdiv_fips)* state_county_tract(fields, state_fips, county_fips, tract)* state_place(fields, state_fips, place)* state_district(fields, state_fips, district)* state_msa(fields, state_fips, msa)* state_csa(fields, state_fips, csa)* state_district_place(fields, state_fips, district, place)* state_zip(fields, state_fips, zip)Product's homepage


census Related Software