Giter Site home page Giter Site logo

adeebahmed / tdameritrade Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timkpaine/tdameritrade

0.0 1.0 0.0 989 KB

Python interface to TD Ameritrade (https://developer.tdameritrade.com)

License: Apache License 2.0

Makefile 2.20% Python 83.66% Jupyter Notebook 14.15%

tdameritrade's Introduction

tdameritrade

Python interface to TD Ameritrade Api

Build Status Coverage BCH compliance License PyPI Docs

Getting Started

Install

Install from pip

pip install tdameritrade

or from source

python setup.py install

Docs

Major changes in the v0.1.0 update to the way tokens are handled.
You will still need the original authentication instructions, but the TDClient now takes the refresh token and client id, not the access token. A new session class handles token expiration and will automatically call a new token as needed.

It is recommended that you store these as environmental variables.

client_id = os.getenv('TDAMERITRADE_CLIENT_ID')
account_id = os.getenv('TDAMERITRADE_ACCOUNT_ID')
refresh_token = os.getenv('TDAMERITRADE_REFRESH_TOKEN')

tdclient = tdameritrade.TDClient(client_id=client_id, refresh_token=refresh_token, account_ids=[account_id])

See the tests\test_client.py file for examples on current usage.

Read the docs!

All functionality is available as methods on the TDClient object. For most methods, there is a convenience method to return the result as a pandas DataFrame.

Most data fetching methods accept the symbol as argument. For equities, this is just the ticker.

For different assets, utilize the search and instrument methods to lookup symbols. For options, you can utilize the options method.

tdameritrade's People

Contributors

dahifi avatar eralpha avatar jecker7 avatar jrbartola avatar pkout avatar timkpaine avatar willforan avatar zachnagengast avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.