Skip to main content

A Python client and SDK for the Tastytrade API

Project description

Tastytrade API Python SDK

The Tastytrade API, which my Python module relies on, is currently in beta.

A Python client for the Tastytrade API, providing convenient access to Tastytrade's REST API for trading, account management, and more.

Installation

Install the package using pip:

pip install tastytrade-api

USAGE

Here's an example of how to use the Tastytrade API client:

from tastytrade_api.authentication import TastytradeAuth

username = "your_username"
password = "your_password"

# Initialize the authentication object
auth = TastytradeAuth(username, password)

# Log in to the API
auth_data = auth.login()

if auth_data:
    print("Successfully logged in!")
else:
    print("Failed to log in.")

# Validate the session
is_valid = auth.validate_session()

if is_valid:
    print("Session is valid.")
else:
    print("Session is invalid or expired.")

# Destroy the session (log out)
if auth.destroy_session():
    print("Successfully logged out.")
else:
    print("Failed to log out.")

Development

To run tests, first install the required development packages:

pip install -r requirements-dev.txt

Then, execute the tests using unittest:

python -m unittest discover

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tastytrade-api-1.0.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

tastytrade_api-1.0.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file tastytrade-api-1.0.0.tar.gz.

File metadata

  • Download URL: tastytrade-api-1.0.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for tastytrade-api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a3f5ea5c68f1f5978441d30b9975624eaa0026a337c2715d3b79ae626995ddca
MD5 2b41e0ce4b5ed502cd0ab41c381b15d7
BLAKE2b-256 ec4b4ebbf70b1f265a049c30ca9d39ad81203f6e9e3fa908e377392d9c074f59

See more details on using hashes here.

File details

Details for the file tastytrade_api-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tastytrade_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63870179bf436393c1d8256fb1598240e3fafdc2ce5c9b31c715caaff9bfa9d1
MD5 e1f1aa6af99919b3c1d0f7e5cfe2df68
BLAKE2b-256 bb3fe2e3c454c1401a06d5611c725964fbe9e671c123cc73beed4b8212dbb3d6

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