td-ameritrade-api
td-ameritrade-api copied to clipboard
A Few Suggestions
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.
-
The instructions don't show an example of the config.init file. [main] client_id = MY-OWN-CLIENT-ID redirect_uri = MY-REDIRECT-URI
-
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'
-
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)
-
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')