Skip to main content

Reactive Markets Platform SDK Python

The Reactive Platform SDK for Python.

Getting Started

Install

The package only support python3.7 and python3.8, not for lower versions.

Install the package in a python environment:

$ pip install reactive-platform

Uninstall the package:

$ pip uninstall reactive-platform

Using REST API

The REST API has endpoints for various kinds of data from platform, e.g. orders, analytics and references. This package now only supports querying reference data. To access the platform, a API token must be granted from platform UI.

Create a REST client

Create a client first:

from reactive.platform.rest.client import Client

api_key = 'xxx'
url = "https://api.platform.reactivemarkets.com"
rc = Client(url=url, api_key=api_key)

Reference Data

Reference data includes asset, instrument, venue and markets. Get those data:

asset_ref = rc.fetch_asset_ref()
# json format assets reference data
assets = asset_ref.to_json()
print("asset reference:\n", assets)
# dict format assets
assets_dict = asset_ref.to_dict()
print("assets dict:\n", assets)

# instr reference
instr_ref = rc.fetch_instr_ref()
instrs = instr_ref.to_json()
print("instrument reference:\n", instrs)

# venue reference
venue_ref = rc.fetch_venue_ref()
venues = venue_ref.to_json()
print("venue reference:\n", venues)

# market reference
market_ref = rc.fetch_market_ref()
markets = market_ref.to_json()
print("market reference:\n", venues)

If client uses pandas, the reference data can be viewed in a Dataframe table in jupyter-notebook:

import pandas as pd

df = pd.read_json(market_ref.to_json())
df

Platform WebSocket API

The websocket feed provides real-time level 2 market data snapshots, public trades and liquidation via

wss://api.platform.reactivemarkets.com/feed

WebSocket Client

To access the platform via web socket, create a Client which manages the web socket connection and provides methods to access the platform. See the example in example/wsclient.py.

The message protocol is Flatbuffers, which provides an efficient serialization/deserializaton mechanism in terms of both processing and space requirements. The flatbuffer message python API for the platform is in the reactive-papi package.

Client decodes receiving messages into reactive.papi.Message.Message and allow user to apply user defined data_handler call back to handle the flatbuffer message.

Create a FeedClient

The platform-py also provides another option, FeedClient.

from reactive.platform.feed.client import FeedClient

api_key = 'xxx'
addr = "wss://api.platform.reactivemarkets.com/feed"
feed_client = FeedClient(addr=addr, api_key=api_key)

FeedClient provides methods subscribe and unsubscribe to control sending request to platform, and implement python classes in reactive.platform.feed subpackage for corresponding flatbuffer message types. see a full example in example/marketdata.py or example/trade. The client can specify book view parameters in the request. Currently, the feed gateway supports, book depths (1, 5, 10, 20), tick grouping (1, 50), and frequency integer (1 or a larger number).

Metadata

Release files for reactive-platform 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reactive-platform 0.3.0
File Size Uploaded Provenance Actions
reactive-platform-0.3.0.tar.gz 24.3 kB Without provenance Details for reactive-platform-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reactive-platform 0.3.0
File Interpreter ABI Platform Actions
reactive_platform-0.3.0-py3-none-any.whl Python 3 none any Details for reactive_platform-0.3.0-py3-none-any.whl

Total release size: 61.0 kB

Release files / reactive-platform-0.3.0.tar.gz

Download URL reactive-platform-0.3.0.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b25ad31f2d6878e11a95199ad773968a69aa832d9328947e14c0be0e14d81db6
BLAKE2b-256 checksum
How to use checksums
327f8d253e6c6810826f30b5b22d0e16d79e683170e37bd8ba99eadd7bb5f68a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release files / reactive_platform-0.3.0-py3-none-any.whl

Download URL reactive_platform-0.3.0-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b660752c6413d870233d1f65c32f62c8befabfc6e349e0aa39a642870dd614f
BLAKE2b-256 checksum
How to use checksums
7455ca053241588b106125d81ffb8cb9bd18b47d22ac2abb5ac90f6f942b1aac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Security for reactive-platform 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page