Skip to main content

module client

Python API REST wrapper and helpers

class RetryException

API Client retry exception

class APIError

Represent API related error. error.status_code will have http status code.

method __init__

__init__(error, http_error=None)

property code

Return error code

property request

Handle requests error

property response

Handle response error :return:

property status_code

Return response status code Returns: int

class ClientConfig

Args: raw_data: should we return api response raw or wrap it with Entity objects.

class REST

REST client wrapper to manage requests with retries, auth and error handling.

method __init__

__init__(config: ClientConfig)

method close

close()
Close requests session

method delete

delete(path, data=None)
DELETE method Parameters: path (str): data (): Returns: Response

method get

get(path, data=None)
GET method Parameters: path (str): data (): Returns: Response

method patch

patch(path, data=None)
PATCH method Parameters: path (str): data (): Returns: Response

method post

post(path, data=None)
POST method Parameters: path (str): data (): Returns: Response

method put

put(path, data=None)
PUT method Parameters: path (str): data (): Returns: Response