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. |
|
A generic extract object for working with collections that are not yet officially supported by this API library |
|
Defining an IPUMS USA extract. |
|
Defining an IPUMS CPS extract. |
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 BaseExtract object. |
|
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. |
|
Create a BaseExtract object from a parsed DDI codebook. |
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 |