uktrade / stream-read-xbrl

Python package to parse Companies House accounts data in a streaming way
https://stream-read-xbrl.docs.trade.gov.uk/
MIT License
18 stars 2 forks source link

refactor: fewer conditionals and less mutation #45

Closed michalc closed 1 year ago

michalc commented 1 year ago

Instead of a type that has to be tested, store the actual parser against each XPath mapping. This means fewer conditionals and (hopefully) clearer code.

Also in the case of certain decimals, we avoid mutating the DOM itself for clarity (and maybe micro performance improvement)