td-ameritrade-api icon indicating copy to clipboard operation
td-ameritrade-api copied to clipboard

A Few Suggestions

Open csaleman opened this issue 1 year ago • 0 comments

First thank you for for this API. Took me way too long to get the td_credentials.json file. So here is a list of issues I found.

  1. The instructions don't show an example of the config.init file. [main] client_id = MY-OWN-CLIENT-ID redirect_uri = MY-REDIRECT-URI

  2. The example fails to generate a credential.json in order to initiate the oauth workflow the line below needs to be omitted.

    credential_file='config/td_credentials.json'

  3. URL was not showing, I'm developing on a VM without a web browser. So I added a print(url) on credentials.py right after line 468

    webbrowser.open(url=url) print(url)

  4. After entering the code, nothing actually got saved, The token file was available but not saved. So I added the

td_credentials.to_credential_file('config/td_credentials.json')

# Initialize the Parser.
config = ConfigParser()

# Read the file.
config.read('config/config.ini')

# Get the specified credentials.
client_id = config.get('main', 'client_id')
redirect_uri = config.get('main', 'redirect_uri')

# Intialize our `Credentials` object.
td_credentials = TdCredentials(
    client_id=client_id,
    redirect_uri=redirect_uri
)

td_credentials.to_credential_file('config/td_credentials.json')

csaleman avatar Sep 29 '22 07:09 csaleman