Skip to content

Commit ed57067

Browse files
committed
Update README with exchange repository links
1 parent 12a1444 commit ed57067

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# binance-python
2+
Python SDK (sync and async) for Binance with Rest and WS capabilities.
3+
4+
You can check Binance's docs here: [Docs](https://ccxt.com)
5+
6+
7+
You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/binance)
8+
9+
*This package derives from CCXT and allows you to call pretty much every endpoint by either using the unified CCXT API or calling the endpoints directly*
10+
11+
## Installation
12+
13+
```
14+
pip install binance
15+
```
16+
17+
## Usage
18+
19+
### Sync
20+
21+
```Python
22+
from binance import BinanceSync
23+
24+
def main():
25+
instance = BinanceSync({})
26+
ob = instance.fetch_order_book("BTC/USDC")
27+
print(ob)
28+
#
29+
# balance = instance.fetch_balance()
30+
# order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)
31+
```
32+
33+
### Async
34+
35+
```Python
36+
import asyncio
37+
from binance import BinanceAsync
38+
39+
async def main():
40+
instance = BinanceAsync({})
41+
ob = await instance.fetch_order_book("BTC/USDC")
42+
print(ob)
43+
#
44+
# balance = await instance.fetch_balance()
45+
# order = await instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)
46+
47+
asyncio.run(main())
48+
```
49+
50+
### Websockets
51+
52+
```Python
53+
from binance import BinanceWs
54+
55+
async def main():
56+
instance = BinanceWs({})
57+
while True:
58+
ob = await instance.watch_order_book("BTC/USDC")
59+
print(ob)
60+
# orders = await instance.watch_orders("BTC/USDC")
61+
```
62+

0 commit comments

Comments
 (0)