finreportr

finreportr: Financial Data from U.S. Securities and Exchange Commission - Published in JOSS (2016)

https://github.com/sewardlee337/finreportr

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

balance-sheet cash-flow finance financial-data financial-statement financial-statements income-statement r sec stock-ticker-symbol
Last synced: 6 months ago · JSON representation

Repository

R package - Financial Data from U.S. Securities and Exchange Commission

Basic Info
  • Host: GitHub
  • Owner: sewardlee337
  • License: other
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 77.1 KB
Statistics
  • Stars: 133
  • Watchers: 18
  • Forks: 48
  • Open Issues: 15
  • Releases: 1
Topics
balance-sheet cash-flow finance financial-data financial-statement financial-statements income-statement r sec stock-ticker-symbol
Created over 10 years ago · Last pushed about 4 years ago
Metadata Files
Readme License

README.md

Travis-CI Build Status CRAN_Status_Badge DOI status

finreportr - Financial Data from U.S. Securities and Exchange Commission

Introduction

A financial analyst's time is valuable – it shouldn't be wasted performing manual data entry. finreportr is a web scraper written in R that allows analysts to query data from the U.S. Securities and Exchange Commission directly from the R console. It aims to eliminate time wasters from a financial analyst's workflow, such as navigating the SEC EDGAR database, flipping through financial reports, and parsing XBRL-encoded data.

finreportr allows you to fetch data from the SEC and load it into your workspace using the following commands: * CompanyInfo(): returns basic information about a company * AnnualReports(): returns a listing of annual reports filed by a company * GetIncome(): returns the income statement for a given company * GetBalanceSheet(): returns the balance sheet for a given company * GetCashFlow(): returns the cash flow statement for a given company

To install CRAN release version of finreportr:

install.packages("finreportr")

To install bleeding-edge version from GitHub:

devtools::install_github("sewardlee337/finreportr")

CompanyInfo()

CompanyInfo() returns the following information about a given company based on its stock ticker symbol: * Company Name * Central Index Key ("CIK") * Standard Industrial Classification ("SIC") * State Location * State of Incorporation * Fiscal Year End (ddmm) * Street Address * City, State, ZIP

Arguments:

CompanyInfo(symbol)

where

  • symbol is a character string that represents the relevant stock ticker symbol.

Examples:

```

CompanyInfo("GOOG")

  company        CIK  SIC state state.inc FY.end            street.address             city.state

1 GOOGLE INC. 0001288776 7370 CA DE 1231 1600 AMPHITHEATRE PARKWAY MOUNTAIN VIEW CA 94043

CompanyInfo("FB")

   company        CIK  SIC state state.inc FY.end   street.address          city.state

1 Facebook Inc 0001326801 7370 CA DE 1231 1601 WILLOW ROAD MENLO PARK CA 94025 ```

AnnualReports()

AnnualReports() returns a dataframe that summarizes a given company's annual reports based on its stock ticker symbol. Information returned include: * Filing Name * Filing Date * Accession Number

AnnualReports() will return data relating to a company's Form 10-Ks if the company is domestic, and Form 20-Fs if the company is foreign.

Arguments:

AnnualReports(symbol, foreign = FALSE)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • foreign is a logical indicating whether the company in question is domestic or foreign. foreign is set to FALSE by default.

Examples:

```

AnnualReports("GOOG")

filing.name filing.date accession.no 1 10-K 2015-02-09 0001288776-15-000008 2 10-K 2014-02-12 0001288776-14-000020 3 10-K 2013-01-29 0001193125-13-028362 4 10-K/A 2012-04-23 0001193125-12-174477 5 10-K 2012-01-26 0001193125-12-025336 6 10-K 2011-02-11 0001193125-11-032930 7 10-K 2010-02-12 0001193125-10-030774 8 10-K 2009-02-13 0001193125-09-029448 9 10-K 2008-02-15 0001193125-08-032690 10 10-K 2007-03-01 0001193125-07-044494 11 10-K 2006-03-16 0001193125-06-056598 12 10-K 2005-03-30 0001193125-05-065298

AnnualReports("HTHIY", foreign = TRUE)

filing.name filing.date accession.no 1 20-F/A 2011-07-21 0001193125-11-192990 2 20-F 2011-06-24 0001193125-11-172867 3 20-F/A 2010-07-29 0001193125-10-169851 4 20-F 2010-06-29 0001193125-10-149406 5 20-F 2009-07-27 0001193125-09-155317 6 20-F 2008-06-20 0001193125-08-137042 7 20-F/A 2008-04-28 0001193125-08-091853 8 20-F/A 2007-11-30 0001193125-07-256746 9 20-F 2007-06-26 0001193125-07-142357 10 20-F 2006-08-07 0001193125-06-163031 11 20-F 2005-08-26 0001193125-05-174960 12 20-F 2004-08-20 0001193125-04-144223 13 20-F 2003-09-30 0001193125-03-056135 14 20-F 2002-09-26 0001145549-02-000252 ```

GetIncome()

GetIncome() returns a company's income statement from the annual report of a given filing year as a dataframe. This functionality is only available for queries of income statements that belong to domestic companies. Note that all data returned by this function comes from the company's 10-K, not 10-K/A.

Arguments:

GetIncome(symbol, year)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • year is the year during which the annual report was filed. (Note: This is not necessarily identical to the fiscal year for which the annual report was filed)

Example:

```

Fetch first 20 lines of Google's income statement in the Form 10-K published in 2016.

head(GetIncome("GOOG", 2016), 20)

                           Metric Units      Amount  startDate    endDate

1 Revenues usd 55519000000 2013-01-01 2013-12-31 2 Revenues usd 66001000000 2014-01-01 2014-12-31 3 Revenues usd 74989000000 2015-01-01 2015-12-31 4 Cost of Revenue usd 21993000000 2013-01-01 2013-12-31 5 Cost of Revenue usd 25691000000 2014-01-01 2014-12-31 6 Cost of Revenue usd 28164000000 2015-01-01 2015-12-31 7 Research and Development Expense usd 7137000000 2013-01-01 2013-12-31 8 Research and Development Expense usd 9832000000 2014-01-01 2014-12-31 9 Research and Development Expense usd 12282000000 2015-01-01 2015-12-31 10 Selling and Marketing Expense usd 6554000000 2013-01-01 2013-12-31 11 Selling and Marketing Expense usd 8131000000 2014-01-01 2014-12-31 12 Selling and Marketing Expense usd 9047000000 2015-01-01 2015-12-31 13 General and Administrative Expense usd 4432000000 2013-01-01 2013-12-31 14 General and Administrative Expense usd 5851000000 2014-01-01 2014-12-31 15 General and Administrative Expense usd 6136000000 2015-01-01 2015-12-31 16 Costs and Expenses usd 40116000000 2013-01-01 2013-12-31 17 Costs and Expenses usd 49505000000 2014-01-01 2014-12-31 18 Costs and Expenses usd 55629000000 2015-01-01 2015-12-31 19 Operating Income (Loss) usd 15403000000 2013-01-01 2013-12-31 20 Operating Income (Loss) usd 16496000000 2014-01-01 2014-12-31 ```

GetBalanceSheet()

GetBalanceSheet() returns a company's balance sheet from the annual report of a given filing year as a dataframe. This functionality is only available for queries of balance sheets that belong to domestic companies. Note that all data returned by this function comes from the company's 10-K, not 10-K/A.

Arguments:

GetBalanceSheet(symbol, year)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • year is the year during which the annual report was filed. (Note: This is not necessarily identical to the fiscal year for which the annual report was filed)

Example:

```

Fetch first 20 lines of Google's balance sheet in the Form 10-K published in 2016.

head(GetBalanceSheet("GOOG", 2016), 20)

                                                   Metric Units      Amount startDate    endDate

1 Cash and Cash Equivalents, at Carrying Value usd 14778000000 2012-12-31 2 Cash and Cash Equivalents, at Carrying Value usd 18898000000 2013-12-31 3 Cash and Cash Equivalents, at Carrying Value usd 18347000000 2014-12-31 4 Cash and Cash Equivalents, at Carrying Value usd 16549000000 2015-12-31 5 Available-for-sale Securities, Current usd 46048000000 2014-12-31 6 Available-for-sale Securities, Current usd 56517000000 2015-12-31 7 Cash, Cash Equivalents, and Short-term Investments usd 64395000000 2014-12-31 8 Cash, Cash Equivalents, and Short-term Investments usd 73066000000 2015-12-31 9 Accounts Receivable, Net, Current usd 9383000000 2014-12-31 10 Accounts Receivable, Net, Current usd 11556000000 2015-12-31 11 Receivable Under Reverse Repurchase Agreements usd 875000000 2014-12-31 12 Receivable Under Reverse Repurchase Agreements usd 450000000 2015-12-31 13 Income Taxes Receivable, Current usd 591000000 2014-12-31 14 Income Taxes Receivable, Current usd 1903000000 2015-12-31 15 Prepaid Revenue Share Expenses And Other Assets Current usd 3412000000 2014-12-31 16 Prepaid Revenue Share Expenses And Other Assets Current usd 3139000000 2015-12-31 17 Assets, Current usd 78656000000 2014-12-31 18 Assets, Current usd 90114000000 2015-12-31 19 Prepaid Revenue Share Expenses And Other Assets Noncurrent usd 3187000000 2014-12-31 20 Prepaid Revenue Share Expenses And Other Assets Noncurrent usd 3181000000 2015-12-31 ```

GetCashFlow()

GetCashFlow() returns a company's statement of cash flow from the annual report of a given filing year as a dataframe. This functionality is only available for queries of cash flow statements that belong to domestic companies. Note that all data returned by this function comes from the company's 10-K, not 10-K/A.

Arguments:

GetCashFlow(symbol, year)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • year is the year during which the annual report was filed. (Note: This is not necessarily identical to the fiscal year for which the annual report was filed)

Example:

```

Fetch first 20 lines of Google's cash flow statement in the Form 10-K published in 2016.

head(GetCashFlow("GOOG", 2016), 20)

                                                               Metric Units      Amount  startDate    endDate

1 Net Income (Loss) Attributable to Parent usd 12733000000 2013-01-01 2013-12-31 2 Net Income (Loss) Attributable to Parent usd 14136000000 2014-01-01 2014-12-31 3 Net Income (Loss) Attributable to Parent usd 16348000000 2015-01-01 2015-12-31 4 Depreciation and Impairment on Disposition of Property and Equipment usd 2781000000 2013-01-01 2013-12-31 5 Depreciation and Impairment on Disposition of Property and Equipment usd 3523000000 2014-01-01 2014-12-31 6 Depreciation and Impairment on Disposition of Property and Equipment usd 4132000000 2015-01-01 2015-12-31 7 Amortization and Impairment of Intangible and Other Assets usd 1158000000 2013-01-01 2013-12-31 8 Amortization and Impairment of Intangible and Other Assets usd 1456000000 2014-01-01 2014-12-31 9 Amortization and Impairment of Intangible and Other Assets usd 931000000 2015-01-01 2015-12-31 10 Share-based Compensation usd 3343000000 2013-01-01 2013-12-31 11 Share-based Compensation usd 4279000000 2014-01-01 2014-12-31 12 Share-based Compensation usd 5203000000 2015-01-01 2015-12-31 13 Excess Tax Benefit from Share-based Compensation, Operating Activities usd 481000000 2013-01-01 2013-12-31 14 Excess Tax Benefit from Share-based Compensation, Operating Activities usd 648000000 2014-01-01 2014-12-31 15 Excess Tax Benefit from Share-based Compensation, Operating Activities usd 548000000 2015-01-01 2015-12-31 16 Deferred Income Taxes and Tax Credits usd -437000000 2013-01-01 2013-12-31 17 Deferred Income Taxes and Tax Credits usd -104000000 2014-01-01 2014-12-31 18 Deferred Income Taxes and Tax Credits usd -179000000 2015-01-01 2015-12-31 19 Gain (Loss) on Sale of Business, Including Discontinued Operations usd 700000000 2013-01-01 2013-12-31 20 Gain (Loss) on Sale of Business, Including Discontinued Operations usd 740000000 2014-01-01 2014-12-31 ```

Bug Reports and Feedback

Please use the GitHub issue tracker for bug reports, feature request, or general discussions.

Owner

  • Name: Seward Lee
  • Login: sewardlee337
  • Kind: user
  • Location: San Francisco Bay Area

Data scientist and open source enthusiast.

JOSS Publication

finreportr: Financial Data from U.S. Securities and Exchange Commission
Published
December 05, 2016
Volume 1, Issue 8, Page 119
Authors
Seward Lee ORCID
None
Editor
Arfon Smith ORCID
Tags
finance accounting

GitHub Events

Total
  • Issues event: 1
  • Watch event: 6
  • Issue comment event: 1
  • Fork event: 1
Last Year
  • Issues event: 1
  • Watch event: 6
  • Issue comment event: 1
  • Fork event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 68
  • Total Committers: 1
  • Avg Commits per committer: 68.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
sewardlee337 s****7@g****m 68

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 20
  • Total pull requests: 3
  • Average time to close issues: about 2 months
  • Average time to close pull requests: less than a minute
  • Total issue authors: 18
  • Total pull request authors: 1
  • Average comments per issue: 4.6
  • Average comments per pull request: 1.67
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • vsoler (2)
  • joeymizrahi (2)
  • pacov (1)
  • wwni60 (1)
  • andresmorago (1)
  • jibanes (1)
  • dmaupin12 (1)
  • msmith01 (1)
  • Mossharbor (1)
  • robdoumar (1)
  • ChiTownTimmy23 (1)
  • georgeaj (1)
  • brettboles (1)
  • jsta (1)
  • rrik (1)
Pull Request Authors
  • ZeccaLehn (3)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 401 last-month
  • Total docker downloads: 43,390
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
cran.r-project.org: finreportr

Financial Data from U.S. Securities and Exchange Commission

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 401 Last month
  • Docker Downloads: 43,390
Rankings
Forks count: 1.6%
Stargazers count: 3.6%
Average: 18.6%
Downloads: 22.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • XBRL * imports
  • curl * imports
  • dplyr * imports
  • httr * imports
  • rvest * imports
  • xml2 * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests