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

This version

0.1.3

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.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

tastytrade_sdk-0.1.3-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file tastytrade_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: tastytrade_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 7.9 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.3.tar.gz
Algorithm Hash digest
SHA256 74277039390a3942d6b48d319353ebcae0f773701bdc563e238aaa6a0dcdfec6
MD5 04fde533a649ebc06fc6a6469ab78ab1
BLAKE2b-256 96464f4204a1ce0468e2f5c22d0ebb18da3d7fc949a87865fd0bb6d4cd4776a2

See more details on using hashes here.

File details

Details for the file tastytrade_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tastytrade_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.3 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

Hashes for tastytrade_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 871170e1df414b9a469447db63482e41b098234db9aa318edf003791e331f1e4
MD5 095bf2bfaa3b5843cb837ecc340917e0
BLAKE2b-256 3f350951ebfb5763bc8eb25a4539dc266d97cd3e85caf0f127d9ee6a233c6ed6

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