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')


# Define some event handlers
def on_quote(quote: Quote):
    print(quote)


def on_candle(candle: Candle):
    print(candle)


def on_greeks(greeks: Greeks):
    print(greeks)


# Subscribing to symbols across different instrument types
symbols = [
    'BTC/USD',
    'SPY',
    '/ESU3',
    'SPY   230630C00255000',
    './ESU3 EW2N3 230714C4310'
]

subscription = tasty.market_data.subscribe(
    symbols=symbols,
    on_quote=on_quote,
    on_candle=on_candle,
    on_greeks=on_greeks
)

# 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.dev6.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

tastytrade_sdk-0.1.4a0.dev6-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file tastytrade_sdk-0.1.4a0.dev6.tar.gz.

File metadata

  • Download URL: tastytrade_sdk-0.1.4a0.dev6.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.dev6.tar.gz
Algorithm Hash digest
SHA256 950c9cf66ca58af84d00b4805bca99a1df1dd2d8bed4ec4d8aba9e1ab77835f0
MD5 872e314eda79ac8feda30bda48c693b9
BLAKE2b-256 fcd506dd7d9b08fe5c31e9887b3bca459f3bcfed4eb4f0e7a5168d76a391f874

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tastytrade_sdk-0.1.4a0.dev6-py3-none-any.whl
Algorithm Hash digest
SHA256 ead523e3a30475f9e7818628377ac6063a43ac36ad864c12d5b61be2f5e2f645
MD5 9f9b5993472cabf8137fbce89e747e96
BLAKE2b-256 d0bb8f756d0912e97f3c41265a635f3729ea7bae9286e1c53e2ff5c4abc1099b

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