ipumspy.api.IpumsApiClient.wait_for_extract#
- IpumsApiClient.wait_for_extract(extract, collection=None, inital_wait_time=1, max_wait_time=300, timeout=10800)[source]#
Convenience function to wait for an extract to complete. Will sleep until the IPUMS API returns a “completed” status for the extract.
- Parameters:
extract (
Union
[BaseExtract
,int
]) – The extract to download. This extract must have been submitted. Alternatively, can be an extract id. If an extract id is provided, you must supply the collection namecollection (
Optional
[str
]) – The name of the collection to pull the extract from. If None, thenextract
must be aBaseExtract
initial_wait_time – How long in seconds to initially wait between pings to the IPUMS API. Future pings will be spaced by exponential backoff
max_wait_time (
float
) – Pings will always occur at least once everymax_wait_time
secondstimeout (
float
) – If this many seconds passes, anIpumsTimeoutException
will be raised.
- Raises:
IpumsTimemoutException – If
timeout
seconds pass before a “completed” status is returned.