Skip to main content

A Python client for the Tastytrade API

Project description

Tastytrade API

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

Uploaded Source

Built Distribution

tastytrade_api-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tastytrade-api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7e49bf2a872bfe037a92676512ea700df2c87f7ab6433a6acb90c5f735e7ea0c
MD5 1c21d3773e173490e5ab4892226a37d4
BLAKE2b-256 c6de0ccb4576843be4094564c8d284e1dd9c5d249f63cb743de818958484724e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tastytrade_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81b090ed18409b70ea73a778a8ea1701c1a97d42fb040db58ba5bde4e1e90138
MD5 fee52a15ece626916d14cbacd955c63e
BLAKE2b-256 9a92cdda8bd35107b4ec946b6a2ff5509000a9bb890ac611f0bd94d1af79f21e

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