No project description provided
Project description
EZX API
EZX Api Network Client, messages and library functions for sending and receiving orders to the EZX iServer.
Installing
pip install ezx-pyapi
Usage
The iServer API is not really designed to be run interactively, although it is possible to do it, as shown below. The easiest way to familiarize yourself with the API is to download and run the sample API app, ezx-sample-py, from Github.
import logging
FORMAT='%(asctime)s %(levelname)s: Thread-%(thread)d %(name)s %(funcName)s %(message)s'
logging.basicConfig(level=logging.INFO,format=FORMAT,stream=sys.stdout,force=True)
from iserver.net import ConnectionInfo,ApiClient
info = ConnectionInfo(host='192.168.1.218',company='FEIS',user='igor',password='igor', port=15000)
client=ApiClient(info)
client.start()
# send an order
from iserver.msgs.convenience_msgs import NewOrder
order = NewOrder('ZVZZT',1,100,1.25,'SIMU')
client.send_message(order)
The default message handler just prints the responses from the server. You can set your own handler as follows:
from iserver.msgs.OrderResponse import OrderResponse
responses = []
import iserver.net
def my_msg_handler(msg_subtype: int, msg: EzxMsg):
iserver.net.empty_msg_handler(msg_subtype, msg) # print the message
# write your handling logic here.
responses.append(msg)
client._msg_handler = my_msg_handler # normally this is set in the ApiClient constructor
client.send_message(order)
Also see the EZX API Quick Start Guide for more details on the API.
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
ezx-pyapi-0.4.2.tar.gz
(57.1 kB
view details)
File details
Details for the file ezx-pyapi-0.4.2.tar.gz.
File metadata
- Download URL: ezx-pyapi-0.4.2.tar.gz
- Upload date:
- Size: 57.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daecd6e1be326a813736c95920c26ace9045c030cd96b6f5f15d740a20e52965
|
|
| MD5 |
537a111dc05c966fabbd4ae18f4817e9
|
|
| BLAKE2b-256 |
5723cd309d3cb6a1e39df9d920dcc41c9eb4e3128709ddbe0ac4f6d666467782
|