API reference

Exploration Tools

These are functions that assist in understanding the census bureau products.

cenpy.explorer.available([verbose])

Returns available identifiers for Census Data APIs.

cenpy.explorer.explain([identifier, verbose])

Explains datasets currently available via the census API

cenpy.explorer.fips_table(kind[, in_state])

Pulls a table of FIPS codes for reference

Configuration Tools

These are functions that allow users to register their US Census Bureau API Key with cenpy.

cenpy.set_sitekey(sitekey[, overwrite])

Save the sitekey so that users can access it via cenpy.SITEKEY.

Product: American Community Survey

A product that integrates the data & geographic APIs for the 5-year 2013-2017 ACSs.

cenpy.products.ACS

The American Community Survey (5-year vintages) from the Census Bueau

cenpy.products.ACS.variables

All variables, including columns and search predictates, available from the API

cenpy.products.ACS.tables

All of the main table codes in the Census API for this product.

cenpy.products.ACS.crosstab_tables

All of the crosstab table codes in the Census API for this product.

cenpy.products.ACS.filter_variables

Grabs columns that match a particular search pattern.

cenpy.products.ACS.filter_tables

Filter tables by a given pattern.

cenpy.products.ACS.check_match

A helper function to verify the match used by the product API.

cenpy.products.ACS.from_place

Query the Census for the given place.

cenpy.products.ACS.from_msa

Query the Census for the given MSA.

cenpy.products.ACS.from_csa

Query the Census for the given CSA.

cenpy.products.ACS.from_county

Query the Census for the given county.

cenpy.products.ACS.from_state

Query the Census for the given state.

Product: Decennial 2010 Census

A product that integrates the data & geographic APIs for the 2010 Census.

cenpy.products.Decennial2010

The 2010 Decennial Census from the Census Bueau

cenpy.products.Decennial2010.variables

All variables, including columns and search predictates, available from the API

cenpy.products.Decennial2010.tables

All of the main table codes in the Census API for this product.

cenpy.products.Decennial2010.crosstab_tables

All of the crosstab table codes in the Census API for this product.

cenpy.products.Decennial2010.filter_variables

Grabs columns that match a particular search pattern.

cenpy.products.Decennial2010.filter_tables

Filter tables by a given pattern.

cenpy.products.Decennial2010.check_match

A helper function to verify the match used by the product API.

cenpy.products.Decennial2010.from_place

Query the Census for the given place.

cenpy.products.Decennial2010.from_msa

Query the Census for the given MSA.

cenpy.products.Decennial2010.from_csa

Query the Census for the given CSA.

cenpy.products.Decennial2010.from_county

Query the Census for the given county.

cenpy.products.Decennial2010.from_state

Query the Census for the given state.

Architectural Component: APIConnection

The fundamental building block that manages connections to the raw data API, a REST-ful plaintext API.

cenpy.remote.APIConnection

The fundamental building block for US Census Bureau data API Endpoints

cenpy.remote.APIConnection.explain

Explain a column or list of columns.

cenpy.remote.APIConnection.query

Conduct a query over the USCB api connection

cenpy.remote.APIConnection.varslike

Grabs columns that match a particular search pattern.

cenpy.remote.APIConnection.set_mapservice

Assign a mapservice to the connection instance

Architectural Component: TigerConnection

The fundamental building block that manages connections to the geographic API, the US Census’s ESRI MapService.

cenpy.tiger.TigerConnection

The fundamental building block for US Census Bureau’s Geographic, an ESRI MapService

cenpy.tiger.TigerConnection.query

method to query the ESRI API.

Architectural Component: ESRILayer

The fundamental building block that manages connections to individual ESRI Layers within the ESRI MapService

cenpy.tiger.ESRILayer

The fundamental building block to access a single Geography/Layer in an ESRI MapService

cenpy.tiger.ESRILayer.query

A query function to extract data out of MapServer layers.

Architectural Component: APIConnection

The fundamental building block that provides an absract base class for subclasses, which are Census Data Products that unite raw data & geographical APIs.

cenpy.products._Product

The fundamental building block to make pre-configured Census Products, like ACS or Decennial2010.

cenpy.products._Product.variables

All variables, including columns and search predictates, available from the API

cenpy.products._Product.tables

All of the main table codes in the Census API for this product.

cenpy.products._Product.filter_variables

Grabs columns that match a particular search pattern.

cenpy.products._Product.filter_tables

Filter tables by a given pattern.

cenpy.products._Product.from_place

Query the Census for the given place.

cenpy.products._Product._from_bbox

This is an internal method to handle querying the Census API and the GeoAPI using bounding boxes.

cenpy.products._Product._from_name

A helper function, internal to the product, which pieces together the construction of a bounding box (from environment_from_layer) and the querying of the GeoAPI using that bounding box in (from_bbox)

cenpy.products._Product.check_match

A helper function to verify the match used by the product API.