keyが途中で切れる
meihei3 opened this issue · comments
jpcrp030000-asr_E00053-000:ManagementAnalysisOfFinancialPositionOperatingResultsAndCashFlowsTextBlock
という元データのkeyに対して、
jpcrp030000-asr_e00053-000:managementanalysisoffinancialpositionoperatingresultsandcashflowstextbloc
となり、途中で途切れてしまいます。
@yameholo なるほど、もう少し具体的に情報がほしいんですが
https://github.com/BuffetCode/edinet_xbrl/blob/master/edinet_xbrl/edinet_xbrl_parser.py#L24
この node
の時点で途切れちゃってますか?
@shoe116 はい。node.name
が元のデータのtag名を100文字でスライスしているようです。
bs4でxmlをパースして似たような現象が起きている人を見つけたので、このライブラリではなくbs4側のバグ(もしくは仕様)かもしれません。
https://groups.google.com/forum/#!topic/beautifulsoup/MjBN2_eQql8
@yameholo bs4を読んでみたんですが、おそらくbs4の tag.name
の扱いのせいですね、 tag["name"]
にすれば大丈夫かも。
https://github.com/BuffetCode/edinet_xbrl/blob/master/edinet_xbrl/edinet_xbrl_parser.py#L30
ここですね、この node.name
を node['name']
に変更