Python lib for bx.in.th market
Project description
# Library for bx.in.th
## Description
Python library for bx.in.th api.
## Requirements
- [python 3.6+](https://www.python.org/download/releases/3.6.0/)
- [pyotp](https://github.com/pyotp/pyotp)
- [requests](https://github.com/requests/requests/)
## Installation
```bash
$ pip install bxinth
```
## Usage
```python
from bxinth import BxIn, pairs
bx = BxIn('api_key', 'api_secret', 'otp')
# get orderbook
book = bx.orderbook(pairs.THBBTC)
bids = book['bids']
asks = book['asks']
# make order
order_id = bx.order(pairs.THBBTC, 1, 33000)['order_id']
# cancel order
bx.cancel(pairs.THBBTC, order_id)
```
## Testing
Add src/config_test.py file with
```python
API_KEY = 'api_key'
API_SECRET = 'api_secret'
OTP = 'otp'
```
and run
```bash
$ python -m unittest
```
## Description
Python library for bx.in.th api.
## Requirements
- [python 3.6+](https://www.python.org/download/releases/3.6.0/)
- [pyotp](https://github.com/pyotp/pyotp)
- [requests](https://github.com/requests/requests/)
## Installation
```bash
$ pip install bxinth
```
## Usage
```python
from bxinth import BxIn, pairs
bx = BxIn('api_key', 'api_secret', 'otp')
# get orderbook
book = bx.orderbook(pairs.THBBTC)
bids = book['bids']
asks = book['asks']
# make order
order_id = bx.order(pairs.THBBTC, 1, 33000)['order_id']
# cancel order
bx.cancel(pairs.THBBTC, order_id)
```
## Testing
Add src/config_test.py file with
```python
API_KEY = 'api_key'
API_SECRET = 'api_secret'
OTP = 'otp'
```
and run
```bash
$ python -m unittest
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bxinth-0.1.2.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file bxinth-0.1.2.tar.gz
.
File metadata
- Download URL: bxinth-0.1.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.2 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 530c02470fd4c03683d11546ce4d519ccbc51f3e58176b6d9d86bb961491f6ee |
|
MD5 | 761c618d3cba2e7b6e7161be426f6a3e |
|
BLAKE2b-256 | 30ba9c2a8eba2989b7def11c5633ead1f2b73b32307b572fae2c23fd79fde040 |
File details
Details for the file bxinth-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: bxinth-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.2 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8613f0dc36632126eb32cae27a881d7023c9dc3dabcfb1af8035de18a832b0be |
|
MD5 | d4cef587682922a16af718c1e5ac47c1 |
|
BLAKE2b-256 | 57d4b670a4f898badcb170eba9624bd379f6b3951d3e8be719ac91924d94dac4 |