REST API Interface#
These objects are used to interact with the IPUMS REST API from Python.
Core API Interface#
Class for creating and retrieving IPUMS extracts via API |
Extract Wrappers#
Different IPUMS collections may have slightly different query parameters. Thus, to pull from a particular collection, you will need to use a particular extract class.
A wrapper around an IPUMS extract. |
|
Class for defining an extract for an IPUMS microdata collection. |
|
Class for defining an extract request for an IPUMS aggregate data collection. |
Other IPUMS Objects#
Helpful data classes for defining IPUMS Extract objects.
IPUMS variable object to include in a |
|
IPUMS sample object to include in a |
|
IPUMS time use variable to include in a |
|
IPUMS dataset object to include in an |
|
IPUMS dataset object to include in an |
|
IPUMS time series table object to include in an |
|
IPUMS shapefile object to include in an |
Importing or Exporting Extract Definitions#
There are two convenience methods to transform ipumspy extract objects to dictionary objects and from dictonary objects to ipumspy extract objects.
Convert an extract that is currently specified as a dictionary (usually from a file) into a |
|
Convert an extract object to a dictionary (usually to write to a file). |
|
Convenience method to save an IPUMS extract definition to a json file. |
|
Convenience method to convert an IPUMS extract definition or definitions stored in a json file into a BaseExtract object. |
IPUMS Metadata#
Use these classes and methods to request IPUMS metadata for aggregate data collections via the IPUMS API.
Class to request and store metadata for an IPUMS NHGIS dataset |
|
Class to request and store metadata for an IPUMS IHGIS dataset |
|
Class to request and store metadata for an IPUMS NHGIS data table |
|
Class to request and store metadata for an IPUMS IHGIS data table |
|
Class to request and store metadata for an IPUMS time series table. |
Exceptions#
Several different exceptions may be raised when interacting with the IPUMS API.
Represents the case that your extract is not yet ready |
|
Represents when waiting for the IPUMS API times out |
|
Represents attempted unauthorized API access |
|
Represents an error in the api request json, such as invalid sample id or var name |
|
Represents the case when an extract needs to be submitted before the operation can be performed |
|
Represents a request that exceeds the IPUMS API rate limit |