Coder Social home page Coder Social logo

xbrl's Introduction

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')

xbrl's People

Contributors

divbzero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.