Skip to main content

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.

Most of the times, the currently available Yahoo finance API wrappers take company symbols as input queries instead of company names. This often causes confusion as it is difficult to guess company symbols by heart.
(eg. what is the abbreviation form of the company Apple, is it APPL? AAPL? or APLE?)

Therefore, this package aims to provide an improved functionality of querying by making it possible for users to fetch stock data by company name(s) alone.

Moreover, this package will generate stock information in dynamic formats in the form of visualizations, data table, stock price forecast, and an audio file with daily prime stock price.

The fetched data table includes:

  • company name, open, high, low, close (closing price), adj close, volume, daily return, and PE ratios.

Installation

$ pip install stock_info_easy

Usage

1. Fetch Stock Data

Insert the name of a company inside the get_hist_data function.
ex) ['amazon', 'apple', 'google', 'microsoft']

# By default, today's date will be used as end_date when the end_date is not specified. 

>>> 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") 
# To view the stock data as a table, 
# Type "data_list" (to view all) or "company_list[i]", i = index of the company. 

# stock info of all queried companies.
>>> data_list 


# first company info (amazon).
>>> company_list[0]  


# second company info (apple).
>>> company_list[1]  


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. Prime Stock Info on Audio

This package provides key stock information such as PE ratio and basic company information of all queries companies in an audio format.

# Can customize the audio filename in the "audio_filename" parameter.
>>> generate_audio(comp_names_abbr, audio_filename='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.

# Copy-paste the below function.
# The window size and prediction window size can be customized. 

>>> 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


Download files

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

Source Distribution

stock_info_easy-1.3.7.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

stock_info_easy-1.3.7-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file stock_info_easy-1.3.7.tar.gz.

File metadata

  • Download URL: stock_info_easy-1.3.7.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.6 Darwin/21.4.0

File hashes

Hashes for stock_info_easy-1.3.7.tar.gz
Algorithm Hash digest
SHA256 4eb9288f5241a86b7446bd03bffba255364e7d8f251ea711e54b06ba8a49eb32
MD5 13a43f94dfbe9232e94810cf1c4e4d77
BLAKE2b-256 3749776f6659748bb05b710f2a8e9e53634bfada42f2a701777c46402d28575a

See more details on using hashes here.

File details

Details for the file stock_info_easy-1.3.7-py3-none-any.whl.

File metadata

  • Download URL: stock_info_easy-1.3.7-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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

Hashes for stock_info_easy-1.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 edfbde08a749e0d669bdc8d8bfb4c8f0bdfdb6a67e833caa5aca2999ca2c96cd
MD5 a11295fda91acff692f3262a759fcf23
BLAKE2b-256 ffd001ee249de823d50670aaff422aea82e5798aa8b53a21f69b520ae328fa52

See more details on using hashes here.

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