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. |
|
Defining an IPUMS International extract. |
Other IPUMS Objects#
Helpful data classes for defining IPUMS Extract objects.
IPUMS variable object to include in an IPUMS extract object. |
|
IPUMS sample object to include in an IPUMS extract object. |
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. |
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 |