Skip to content

Commit

Permalink
Merge pull request #35 from NelsonDane/deepsource
Browse files Browse the repository at this point in the history
Multiple Accounts, Improvements, Brokerage Class, External Login
  • Loading branch information
NelsonDane authored Jun 30, 2023
2 parents cb93cbe + bbc2f58 commit a5933f5
Show file tree
Hide file tree
Showing 14 changed files with 1,179 additions and 1,119 deletions.
39 changes: 21 additions & 18 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,35 @@ DISCORD_TOKEN=
# Channel the bot will run in
DISCORD_CHANNEL=

# Ally API
ALLY_CONSUMER_KEY=
ALLY_CONSUMER_SECRET=
ALLY_OAUTH_TOKEN=
ALLY_OAUTH_SECRET=
ALLY_ACCOUNT_NBR=
# ALL BROKERS: Separate multiple accounts with a comma
# and separate account credentials with a colon

# Ally
# ALLY=ALLY_CONSUMER_KEY:ALLY_CONSUMER_SECRET:ALLY_OAUTH_TOKEN:ALLY_OAUTH_SECRET:ALLY_ACCOUNT_NBR
ALLY=

# Fidelity
FIDELITY_USERNAME=
FIDELITY_PASSWORD=
# FIDELITY=FIDELITY_USERNAME:FIDELITY_PASSWORD
FIDELITY=

# Robinhood
ROBINHOOD_USERNAME=
ROBINHOOD_PASSWORD=
# If 2fa is enabled
ROBINHOOD_TOTP=
# If 2fa is enabled:
# ROBINHOOD=ROBINHOOD_USERNAME:ROBINHOOD_PASSWORD:ROBINHOOD_TOTP
# If 2fa is not enabled:
# ROBINHOOD=ROBINHOOD_USERNAME:ROBINHOOD_PASSWORD:NA
ROBINHOOD=

# Schwab
SCHWAB_USERNAME=
SCHWAB_PASSWORD=
# If 2fa is enabled
SCHWAB_TOTP_SECRET=
# SCHWAB=SCHWAB_USERNAME:SCHWAB_PASSWORD:SCHWAB_TOTP_SECRET
# If 2fa is not enabled
# SCHWAB=SCHWAB_USERNAME:SCHWAB_PASSWORD:NA
SCHWAB=

# Tradier
TRADIER_ACCESS_TOKEN=
# TRADIER=TRADIER_ACCESS_TOKEN
TRADIER=

# Tastytrade
TASTYTRADE_USERNAME=
TASTYTRADE_PASSWORD=
# TASTYTRADE=TASTYTRADE_USERNAME:TASTYTRADE_PASSWORD
TASTYTRADE=
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
__pycache__/
did.bin
test.py
.vscode/
.vscode/
*.png
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Install Edge
RUN wget https://packages.microsoft.com/keys/microsoft.asc -O- | apt-key add -
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge.list'
RUN apt-get update && apt-get install -y --no-install-recommends microsoft-edge-stable && rm -rf /var/lib/apt/lists/*

Expand All @@ -37,8 +38,8 @@ COPY ./requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install playwright
RUN playwright install
RUN playwright install-deps
RUN playwright install && \
playwright install-deps

# Grab needed files
COPY ./autoRSA.py .
Expand All @@ -47,7 +48,7 @@ COPY ./fidelityAPI.py .
COPY ./robinhoodAPI.py .
COPY ./schwabAPI.py .
COPY ./tradierAPI.py .
COPY ./seleniumAPI.py .
COPY ./helperAPI.py .
COPY ./tastyAPI.py .
COPY ./entrypoint.sh .

Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ Like what you see? Feel free to support me on Ko-Fi!
DISCLAIMER: I am not a financial advisor and not affiliated with any of the brokerages listed below. Use this tool at your own risk. I am not responsible for any losses or damages you may incur by using this project. This tool is provided as-is with no warranty.

## Supported brokerages:

All brokers: separate account credentials with ":". For example, `ALLY_USERNAME:ALLY_PASSWORD`. Separate multiple accounts with the same broker with ",". For example, `ALLY_USERNAME:ALLY_PASSWORD,ALLY_USERNAME2:ALLY_PASSWORD2`.

### Ally
Made using [PyAlly](https://github.com/alienbrett/PyAlly). Go give them a ⭐

Expand All @@ -97,6 +100,9 @@ Required `.env` variables:
- ALLY_OAUTH_SECRET
- ALLY_ACCOUNT_NBR

`.env` file format:
- ALLY=ALLY_CONSUMER_KEY:ALLY_CONSUMER_SECRET:ALLY_OAUTH_TOKEN:ALLY_OAUTH_SECRET:ALLY_ACCOUNT_NBR

To get these, follow [these instructions](https://alienbrett.github.io/PyAlly/installing.html#get-the-library).

### Fidelity
Expand All @@ -106,6 +112,9 @@ Required `.env` variables:
- FIDELITY_USERNAME
- FIDELITY_PASSWORD

`.env` file format:
- FIDELITY=FIDELITY_USERNAME:FIDELITY_PASSWORD

### Robinhood
Made using [robin_stocks](https://github.com/jmfernandes/robin_stocks). Go give them a ⭐

Expand All @@ -114,6 +123,10 @@ Required `.env` variables:
- ROBINHOOD_PASSWORD
- ROBINHOOD_TOTP: If 2fa enabled

`.env` file format:
- With 2fa: ROBINHOOD=ROBINHOOD_USERNAME:ROBINHOOD_PASSWORD:ROBINHOOD_TOTP
- Without 2fa: ROBINHOOD=ROBINHOOD_USERNAME:ROBINHOOD_PASSWORD:NA

Configuring 2fa can be tricky, read the TOTP section [here](https://github.com/jmfernandes/robin_stocks/blob/master/Robinhood.rst).

### Schwab
Expand All @@ -124,6 +137,10 @@ Required `.env` variables:
- SCHWAB_PASSWORD
- SCHWAB_TOTP_SECRET (Optional, if 2fa is enabled)

`.env` file format:
- With 2fa: SCHWAB=SCHWAB_USERNAME:SCHWAB_PASSWORD:SCHWAB_TOTP_SECRET
- Without 2fa: SCHWAB=SCHWAB_USERNAME:SCHWAB_PASSWORD:NA

To get your TOTP secret, follow this [guide](guides/schwabSetup.md).

### Tradier
Expand All @@ -132,6 +149,9 @@ Made by yours truly using the official [Tradier API](https://documentation.tradi
Required `.env` variables:
- TRADIER_ACCESS_TOKEN

`.env` file format:
- TRADIER=TRADIER_ACCESS_TOKEN

To get your access token, go to your [Tradier API settings](https://dash.tradier.com/settings/api).

### Tastytrade
Expand All @@ -141,6 +161,8 @@ Required `.env` variables:
- TASTYTRADE_USERNAME
- TASTYTRADE_PASSWORD

`.env` file format:
- TASTYTRADE=TASTYTRADE_USERNAME:TASTYTRADE_PASSWORD

### Maybe future brokerages
#### Chase
Expand Down
Loading

0 comments on commit a5933f5

Please sign in to comment.