An XBRL parser built in Rust that provides a fast, easy, and lightweight way to convert XBRL XML files into JSON or CSV. Available as a Python library or a standalone command line utility.
Author: Ties de Kok (Personal Page)
The objective of fast-xbrl-parser
is to provide a fast, easy, and lightweight way to parse XBRL XML files into JSON or CSV.
It is built with the following objectives in mind:
- An easy to use interface
- Very fast
- Lightweight and easy to install
- Cross-platform support (Windows, Linux, and Mac OS are supported)
- Only tested on US XBRL files from SEC EDGAR
- Opinionated conversion to CSV
- Not validated against the XBRL specification
Use at your own discretetion and always verify the results yourself.
Note: fast-xbrl-parser
requires Python 3.6+
pip install fast-xbrl-parser
Download the executable file from:
https://github.com/TiesdeKok/fast_xbrl_parser/releases/
For full examples and documentation see: notebook
import fast_xbrl_parser as fxp
input = "https://www.sec.gov/Archives/edgar/data/1326380/000132638021000129/gme-20211030_htm.xml" ## Edgar URL
#input = "gme-20211030_htm.xml" ## Local XML file
xbrl_dict = fxp.parse(
input,
output=['json', 'facts', 'dimensions'], ### You can adjust this to only return certain outputs.
email = "[email protected]" ### Adjust this to reflect your email address. This is required by the SEC Edgar system when passing a URL.
)
json_valid_dict = xbrl_dict['json']
facts_list = xbrl_dict['facts']
facts_df = pd.DataFrame(facts_list)
fast_xbrl_parser.exe
--input "https://www.sec.gov/Archives/edgar/data/1589526/000158952621000140/blbd-20211002_htm.xml"
--json --facts --dimensions
--save-dir "D:\xbrl_storage" --email "[email protected]"
## This will save the JSON / CSV files in the `save-dir`
If you have questions or experience problems please use the issues
tab of this repository.
MIT - Ties de Kok - 2022