tdameritrade
Python interface to TD Ameritrade Api
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.
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.
Metadata
Release files for tdameritrade 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tdameritrade-0.2.1.tar.gz | 28.5 kB | Without provenance | Details for tdameritrade-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tdameritrade-0.2.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for tdameritrade-0.2.1-py2.py3-none-any.whl |
Total release size: 57.0 kB
Release files / tdameritrade-0.2.1.tar.gz
| Download URL | tdameritrade-0.2.1.tar.gz |
|---|---|
| Size | 28.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ef13cf4bbef50633df3d5e3f263bc6a4a301e4b2ff3397077927a9fae0c709a
|
|
BLAKE2b-256 checksum How to use checksums |
fbc156a790c36e702e555a90b9b8ec237c0aca4d9ee79199af4de93c6c0268a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / tdameritrade-0.2.1-py2.py3-none-any.whl
| Download URL | tdameritrade-0.2.1-py2.py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
2c51f3887634b617810bc9908d0b7bd70ff6d7b17a2efe6d270d509c9d99c528
|
|
BLAKE2b-256 checksum How to use checksums |
5d1455def97725823a4e01ea2c64ce330e4bf92dffb212c3ced70d2abf248c30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for tdameritrade 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.