IG streaming API client
Small Python library to connect to IG streaming API (more information and API reference is available on IG Labs website).
Installation
To use most recent release:
pip install ig-streaming-client
To use current master branch:
pip install git+https://github.com/wjszlachta/ig-streaming-client.git
Usage
For demo account:
import time
from ig_streaming_client import IgStreamingSession
from lightstreamer_client import LightstreamerSubscription
api_key = '...'
account_id = '...'
rest_api_username = '...'
rest_api_password = '...'
session = IgStreamingSession(api_key, account_id, rest_api_username, rest_api_password)
subscription = LightstreamerSubscription('MERGE',
['MARKET:CS.D.BITCOIN.TODAY.IP'],
['UPDATE_TIME', 'BID', 'OFFER'])
subscription.addlistener(lambda item: print(item))
session.subscribe(subscription)
time.sleep(30)
session.log_out()
For live account:
import time
from ig_rest_client import IG_REST_TRADING_API_LIVE_URL
from ig_streaming_client import IgStreamingSession
from lightstreamer_client import LightstreamerSubscription
api_key = '...'
account_id = '...'
rest_api_username = '...'
rest_api_password = '...'
session = IgStreamingSession(api_key, account_id, rest_api_username, rest_api_password, rest_api_url=IG_REST_TRADING_API_LIVE_URL)
subscription = LightstreamerSubscription('MERGE',
['MARKET:CS.D.BITCOIN.TODAY.IP'],
['UPDATE_TIME', 'BID', 'OFFER'])
subscription.addlistener(lambda item: print(item))
session.subscribe(subscription)
time.sleep(30)
session.log_out()
Metadata
Release files for ig-streaming-client 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ig-streaming-client-0.1.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ig_streaming_client-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.3 kB
Release files / ig-streaming-client-0.1.tar.gz
| Download URL | ig-streaming-client-0.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbb94cba0400395a399e1a17470e5154f98059681600494b667dc8b35a663d8f
|
|
BLAKE2b-256 checksum How to use checksums |
b98d75c783c151e622e1e36ade47d959db761311b9e226db1535465c03d69d12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Release files / ig_streaming_client-0.1-py3-none-any.whl
| Download URL | ig_streaming_client-0.1-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
389d9ba4d1f738a014206c035abb95ca4d72904f0f2fe5f63d01cf25aa339ed3
|
|
BLAKE2b-256 checksum How to use checksums |
d1fd39f16155f15352083616ef32bf79a47af768de6ed73c07b58383d65f714a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|