PyHodl  0.2.6
Framework to download, update, analyze and plot your crypto-transactions. Completely off-line and security-oriented.
pyhodl.utils.network Namespace Reference

Functions

def handle_rate_limits (func, time_wait=60, max_attempts=2)
 
def is_network_rate_error (exc)
 
def get_and_sleep (symbols, fetcher, sleep_time, log_data)
 
def download (url)
 
def download_with_tor (url, tor_password, max_attempts)
 

Function Documentation

def pyhodl.utils.network.download (   url)
:param url: str
    Url to get
:return: response
    Response of request
def pyhodl.utils.network.download_with_tor (   url,
  tor_password,
  max_attempts 
)
:param url: str
    Url to get
:param tor_password: str
    Password to connect to tor proxy
:param max_attempts: int
    Max number of attempts to do
:return: response
    Response of request
def pyhodl.utils.network.get_and_sleep (   symbols,
  fetcher,
  sleep_time,
  log_data 
)
:param symbols: [] of *
    List of data to fetch
:param fetcher: func
    Perform operations with this function on each data
:param sleep_time: int
    After operations, sleep this amount of seconds
:param log_data: str
    Extra log data to print
:return: [] of *
    Performs function on each data, waits (after each operation) and
    returns results
def pyhodl.utils.network.handle_rate_limits (   func,
  time_wait = 60,
  max_attempts = 2 
)
:param func: callback function
    function to wrap
:param time_wait: int
    Time to wait between consecutive attempts
:param max_attempts: int
    Max number of attempt to do before giving up
:return: callback function return type
    wraps callback function
def pyhodl.utils.network.is_network_rate_error (   exc)
:param exc: Exception
    Exception thrown when requesting network resource
:return: bool
    True iff exception tells you abused APIs