A python wrapper around the tastytrade open API
Project description
Getting Started
Before using this SDK, ensure that you:
- have a Tastytrade account
- have opted into the Tastytrade Open API program
Install
pip install tastytrade-sdk
Use It
from tastytrade_sdk import Tastytrade
tasty = Tastytrade()
tasty.login(
login='trader@email.com',
password='password'
)
tasty.api.post('/sessions/validate')
tasty.logout()
Examples
Streaming Market Data
from tastytrade_sdk import Tastytrade
from tastytrade_sdk.market_data.models import Quote, Candle, Greeks
tasty = Tastytrade().login(login='trader@email.com', password='password')
# Subscribing to symbols across different instrument types
symbols = [
'BTC/USD',
'SPY',
'/ESU3',
'SPY 230630C00255000',
'./ESU3 EW2N3 230714C4310'
]
# Define a handler for market data messages
def on_message(message: dict) -> None:
print(message)
subscription = tasty.market_data.subscribe(symbols=symbols, on_message=on_message)
# start streaming
subscription.open()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tastytrade_sdk-0.1.4a0.dev8.tar.gz
.
File metadata
- Download URL: tastytrade_sdk-0.1.4a0.dev8.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5129520a2439910d44a0513267f5d399850274501c6a212f7a452ed76307ec6 |
|
MD5 | fb78a82ba4b638076d01b36ba5a3f084 |
|
BLAKE2b-256 | 40995518af8ede59a3ab21c019a933e042ec4c22925d37f64ffb670880084b27 |
File details
Details for the file tastytrade_sdk-0.1.4a0.dev8-py3-none-any.whl
.
File metadata
- Download URL: tastytrade_sdk-0.1.4a0.dev8-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbcc963df73ddd164a71cd2154e1e0751800682572f2a5bf3465a3e793add32f |
|
MD5 | f8388708255496498ec96bf5fa2c1469 |
|
BLAKE2b-256 | af7ef39a703459a375d6657acdf4ec5916c4387ed8a6d3d85f114fda1c8c8055 |