Skip to main content

EZX API client and message library for communicating with the iServer.

Project description

EZX API

EZX Api Network Client, messages and library functions for sending and receiving orders to the EZX iServer. Release Notes can be viewed here: CHANGELOG-API.md.

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.

Interactive Mode

	from interactive import * #this creates an interactive connection to the iserver
	
	
	# send an order
	from iserver.msgs.convenience_msgs import *
	order = NewOrder('ZVZZT',1,100,1.25,'SIMU')
	client.send_message(order)
	
	# type: show_help() to display avaialble functions in the interactive environment
	
	Available functions: (type help(function name) to see the parameters for the function.):
	----------------------------------------------------------------------------------------
	connect - Connect to the iserver.
	stop - Disconnect from the iserver.  You will need to call the connect method again to reconnect.
	status - Indicates connection status. if connected=True, then the client is logged in to the iserver.
	show_help - Displays information about available functions.
	----------------------------------------------------------------------------------------
	
	 status()
	 iserver client connected=True. company=EROOM, user=test1
	 
	 # Replace an order
	 client.send_message(ReplaceOrder(551, -1.24, 60))
	 
	 # Cancel an order
	 client.send_message(CancelOrder(551))
	 
	 # disconnect
	 stop()
	 
	

More...

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


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-1.1.2.tar.gz (59.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezx_pyapi-1.1.2-py3-none-any.whl (111.3 kB view details)

Uploaded Python 3

File details

Details for the file ezx_pyapi-1.1.2.tar.gz.

File metadata

  • Download URL: ezx_pyapi-1.1.2.tar.gz
  • Upload date:
  • Size: 59.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ezx_pyapi-1.1.2.tar.gz
Algorithm Hash digest
SHA256 bddabb1820523cbeaf03fce62d9ceb68c50936d29f3a5fd11529f36d5c94a27f
MD5 c40353dd92eb44c73269cf5474245194
BLAKE2b-256 9c00a01661eee242568abf6184d905f0b38864c7e88788352bbb5ebb39a43014

See more details on using hashes here.

File details

Details for the file ezx_pyapi-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: ezx_pyapi-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 111.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ezx_pyapi-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2e97895b6fc3684728479b1e60cbb8fe0b3f22a2e12b9bee8a1d3e6a3500fde
MD5 935da2ac093c3d66730946a4c8a0bc4c
BLAKE2b-256 9ec2c02db8ae78ac2eb10f3c2dcb832e90361c224e22e951b55badf0cac3665f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page