shopify_requests package

Module contents

class shopify_requests.RestClient(myshopify_domain, access_token=None, username=None, password=None, connect_retries=None, backoff_factor=None, max_limit_retries=None, limit_backoff_factor=None, version=None)

Bases: object

Create a session client for this Shopify store.

Note

  • Only access_token or (username and password) are required

  • urllib3 documents backoff_factor as
    • {backoff factor} * (2 ** ({number of total retries} - 1))

Parameters
  • myshopify_domain – foobar.myshopify.com

  • access_token – OAuth token from a pubilc app

  • username – Username for private app

  • password – Password for private app

  • connect_retries[default: 3] how many connection-related errors to retry on

  • backoff_factor[default: 0.5] how quickly to backoff for safe retries

  • max_limit_retries[default: 0] how many retries to do when rate limited

  • limit_backoff_factor[default: 0.5] same as backoff_factor but for rate limited

  • version[default: unstable] the Shopify API version to use

calls_remaining()

Return the number of API calls remaining.

Return type

int

See also

Shopify API call limits

calls_used()

Return the number of API calls used.

Return type

int

See also

Shopify API call limits

close()

Close the session.

See also

requests.Session.close.

delete(url, **kwargs)

Send a DELETE request.

Parameters
  • url – URL for the new Request object.

  • **kwargs – Optional arguments that session takes.

Return type

requests.Response

See also

requests.Session.delete.

get(url, **kwargs)

Send a GET request.

Parameters
  • url – URL for the new Request object.

  • **kwargs – Optional arguments that session takes.

Return type

requests.Response

See also

requests.Session.get.

max_available()

Return the bucket size for the token.

Return type

int

See also

Shopify API call limits

patch(url, **kwargs)

Send a PATCH request.

Parameters
  • url – URL for the new Request object.

  • **kwargs – Optional arguments that session takes.

Return type

requests.Response

See also

requests.Session.patch.

post(url, **kwargs)

Send a POST request.

Parameters
  • url – URL for the new Request object.

  • **kwargs – Optional arguments that session takes.

Return type

requests.Response

See also

requests.Session.post.

put(url, **kwargs)

Send a PUT request.

Parameters
  • url – URL for the new Request object.

  • **kwargs – Optional arguments that session takes.

Return type

requests.Response

See also

requests.Session.put.