base

Base Client

class prometeo.base_client.BaseClient(api_key, environment)[source]

Base client class to make api calls

call_api(method, url, *args, **kwargs)[source]

Calls an API endpoint, using the configured api key and environment.

Parameters
  • method (str) – The HTTP method to use (GET, POST, etc)

  • url (str) – The url to call (without the environment’s domain)

Return type

JSON data as a python object.

get_session(session_key)[source]

Restore a session from its session key

Parameters

session_key (str) – The session key

Return type

Session

on_response(response_data)[source]

Called after every 200 response

class prometeo.base_client.Download(client, url)[source]

Represents a downloadable file, like an xml bill or pdf document

get_file()[source]

Downloads the file and returns its contents.

Return type

bytes

Base Session

class prometeo.base_session.BaseSession(client, status, session_key)[source]

Base class that handles calling the API endpoints that use session keys.

get_session_key()[source]

Returns this session’s session key

Return type

str

get_status()[source]

Returns this session’s status

Return type

str