Code Monkey home page Code Monkey logo

xbrlj's Introduction

xbrlj

Core Java library that implements XBRL parsing and analysis. To get started,

  1. Construct a new XbrlReader as follows

     XbrlReader reader = new XbrlReader();
    
  2. Get XbrlInstance from the reader

     //
     // url can be a http url to the root .xml document, 
     //     e.g. https://www.sec.gov/Archives/edgar/data/773840/000093041315000621/hon-20141231.xml for Honeywell, FY 2014
     // It can also be a file url, a zip url to the entire xbrl instance or a zip url to an iXBRL instance
     // There are other variations of this basic method. Look at the class for more details or XbrlTest in src/test
     //
     XbrlInstance instance = reader.getInstance(url)
    
  3. Introspect the instance. The simplest introspection is printing the instance to a text file as follows

     PrintWriter writer = new PrintWriter(new FileWriter(path));
     PrettyPrinter printer = new PrettyPrinter(writer, true, true, false);
     PresentationNetwork fileWriter = new PresentationNetwork(instance, printer);
    
     DiscoverableTaxonomySet dts = instance.getTaxonomy();
     Collection<RoleType> roles = dts.getReportableRoleTypes();
     for (RoleType roleType : roles) {
         fileWriter.process(roleType);
     }
    

    Here is a sample output in json (https://datanapis.io/JPM_20210930_ZIP.json), text (https://datanapis.io/JPM_20210930_ZIP.txt) and text with labels (https://datanapis.io/JPM_20210930_ZIP_with_labels.txt)

  4. You can do many more things such as exploring the concepts and facts used by the XbrlInstance, exploring the DefinitionNetwork, the CalculationNetwork, validating calculations, exploring the Discoverable Taxonomy Set, etc.

I have run this on 305,676 XBRL instances submitted to Edgar starting from 2012 with 99.59% success rate. You can download these statistics from here - https://datanapis.io/xbrl_results.csv

The software for downloading from Edgar and processing all those instances is not part of this repository.

Before you can start to download XBRL instances from Edgar, you may need to set the property user.agent to a valid email. See the Edgar documentation for more details.

xbrlj's People

Contributors

macnjk avatar gmconte avatar ammasjk 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.