pyetrade (Python E-Trade API Wrapper)
Completed
Install
pip install pyetrade
OR
git clone https://github.com/jessecooper/pyetrade.git
cd pyetrade
sudo make init
sudo make install
Example Usage
To create the OAuth tokens:
import pyetrade
consumer_key = "<CONSUMER_KEY>"
consumer_secret = "<SECRET_KEY>"
oauth = pyetrade.ETradeOAuth(consumer_key, consumer_secret)
print(oauth.get_request_token())
verifier_code = input("Enter verification code: ")
tokens = oauth.get_access_token(verifier_code)
print(tokens)
And then on the example code:
import pyetrade
consumer_key = "<CONSUMER_KEY>"
consumer_secret = "<SECRET_KEY>"
tokens = {'oauth_token': '<TOKEN FROM THE SCRIPT ABOVE>',
'oauth_token_secret': '<TOKEN FROM THE SCRIPT ABOVE>'}
accounts = pyetrade.ETradeAccounts(
consumer_key,
consumer_secret,
tokens['oauth_token'],
tokens['oauth_token_secret']
)
print(accounts.list_accounts())
Documentation
PyEtrade Documentation
Contribute to pyetrade
ETrade API Docs
Development Setup:
- Fork pyetrade
- Setup development environment
make init
make devel
OR
pip install -r requirements.txt
pip install -r requirements_dev.txt
pip install -e .
pre-commit install --hook-type pre-commit --hook-type pre-push --install-hooks -t post-checkout -t post-merge
- Lint (Run analysis - pre-commit-config)
make analysis
make test
-
Push Changes
- Push changes to a branch on your forked repo
-
Create pull request
- Open a pull request on pyetrade and put your fork as the source of your changes