PK!cG88py_ax_s/__init__.py__version__ = '0.1.0' from py_ax_s.api import API PK!'|>||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 bearer token """ def __init__(self, bearer): self.bearer = bearer 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.bearer}"} 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.2.dist-info/WHEEL A н#Z;/"d&F[xzw@Zpy3Fv]\fi4WZ^EgM_-]#0(q7PK!H?d py_ax_s-0.1.2.dist-info/METADATAOMK1WQC(AR=u$5ɂMV7ޛGNN+(T-Y6p4}R%VednJ{`;; Gte}>mڇUkٲf~'^%*cWqQW1Z8-P7(;V\krK1?>o%&!C)jYaU5 PK!HP]py_ax_s-0.1.2.dist-info/RECORDur0лߒ ЃK "/Td_Kvx3y8fʹE˹TIC4^<4+ڦƌl}UDW:_!ت2k[ K Rb}Pbw;defr 0AOʒ"!)M E~)'ڝêOb\EVIcps'rvrG2Th<4,=׿XjkzFs1^еl|PK!cG88py_ax_s/__init__.pyPK!'|>||ipy_ax_s/api.pyPK!HڽTUpy_ax_s-0.1.2.dist-info/WHEELPK!H?d py_ax_s-0.1.2.dist-info/METADATAPK!HP]py_ax_s-0.1.2.dist-info/RECORDPKb