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.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)
Built Distribution
Close
Hashes for yahoostock-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94452d8d1ac741522525bbd238c9e9f1b21f262c48b66eedd22f21657c6a8f1d |
|
MD5 | 5200edab7446bff2ce13d89e8af6b636 |
|
BLAKE2b-256 | 640f373259c8520c2923ee3c066aba6acc5c9105e6f4cf8ddcd1fa6d2b75d808 |