Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to get the presentation information from these APIs? #4

Open
jeffmarshall opened this issue Sep 8, 2023 · 1 comment

Comments

@jeffmarshall
Copy link

I know this isn't relevant to your code, but is there any way to figure out what report each fact belongs to, and the order in which the facts should be displayed?

@webbsledge
Copy link

webbsledge commented Jul 9, 2024

Hi @jeffmarshall. It's pretty buried, but it's there. When using the get_company_facts method, the report is listed in the form field. I don't know how you're pulling the data, but I find it easiest to write the output to a json file, and then open the json in either a browser or an IDE, which will allow you to expand and collapse fields to see the nesting more easily. I've provided a little code snippet below to do that, but the "form" field is nested as follows, using the first taxonomy (dei) and tag (EntityCommonStockSharesOutstanding) as an example:

facts/dei/EntityCommonStockSharesOutstaning/units/shares/form

This structure repeats under different taxonomies and different tags, also.

In a Python IDE or REPL you can run:

cik = "789019" # Microsoft
company_facts = edgar.get_company_facts(cik=cik)
with open('<path>/company_facts.json', 'w') as outfile:
    json.dump(company_facts, outfile)

The output looks something like this (this is just the head):

{
  "cik": 789019,
  "entityName": "MICROSOFT CORPORATION",
  "facts": {
    "dei": {
      "EntityCommonStockSharesOutstanding": {
        "label": "Entity Common Stock, Shares Outstanding",
        "description": "Indicate number of shares or other units outstanding of each of registrant's classes of capital or common stock or other ownership interests, if and as stated on cover of related periodic report. Where multiple classes or units exist define each class/interest by adding class of stock items such as Common Class A [Member], Common Class B [Member] or Partnership Interest [Member] onto the Instrument [Domain] of the Entity Listings, Instrument.",
        "units": {
          "shares": [
            {
              "end": "2009-10-19",
              "val": 8879121378,
              "accn": "0001193125-09-212454",
              "fy": 2010,
              "fp": "Q1",
              "form": "10-Q",
              "filed": "2009-10-23",
              "frame": "CY2009Q3I"
            },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants