ipumspy.api.CpsExtract

class ipumspy.api.CpsExtract(samples, variables, description='My IPUMS CPS extract', data_format='fixed_width', **kwargs)[source]

Defining an IPUMS CPS extract.

Parameters
  • samples (List[str]) – list of IPUMS CPS sample IDs

  • variables (List[str]) – list of IPUMS CPS variable names

  • description (str) – short description of your extract

  • data_format (str) – fixed_width and csv supported

Attributes

collection

Name of an IPUMS data collection

extract_id

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

extract_info

The API response recieved by the IpumsApiClient

Methods

__init__

Defining an IPUMS CPS extract.

build

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

from_api_response

rtype

CpsExtract