craft_store.store_client module

Craft Store StoreClient.

class craft_store.store_client.StoreClient(*, base_url, storage_base_url, endpoints, application_name, user_agent, environment_auth=None, ephemeral=False)[source]

Bases: craft_store.base_client.BaseClient

Encapsulates API calls for the Snap Store or Charmhub.

Parameters
  • base_url (str) –

  • storage_base_url (str) –

  • endpoints (Endpoints) –

  • application_name (str) –

  • user_agent (str) –

  • environment_auth (Optional[str]) –

  • ephemeral (bool) –

TOKEN_TYPE: str = 'macaroon'
class craft_store.store_client.WebBrowserWaitingInteractor(user_agent)[source]

Bases: macaroonbakery.httpbakery._browser.WebBrowserInteractor

WebBrowserInteractor implementation using HTTPClient.

Waiting for a token is implemented using HTTPClient which mounts a session with backoff retries.

Better exception classes and messages are provided to handle errors.

Parameters

user_agent (str) –