Skip to main content

A python wrapper around the tastytrade open API

Project description

PyPI GitHub Discussions GitHub issues

Getting Started

Before using this SDK, ensure that you:

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

tastytrade_sdk-0.1.4a0.dev8.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

tastytrade_sdk-0.1.4a0.dev8-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

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

Hashes for tastytrade_sdk-0.1.4a0.dev8.tar.gz
Algorithm Hash digest
SHA256 a5129520a2439910d44a0513267f5d399850274501c6a212f7a452ed76307ec6
MD5 fb78a82ba4b638076d01b36ba5a3f084
BLAKE2b-256 40995518af8ede59a3ab21c019a933e042ec4c22925d37f64ffb670880084b27

See more details on using hashes here.

File details

Details for the file tastytrade_sdk-0.1.4a0.dev8-py3-none-any.whl.

File metadata

File hashes

Hashes for tastytrade_sdk-0.1.4a0.dev8-py3-none-any.whl
Algorithm Hash digest
SHA256 dbcc963df73ddd164a71cd2154e1e0751800682572f2a5bf3465a3e793add32f
MD5 f8388708255496498ec96bf5fa2c1469
BLAKE2b-256 af7ef39a703459a375d6657acdf4ec5916c4387ed8a6d3d85f114fda1c8c8055

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page