|
1 |
| -# ETRADE-API-Python |
2 |
| -ETRADE API Python |
| 1 | +# E*TRADE API Python Sample Application |
| 2 | + |
| 3 | +This sample Python application provides examples on using the ETRADE API endpoints. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +* [Requirements](#requirements) |
| 8 | +* [Setup](#setup) |
| 9 | +* [Running Code](#running-code) |
| 10 | + |
| 11 | +## Requirements |
| 12 | + |
| 13 | +In order to run this sample application you need the following three items: |
| 14 | + |
| 15 | +1. Python 3 - this sample application is written in Python and requires Python 3. If you do not |
| 16 | +already have Python 3 installed, download it from |
| 17 | + |
| 18 | + [`https://www.python.org/downloads/`](https://www.python.org/downloads/). |
| 19 | + |
| 20 | +2. An [E*TRADE](https://us.etrade.com) account |
| 21 | + |
| 22 | +3. E*TRADE consumer key and consumer secret. |
| 23 | + |
| 24 | + |
| 25 | +## Setup |
| 26 | + |
| 27 | +1. Unzip python zip file |
| 28 | + |
| 29 | +2. Edit [`config.ini`](EtradePythonClient/etrade_python_client/config.ini) |
| 30 | +with your consumer key and consumer secret; copy these from your application's keys' section |
| 31 | + |
| 32 | +3. Create the virtual environment by running the Python's venv command; see the command syntax below |
| 33 | + |
| 34 | +``` |
| 35 | +$ python3 -m venv venv |
| 36 | +``` |
| 37 | + |
| 38 | +4. Activate the Python virtual environment |
| 39 | + |
| 40 | +On Windows, run: |
| 41 | + |
| 42 | +``` |
| 43 | +$ venv\Scripts\activate.bat |
| 44 | +``` |
| 45 | + |
| 46 | +On Unix or Mac OS, run: |
| 47 | + |
| 48 | +``` |
| 49 | +$ source venv/bin/activate |
| 50 | +``` |
| 51 | + |
| 52 | +5. Use pip to install dependencies for the sample application |
| 53 | + |
| 54 | +``` |
| 55 | +$ pip install -r requirements.txt |
| 56 | +``` |
| 57 | + |
| 58 | +6. Run the sample application |
| 59 | + |
| 60 | +``` |
| 61 | +$ cd etrade_python_client |
| 62 | +$ python3 etrade_python_client.py |
| 63 | +``` |
| 64 | + |
| 65 | +## Running Code |
| 66 | + |
| 67 | +Complete these steps to run the code for the sample application: |
| 68 | + |
| 69 | +1. Activate the Python virtual environment |
| 70 | + |
| 71 | +On Windows, run: |
| 72 | + |
| 73 | +``` |
| 74 | +$ venv\Scripts\activate.bat |
| 75 | +``` |
| 76 | + |
| 77 | +On Unix or Mac OS, run: |
| 78 | + |
| 79 | +``` |
| 80 | +$ source venv/bin/activate |
| 81 | +``` |
| 82 | + |
| 83 | +2. Run the application |
| 84 | + |
| 85 | +``` |
| 86 | +$ cd etrade_python_client |
| 87 | +$ python3 etrade_python_client.py |
| 88 | +``` |
0 commit comments