quartzbio.client module

class quartzbio.client.QuartzBioClient(host=None, token=None, token_type: Literal['Bearer', 'Token'] = 'Bearer', include_resources=True, retry_all: bool = None)

Bases: object

A requests-based HTTP client for QuartzBio API resources

delete(url, data, **kwargs)

Issues an HTTP DELETE across the wire via the Python requests library. See request for information on keyword args.

get(url, params, **kwargs)

Issues an HTTP GET across the wire via the Python requests library. See request() for information on keyword args.

is_logged_in()
post(url, data, **kwargs)

Issues an HTTP POST across the wire via the Python requests library. See request for information on keyword args.

request(method, url, **kwargs)

Issues an HTTP Request across the wire via the Python requests library.

Parameters:
  • method (an HTTP)

  • method

  • url (str)

  • start (the place to connect to. If the url doesn't)

  • (https (with a protocol)

  • front. (quartzbio.api_host in the)

  • allow_redirects (bool, optional)

  • redirects (set False we won't follow any)

  • headers (dict, optional) – Custom headers can be provided here; generally though this will be set correctly by default dependent on the method type. If the content type is JSON, we’ll JSON-encode params.

  • param (dict, optional) – passed as params in the requests.request

  • timeout (int, optional) – timeout value in seconds for the request

  • raw (bool, optional) – unless True the response encoded to json

  • files (file) – File content in the form of a file handle which is to be uploaded. Files are passed in POST requests

Returns:

  • response object. If *raw is not True and*

  • repsonse if valid the object will be JSON encoded. Otherwise

  • it will be the request.reposne object.

set_credentials(host: str, token: str, token_type: Literal['Bearer', 'Token'], *, debug: bool = False, raise_on_missing: bool = True)
set_user_agent(name=None, version=None)
validate_host_is_www_url(host)
whoami()