Bitmex websocket API
Project description
bitmex-websocket
==========================
[![Build Status](https://travis-ci.org/joliveros/bitmex-websocket.svg?branch=master)](https://travis-ci.org/joliveros/bitmex-websocket)
[![Requires.io](https://requires.io/github/joliveros/bitmex-websocket/requirements.svg?branch=master)](https://requires.io/github/joliveros/bitmex-websocket/requirements?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/joliveros/bitmex-websocket/badge.svg?branch=master)](https://coveralls.io/github/joliveros/bitmex-websocket?branch=master)
Bitmex Websocket API Wrapper
## Install
```bash
pip install bitmex-websocket
```
## Usage
1. First you should set your `BITMEX_API_KEY` and `BITMEX_API_SECRET`. It can
be done as follows:
```bash
$ cp .env.example .env
# edit .env to reflect your API key and secret
$ source .env
```
1. Then in your project you can consume `Instrument` as follows:
```python
from bitmex_websocket import Instrument
import asyncio
import websocket
websocket.enableTrace(True)
XBTH17 = Instrument(symbol='XBTH17',
# subscribes to all channels by default, here we
# limit to just these two
channels=['margin', 'orderBook10'],
# you must set your environment variables to authenticate
# see .env.example
shouldAuth=True)
# Get the latest orderbook
orderBook10 = XBTH17.get_table('orderBook10')
# subscribe to all action events for this instrument
XBTH17.on('action', lambda x: print("# action message: %s" % x))
loop = asyncio.get_event_loop()
loop.run_forever()
```
## Examples
Run example scripts:
```bash
RUN_ENV=test python -m examples.example-1
```
## Tests
Testing is set up using [pytest](http://pytest.org) and coverage is handled
with the pytest-cov plugin.
Run your tests with ```py.test``` in the root directory.
Coverage is ran by default and is set in the ```pytest.ini``` file.
To see an html output of coverage open ```htmlcov/index.html``` after running the tests.
==========================
[![Build Status](https://travis-ci.org/joliveros/bitmex-websocket.svg?branch=master)](https://travis-ci.org/joliveros/bitmex-websocket)
[![Requires.io](https://requires.io/github/joliveros/bitmex-websocket/requirements.svg?branch=master)](https://requires.io/github/joliveros/bitmex-websocket/requirements?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/joliveros/bitmex-websocket/badge.svg?branch=master)](https://coveralls.io/github/joliveros/bitmex-websocket?branch=master)
Bitmex Websocket API Wrapper
## Install
```bash
pip install bitmex-websocket
```
## Usage
1. First you should set your `BITMEX_API_KEY` and `BITMEX_API_SECRET`. It can
be done as follows:
```bash
$ cp .env.example .env
# edit .env to reflect your API key and secret
$ source .env
```
1. Then in your project you can consume `Instrument` as follows:
```python
from bitmex_websocket import Instrument
import asyncio
import websocket
websocket.enableTrace(True)
XBTH17 = Instrument(symbol='XBTH17',
# subscribes to all channels by default, here we
# limit to just these two
channels=['margin', 'orderBook10'],
# you must set your environment variables to authenticate
# see .env.example
shouldAuth=True)
# Get the latest orderbook
orderBook10 = XBTH17.get_table('orderBook10')
# subscribe to all action events for this instrument
XBTH17.on('action', lambda x: print("# action message: %s" % x))
loop = asyncio.get_event_loop()
loop.run_forever()
```
## Examples
Run example scripts:
```bash
RUN_ENV=test python -m examples.example-1
```
## Tests
Testing is set up using [pytest](http://pytest.org) and coverage is handled
with the pytest-cov plugin.
Run your tests with ```py.test``` in the root directory.
Coverage is ran by default and is set in the ```pytest.ini``` file.
To see an html output of coverage open ```htmlcov/index.html``` after running the tests.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for bitmex_websocket-0.1.0-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2048a96530284373f574f3b640ed83da03c0149df570d091a6bd007d2f83e128 |
|
MD5 | 1ac8f6a822eab27bc88def206671362f |
|
BLAKE2b-256 | 9e993e2fd5465ad9f71b7f302c9d07b9b74b76f6d998c369821c51bf0cb7d348 |
Close
Hashes for bitmex_websocket-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6669055b9fce61f4f61d907dc491ebd4ef7bcd2555ba5b9e8c9f9050337a8ae |
|
MD5 | 80b4595dc41a24847144166f94b218a7 |
|
BLAKE2b-256 | 492ae520211a2aef43d01f8e6c8c85a4860b90329fa5f9fa5128284679e116e4 |