A python library for getting useful data out of ixbrl files.
A python module for getting useful data out of iXBRL™ and XBRL™ files. The library is at an early stage - feedback and improvements are very welcome.
Full documentation is available at ixbrl-parse.readthedocs.io
For more about the iXBRL™ and XBRL™ standards, see the specification site and XBRL International. This tool is not affiliated with XBRL International.
The module requires BeautifulSoup and lxml to parse the documents.
word2number is used to process the
numeric items with the numsenwords
format.
You can install from pypi using pip:
pip install ixbrlparse
You can run the module directly to extract data from an iXBRL™ file.
ixbrlparse example_file.html
# or
python -m ixbrlparse example_file.html
While primarily designed for iXBRL™ files, the parser should also work for XBRL™ files.
The various options for using this can be found through:
python -m ixbrlparse -h
# optional arguments:
# -h, --help show this help message and exit
# --outfile OUTFILE Where to output the file
# --format {csv,json,jsonlines,jsonl}
# format of the output
# --fields {numeric,nonnumeric,all}
# Which fields to output
You can also use as a python module (see the documentation for more details)
The module is setup for development using hatch.
Tests can be run with pytest
:
hatch run test
Run tests then report on coverage
hatch run cov
Run tests then run a server showing where coverage is missing
hatch run cov-html
hatch run lint:typing
Ruff should be run before committing any changes.
To check for any changes needed:
hatch run lint:style
To run any autoformatting possible:
hatch run lint:fmt
hatch run lint:all
hatch build
hatch publish
git tag v<VERSION_NUMBER>
git push origin v<VERSION_NUMBER>
Developed by David Kane of Kane Data Ltd
Originally developed for a project with Power to Change looking at how to extract data from financial documents of community businesses.
Thanks to the following users for their contributions:
XBRL™ and iXBRL™ are trademarks of XBRL International, Inc. All rights reserved.
The XBRL™ standards are open and freely licensed by way of the XBRL International License Agreement. Our use of these trademarks is permitted by XBRL International in accordance with the XBRL International Trademark Policy.