Skip to main content

Parsing and navigating XBRL documents

Project description

Features

  • (P0) Parse XBRL instance documents
  • (P0) Parse XBRL linkbases
    • (P2) Calculation linkbase
    • (P2) Definition linkbase
    • (P1) Label linkbase
    • (P0) Presentation linkbase
  • (P0) Parse XBRL schemas

Classes

XBRL Instance

Document

class XBRL(list):
    """An XBRL instance document"""
    ...

Fact

class Fact(dict):
    """An XBRL fact: concept, context, value"""
    ...

Concept

class Concept(dict):
    """An XBRL concept"""
    ...

Context

class Context(dict):
    """An XBRL context: company, segment, period"""
    ...
class Period(dict):
    """An XBRL period: start date, end date"""
    ...

Value

class Value(dict):
    """An XBRL value: amount, unit"""
    ...
class Unit(dict):
    """An XBRL unit"""
    ...

XBRL Linkbase

Linkbase

class Linkbase(list):
    """An XBRL linkbase"""
    ...
class CalculationLinkbase(Linkbase):
    """An XBRL calculation linkbase"""
    ...
class DefinitionLinkbase(Linkbase):
    """An XBRL definition linkbase"""
    ...
class LabelLinkbase(Linkbase):
    """An XBRL label linkbase"""
    ...
class PresentationLinkbase(Linkbase):
    """An XBRL Presentation linkbase"""
    ...

Link

class Link(dict):
    """An XBRL link"""
    ...
class CalculationLink(Link):
    """An XBRL calculation link"""
    ...
class DefinitionLink(Link):
    """An XBRL definition link"""
    ...
class LabelLink(Link):
    """An XBRL label link"""
    ...
class PresentationLink(Link):
    """An XBRL Presentation link"""
    ...

Usage

XBRL Instance

brka = XBRL(file='brka-20151231.xml')
brka = XBRL('BRKA', 2015)
brka = XBRL('BRKA', 2015, 'FY')
brka = XBRL(file='brka-20160331.xml')
brka = XBRL('BRKA', 2016, 'Q1')
facts = list(brka)
contexts = list(brka.contexts)
units = list(brka.units)

XBRL Linkbase

brka_cal = CalculationLinkbase(file='brka-20151231_cal.xml')
brka_cal = CalculationLinkbase('BRKA', 2015)
brka_cal = CalculationLinkbase('BRKA', 2015, 'FY')
brka_def = DefinitionLinkbase(file='brka-20151231_def.xml')
brka_def = DefinitionLinkbase('BRKA', 2015)
brka_def = DefinitionLinkbase('BRKA', 2015, 'FY')
brka_lab = LabelLinkbase(file='brka-20151231_lab.xml')
brka_lab = LabelLinkbase('BRKA', 2015)
brka_lab = LabelLinkbase('BRKA', 2015, 'FY')
brka_pre = PresentationLinkbase(file='brka-20151231_pre.xml')
brka_pre = PresentationLinkbase('BRKA', 2015)
brka_pre = PresentationLinkbase('BRKA', 2015, 'FY')

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

xbrl-0.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

xbrl-0.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file xbrl-0.0.1.tar.gz.

File metadata

  • Download URL: xbrl-0.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for xbrl-0.0.1.tar.gz
Algorithm Hash digest
SHA256 60d1d352b2f91e50bbdc941620a1d2b29ee785eea757a86aa36303c801b9f6fd
MD5 9e1d4b4bec20a38443826e40efff33db
BLAKE2b-256 64b478e5a101c4fa0098618f201c9b8041bf1c4525a8b2eefc9fa4951a41d744

See more details on using hashes here.

File details

Details for the file xbrl-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: xbrl-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for xbrl-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1bb30a550d7676a43e38b349b3bce6dc2268e45e3d9e60128e3cdd57e37467c
MD5 e1a9208bd910b982a5ef2d3b5b7d5deb
BLAKE2b-256 4624e807f2511c8f4f66f2e5abcfbb99d90b4435480211e26e6de7377c22f4b1

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page