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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tastytrade_sdk-0.1.4a0.dev9.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.dev9.tar.gz
Algorithm Hash digest
SHA256 c65e65b6a38588669caf648bbb37ba5924d42c02a070d7b1db732a6983cc8138
MD5 383dc069b5b7d17ca148ecc6667935e8
BLAKE2b-256 af9995439aaf228c524cc0939f97e6980159e9001d608a79266c666033aa0d69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tastytrade_sdk-0.1.4a0.dev9-py3-none-any.whl
Algorithm Hash digest
SHA256 5ef19a0d16001b1e81aba6be3d401eade0ccf48cde268b051c2042eff21e3f6b
MD5 141dca8fe9d4830f62b24e9b4e7aac2b
BLAKE2b-256 7e01413bf1ebb1d9adbdeca90a706a25f9dd5d47ab3e89d4364b88b37410e027

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