Changed docs and updated methods in Focus
This commit is contained in:
@@ -29,10 +29,17 @@
|
|||||||
Основные методы
|
Основные методы
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.FocusCompliance.company_is_foreign_agent()
|
Юридические лица
|
||||||
|
----------------
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.FocusCompliance.person_is_foreign_agent()
|
.. autofunction:: kontur_focus.FocusCompliance.company_is_foreign_agent()
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.FocusCompliance.search_global_company_profiles_id()
|
.. autofunction:: kontur_focus.FocusCompliance.search_global_company_profiles_id()
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.FocusCompliance.legal_entity_profile_report(profile_id_list, path)
|
.. autofunction:: kontur_focus.FocusCompliance.legal_entity_profile_report(profile_id_list, path)
|
||||||
|
|
||||||
|
|
||||||
|
Физические лица
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. autofunction:: kontur_focus.FocusCompliance.person_is_foreign_agent()
|
||||||
|
|||||||
@@ -35,11 +35,16 @@
|
|||||||
|
|
||||||
focus.base_info()
|
focus.base_info()
|
||||||
|
|
||||||
|
Юридические лица
|
||||||
|
----------------
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.Focus.base_info()
|
.. autofunction:: kontur_focus.Focus.base_info()
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.Focus.advanced_info()
|
.. autofunction:: kontur_focus.Focus.advanced_info()
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.Focus.excerpt(path=None)
|
.. autofunction:: kontur_focus.Focus.excerpt(path)
|
||||||
|
|
||||||
|
.. autofunction:: kontur_focus.Focus.express_report(pdf, path)
|
||||||
|
|
||||||
.. autofunction:: kontur_focus.Focus.founders_history()
|
.. autofunction:: kontur_focus.Focus.founders_history()
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Focus(Request):
|
|||||||
"""
|
"""
|
||||||
return self.get('/egrDetails')
|
return self.get('/egrDetails')
|
||||||
|
|
||||||
def excerpt(self, path: str = None):
|
def excerpt(self, path: str = None) -> dict:
|
||||||
"""Выписка из ЕГРЮЛ/ЕГРИП
|
"""Выписка из ЕГРЮЛ/ЕГРИП
|
||||||
|
|
||||||
:param path: Путь выгрузки файла. Если не указан, выгружается в текущий каталог.
|
:param path: Путь выгрузки файла. Если не указан, выгружается в текущий каталог.
|
||||||
@@ -53,11 +53,20 @@ class Focus(Request):
|
|||||||
with open(file_path, mode='wb') as file:
|
with open(file_path, mode='wb') as file:
|
||||||
file.write(response.content)
|
file.write(response.content)
|
||||||
|
|
||||||
return f'File {file_path} saved'
|
return {'success': True, 'filename': filename, 'path': file_path}
|
||||||
except Exception:
|
except Exception as e:
|
||||||
return 'Saving error!'
|
return {'success': False, 'message': e}
|
||||||
|
|
||||||
def express_report(self, pdf: bool = True, path: str = None):
|
def express_report(self, pdf: bool = True, path: str = None) -> dict:
|
||||||
|
"""Экспресс-отчет по контрагенту
|
||||||
|
|
||||||
|
:param pdf: Выгрузить PDF файл, по-умолчанию True
|
||||||
|
:type pdf: bool, optional
|
||||||
|
:param path: Путь выгрузки файла. Если не указан, выгружается в текущий каталог.
|
||||||
|
:type path: str, optional
|
||||||
|
:return: _description_
|
||||||
|
:rtype: _type_
|
||||||
|
"""
|
||||||
response = self.get('/briefReport', pdf=pdf)
|
response = self.get('/briefReport', pdf=pdf)
|
||||||
current_datetime = datetime.now().strftime('%d-%m-%Y_%H-%M')
|
current_datetime = datetime.now().strftime('%d-%m-%Y_%H-%M')
|
||||||
filename = f'Экспресс-отчет_{self.inn}_{current_datetime}.pdf'
|
filename = f'Экспресс-отчет_{self.inn}_{current_datetime}.pdf'
|
||||||
@@ -72,9 +81,9 @@ class Focus(Request):
|
|||||||
with open(file_path, mode='wb') as file:
|
with open(file_path, mode='wb') as file:
|
||||||
file.write(response.content)
|
file.write(response.content)
|
||||||
|
|
||||||
return f'File {file_path} saved'
|
return {'success': True, 'filename': filename, 'path': file_path}
|
||||||
except Exception:
|
except Exception as e:
|
||||||
return 'Saving error!'
|
return {'success': False, 'message': e}
|
||||||
else:
|
else:
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user