PK!cG88py_ax_s/__init__.py__version__ = '0.1.0' from py_ax_s.api import API PK!6 #py_ax_s/api.py""" py_ax_s.api ~~~~~~~~~~~ This module implements the ax-s API interface. :copyright: (c) 2019 by Elliott Maguire """ import requests class API: """ Enables interaction with the ax-s API. :param token: a user's platform access token """ def __init__(self, key): self.key = key def call(self, token, name, **kwargs): """ Calls a given endpoint. :param token: a registered API's access token :param name: a registered endpoint's name """ url = f"https://easy.ax-s.io/api/call/{token}?endpoint={name}" headers = {'Authorization': f"Token {self.key}"} body = {} for k, v in kwargs.items(): if k in ('headers', 'params', 'body'): body[k] = v response = requests.post(url, headers=headers, data=body) return response PK!HڽTUpy_ax_s-0.1.1.dist-info/WHEEL A н#Z;/"d&F[xzw@Zpy3Fv]\fi4WZ^EgM_-]#0(q7PK!H!ld py_ax_s-0.1.1.dist-info/METADATAOMK1WBC(ԃb]z4$5ɂb^{o7W PRhIi)H*2Xa@7w\4ݽwޒ%i KEUgfP3}L8*֫Z-kUM1)wֲ3Eg\ O7c2"\WVL|PK!HG ]py_ax_s-0.1.1.dist-info/RECORDuMo0񻟥(ia^DyH\ziP@X >d.?ȑekgq;ƦrmAoM (W֚YP4h"Lk.l@DenGyNKX=D{[`?EQ.f[=ў{x}@0u7RΜ˥Pkx t|sT/+99'0!\1k_к,2X[@_/PK!cG88py_ax_s/__init__.pyPK!6 #ipy_ax_s/api.pyPK!HڽTUpy_ax_s-0.1.1.dist-info/WHEELPK!H!ld py_ax_s-0.1.1.dist-info/METADATAPK!HG ]py_ax_s-0.1.1.dist-info/RECORDPKb