Resolving merge conflicts with main

This commit is contained in:
Artem Veremey
2021-03-04 17:20:04 -08:00
16 changed files with 3477 additions and 280 deletions

7
.dockerignore Normal file
View File

@@ -0,0 +1,7 @@
.git
.*
.dockerignore
.env*
.gitignore
docker-compose.yaml
Dockerfile*

23
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]"
labels: 'bug'
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps(from the start) and commands to reproduce the behavior
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Mac Sierra]
- Python version [e.g. 3.6.8]
**Additional context**
Add any other information that you think could be useful for us.

20
.github/ISSUE_TEMPLATE/enhancement.md vendored Normal file
View File

@@ -0,0 +1,20 @@
---
name: Improvement
about: Improve something on this project
title: "[IMPROVE]"
labels: 'enhancement'
assignees: ''
---
**What's the feature that should be improved?**
A description of what's the feature you want improved, and a bit of context (why is that).
**Describe how you would like the feature improved**
A description of what the current feature is vs what it would be after your suggestion.
**Possibly describe the ideal way to improve this**
If you have thought about how you would do it, add it here.
**Additional information**
Add any other information or screenshots about the feature improvement.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FR]"
labels: 'new feature'
assignees: ''
---
**What's the problem of not having this feature?**
A clear description of what you are lacking, or why you need this additional feature.
**Describe the solution you would like**
A description of what you think would be the best solution for this. From user inputs, to an output.
**Describe alternatives you've considered**
If there are other alternatives (worth considering) to your solution, list them here.
**Additional information**
Add any other information or screenshots about the feature request here.

119
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,119 @@
name: Tests
on: [pull_request, push]
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: x64
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-linting
restore-keys: ${{ runner.os }}-linting
- run: pip install bandit black codespell flake8 isort mypy pyupgrade safety
- run: bandit -r . || true
- run: black --check . || true
- run: codespell --ignore-words-list="mape" --quiet-level=2 # --skip=""
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- run: isort --check-only --profile black . || true
- run: mypy --ignore-missing-imports . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
- run: safety check
test:
name: ubuntu-latest - Python 3.8
needs: linting
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: x64
- name: Install Poetry
uses: snok/install-poetry@v1.1.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install Package
run: poetry install --no-interaction
- name: Run tests
env:
MPLBACKEND: Agg
run: |
source $VENV
pytest tests/
tests:
needs: test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: ['3.6', '3.7', '3.8']
os: [ubuntu-latest, macos-latest]
exclude:
- os: ubuntu-latest
python-version: '3.8'
name: ${{ matrix.os}} - Python ${{ matrix.python-version }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Poetry
uses: snok/install-poetry@v1.1.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install Package
run: poetry install --no-interaction
- name: Run tests
env:
MPLBACKEND: Agg
run: |
source $VENV
pytest tests/

33
Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
FROM python:3.6.13-slim-buster
RUN apt-get update && apt-get -y install --no-install-recommends \
gcc \
g++ \
make \
wget \
curl \
telnet \
net-tools \
iputils-ping \
dnsutils \
git \
gnupg \
unzip \
bzip2 && \
apt-get -y autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN useradd --create-home --shell /bin/bash python
USER python
WORKDIR /home/python
ENV PATH="/home/python/.local/bin:${PATH}"
COPY --chown=python:python . .
#RUN INSTALL_ON_LINUX=1 pip install -r requirements.txt
RUN pip install "poetry==1.1.4"
RUN poetry export --without-hashes -f requirements.txt | pip install -r /dev/stdin
CMD ["python", "gamestonk_terminal.py"]

306
README.md
View File

@@ -7,7 +7,7 @@
## About
Gamestonk Terminal is an awesome stock market terminal that has been developed for fun, while I saw my GME shares tanking. But hey, I like the stock 💎🙌.
Gamestonk Terminal is an awesome stock and crypto market terminal that has been developed for fun, while I saw my GME shares tanking. But hey, I like the stock 💎🙌.
The implementation (in python) allows to easily add more commands, and expand on their configuration.
@@ -34,16 +34,22 @@ The main menu allows the following commands:
```text
load -t S_TICKER [-s S_START_DATE] [-i {1,5,15,30,60}]
clear
view -t S_TICKER [-s S_START_DATE] [-i {1,5,15,30,60}] [--type N_TYPE]
```
With their functions being:
* Load stock ticker to perform analysis on
* -s : The starting date (format YYYY-MM-DD) of the stock
* -i : Intraday stock minutes
```text
clear
```
* Clear previously loaded stock ticker.
```text
view -t S_TICKER [-s S_START_DATE] [-i {1,5,15,30,60}] [--type N_TYPE]
```
* Visualise historical data of a stock. An alpha_vantage key is necessary.
* -s : The starting date (format YYYY-MM-DD) of the stock
* -i : Intraday stock minutes
@@ -55,176 +61,178 @@ Note: Until a ticker is loaded, the menu will only show *disc* and *sen* menu, a
### [Discover Stocks](gamestonk_terminal/discovery/README.md) <a name="Discover_Stocks"></a>
```text
map S&P500 index stocks map [Finviz]
sectors show sectors performance [Alpha Vantage]
gainers show latest top gainers [Yahoo Finance]
orders orders by Fidelity Customers [Fidelity]
up_earnings upcoming earnings release dates [Seeking Alpha]
high_short show top high short interest stocks of over 20% ratio [www.highshortinterest.com]
low_float show low float stocks under 10M shares float [www.lowfloat.com]
simply_wallst Simply Wall St. research data [Simply Wall St.]
spachero great website for SPACs research [SpacHero]
uwhales good website for SPACs research [UnusualWhales]
```
Command|Description|Source
---|---|---
`map` |S&P500 index stocks map |[Finviz](https://finviz.com)
`sectors` |show sectors performance |[Alpha Vantage](www.alphavantage.co)
`gainers` |show latest top gainers |[Yahoo Finance](https://finance.yahoo.com/)
`orders` |orders by Fidelity Customers |[Fidelity](https://www.fidelity.com/)
`up_earnings` |upcoming earnings release dates |[Seeking Alpha](https://seekingalpha.com/)
`high_short` |show top high short interest stocks of over 20% ratio |[High Short Interest](https://www.highshortinterest.com/)
`low_float` |show low float stocks under 10M shares float |[Low Float](https://www.lowfloat.com/)
`simply_wallst` |Simply Wall St. research data |[Simply Wall St.](https://simplywall.st/about)
`spachero` |great website for SPACs research |[SpacHero](https://www.spachero.com/)
`uwhales` |good website for SPACs research |[UnusualWhales](https://unusualwhales.com/)
### [Market Sentiment](gamestonk_terminal/sentiment/README.md) <a name="Market_Sentiment"></a>
```text
Reddit:
wsb show what WSB gang is up to in subreddit wallstreetbets
watchlist show other users watchlist
popular show popular tickers
spac_c show other users spacs announcements from subreddit SPACs community
spac show other users spacs announcements from other subs
Stocktwits:
bullbear estimate quick sentiment from last 30 messages on board
messages output up to the 30 last messages on the board
trending trending stocks
stalker stalk stocktwits user's last messages
Twitter:
infer infer about stock's sentiment from latest tweets
sentiment in-depth sentiment prediction from tweets over time
Google:
mentions interest over time based on stock's mentions
regions regions that show highest interest in stock
queries top related queries with this stock
rise top rising related queries with stock
```
Command|Description
----|----
[Reddit](https://reddit.com)|
`wsb` |show what WSB gang is up to in subreddit wallstreetbets
`watchlist` |show other users watchlist
`popular` |show popular tickers
`spac_c` |show other users spacs announcements from subreddit SPACs community
`spac` |show other users spacs announcements from other subs
[Stocktwits](https://stocktwits.com/)|
`bullbear` |estimate quick sentiment from last 30 messages on board
`messages` |output up to the 30 last messages on the board
`trending` |trending stocks
`stalker` |stalk stocktwits user's last message
[Twitter](https://twitter.com/)|
`infer` |infer about stock's sentiment from latest tweets
`sentiment` |in-depth sentiment prediction from tweets over time
[Google](https://google.com/)|
`mentions` |interest over time based on stock's mentions
`regions` |regions that show highest interest in stock
`queries` |top related queries with this stock
`rise` |top rising related queries with stock
### Research Web pages <a name="Research_Web_pages"></a>
```text
macroaxis www.macroaxis.com
yahoo www.finance.yahoo.com
finviz www.finviz.com
marketwatch www.marketwatch.com
fool www.fool.com
businessinsider www.markets.businessinsider.com
fmp www.financialmodelingprep.com
fidelity www.eresearch.fidelity.com
tradingview www.tradingview.com
marketchameleon www.marketchameleon.com
stockrow www.stockrow.com
barchart www.barchart.com
grufity www.grufity.com
fintel www.fintel.com
zacks www.zacks.com
macrotrends www.macrotrends.net
newsfilter www.newsfilter.io
resources www.tradinganalysisresources.com
```
Command|Website
----|----
`macroaxis` |www.macroaxis.com
`yahoo` |www.finance.yahoo.com
`finviz` |www.finviz.com
`marketwatch` |www.marketwatch.com
`fool` |www.fool.com
`businessinsider` |www.markets.businessinsider.com
`fmp` |www.financialmodelingprep.com
`fidelity` |www.eresearch.fidelity.com
`tradingview` |www.tradingview.com
`marketchameleon` |www.marketchameleon.com
`stockrow` |www.stockrow.com
`barchart` |www.barchart.com
`grufity` |www.grufity.com
`fintel` |www.fintel.com
`zacks` |www.zacks.com
`macrotrends` |www.macrotrends.net
`newsfilter` |www.newsfilter.io
`resources` |www.tradinganalysisresources.com
### [Fundamental Analysis](gamestonk_terminal/fundamental_analysis/README.md) <a name="Fundamental_Analysis"></a>
```text
Daily Stock: BB (from 2020-06-04)
screener screen info about the company [Finviz]
mgmt management team of the company [Business Insider]
Market Watch API
income income statement of the company
assets assets of the company
liabilities liabilities and shareholders equity of the company
operating cash flow operating activities of the company
investing cash flow investing activities of the company
financing cash flow financing activities of the company
Yahoo Finance API
info information scope of the company
shrs shareholders of the company
sust sustainability values of the company
cal calendar earnings and estimates of the company
Alpha Vantage API
overview overview of the company
income income statements of the company
balance balance sheet of the company
cash cash flow of the company
earnings earnings dates and reported EPS
Financial Modeling Prep API
profile profile of the company
quote quote of the company
enterprise enterprise value of the company over time
dcf discounted cash flow of the company over time
inc income statements of the company
bal balance sheet of the company
cashf cash flow of the company
metrics key metrics of the company
ratios financial ratios of the company
growth financial statement growth of the company
```
Command|Description
----- | ---------
`screener` |screen info about the company ([Finviz](https://finviz.com/))
`mgmt` |management team of the company ([Business Insider](https://markets.businessinsider.com/))
[Market Watch API](https://markets.businessinsider.com/) |
`income` |income statement of the company
`assets` |assets of the company
`liabilities` |liabilities and shareholders equity of the company
`operating` |cash flow operating activities of the company
`investing` |cash flow investing activities of the company
`financing` |cash flow financing activities of the company
[Yahoo Finance API](https://finance.yahoo.com/) |
`info` |information scope of the company
`shrs` |shareholders of the company
`sust` |sustainability values of the company
`cal` |calendar earnings and estimates of the company
[Alpha Vantage API](https://www.alphavantage.co/) |
`overview` |overview of the company
`income` |income statements of the company
`balance` |balance sheet of the company
`cash` |cash flow of the company
`earnings` |earnings dates and reported EPS
[Financial Modeling Prep API](https://financialmodelingprep.com/) |
`profile` |profile of the company
`quote` |quote of the company
`enterprise` |enterprise value of the company over time
`dcf` |discounted cash flow of the company over time
`inc` |income statements of the company
`bal` |balance sheet of the company
`cashf` |cash flow of the company
`metrics` |key metrics of the company
`ratios` |financial ratios of the company
`growth` |financial statement growth of the company
### [Technical Analysis](gamestonk_terminal/technical_analysis/README.md) <a name="Technical_Analysis"></a>
```text
overlap:
ema exponential moving average
sma simple moving average
vwap volume weighted average price
momentum:
cci commodity channel index
macd moving average convergence/divergence
rsi relative strength index
stoch stochastic oscillator
trend:
adx average directional movement index
aroon aroon indicator
volatility:
bbands bollinger bands
volume:
ad chaikin accumulation/distribution line values
obv on balance volume
```
Command | Description | Sources
------ | ------ | ------
[overlap](https://github.com/twopirllc/pandas-ta/tree/master/pandas_ta/overlap) |
`ema` | exponential moving average | [Wikipedia](https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average), [Investopedia](https://www.investopedia.com/terms/e/ema.asp)
`sma` |simple moving average | [Wikipedia](https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average_(boxcar_filter)), [Investopedia](https://www.investopedia.com/terms/s/sma.asp)
`vwap` |volume weighted average price | [Wikipedia](https://en.wikipedia.org/wiki/Volume-weighted_average_price), [Investopedia](https://www.investopedia.com/terms/v/vwap.asp)
[momentum](https://github.com/twopirllc/pandas-ta/tree/master/pandas_ta/momentum) |
`cci` |commodity channel index | [Wikipedia](https://en.wikipedia.org/wiki/Commodity_channel_index), [Investopedia](https://www.investopedia.com/terms/c/commoditychannelindex.asp)
`macd` |moving average convergence/divergence | [Wikipedia](https://en.wikipedia.org/wiki/MACD), [Investopedia](https://www.investopedia.com/terms/m/macd.asp)
`rsi` |relative strength index | [Wikipedia](https://en.wikipedia.org/wiki/Relative_strength_index), [Investopedia](https://www.investopedia.com/terms/r/rsi.asp)
`stoch` |stochastic oscillator | [Wikipedia](https://en.wikipedia.org/wiki/Stochastic_oscillator), [Investopedia](https://www.investopedia.com/terms/s/stochasticoscillator.asp)
[trend](https://github.com/twopirllc/pandas-ta/tree/master/pandas_ta/trend) |
`adx` |average directional movement index | [Wikipedia](https://en.wikipedia.org/wiki/Average_directional_movement_index), [Investopedia](https://www.investopedia.com/terms/a/adx.asp)
`aroon` |aroon indicator | [Investopedia](https://www.investopedia.com/terms/a/aroon.asp)
[volatility](https://github.com/twopirllc/pandas-ta/tree/master/pandas_ta/volatility) |
`bbands` |bollinger bands | [Wikipedia](https://en.wikipedia.org/wiki/Bollinger_Bands), [Investopedia](https://www.investopedia.com/terms/b/bollingerbands.asp)
[volume](https://github.com/twopirllc/pandas-ta/tree/master/pandas_ta/volume) |
`ad` |chaikin accumulation/distribution line values | [Wikipedia](https://en.wikipedia.org/wiki/Accumulation/distribution_index), [Investopedia](https://www.investopedia.com/terms/a/accumulationdistribution.asp)
`obv` |on balance volume | [Wikipedia](https://en.wikipedia.org/wiki/On-balance_volume), [Investopedia](https://www.investopedia.com/terms/o/onbalancevolume.asp)
### [Due Diligence](gamestonk_terminal/due_diligence/README.md) <a name="Due_Diligence"></a>
```text
news latest news of the company [Finviz]
red gets due diligence from another user's post [Reddit]
analyst analyst prices and ratings of the company [Finviz]
rating rating of the company from strong sell to strong buy [FMP]
pt price targets over time [Business Insider]
est quarter and year analysts earnings estimates [Business Insider]
ins insider activity over time [Business Insider]
insider insider trading of the company [Finviz]
sec SEC filings [Market Watch]
short short interest [Quandl]
warnings company warnings according to Sean Seah book [Market Watch]
```
Command|Explanation|Source
------ | --------|----
`news` |latest news of the company |[Finviz](https://finviz.com/)
`red` |gets due diligence from another user's post |[Reddit](https://reddit.com)
`analyst` |analyst prices and ratings of the company |[Finviz](https://finviz.com/)
`rating` |rating of the company from strong sell to strong buy | [FMP](https://financialmodelingprep.com/)
`pt` |price targets over time |[Business Insider](https://www.businessinsider.com/)
`est` |quarter and year analysts earnings estimates |[Business Insider](https://www.businessinsider.com/)
`ins` |insider activity over time |[Business Insider](https://www.businessinsider.com/)
`insider` |insider trading of the company |[Finviz](https://finviz.com/)
`sec` |SEC filings |[MarketWatch](https://www.marketwatch.com/)
`short` |short interest |[Quandl](https://www.quandl.com/)
`warnings` |company warnings according to Sean Seah book |[MarketWatch](https://www.marketwatch.com/)
### [Prediction Techniques](gamestonk_terminal/prediction_techniques/README.md) <a name="Prediction_Techniques"></a>
```text
sma simple moving average
knn k-Nearest Neighbors
linear linear regression (polynomial 1)
quadratic quadratic regression (polynomial 2)
cubic cubic regression (polynomial 3)
regression regression (other polynomial)
arima autoregressive integrated moving average
prophet Facebook's prophet prediction
mlp MultiLayer Perceptron
rnn Recurrent Neural Network
lstm Long-Short Term Memory
```
Command|Technique|Sources
------ | ------------|---
`sma` |simple moving average | [Wikipedia](https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average), [Investopedia](https://www.investopedia.com/terms/s/sma.asp)
`knn` |k-Nearest Neighbors | [Wikipedia](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm)
`linear` |linear regression (polynomial 1) | [Wikipedia](https://en.wikipedia.org/wiki/Linear_regression), [Investopedia](https://www.investopedia.com/terms/r/regression.asp)
`quadratic` |quadratic regression (polynomial 2) | [Wikipedia](https://en.wikipedia.org/wiki/Polynomial_regression), [Investopedia](https://www.investopedia.com/terms/r/regression.asp)
`cubic` |cubic regression (polynomial 3) | [Wikipedia](https://en.wikipedia.org/wiki/Polynomial_regression), [Investopedia](https://www.investopedia.com/terms/r/regression.asp)
`regression` |regression (other polynomial) | [Wikipedia](https://en.wikipedia.org/wiki/Polynomial_regression), [Investopedia](https://www.investopedia.com/terms/r/regression.asp)
`arima` |autoregressive integrated moving average | [Wikipedia](https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average), [Investopedia](https://www.investopedia.com/terms/a/autoregressive-integrated-moving-average-arima.asp)
`prophet` |Facebook's prophet prediction | [Details](https://facebook.github.io/prophet/)
`mlp` |MultiLayer Perceptron | [Wikipedia](https://en.wikipedia.org/wiki/Multilayer_perceptron)
`rnn` |Recurrent Neural Network | [Wikipedia](https://en.wikipedia.org/wiki/Recurrent_neural_network)
`lstm` |Long Short-Term Memory | [Wikipedia](https://en.wikipedia.org/wiki/Long_short-term_memory), [Details](https://colah.github.io/posts/2015-08-Understanding-LSTMs/)
## Install <a name="Install"></a>
This project was written and tested with Python 3.6.8.
In order to install all libraries used by this repository, you must run
In order to install, you must run:
```text
git clone https://github.com/DidierRLopes/GamestonkTerminal
cd GamestonkTerminal/
pip install -r requirements.txt
```
Then run:
```text
python gamestonk_terminal.py
```
Note: The libraries specified in the [requirements.txt](/requirements.txt) file have been tested and work for the purpose of this project, however, these may be older versions. Hence, it is recommended for the user to set up a virtual python environment prior to installing these. This allows to keep dependencies required by different projects in separate places.
Note: The libraries specified in the [requirements.txt](/requirements.txt) file have been tested and work for the purpose of this project, however, these may be older versions. Hence, it is recommended for the user to set up a virtual python environment prior to installing these. This allows to keep dependencies required by different projects in separate places.
## API Keys <a name="API_Keys"></a>
@@ -239,7 +247,7 @@ These are the ones where a key is necessary:
* Reddit: <https://www.reddit.com/prefs/apps>
* Twitter: <https://developer.twitter.com>
When these are obtained, don't forget to update [config_terminal.py](/config_terminal.py). Alternatively, you can also set them to the following environment variables
When these are obtained, don't forget to update [config_terminal.py](gamestonk_terminal/config_terminal.py). Alternatively, you can also set them to the following environment variables
* GT_API_KEY_ALPHAVANTAGE
* GT_API_KEY_FINANCIALMODELINGPREP
@@ -253,6 +261,8 @@ When these are obtained, don't forget to update [config_terminal.py](/config_ter
* GT_API_TWITTER_SECRET_KEY
* GT_API_TWITTER_BEARER_TOKEN.
Note that it is not necessary to have a valid Alpha Vantage key to get daily OHLC values.
## Disclaimer <a name="Disclaimer"></a>
"A few things I am not. I am not a cat. I am not an institutional investor, nor am I a hedge fund. I do not have clients and I do not provide personalized investment advice for fees or commissions." DFV

6
docker-compose.yaml Normal file
View File

@@ -0,0 +1,6 @@
version: '3.8'
services:
gamestonkterminal:
build:
context: .
image: gamestonkterminal:dev

View File

@@ -226,6 +226,11 @@ Prints a complete cash flow statement over time. This can be either quarterly or
* n : Number of latest years/quarters. Default 1.
* q : Quarter fundamental data flag. Default False.
Prints a complete cash flow statement over time. This can be either quarterly or annually. The following fields are expected: Accepted date, Accounts payables, Accounts receivables, Acquisitions net, Capital expenditure, Cash at beginning of period, Cash at end of period, Change in working capital, Common stock issued, Common stock repurchased, Debt repayment, Deferred income tax, Depreciation and amortization, Dividends paid, Effect of forex changes on cash, Filling date, Final link, Free cash flow, Inventory, Investments in property plant and equipment, Link, Net cash provided by operating activities, Net cash used for investing activities, Net cash used provided by financing activities, Net change in cash, Net income, Operating cash flow, Other financing activities, Other investing activities, Other non cash items, Other working capital, Period, Purchases of investments, Sales maturities of investments, Stock based compensation. [Source: Alpha Vantage]
* n : Number of latest years/quarters. Default 1.
* q : Quarter fundamental data flag. Default False.
### earnings <a name="earnings"></a>
```text
@@ -310,6 +315,11 @@ Prints a complete cash flow statement over time. This can be either quarterly or
* n : Number of latest years/quarters. Default 1.
* q : Quarter fundamental data flag. Default False.
Prints a complete cash flow statement over time. This can be either quarterly or annually. The following fields are expected: Accepted date, Accounts payables, Accounts receivables, Acquisitions net, Capital expenditure, Cash at beginning of period, Cash at end of period, Change in working capital, Common stock issued, Common stock repurchased, Debt repayment, Deferred income tax, Depreciation and amortization, Dividends paid, Effect of forex changes on cash, Filling date, Final link, Free cash flow, Inventory, Investments in property plant and equipment, Link, Net cash provided by operating activities, Net cash used for investing activities, Net cash used provided by financing activities, Net change in cash, Net income, Operating cash flow, Other financing activities, Other investing activities, Other non cash items, Other working capital, Period, Purchases of investments, Sales maturities of investments, Stock based compensation. [Source: Financial Modeling Prep]
* n : Number of latest years/quarters. Default 1.
* q : Quarter fundamental data flag. Default False.
### metrics <a name="metrics"></a>
```text

View File

@@ -84,11 +84,10 @@ def info(l_args, s_ticker):
filepath = "fundamental_analysis/key_metrics_explained.txt"
with open(filepath) as fp:
# Fix: this needs to be going somewhere
# pylint: disable=unused-variable
line = fp.readline()
while line:
print("{}".format(line.strip()))
line = fp.readline()
print("")
print("")
except Exception as e:
print(e)

View File

@@ -135,6 +135,6 @@ def pred_menu(df_stock, s_ticker, s_start, s_interval):
elif ns_known_args.cmd == "lstm":
neural_networks.lstm(l_args, s_ticker, s_interval, df_stock)
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
else:
print("Command not recognized!")

View File

@@ -6,6 +6,7 @@ from gamestonk_terminal.technical_analysis import trend as ta_trend
from gamestonk_terminal.technical_analysis import volatility as ta_volatility
from gamestonk_terminal.technical_analysis import volume as ta_volume
# -----------------------------------------------------------------------------------------------------------------------
def print_technical_analysis(s_ticker, s_start, s_interval):
""" Print help """

View File

@@ -0,0 +1,14 @@
""" fundamental_analysis/yahoo_finance_api.py tests """
# noqa: F401
import unittest
# pylint: disable=unused-import
import pytest
from gamestonk_terminal.prediction_techniques.neural_networks import mlp
class TestPredNeuralNetworks(unittest.TestCase):
def test_mlp(self):
# Fix: need to move loading of ticker data into a df somewhere
mlp([], "TLSA", None, None)

2910
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

37
pyproject.toml Normal file
View File

@@ -0,0 +1,37 @@
[tool.poetry]
name = "GamestonkTerminal"
version = "0.1.0"
description = ""
authors = ["Didier Rodrigues Lopes"]
[tool.poetry.dependencies]
python = "^3.6.8"
fbprophet = "^0.6"
pandas = "^1.1.5"
iso8601 = "^0.1.14"
FundamentalAnalysis = "^0.2.6"
requests = "^2.25.1"
alpha-vantage = "^2.3.1"
finviz = "^1.3.4"
bs4 = "^0.0.1"
rapidfuzz = "^1.1.1"
yfinance = "^0.1.55"
pandas-ta = "^0.2.23b0"
prettytable = "^2.0.0"
psaw = "^0.0.12"
praw = "^7.1.4"
Quandl = "^3.6.0"
flair = "^0.7"
pytrends = "^4.7.3"
TimeSeriesCrossValidation = { git = "https://github.com/DidierRLopes/TimeSeriesCrossValidation.git", branch = "master" }
pmdarima = "^1.8.0"
tensorflow = "^2.4.1"
matplotlib = "^3.3.3"
plotly = "^4.14.3"
[tool.poetry.dev-dependencies]
pytest = "^6.2.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

View File

@@ -1,141 +1,129 @@
absl-py==0.11.0
aiohttp==3.7.3
absl-py==0.11.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.2.0"
aiohttp==3.7.4; python_version >= "3.6"
alpha-vantage==2.3.1
# appscript==1.1.2
astunparse==1.6.3
async-timeout==3.0.1
attrs==20.3.0
async-timeout==3.0.1; python_full_version >= "3.5.3" and python_version >= "3.6"
attrs==20.3.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
beautifulsoup4==4.9.3
black==20.8b1
bpemb==0.3.2
cachetools==4.2.1
certifi==2020.12.5
chardet==3.0.4
click==7.1.2
cloudpickle==1.6.0
codespell==2.0.0
config==0.5.0.post0
convertdate==2.3.1
cssselect==1.1.0
cycler==0.10.0
Cython==0.29.17
decorator==4.4.2
Deprecated==1.2.11
fbprophet==0.7.1
filelock==3.0.12
finviz @ git+https://github.com/mariostoev/finviz@be8dc934e80bf03d26ddd37b4c78a5e3d57abeef
flair==0.7
bpemb==0.3.2; python_version >= "3.6"
bs4==0.0.1
cachetools==4.2.1; python_version >= "3.5" and python_version < "4.0" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0")
certifi==2020.12.5; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
chardet==3.0.4; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
click==7.1.2; python_full_version >= "3.6.0" and python_version >= "3.6"
cloudpickle==1.6.0; python_version >= "3.6"
cmdstanpy==0.4.0
convertdate==2.3.1; python_version >= "3.5"
cssselect==1.1.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0"
cycler==0.10.0; python_version >= "3.6"
cython==0.29.17; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6"
dataclasses==0.8; python_version >= "3.6" and python_version < "3.7" and python_full_version >= "3.6.2"
decorator==4.4.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.2.0" and python_version >= "3.6"
deprecated==1.2.11; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
ephem==3.7.7.1; python_version >= "2.7" and python_version < "4"
fbprophet==0.6
filelock==3.0.12; python_full_version >= "3.6.0" and python_version >= "3.6"
finviz==1.3.4
flair==0.7; python_version >= "3.6"
flatbuffers==1.12
ftfy==5.9
FundamentalAnalysis==0.2.6
future==0.18.2
gast==0.3.3
gdown==3.12.2
gensim==3.8.3
google-auth==1.27.0
google-auth-oauthlib==0.4.2
ftfy==5.9; python_version >= "3.6"
fundamentalanalysis==0.2.6
future==0.18.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6"
gast==0.3.3; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0"
gdown==3.12.2; python_version >= "3.6"
gensim==3.8.2; python_version >= "3.6"
google-auth-oauthlib==0.4.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.2.0" and python_version >= "3.6"
google-auth==1.27.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6"
google-pasta==0.2.0
grpcio==1.32.0
grpcio==1.32.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.2.0"
h5py==2.10.0
hijri-converter==2.1.1
hijri-converter==2.1.1; python_version >= "3.6"
holidays==0.10.5.2
hyperopt==0.2.5
idna==2.10
importlib-metadata==3.7.0
inflection==0.5.1
hyperopt==0.2.5; python_version >= "3.6"
idna-ssl==1.1.0; python_version < "3.7" and python_version >= "3.6"
idna==2.10; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "3.7" or python_version < "3.7" and python_version >= "3.6" and python_full_version >= "3.5.0"
importlib-metadata==3.7.0; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "3.8" or python_full_version >= "3.2.0" and python_version >= "3.6" and python_version < "3.8"
inflection==0.5.1; python_version >= "3.5"
iso8601==0.1.14
jupyter==1.0.0
Janome==0.4.1
joblib==1.0.1
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
konoha==4.6.2
janome==0.4.1; python_version >= "3.6"
joblib==1.0.1; python_full_version >= "3.6.0" and python_version >= "3.6"
keras-preprocessing==1.1.2
kiwisolver==1.3.1; python_version >= "3.6"
konoha==4.6.2; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6"
korean-lunar-calendar==0.2.1
langdetect==1.0.8
levenshtein==0.12.0
LunarCalendar==0.0.9
lxml==4.6.2
Markdown==3.3.4
# matplotlib==3.1.1
matplotlib==3.3.2
more-itertools==8.7.0
mpld3==0.3
mplfinance==0.12.7a7
multidict==5.1.0
langdetect==1.0.8; python_version >= "3.6"
lunarcalendar==0.0.9; python_version >= "2.7" and python_version < "4"
lxml==4.6.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
markdown==3.3.4; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.2.0" and python_version >= "3.6"
matplotlib==3.3.4; python_version >= "3.6"
more-itertools==8.7.0; python_version >= "3.5"
mpld3==0.3; python_version >= "3.6"
multidict==5.1.0; python_version >= "3.6"
multitasking==0.0.9
networkx==2.5
numpy==1.19.2
oauthlib==3.1.0
opt-einsum==3.3.0
overrides==3.0.0
packaging==20.9
pandas==1.1.5
pandas-ta==0.2.23b0
papermill==2.3.2
patsy==0.5.1
networkx==2.5; python_version >= "3.6"
numpy==1.19.5; python_version >= "3.6" and python_full_version >= "3.6.2" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.2.0" and python_version >= "3.6")
oauthlib==3.1.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
opt-einsum==3.3.0; python_version >= "3.5"
overrides==3.0.0; python_full_version >= "3.6.1" and python_full_version < "4.0.0" and python_version >= "3.6"
packaging==20.9; python_full_version >= "3.6.0" and python_version >= "3.6"
pandas-ta==0.2.45b
pandas==1.1.5; python_full_version >= "3.6.1"
patsy==0.5.1; python_version >= "3.6"
pillow==8.1.0; python_version >= "3.6"
plotly==4.14.3
pmdarima==1.8.0
praw==7.2.0
prawcore==2.0.0
prettytable==2.0.0
protobuf==3.15.2
psaw==0.0.12
psutil==5.8.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
PyMeeus==0.4.2
pylint==2.7.0
pyparsing==2.4.7
PySocks==1.7.1
pytest==6.2.2
python-dateutil==2.8.1
python-Levenshtein==0.12.2
pmdarima==1.8.0; python_version >= "3.6"
praw==7.2.0; python_version >= "3.6" and python_version < "4.0"
prawcore==2.0.0; python_version >= "3.6" and python_version < "4.0"
prettytable==2.0.0; python_version >= "3.6"
protobuf==3.15.3; python_full_version >= "3.6.0" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.2.0")
psaw==0.0.12; python_version >= "3"
pyasn1-modules==0.2.8; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
pyasn1==0.4.8; python_version >= "3.5" and python_full_version < "3.0.0" and python_version < "4" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6") or python_version >= "3.5" and python_version < "4" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6") and python_full_version >= "3.6.0"
pymeeus==0.4.3; python_version >= "3.5"
pyparsing==2.4.7; python_full_version >= "3.6.0" and python_version >= "3.6"
pysocks==1.7.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
pystan==2.18
python-dateutil==2.8.1; python_full_version >= "3.6.1" and python_version >= "3.5" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6") and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0") and (python_version >= "2.7" and python_full_version < "3.0.0" and python_version < "4" or python_version >= "2.7" and python_version < "4" and python_full_version >= "3.3.0")
pytrends==4.7.3
pytz==2019.3
Quandl==3.6.0
rapidfuzz==1.1.1
regex==2020.11.13
requests==2.25.1
requests-oauthlib==1.3.0
rsa==4.7.2
sacremoses==0.0.43
scikit-learn==0.24.1
scipy==1.6.1
segtok==1.5.10
sentencepiece==0.1.91
six==1.15.0
smart-open==4.2.0
soupsieve==2.2
sqlitedict==1.7.0
statsmodels==0.12.2
tabulate==0.8.9
tensorboard==2.4.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.4.1
pytz==2021.1; python_full_version >= "3.6.1" and python_version >= "3.5" and python_version < "4"
quandl==3.6.0; python_version >= "3.5"
rapidfuzz==1.1.1; python_version >= "2.7"
regex==2020.11.13; python_full_version >= "3.6.0" and python_version >= "3.6"
requests-oauthlib==1.3.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
requests==2.25.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
retrying==1.3.3
rsa==4.7.2; python_version >= "3.5" and python_version < "4" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6")
sacremoses==0.0.43; python_full_version >= "3.6.0" and python_version >= "3.6"
scikit-learn==0.24.1; python_version >= "3.6"
scipy==1.5.4; python_version >= "3.6"
segtok==1.5.10; python_version >= "3.6"
sentencepiece==0.1.91; python_full_version >= "3.6.0" and python_version >= "3.6"
setuptools-git==1.2
six==1.15.0; python_full_version >= "3.6.0" and python_version >= "3.6" and python_version < "4.0" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6") and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0")
smart-open==4.2.0; python_version >= "3.6"
soupsieve==2.2; python_version >= "3.6"
sqlitedict==1.7.0; python_version >= "3.6"
statsmodels==0.12.2; python_version >= "3.6"
tabulate==0.8.9; python_version >= "3.6"
tensorboard-plugin-wit==1.8.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.2.0"
tensorboard==2.4.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.2.0"
tensorflow-estimator==2.4.0
termcolor==1.1.0
threadpoolctl==2.1.0
TimeSeriesCrossValidation @ git+https://github.com/DidierRLopes/TimeSeriesCrossValidation@1e29d393204abb3bde23ff3f15258ed85d3b263e
tokenizers==0.9.3
torch==1.7.1
tqdm==4.57.0
transformers==3.5.1
typing-extensions==3.7.4.3
update-checker==0.18.0
urllib3==1.26.3
user-agent==0.1.9
wcwidth==0.2.5
websocket-client==0.57.0
Werkzeug==1.0.1
wrapt==1.12.1
XlsxWriter==1.2.7
xlwings==0.16.4
yahoo-fin==0.8.4
yarl==1.6.3
yfinance==0.1.55
beautifulsoup4==4.9.3
FundamentalAnalysis==0.2.6
python_dateutil==2.8.1
scikit_learn==0.24.1
tensorflow==2.4.1
zipp==3.4.0
termcolor==1.1.0
threadpoolctl==2.1.0; python_version >= "3.6"
timeseriescrossvalidation @ git+https://github.com/DidierRLopes/TimeSeriesCrossValidation.git@master
tokenizers==0.9.3; python_full_version >= "3.6.0" and python_version >= "3.6"
torch==1.7.1; python_full_version >= "3.6.2" and python_version >= "3.6"
tqdm==4.58.0; python_full_version >= "3.6.0" and python_version >= "3.6"
transformers==3.5.1; python_full_version >= "3.6.0" and python_version >= "3.6"
typing-extensions==3.7.4.3; python_full_version >= "3.6.2" and python_version >= "3.6" and python_version < "3.8" and (python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "3.8" or python_full_version >= "3.2.0" and python_version >= "3.6" and python_version < "3.8")
update-checker==0.18.0; python_version >= "3.6" and python_version < "4.0"
urllib3==1.26.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version < "4" and python_version >= "3.6"
user-agent==0.1.9
wcwidth==0.2.5; python_version >= "3.6"
websocket-client==0.57.0; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" or python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.4.0"
werkzeug==1.0.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
wrapt==1.12.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
yarl==1.6.3; python_version >= "3.6"
yfinance==0.1.55
zipp==3.4.0; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "3.8" or python_full_version >= "3.2.0" and python_version >= "3.6" and python_version < "3.8"