This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://docs.python-requests.org/en/master/api/ | |
import requests | |
class RequestsApi: | |
def __init__(self, base_url, **kwargs): | |
self.base_url = base_url | |
self.session = requests.Session() | |
for arg in kwargs: | |
if isinstance(kwargs[arg], dict): | |
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
WARNING: dont use loguru, use structlog | |
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f | |
Configure handlers and formats for application loggers. | |
""" | |
import logging | |
import sys | |
from pprint import pformat |