Skip to main content

A package designed to scrape data from Yahoo Finance.

Project description

Version Package Size Last Commit Release Date License

yahoostock

A package designed to scrape data from Yahoo Finance.

Installation

The most simple installation method is through PIP.

pip install yahoostock

The PyPI page can be found here.

Usage

Use the following code to see a list of useful methods.

from yahoostock import yahoo
print(dir(yahoo))

Note that each method accepts a stock ticker as a single parameter and returns a float with the specified statistic.

Here's an example:

from yahoostock.yahoo import *

stock_name = "GOOGL"

function_list = [
    get_price,
    get_open,
    get_previous_close,
    get_change,
    get_percent_change
]

for function in function_list:
    # prints price ($), opening price ($), last closing price ($),
    # change in price ($), and relative change (%)
    print(function(stock_name))

For information about a specific method's purpose refer to the respective method's docstrings.

For example:

from yahoostock.yahoo import get_price

help(get_price)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yahoostock-1.3.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

yahoostock-1.3.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page