Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TASTYTRADE_LOGIN=your-username
TASTYTRADE_PASSWORD=your-password
API_BASE_URL=api.cert.tastyworks.com
API_BASE_URL=api.tastyworks.com
TT_CLIENT_ID=
TT_CLIENT_SECRET=
TT_REFRESH_TOKEN=
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ jobs:
env:
API_BASE_URL: ${{ vars.TASTYTRADE_CERT_URL }}
TASTYTRADE_LOGIN: ${{ secrets.TASTYTRADE_CERT_LOGIN }}
TASTYTRADE_PASSWORD: ${{ secrets.TASTYTRADE_CERT_PASSWORD }}
TASTYTRADE_PASSWORD: ${{ secrets.TASTYTRADE_CERT_PASSWORD }}
TT_CLIENT_ID: ${{ secrets.TT_CLIENT_ID }}
TT_CLIENT_SECRET: ${{ secrets.TT_CLIENT_SECRET }}
TT_REFRESH_TOKEN: ${{ secrets.TT_REFRESH_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
API_BASE_URL: ${{ vars.TASTYTRADE_CERT_URL }}
TASTYTRADE_LOGIN: ${{ secrets.TASTYTRADE_CERT_LOGIN }}
TASTYTRADE_PASSWORD: ${{ secrets.TASTYTRADE_CERT_PASSWORD }}
TT_CLIENT_ID: ${{ secrets.TT_CLIENT_ID }}
TT_CLIENT_SECRET: ${{ secrets.TT_CLIENT_SECRET }}
TT_REFRESH_TOKEN: ${{ secrets.TT_REFRESH_TOKEN }}
- name: Build with Poetry
run: |
poetry version "$(poetry version -s)dev${GITHUB_RUN_NUMBER}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.env
.cache*
.DS_Store
.vscode
dist
*.egg-info
docs/_build
Expand Down
23 changes: 16 additions & 7 deletions docs/users/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Before using this SDK, ensure that you:
* have a [Tastytrade account](https://open.tastytrade.com/)
* have opted into the [Tastytrade Open API program](https://developer.tastytrade.com/)
* Have a set of OAuth2 client credentials and a refresh token for your personal OAuth2 app. See [Tastytrade OAuth2](https://developer.tastytrade.com/oauth/) for more details.

## Install

Expand All @@ -19,16 +20,14 @@ pip install tastytrade-sdk
```python
from tastytrade_sdk import Tastytrade

tasty = Tastytrade()

tasty.login(
login='trader@email.com',
password='password'
tasty = Tastytrade(
client_id = YOUR_CLIENT_ID,
client_secret = YOUR_CLIENT_SECRET,
refresh_token = YOUR_REFRESH_TOKEN,
)

tasty.api.post('/sessions/validate')

tasty.logout()
```

---
Expand All @@ -39,7 +38,17 @@ tasty.logout()
```python
from tastytrade_sdk import Tastytrade

tasty = Tastytrade().login(login='trader@email.com', password='password')
# Instead of creating a Tastyworks object manually, you can store the details in the following
# environment variables and call this to create the object automatically. Remember, never store
# your client secret or refresh token directly in code or check it into version control.
# To use the sandbox environment instead, use api.cert.tastyworks.com as the API_BASE_URL and
# be sure to use client credentials generated for that environment.
# API_BASE_URL=api.tastyworks.com
# TT_CLIENT_ID=
# TT_CLIENT_SECRET=
# TT_REFRESH_TOKEN=

tasty = Tastytrade.from_env()

# Subscribing to symbols across different instrument types
# Please note: The option symbols here are expired. You need to subscribe to an unexpired symbol to receive quote data
Expand Down
Loading
Loading