ixbrl-parse


Nameixbrl-parse JSON
Version 0.10.1 PyPI version JSON
download
home_pagehttps://github.com/cybermaggedon/ixbrl-parse
SummaryParse iXBRL files, can present in RDF
upload_time2023-05-10 21:35:00
maintainer
docs_urlNone
authorCybermaggedon
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# `ixbrl-parse`

## Introduction

- Python library code, parses iXBRL files.
- Script `ixbrl-dump` emits iXBRL tagged data in a semi-human-readable dump.
- Script `ixbrl-report` emits iXBRL tagged data in a human-readable report.
  This involves downloading referenced XBRL schema to get the human-readable
  fact labels.
- Script `ixbrl-to-rdf` emits iXBRL tagged data in RDF.
- Script `ixbrl-to-csv` outputs iXBRL tagged data in a CSV format.
- Script `ixbrl-to-json` emits iXBRL tagged data in JSON.
- Script `ixbrl-to-xbrl` emits iXBRL tagged data as an XBRL instance.
- Script `ixbrl-to-kv` emits iXBRL in a key-value form easily consumed
  by scripts.
- Script `ixbrl-markdown` emits iXBRL tagged data in a markdown report.

## Sample data

There's a bunch of sample iXBRL files grabbed from various places in
the `ixbrl` directory: US 10-K and 10-Q filings, a few random things
from UK companies house, and a couple of sample ESEF filings.  This is the
data I've tested with.

Also, `accts.html` is a sample file created using
[`gnucash-ixbrl`](https://github.com/cybermaggedon/gnucash-ixbrl).

## Installation

```
pip3 install git+https://github.com/cybermaggedon/ixbrl-parse
```

## Usage

Parse iXBRL and output in RDF (default n3 format):
```
ixbrl-to-rdf accts.html
```

Parse iXBRL and output in RDF/XML:
```
ixbrl-to-rdf accts.html --format xml
```

Parse iXBRL and output in CSV:
```
ixbrl-to-csv accts.html
```

Parse iXBRL and output in JSON:
```
ixbrl-to-json accts.html
```

Schema labels in JSON:
```
ixbrl-to-json ixbrl/10k/lyft-20201231.htm -f labeled \
    -b https://www.sec.gov/Archives/edgar/data/1759509/000175950921000011/lyft-20201231.htm
```

Dump iXBRL values:
```
ixbrl-dump accts.html
```

Human-readable report:
```
ixbrl-report accts.html
```

Human-readable report from SEC EDGAR.  Note need to tell ixbrl-report the
URL of the original report in order to know where to fetch the
custom schema (relative URLs are used):

```
ixbrl-report ixbrl/10k/lyft-20201231.htm \
    -b https://www.sec.gov/Archives/edgar/data/1759509/000175950921000011/lyft-20201231.htm
```

Dump iXBRL as XBRL:
```
ixbrl-to-xbrl accts.html
```

## API

The `ixbrl-to-csv` file is a good starting point if you want to see how
the API works.

## What next?

This loads into a Redland RDF sqlite3 store:

```
ixbrl-to-rdf -i accts.html -f ntriples > accts.ntriples
rdfproc -n -s sqlite accts.db parse accts.ntriples ntriples
rdfproc -s sqlite accts.db print | head
```

I run a SPARQL store across the data, and view it with
[LodLive](https://github.com/LodLive/LodLive).

![Screenshot of LodLive](docs/screenshot.png)




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cybermaggedon/ixbrl-parse",
    "name": "ixbrl-parse",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Cybermaggedon",
    "author_email": "mark@cyberapocalypse.co.uk",
    "download_url": "https://files.pythonhosted.org/packages/06/9c/b56185d5f26322abc82631ec90874730af698768b29d3a7e6bbf37e5b88b/ixbrl-parse-0.10.1.tar.gz",
    "platform": null,
    "description": "\n# `ixbrl-parse`\n\n## Introduction\n\n- Python library code, parses iXBRL files.\n- Script `ixbrl-dump` emits iXBRL tagged data in a semi-human-readable dump.\n- Script `ixbrl-report` emits iXBRL tagged data in a human-readable report.\n  This involves downloading referenced XBRL schema to get the human-readable\n  fact labels.\n- Script `ixbrl-to-rdf` emits iXBRL tagged data in RDF.\n- Script `ixbrl-to-csv` outputs iXBRL tagged data in a CSV format.\n- Script `ixbrl-to-json` emits iXBRL tagged data in JSON.\n- Script `ixbrl-to-xbrl` emits iXBRL tagged data as an XBRL instance.\n- Script `ixbrl-to-kv` emits iXBRL in a key-value form easily consumed\n  by scripts.\n- Script `ixbrl-markdown` emits iXBRL tagged data in a markdown report.\n\n## Sample data\n\nThere's a bunch of sample iXBRL files grabbed from various places in\nthe `ixbrl` directory: US 10-K and 10-Q filings, a few random things\nfrom UK companies house, and a couple of sample ESEF filings.  This is the\ndata I've tested with.\n\nAlso, `accts.html` is a sample file created using\n[`gnucash-ixbrl`](https://github.com/cybermaggedon/gnucash-ixbrl).\n\n## Installation\n\n```\npip3 install git+https://github.com/cybermaggedon/ixbrl-parse\n```\n\n## Usage\n\nParse iXBRL and output in RDF (default n3 format):\n```\nixbrl-to-rdf accts.html\n```\n\nParse iXBRL and output in RDF/XML:\n```\nixbrl-to-rdf accts.html --format xml\n```\n\nParse iXBRL and output in CSV:\n```\nixbrl-to-csv accts.html\n```\n\nParse iXBRL and output in JSON:\n```\nixbrl-to-json accts.html\n```\n\nSchema labels in JSON:\n```\nixbrl-to-json ixbrl/10k/lyft-20201231.htm -f labeled \\\n    -b https://www.sec.gov/Archives/edgar/data/1759509/000175950921000011/lyft-20201231.htm\n```\n\nDump iXBRL values:\n```\nixbrl-dump accts.html\n```\n\nHuman-readable report:\n```\nixbrl-report accts.html\n```\n\nHuman-readable report from SEC EDGAR.  Note need to tell ixbrl-report the\nURL of the original report in order to know where to fetch the\ncustom schema (relative URLs are used):\n\n```\nixbrl-report ixbrl/10k/lyft-20201231.htm \\\n    -b https://www.sec.gov/Archives/edgar/data/1759509/000175950921000011/lyft-20201231.htm\n```\n\nDump iXBRL as XBRL:\n```\nixbrl-to-xbrl accts.html\n```\n\n## API\n\nThe `ixbrl-to-csv` file is a good starting point if you want to see how\nthe API works.\n\n## What next?\n\nThis loads into a Redland RDF sqlite3 store:\n\n```\nixbrl-to-rdf -i accts.html -f ntriples > accts.ntriples\nrdfproc -n -s sqlite accts.db parse accts.ntriples ntriples\nrdfproc -s sqlite accts.db print | head\n```\n\nI run a SPARQL store across the data, and view it with\n[LodLive](https://github.com/LodLive/LodLive).\n\n![Screenshot of LodLive](docs/screenshot.png)\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Parse iXBRL files, can present in RDF",
    "version": "0.10.1",
    "project_urls": {
        "Download": "https://github.com/cybermaggedon/ixbrl-parse/archive/refs/tags/v0.9.4.tar.gz",
        "Homepage": "https://github.com/cybermaggedon/ixbrl-parse"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "069cb56185d5f26322abc82631ec90874730af698768b29d3a7e6bbf37e5b88b",
                "md5": "83cf43a0509dce770854574d7f7040dc",
                "sha256": "9cc074748ba42fe99d7ca6b70949cab30d996a01f562953d706f28720704c2b9"
            },
            "downloads": -1,
            "filename": "ixbrl-parse-0.10.1.tar.gz",
            "has_sig": false,
            "md5_digest": "83cf43a0509dce770854574d7f7040dc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 28876,
            "upload_time": "2023-05-10T21:35:00",
            "upload_time_iso_8601": "2023-05-10T21:35:00.974205Z",
            "url": "https://files.pythonhosted.org/packages/06/9c/b56185d5f26322abc82631ec90874730af698768b29d3a7e6bbf37e5b88b/ixbrl-parse-0.10.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-10 21:35:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cybermaggedon",
    "github_project": "ixbrl-parse",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ixbrl-parse"
}
        
Elapsed time: 0.08235s