|
@@ -11,6 +11,9 @@ from collections import OrderedDict
|
|
|
|
|
|
import requests
|
|
import requests
|
|
import xlsxwriter as xlsw
|
|
import xlsxwriter as xlsw
|
|
|
|
+from urllib3.util.retry import Retry
|
|
|
|
+from requests.adapters import HTTPAdapter
|
|
|
|
+
|
|
from .writer import Writer
|
|
from .writer import Writer
|
|
|
|
|
|
def insert_keys(dict_, obj, pos):
|
|
def insert_keys(dict_, obj, pos):
|
|
@@ -35,6 +38,10 @@ class anafAPI(object):
|
|
'''Constructor
|
|
'''Constructor
|
|
'''
|
|
'''
|
|
self.session = requests.Session()
|
|
self.session = requests.Session()
|
|
|
|
+ retry = Retry(connect=3, backoff_factor=1)
|
|
|
|
+ adapter = HTTPAdapter(max_retries=retry)
|
|
|
|
+ self.session.mount('http://', adapter)
|
|
|
|
+ self.session.mount('https://', adapter)
|
|
|
|
|
|
def parse_list(self, file_name=None, list_=None, excl_=[], ):
|
|
def parse_list(self, file_name=None, list_=None, excl_=[], ):
|
|
if file_name:
|
|
if file_name:
|