boyan-soubachov / tastyworks_api

An unofficial, reverse-engineered Python API for tastyworks.
Apache License 2.0
209 stars 79 forks source link

Added the ability to have a preferred TW account, very useful when th… #92

Open julie-mindcapers opened 2 years ago

julie-mindcapers commented 2 years ago

Problem addressed

User has multiple TastyWorks Accounts and accounts[0] is a closed account.

Solution

Add TW_PREF environment variable to store the user's preferred account; add fuction get_pref_account to parse the accounts list and return the preferred account if it exists, otherwise it returns accounts[0] just as before.

Checklist