Skip to content

Commit

Permalink
stripped and cleaned value
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyism committed Dec 15, 2019
1 parent f8e1c5e commit 54be49d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
59 changes: 59 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ To get all companies and find a specific one, run
edgar = Edgar()
possible_companies = edgar.find_company_name("Cisco System")
To get XBRL data, run

.. code-block:: python
from edgar import Company, XBRL, XBRLElement
company = Company("Oracle Corp", "0001341439")
results = company.get_data_files_from_10K("EX-101.INS", isxml=True)
xbrl = XBRL(results[0])
XBRLElement(xbrl.relevant_children_parsed[15]).to_dict() // returns a dictionary of name, value, and schemaRef
API
---

Expand Down Expand Up @@ -80,6 +91,39 @@ Returns the HTML in the form of `lxml.html <http://lxml.de/lxmlhtml.html>`_
* ownership: defaults to include. Options are include, exclude, only.
* no_of_entries: defaults to 100. Returns the number of entries to be returned. Maximum is 100.

get_10Ks
""""""""

Returns the HTML in the form of `lxml.html <http://lxml.de/lxmlhtml.html>`_ of concatenation of all the documents in the 10-K


* **Input**

* no_of_documents (default: 1): numer of documents to be retrieved

get_document_type_from_10K
""""""""""""""""""""""""""

Returns the HTML in the form of `lxml.html <http://lxml.de/lxmlhtml.html>`_ of the document within 10-K


* **Input**

* document_type: Tye type of document you want, i.e. 10-K, EX-3.2
* no_of_documents (default: 1): numer of documents to be retrieved

get_data_files_from_10K
"""""""""""""""""""""""

Returns the HTML in the form of `lxml.html <http://lxml.de/lxmlhtml.html>`_ of the data file within 10-K


* **Input**

* document_type: Tye type of document you want, i.e. EX-101.INS
* no_of_documents (default: 1): numer of documents to be retrieved
* isxml (default: False): by default, things aren't case sensitive and is parsed with ``html`` in ``lxml. If this is True, then it is parsed with``\ etree` which is case sensitive

Edgar
^^^^^

Expand Down Expand Up @@ -119,3 +163,18 @@ Returns a list of strings, each string contains the body of the specified docume

* tree: lxml.html form that is returned from Company.getAllFilings
* no_of_documents: number of document returned. If it is 1, the returned result is just one string, instead of a list of strings. Defaults to 1.

XBRL
^^^^

Parses data from XBRL


* ``relevant_children``

* get children that are not ``context``

* ``relevant_children_parsed``

* get children that are not ``context``\ , ``unit``\ , ``schemaRef``
* cleans tags
2 changes: 1 addition & 1 deletion edgar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .company import Company
from .xbrl import XBRL, XBRLElement

__version__ = "4.1.0"
__version__ = "4.1.1"

modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
2 changes: 1 addition & 1 deletion edgar/xbrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def name(self):

@property
def value(self) -> str:
return self.child.text
return self.child.text.replace("\n", "").strip()

def to_dict(self) -> Dict:
return {
Expand Down

0 comments on commit 54be49d

Please sign in to comment.