https://github.com/peter-oroszvari/tastytrade-api
Python SDK for Tastytrade API
https://github.com/peter-oroszvari/tastytrade-api
python sdk-python tastytrade tastyworks
Last synced: 6 months ago
JSON representation
Python SDK for Tastytrade API
- Host: GitHub
- URL: https://github.com/peter-oroszvari/tastytrade-api
- Owner: peter-oroszvari
- License: mit
- Created: 2023-04-14T18:53:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-04T22:29:59.000Z (about 2 years ago)
- Last Synced: 2025-04-12T21:12:22.826Z (6 months ago)
- Topics: python, sdk-python, tastytrade, tastyworks
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 42
- Watchers: 7
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
pip install tastytrade-api
```## USAGE
Here's an example of how to use the Tastytrade API client:
```python
from tastytrade_api.authentication import TastytradeAuthusername = "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:
```bash
pip install -r requirements-dev.txt
```Then, execute the tests using unittest:
```bash
python -m unittest discover
```## License
This project is licensed under the MIT License. See the LICENSE file for details.