ipumspy.api.AggregateDataExtract#

class ipumspy.api.AggregateDataExtract(collection, datasets=[], time_series_tables=[], shapefiles=[], description='', data_format='csv_no_header', geographic_extents=None, tst_layout='time_by_column_layout', breakdown_and_data_type_layout='single_file', **kwargs)[source]#

Class for defining an extract request for an IPUMS aggregate data collection.

Parameters:
  • datasets (Optional[List[NhgisDataset] | List[IhgisDataset]]) – list of NhgisDataset objects (for NHGIS extracts) or IhgisDataset objects (for IHGIS extracts)

  • time_series_tables (Optional[List[TimeSeriesTable]]) – list of TimeSeriesTable objects (for NHGIS extracts)

  • shapefiles (Optional[Union[List[str], List[Shapefile]]]) – list of shapefile names (for NHGIS extracts)

  • description (str) – short description of your extract

  • data_format (str) – desired format of the extract data file (for NHGIS extracts). One of "csv_no_header", "csv_header", or "fixed_width".

  • geographic_extents (Optional[List[str]]) – Geographic extents to use for all datasets and time_series_tables in an NHGIS extract definition (for instance, to to obtain data within a particular state)

  • tst_layout (str) – desired data layout for all time_series_tables in the extract definition. One of "time_by_column_layout" (default), "time_by_row_layout", or "time_by_file_layout"

  • breakdown_and_data_type_layout (str) – desired layout of any datasets that have multiple data types or breakdown values in an NHGIS extract definition. Either "single_file" (default) or "separate files"

Attributes

collection_type

IPUMS collection type

extract_id

The extract id associated with this extract, assigned by the IpumsApiClient

extract_info

The API response recieved by the IpumsApiClient

api_version

IPUMS API version number

Methods

__init__

Class for defining an extract request for an IPUMS aggregate data collection.

build

Convert the object into a dictionary to be passed to the IPUMS API as a JSON string