fictive.heap.client module

A client for working with the Heap server side API

see https://docs.heap.io/reference#track-1

Classes

HeapAddAccountPropertiesAccountSchema

schema for POSTing to add_account_properties

HeapAddUserPropertiesUserSchema

schema for POSTing to add_user_properties

HeapClient

A client for working with the Heap server side API

HeapTrackRequestEventSchema

schema for POSTing to track

class fictive.heap.client.HeapAddAccountPropertiesAccountSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)[source]

Bases: marshmallow.schema.Schema

schema for POSTing to add_account_properties

opts = <marshmallow.schema.SchemaOpts object>
class fictive.heap.client.HeapAddUserPropertiesUserSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)[source]

Bases: marshmallow.schema.Schema

schema for POSTing to add_user_properties

opts = <marshmallow.schema.SchemaOpts object>
class fictive.heap.client.HeapClient(app_id)[source]

Bases: object

A client for working with the Heap server side API

BASE_URL = 'https://heapanalytics.com/api/'
ENDPOINTS = {'add_account_properties': <class 'fictive.heap.client.HeapAddAccountPropertiesAccountSchema'>, 'add_user_properties': <class 'fictive.heap.client.HeapAddUserPropertiesUserSchema'>, 'track': <class 'fictive.heap.client.HeapTrackRequestEventSchema'>}
__init__(app_id)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod api_url(*endpoint_path_segments)[source]

combine path segments with the API base url

post(endpoint: str, endpoint_data: Union[Mapping, Iterable], app_id: str = None)[source]

POST endpoint_data to endpoint as application/json

class fictive.heap.client.HeapTrackRequestEventSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)[source]

Bases: marshmallow.schema.Schema

schema for POSTing to track

opts = <marshmallow.schema.SchemaOpts object>