BuffetCode / edinet_xbrl

A Python xbrl file downloader and parser for EDINET

Home Page:https://www.buffett-code.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.namenode['name'] に変更