Skip to content

Commit f03f454

Browse files
committed
added comments that python-dotenv needs to be installed for the example scripts to run
1 parent 521da32 commit f03f454

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ OKX_API_KEY=<key>
3030
OKX_API_PASSPHRASE=<passphrase>
3131
OKX_API_SECRET=<secret>
3232
```
33-
API credentials are stored in a ```.env``` file for security reasons. It is not advisable to include API credentials directly in source code or to provide them as command line arguments.
33+
API credentials are stored in a ```.env``` file for security reasons. It is not advisable to include API credentials directly in source code or to supply them as command line arguments.
3434

3535
### Run examples
36-
Import and instantiate the API wrapper class ```AsyncTradeAPI```, which is used for order placement, as follows
36+
Import and instantiate the API wrapper class ```AsyncTradeAPI```, which is used for order placement, as shown below. You may first need to run ```pip install python-dotenv``` to install the ```dotenv``` package on your system.
3737
```
3838
import os
3939
from dotenv import load_dotenv
@@ -43,8 +43,8 @@ load_dotenv()
4343
4444
tradeAPI = AsyncTradeAPI(os.getenv("OKX_API_KEY"), os.getenv("OKX_API_SECRET"), os.getenv("OKX_API_PASSPHRASE"), flag="0", debug=False)
4545
```
46-
The other API classes can be instantiated similarly. Note that by default ```flag="1"```, which is the OKX demo environment, and ```debug=True```.
46+
The other REST API classes can be instantiated similarly. Note that by default ```flag="1"```, which is the OKX demo environment, and ```debug=True```.
4747

48-
The ```example_order_book.py``` script included in the Github repository prints the order book for the XCH-USDT spot market to a depth of 20 levels.
48+
For a complete example see the ```example_order_book.py``` file included in the Github repository. The script prints the order book for the XCH-USDT spot market to a depth of 20 levels.
4949

5050
Also make sure to check out the documentation of ```python-okx```, and the additional [examples](https://github.com/okxapi/python-okx/example) included in that repository.

example_order_book.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import asyncio
3-
from dotenv import load_dotenv
3+
from dotenv import load_dotenv # 'pip install python-dotenv' to install this package
44
from pprint import pprint
55

66
from okx_async.AsyncMarketData import AsyncMarketAPI

0 commit comments

Comments
 (0)