Skip to main content

A python module for getting useful data out of ixbrl files.

Project description

ixbrl-parse

Test status PyPI version PyPI - Python Version PyPI - License Documentation Status

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.

Changelog

Requirements

The module requires BeautifulSoup and lxml to parse the documents.

word2number is used to process the numeric items with the numsenwords format.

How to install

You can install from pypi using pip:

pip install ixbrlparse

How to use

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)

Development

The module is setup for development using hatch.

Run tests

Tests can be run with pytest:

hatch run test

Test coverage

Run tests then report on coverage

hatch run cov

Run tests then run a server showing where coverage is missing

hatch run cov-html

Run typing checks

hatch run lint:typing

Linting

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

Run all checks at once

hatch run lint:all

Publish to pypi

hatch build
hatch publish
git tag v<VERSION_NUMBER>
git push origin v<VERSION_NUMBER>

Acknowledgements

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ixbrlparse-0.9.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

ixbrlparse-0.9.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file ixbrlparse-0.9.1.tar.gz.

File metadata

  • Download URL: ixbrlparse-0.9.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.1

File hashes

Hashes for ixbrlparse-0.9.1.tar.gz
Algorithm Hash digest
SHA256 085dbe4eb0ea3d85d3b501ca6568466cd79d0996d4861f8fafc5a533b14f14f4
MD5 088419b04c3eef7ec5826d6acd6d677a
BLAKE2b-256 bc73b2a572b10333cedda4a48be4bfef699ef48092782ae3ebc0e306e8e9afd2

See more details on using hashes here.

File details

Details for the file ixbrlparse-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: ixbrlparse-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.1

File hashes

Hashes for ixbrlparse-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43183b49af5f8629f1c7dc5e5421aea1884c034603fca0755ee59c2fc0721f7c
MD5 c6647158c70bc6ae0383a4ff8199c88a
BLAKE2b-256 67850823b141861c594b99c52cfcd02b2e9406f009f53ea687ab632726e171fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page