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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tastytrade_sdk-0.1.4a0.dev10.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.dev10.tar.gz
Algorithm Hash digest
SHA256 0d37aeb29cdc25bc778520d7e7bb9b625defaee8071c31c3410e2b374630f93b
MD5 0f6c1f47addca74b84e82b71a5801701
BLAKE2b-256 55adc51f177c713e40579b6a9e62e2c21b61138860ef8f0a568829a03dd81377

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tastytrade_sdk-0.1.4a0.dev10-py3-none-any.whl
Algorithm Hash digest
SHA256 455356fbb84b4a871a1bd34441ebd8ffb2b44d1cbd7bd10cdbc847763a835659
MD5 d0bbc7bb8f96937fc6bdca5cf01df598
BLAKE2b-256 d3b458c49637694a59955533605c595d31c6f423222c61f12566d532ae08dacc

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