CartAPI Python Module

Cart API module for interacting with carts.

class pacifica.downloader.cartapi.CartAPI(cart_api_url, **kwargs)[source]

Cart api object for manipulating carts.

This class has two methods used for setting up a cart and waiting for completion.

__init__(cart_api_url, **kwargs)[source]

Constructor for cart api.

The constructor takes a required URL to the Cart API. Optionally, there can be passed a requests session via keyword arguments. Also, an optional requests authentication dictionary can be passed via keyword arguments.

__weakref__

list of weak references to the object (if defined)

setup_cart(yield_files)[source]

Setup a cart from the method and return url to the download.

This method takes a callable argument that returns an iterator. The iterator is used to generate a list that is directly sent to the Cartd API. This method returns the full url to the cart created.

wait_for_cart(cart_url, timeout=120)[source]

Wait for cart completion to finish.

This method takes a cart url returned from the setup_cart() method and polls the endpoint until the cart is ready to download.