Skip to content

Commit

Permalink
added docker image and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
omdv committed Jul 15, 2020
1 parent 54b0ed4 commit 8fd54a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
FROM phusion/baseimage:latest
MAINTAINER Oleg Medvedev <[email protected]>
ARG VERSION=unknown
FROM jupyter/base-notebook:latest
MAINTAINER Oleg Medvedev <[email protected]>

RUN apt-get update && \
apt-get install -y \
python3 python3-numpy python3-nose python3-pandas \
pep8 python3-pip python3-matplotlib git && \
pip3 install --upgrade setuptools
USER root

RUN mkdir -p /root/.config/matplotlib && \
echo backend:Agg > /root/.config/matplotlib/matplotlibrc
RUN apt-get update && apt-get install -y git

RUN VERSION=${VERSION} git clone https://github.com/omdv/robinhood-portfolio && \
pip3 install --upgrade --force-reinstall -r robinhood-portfolio/requirements.txt
RUN git clone https://github.com/omdv/robinhood-portfolio ./work && \
pip3 install --upgrade --force-reinstall -r work/requirements.txt

CMD cd robinhood-portfolio && python3 app.py
USER $NB_USER
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Note
This app is heavily relying on [pandas-datareader](https://pydata.github.io/pandas-datareader/stable/remote_data.html#) for financial quotes. Over the last couple years multiple APIs were obsoleted by their providers (Google, Morningstar) and as I am no longer a RH client I have no time to keep up with those changes. If you encounter the "Bad Gateway" error or similar it is likely that the current market data source is no longer valid. You are welcome to fork and try different sources of quotes - I will try to fix it, when/if I have time.
This app is relying on [pandas-datareader](https://pydata.github.io/pandas-datareader/stable/remote_data.html#) for stock historical prices. Over the last couple years multiple APIs were obsoleted by their providers (Google Finance, Morningstar) and as I am no longer a RH client I have no time to keep up with those changes. If you encounter the "Bad Gateway" error or similar it is likely that the current market data source is no longer valid. You are welcome to fork and try different sources of quotes - I will try to fix it, when/if I have time.

**Current API is [TIINGO](https://api.tiingo.com/account/token) for stock and market index.**

# Robinhood Portfolio
Python client to access and analyze the Robinhood portfolio.
Based on unofficial [robinhood-api](https://github.com/Jamonek/Robinhood) and several python libraries for financial analysis, such as:
Python client to analyze the Robinhood portfolio.
Based on unofficial [robinhood-api](https://github.com/Jamonek/Robinhood) and python libraries for financial analysis, such as:
- [empyrical](https://github.com/quantopian/empyrical)
- [portfolioopt](https://github.com/czielinski/portfolioopt)

Expand Down Expand Up @@ -48,18 +48,12 @@ jupyter notebook
Open `main.ipynb`, enter TIINGO `api_key`, Robinhood credentials, set `demo_run` variable to `False` to run with your data, execute all cells.


<!-- ### Docker way
Docker container based on Ubuntu is [available](https://hub.docker.com/r/omdv/robinhood-portfolio/). To launch it in a background mode you need to get TIINGO API key and provide it to docker.
### Docker way
```
docker run -e TIINGO_API_KEY=<API-KEY> -d -p 8080:8080 --name robinhood omdv/robinhood-portfolio:ubuntu
docker run --name robinhood -d -p 8888:8888 omdv/robinhood-portfolio:notebook start.sh jupyter notebook --NotebookApp.token='' --notebook-dir='./work'
```

Once up and running connect to [http://localhost:8080](http://localhost:8080). If using the older versions of docker you will need to use the ip of the docker-machine.
To specify a different port run:
```
docker run -e TIINGO_API_KEY=<API-KEY> -d -e PORT=$PORT -p $PORT:$PORT --name robinhood omdv/robinhood-portfolio:ubuntu
``` -->
Once up and running connect to [http://localhost:8888](http://localhost:8888). Open `main.ipynb`, follow instructions.


### Disclaimer
Expand Down

0 comments on commit 8fd54a1

Please sign in to comment.