Arelle + Google Apps Script = Recent Filings Viewer

I discovered a few exciting things about 1) arelle 2) Google App Scripts– over the course of the week. But I’ll save the boring-stuff for the bottom of the post. Log in to your Google account and open up this Google Spreadsheet.

Warning to XBRL Gurus; this is nothing miraculous. Indeed, the code mainly parsed the SEC’s RSS feed.

Warning to Excel-ophiles; Google Spreadsheet is fantastic, and can create Excel outputs. Try it, you’ll like it.

 

Here are the three steps:

 

Choose Finanze > Recent Filings

The sheet should install a “Finanz” in your toolbar. Click it, and choose “Recent Filings” from the dropdown

Click on the "Refresh" button. You'll know it's working if it says "Loading..." after your click. It is loading the SEC's latest XBRL filings, which they publish in RSS format here: http://www.sec.gov/Archives/edgar/usgaap.rss.xml

Click on the “Refresh” button. You’ll know it’s working if it says “Loading…” after your click. It is loading the SEC’s latest XBRL filings, which they publish in RSS format here: http://www.sec.gov/Archives/edgar/usgaap.rss.xml

Hover or click a company for options

After the latest filings have loaded, hover (or click) a company for more options. Choose the “Load” button. Later on, I’ll make the “Info” button show some summary statistics.

Loads the XBRL data into the spreadsheet

arellecmd.appspot.com processes the XBRL instance document, and I print the facts here (sorted by number-of-facts-which-use-that-element; an additional column I added, “Count”). Now you can export to Excel, sort, filter, or make graphs.

I think you can “make a copy” to view all the source code (and modify it for yourself!)  Google Developer has great documentation.

Here are some things I learned, in quick succession:

<div class="progress-bar" data-caja-role="progressbar" data-caja-aria-valuenow="45" data-caja-aria-valuemin="0" data-caja-aria-valuemax="100" style="width: 45%;"> <span class="sr-only">45% Complete</span> </div>
    • Is “Service”-oriented
      • Reaches to scripts run on server, but written in Javascriptin files suffixed “.gs” (GoogleScript?)
    • Can write scripts for different contexts:
      • UI/Client-side Scripts
        • Can use libraries; but not like running directly in a browser
      • Server-side Scripts
        • suffixed .gs
        • Run on server; no worries about browser support?
        • For instance, I can trust gs to create a JS (GS?) Date object from a standard date string
    • Can access Google API’s
    • Can be deployed as a Web App, or as an add-on
      • Process for publishing to App Script library:
        1. Container-bound
        2. Authorization lifecycle
        3. Apply to be published
    • Has its own template language inside its HTMLService

 

 

EDIT: I realize arelle already made this site to search the latest, with the JSON URLs here 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: