josw123 / dart-fss

한국 금융감독원에서 운영하는 다트(Dart) 시스템 크롤링을 위한 라이브러리
https://github.com/josw123/dart-fss
MIT License
326 stars 111 forks source link

유화증권에서 발생하는 오류 #57

Closed josw123 closed 3 years ago

josw123 commented 3 years ago

유화증권에서 재무제표 추출시 발생하는 오류

Annual reports: 43%|████▎ | 9/21 [02:19<03:04, 15.37s/report]Not Found retrieving http://www.xbrl.or.kr/kr/fr/gaap/im/2008-12-31/kr-gaap-im-2008-12-31.xsd Not Found retrieving http://www.xbrl.or.kr/kr/fr/common/pte/2008-12-31/krfr-pte-2008-12-31.xsd Not Found retrieving http://www.xbrl.or.kr/kr/fr/common/fste/2008-12-31/krfr-fste-2008-12-31.xsd Annual reports: 43%|████▎ | 9/21 [02:23<03:10, 15.91s/report] Traceback (most recent call last): File "C:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3418, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in fs = corp_data.extract_fs(bgn_de = begin_date, separate = True, lang = 'ko') File "C:\Anaconda3\lib\site-packages\dart_fss\corp\corp.py", line 233, in extract_fs return extract(self.corp_code, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) File "C:\Anaconda3\lib\site-packages\dart_fss\fs\extract.py", line 1294, in extract raise e File "C:\Anaconda3\lib\site-packages\dart_fss\fs\extract.py", line 1267, in extract dataset=dataset) File "C:\Anaconda3\lib\site-packages\dart_fss\fs\extract.py", line 1138, in analyze_report show_concept=True, separator=separator) File "C:\Anaconda3\lib\site-packages\dart_fss\fs\extract.py", line 1029, in analyze_xbrl statements[tp] = func_fs[tp]() File "C:\Anaconda3\lib\site-packages\dart_fss\fs\extract.py", line 990, in get_fs data = xbrl.get_financial_statement(separate=separate) File "C:\Anaconda3\lib\site-packages\dart_fss\xbrl\dart_xbrl.py", line 274, in get_financial_statement return self._get_statement('dart-gcd_StatementOfFinancialPosition', separate=separate) File "C:\Anaconda3\lib\site-packages\dart_fss\xbrl\dart_xbrl.py", line 249, in _get_statement table = self.get_table_by_code('d999007') File "C:\Anaconda3\lib\site-packages\dart_fss\xbrl\dart_xbrl.py", line 74, in get_table_by_code if str_compare(table.code, code): File "C:\Anaconda3\lib\site-packages\dart_fss\utils\string.py", line 29, in str_compare str1 = str1.strip().lower() AttributeError: ("'NoneType' object has no attribute 'strip'", "An error occurred while fetching or analyzing {'rcp_no': '20120229000184', 'corp_code': '00145190', 'corp_name': '유화증권', 'stock_code': '003460', 'corp_cls': 'Y', 'report_nm': '[기재정정]사업보고서 (2011.03)', 'flr_nm': '유화증권', 'rcept_dt': '20120229', 'rm': ''}.")

josw123 commented 3 years ago

xbrl 파일 분석시 아래의 3개의 XSD 파일이 없음으로 인해 추가 오류 발생

http://www.xbrl.or.kr/kr/fr/gaap/im/2008-12-31/kr-gaap-im-2008-12-31.xsd http://www.xbrl.or.kr/kr/fr/common/pte/2008-12-31/krfr-pte-2008-12-31.xsd http://www.xbrl.or.kr/kr/fr/common/fste/2008-12-31/krfr-fste-2008-12-31.xsd

Annual reports: 90% 9/10 [02:15<00:15, 15.01s/report] Not Found retrieving http://www.xbrl.or.kr/kr/fr/gaap/im/2008-12-31/kr-gaap-im-2008-12-31.xsd Not Found retrieving http://www.xbrl.or.kr/kr/fr/common/pte/2008-12-31/krfr-pte-2008-12-31.xsd Not Found retrieving http://www.xbrl.or.kr/kr/fr/common/fste/2008-12-31/krfr-fste-2008-12-31.xsd


AttributeError Traceback (most recent call last)

in ----> 1 fs = corp.extract_fs(bgn_de='20120101', separate=True) ~\IdeaProjects\dart-fss\dart_fss\corp\corp.py in extract_fs(self, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) 231 232 """ --> 233 return extract(self.corp_code, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) ~\IdeaProjects\dart-fss\dart_fss\fs\extract.py in extract(corp_code, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) 1292 msg = 'Unexpected Error' 1293 e.args = (*e.args, msg, ) -> 1294 raise e 1295 finally: 1296 dart.utils.spinner.spinner_enable = True ~\IdeaProjects\dart-fss\dart_fss\fs\extract.py in extract(corp_code, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) 1260 1261 else: -> 1262 nstatements = analyze_report(report=report, 1263 fs_tp=fs_tp, 1264 separate=separate, ~\IdeaProjects\dart-fss\dart_fss\fs\extract.py in analyze_report(report, fs_tp, separate, lang, separator, dataset) 1134 if separate is False and not xbrl.exist_consolidated(): 1135 raise NotFoundConsolidated('Could not find consolidated financial statements') -> 1136 fs_df = analyze_xbrl(report, fs_tp=fs_tp, separate=separate, lang=lang, 1137 show_abstract=False, show_class=True, show_depth=10, 1138 show_concept=True, separator=separator) ~\IdeaProjects\dart-fss\dart_fss\fs\extract.py in analyze_xbrl(report, fs_tp, separate, lang, show_abstract, show_class, show_depth, show_concept, separator) 1027 statements = OrderedDict() 1028 for tp in fs_tp: -> 1029 statements[tp] = func_fs[tp]() 1030 if statements[tp]: 1031 statements[tp] = statements[tp].to_DataFrame(**option) ~\IdeaProjects\dart-fss\dart_fss\fs\extract.py in get_fs() 988 # 재무제표 추출을 위한 함수 989 def get_fs(): --> 990 data = xbrl.get_financial_statement(separate=separate) 991 return data[0] if data else None 992 ~\IdeaProjects\dart-fss\dart_fss\xbrl\dart_xbrl.py in get_financial_statement(self, separate) 272 재무상태표 리스트 273 """ --> 274 return self._get_statement('dart-gcd_StatementOfFinancialPosition', separate=separate) 275 276 def get_income_statement(self, separate: bool = False) -> Union[List[Table], None]: ~\IdeaProjects\dart-fss\dart_fss\xbrl\dart_xbrl.py in _get_statement(self, concept_id, separate) 248 """ 249 table = self.get_table_by_code('d999007') --> 250 table_dict = table.get_value_by_concept_id(concept_id) 251 compare_name = 'Separate' if separate else 'Consolidated' 252 for keys, value in table_dict.items(): AttributeError: ("'NoneType' object has no attribute 'get_value_by_concept_id'", "An error occurred while fetching or analyzing {'rcp_no': '20120229000184', 'corp_code': '00145190', 'corp_name': '유화증권', 'stock_code': '003460', 'corp_cls': 'Y', 'report_nm': '[기재정정]사업보고서 (2011.03)', 'flr_nm': '유화증권', 'rcept_dt': '20120229', 'rm': ''}.")
josw123 commented 3 years ago

AttributeError Traceback (most recent call last)

in ----> 1 fs = corp.extract_fs(bgn_de='20100101', separate=True) ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/corp/corp.py in extract_fs(self, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) 231 232 """ --> 233 return extract(self.corp_code, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/fs/extract.py in extract(corp_code, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) 1292 msg = 'Unexpected Error' 1293 e.args = (*e.args, msg, ) -> 1294 raise e 1295 finally: 1296 dart.utils.spinner.spinner_enable = True ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/fs/extract.py in extract(corp_code, bgn_de, end_de, fs_tp, separate, report_tp, lang, separator, dataset) 1260 1261 else: -> 1262 nstatements = analyze_report(report=report, 1263 fs_tp=fs_tp, 1264 separate=separate, ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/fs/extract.py in analyze_report(report, fs_tp, separate, lang, separator, dataset) 1134 if separate is False and not xbrl.exist_consolidated(): 1135 raise NotFoundConsolidated('Could not find consolidated financial statements') -> 1136 fs_df = analyze_xbrl(report, fs_tp=fs_tp, separate=separate, lang=lang, 1137 show_abstract=False, show_class=True, show_depth=10, 1138 show_concept=True, separator=separator) ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/fs/extract.py in analyze_xbrl(report, fs_tp, separate, lang, show_abstract, show_class, show_depth, show_concept, separator) 1027 statements = OrderedDict() 1028 for tp in fs_tp: -> 1029 statements[tp] = func_fs[tp]() 1030 if statements[tp]: 1031 statements[tp] = statements[tp].to_DataFrame(**option) ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/fs/extract.py in get_fs() 988 # 재무제표 추출을 위한 함수 989 def get_fs(): --> 990 data = xbrl.get_financial_statement(separate=separate) 991 return data[0] if data else None 992 ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/xbrl/dart_xbrl.py in get_financial_statement(self, separate) 272 재무상태표 리스트 273 """ --> 274 return self._get_statement('dart-gcd_StatementOfFinancialPosition', separate=separate) 275 276 def get_income_statement(self, separate: bool = False) -> Union[List[Table], None]: ~/opt/miniconda3/lib/python3.8/site-packages/dart_fss/xbrl/dart_xbrl.py in _get_statement(self, concept_id, separate) 248 """ 249 table = self.get_table_by_code('d999007') --> 250 table_dict = table.get_value_by_concept_id(concept_id) 251 compare_name = 'Separate' if separate else 'Consolidated' 252 for keys, value in table_dict.items(): AttributeError: ("'NoneType' object has no attribute 'get_value_by_concept_id'", "An error occurred while fetching or analyzing {'rcp_no': '20120229000184', 'corp_code': '00145190', 'corp_name': '유화증권', 'stock_code': '003460', 'corp_cls': 'Y', 'report_nm': '[기재정정]사업보고서 (2011.03)', 'flr_nm': '유화증권', 'rcept_dt': '20120229', 'rm': ''}.")