A package designed to scrape data from Yahoo Finance.
Project description
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 import yahoo
stock_name = "GOOGL"
function_list = [
yahoo.get_price,
yahoo.get_open,
yahoo.get_previous_close,
yahoo.get_change,
yahoo.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))
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.1.0.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for yahoostock-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eba1a0c484a72f9f14b9c4d7d5a95ac0153e2ffad7ad4024f2fe3304e104795 |
|
MD5 | 03b06b36799a302c91638fdae6780de6 |
|
BLAKE2b-256 | 98bea34db7a7017b047736b86bb1a6711f4c2c2962026396c255edaad756a309 |