<commit_before>**python-xbrl** is a library for parsing [xbrl](http://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html) documents providing output as both a basic model object and serialized objects
thur [marshmallow](http://marshmallow.readthedocs.org/en/latest/) for rendering into standards formats like JSON or HTTP API

Usage
-----

If you really want to become familiar with this library, read
the docstrings in the code.

Initialization
--------------

To start using the library, first import the `XBRLParser`

    from parser import XBRLParser

Simple Parsing Workflow
-----------------------

First parse the incoming XRBL file into a new `XBRL` basic object

    xbrl = XBRLParser.parse(file("sam-20131228.xml"))
    
Then you can parse the document using different parser

    gaap_obj = XBRLParser.parseGAAP(xbrl)
    
Now we have a `GAAP` model object that has the GAAP parsed elements from the document.

You can serialize the GAAP model object into a serialized object acceptable for rending into a standard format such as JSON or HTTP API.

    serialized = GAAPSerializer(gaap_obj)
    
You can also just view the data in the serialized object

    print serialized.data
    
You can apply various parsers to the base `XBRLParser` object to get different data than just GAAP data from the document. In addition as expected you can also create different serialized objects on the resulting parsed data object. 

Testing
-------

To run the unit tests, you need pytest
<commit_msg>Updates for doc_date and doc_type<commit_after>**python-xbrl** is a library for parsing [xbrl](http://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html) documents providing output as both a basic model object and serialized objects
thur [marshmallow](http://marshmallow.readthedocs.org/en/latest/) for rendering into standards formats like JSON or HTTP API

Usage
-----

If you really want to become familiar with this library, read
the docstrings in the code.

Initialization
--------------

To start using the library, first import the `XBRLParser`

    from parser import XBRLParser

Simple Parsing Workflow
-----------------------

First parse the incoming XRBL file into a new `XBRL` basic object
    
    xbrl_parser = XBRLParser()
    xbrl = XBRLParser.parse(file("sam-20131228.xml"))
    
Then you can parse the document using different parsers

    gaap_obj = XBRLParser.parseGAAP(xbrl, doc_date="20131228", doc_type="10-K")
    
Now we have a `GAAP` model object that has the GAAP parsed elements from the document. You can also parse different types of documents, currently only 10-K and 10-Q is supported

You can serialize the GAAP model object into a serialized object acceptable for rending into a standard format such as JSON or HTTP API.

    serialized = GAAPSerializer(gaap_obj)
    
You can also just view the data in the serialized object

    print serialized.data
    
You can apply various parsers to the base `XBRLParser` object to get different data than just GAAP data from the document. In addition as expected you can also create different serialized objects on the resulting parsed data object. 

Testing
-------

To run the unit tests, you need pytest

{'fraction_non_alphanumeric': 0.08522899605702154, 'fraction_numerical': 0.026084319077949652, 'mean_word_length': 3.5426997245179064, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6103898', 'n_tokens_mistral': 992, 'n_tokens_neox': 923, 'n_words': 407}