This package provides user-friendly functions to easily navigate stock information of the companies of their interests. The output results include visualization of closing prices and daily returns, stock prediction for the next twenty days, as well as the company information with sectors and PE ratios.
Project description
Stock_Info_Easy
This Python package is an implementation of the existing yfinance wrapper, one of the widely used yahoo finance API wrappers.
One drawback of the existing yahoo finance API wrapper is its inability to fetch stock data using the company name; it can only fetch the data with company symbol registered on the Yahoo Finance.
To improve the functionality of the previous wrapper, this package enables a user to query a company with its full name.
By simply typing a company name, this pacakage will generate today's stock information for the company of interest.
The fetched data includes:
- company name, open, high, low, close (closing price), adj close, volume, daily return, and PE ratios.
The stock information will be provided in dynamic formats with the use of visualizations, a data table, a stock forecast and an audio file.
Installation
$ pip install stock_info_easy
Usage
# Insert the name(s) of company(ies) inside the `get_hist_data` function. ex) ['amazon', 'apple', 'google', 'microsoft']
>>> data_list, comp_names_abbr, company_list, comp_names = stock_info_easy.get_hist_data((['amazon', 'apple', 'google', 'microsoft']), start_date="01/04/2022", end_date = "2022-01-10") # if don't specify the `end_date`, today's date will be selected by default.
# To view the stock data as a table, type `data_list` to view all or by company `company_list[i]`, i = index of the company.
>>> company_list[1] # stock info of all queried companies.
<p align="center">
<img src="https://github.com/shaunahan/Stock_Info_Easy/blob/main/img/data_list.png" width="900" height="400"/>
</p>
<br>
>>> company_list[0] # first company (amazon) info.
<p align="center">
<img src="https://github.com/shaunahan/Stock_Info_Easy/blob/main/img/company_list[0].png" width="900" height="400"/>
</p>
<br>
>>> company_list[1] # second company (apple) info.
<p align="center">
<img src="https://github.com/shaunahan/Stock_Info_Easy/blob/main/img/company_list[1].png" width="900" height="400"/>
</p>
<br>
2. Visualization of Closing Price
# To generate a visualization of closing price, copy-paste below function as it is.
>>> get_closing_price_viz(company_list, comp_names)
3. Visualization of Daily Return
# To generate a visualization of Daily Return, copy-paste below function as it is.
>>> get_daily_return_viz(company_list, company_names)
4. Audio file on Stock Info
This package provides key stock information such as PE ratio and basic company information of all queries companies in an audio format.
>>> generate_audio(comp_names_abbr, audio_filename='default1.mp3') # customize the audio filename; by default, the file will be saved as 'default1.mp3'.
5. Prediction on Closing Price
This package uses the time series LSTM vanila model to predict the closing price. LSTM model is built with two hidden LSTM layers followed by a standard feedforward output layer.
# Write following functions.
# The window size and prediction window size can be customized; by default, they are set as 30 days and 10 days respectively.
>>> stock_info_easy.predict_future_price(data_list, comp_names_abbr, windown_size=30, predict_window_size=10, predict=True)
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
stock_info_easy
was created by Shauna Han. It is licensed under the terms of the MIT license.
Credits
stock_info_easy
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stock_info_easy-1.2.3.tar.gz
.
File metadata
- Download URL: stock_info_easy-1.2.3.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.10.6 Darwin/21.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35953991b8f270033891b903d8b4d7176eae2557dfa282cddf7a13095e5b9a2b |
|
MD5 | 6452aef7acf54c7a1eee7e716050276c |
|
BLAKE2b-256 | 172f918e923f7cd86148fbe6dda23982853bf42ffa320041041939d2e1f74656 |
File details
Details for the file stock_info_easy-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: stock_info_easy-1.2.3-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.10.6 Darwin/21.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8efcec118e85a2a7f085115503695840b13986b4a5ba4dcb725e806dd29451b6 |
|
MD5 | 40581e39f815df6ee3f0c781d5206f75 |
|
BLAKE2b-256 | 331e21ae05c7dc15bf5bec17fab114a9760d378f984be696ae546648a2e1d528 |