Giter VIP home page Giter VIP logo

reuterspy's Introduction

reuterspy

reuterpy

Financial Data Extraction from Reuters.com with Python

reuterspy is a Python package to retrieve data from reuters.com, which provides Balance sheet, Cash Flow, Income Statement and Key Metrics.

reuterspy allows the user to download both recent and historical data from all the financial products indexed at reuters.com

reuterspy seeks simple Python packages when it comes to financial data extraction in order to stop relying on public/private APIs, since reuterspy is FREE and has NO LIMITATIONS.

Installation

In order to get this package working you will need to install it via pip (with a Python3.5 version or higher) on the terminal by typing:

$ pip install reuterspy

Usage

Income Statement

What is an Income Statement?

An income statement is one of the three important financial statements used for reporting a company's financial performance over a specific accounting period, with the other two key statements being the balance sheet and the statement of cash flows.

Also known as the profit and loss statement or the statement of revenue and expense, the income statement primarily focuses on the company’s revenues and expenses during a particular period.

In the example presented below, the yearly income statement of a stock is retrieved.

from reuterspy import Reuters

reuters = Reuters()

ticker_list = ['NFLX.O']
df = reuters.get_income_statement(ticker_list)

print(df.head())
ticker   financialReport  year   metric         value
NFLX.O  income_statement  2019  Revenue  20156.447000
NFLX.O  income_statement  2018  Revenue  15794.341000
NFLX.O  income_statement  2017  Revenue  11692.713000
NFLX.O  income_statement  2016  Revenue   8830.669000
NFLX.O  income_statement  2015  Revenue   6779.511000

Balance Sheet

What Is a Balance Sheet?

A balance sheet is a financial statement that reports a company's assets, liabilities and shareholders' equity at a specific point in time, and provides a basis for computing rates of return and evaluating its capital structure. It is a financial statement that provides a snapshot of what a company owns and owes, as well as the amount invested by shareholders.

The balance sheet is used alongside other important financial statements such as the income statement and statement of cash flows in conducting fundamental analysis or calculating financial ratios.

In the example presented below, the yearly Balance Sheet of a stock is retrieved.

from reuterspy import Reuters

reuters = Reuters()

ticker_list = ['NFLX.O']
df = reuters.get_balance_sheet(ticker_list)

print(df.head())
ticker financialReport  year              metric        value
NFLX.O   balance_sheet  2019                Cash  3103.525000
NFLX.O   balance_sheet  2018                Cash  2572.685000
NFLX.O   balance_sheet  2016                Cash  1264.126000
NFLX.O   balance_sheet  2015                Cash  1706.592000
NFLX.O   balance_sheet  2019  Cash & Equivalents  1914.912000

Cash Flow

What Is a Cash Flow?

Cash flow is the net amount of cash and cash-equivalents being transferred into and out of a business. At the most fundamental level, a company’s ability to create value for shareholders is determined by its ability to generate positive cash flows, or more specifically, maximize long-term free cash flow (FCF).

In the example presented below, the yearly Cash Flow of a stock is retrieved.

from reuterspy import Reuters

reuters = Reuters()

ticker_list = ['NFLX.O']
df = reuters.get_cash_flow(ticker_list)

print(df.head())
ticker financialReport  year                    metric        value
NFLX.O       cash_flow  2019  Net Income/Starting Line  1866.916000
NFLX.O       cash_flow  2018  Net Income/Starting Line  1211.242000
NFLX.O       cash_flow  2017  Net Income/Starting Line   558.929000
NFLX.O       cash_flow  2016  Net Income/Starting Line   186.678000
NFLX.O       cash_flow  2015  Net Income/Starting Line   122.641000

Key Metrics

In the example presented below, the key metrics of a stock is retrieved.

from reuterspy import Reuters

reuters = Reuters()

ticker_list = ['NFLX.O']
df = reuters.get_key_metrics(ticker_list)

print(df.head())
ticker                         metric       value   financialReport
NFLX.O      Price closing or last bid      510.40  Price and Volume
NFLX.O                   52 Week High      575.37  Price and Volume
NFLX.O                    52 Week Low      290.25  Price and Volume
NFLX.O                   Pricing date  2021-01-08  Price and Volume
NFLX.O  10 Day Average Trading Volume        3.49  Price and Volume

Disclaimer

This Python package has been made for research purposes in order to fit the needs that reuters.com does not cover, so this package works like an Application Programming Interface (API) of reuters.com developed in an altruistic way.

Conclude that this package is not related in any way with reuters.com or any dependant company, the only requirement specified by reuters.com in order to develop this package was "mention the source where data is retrieved from".

reuterspy's People

Contributors

viniciuswovst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

reuterspy's Issues

receive only empty dataframes - reuters.com links probably broken/changed?

Get only empty dataframes. Reuters.com links changed i.e. the links used within the code are broken?

Here an example of my input:
Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:25:59)
[GCC 10.3.0] on linux

from reuterspy import Reuters
reuters = Reuters()
ticker_list = ['NFLX.O']
df = reuters.get_income_statement(ticker_list)
print(df.head())
Empty DataFrame
Columns: []
Index: []

using within the browser the link provided in the code (reuterspy/blob/main/reuterspy/utils/api.py), i.e.
https://www.reuters.com/companies/api/getFetchCompanyFinancials/NFLX.O
-> receive the response: we can't find that page

or within the browser the link coded in reuterspy/blob/main/reuterspy/init.py , i.e.
https://www.reuters.com/companies/NFLX.O/key-metrics
-> redirects to https://www.reuters.com/markets/companies/NFLX.O/key-metrics/price-and-volume

Hi, I can't install reuterspy using pip it exits with this error, any help is highly appreciated!

File "/tmp/pip-install-zyi2isqz/pandas_8dad405e437845f08a9d39ba355a887e/versioneer.py", line 400, in get_config_from_root
parser = configparser.SafeConfigParser()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Building wheel for pandas (pyproject.toml) ... error

The script is not usable as the compilation failed at the first stage:
ERROR: Command errored out with exit status 1:....
Complete output (1154 lines):.....
setup.py:45: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
_CYTHON_INSTALLED = _CYTHON_VERSION >= LooseVersion(min_cython_ver)....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.