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.1.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.1-py3-none-any.whl (111.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezx_pyapi-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 9aa73bd22da68c840003dad759242735db737f9362e3ce05030b0ca322ddddf6
MD5 63cb1ac868a6c2bf1c2a0a81fcd704ba
BLAKE2b-256 398edea916928896be39eb61ac2b6c6afc7b6ea3106238d3a8460abcf8b6af13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezx_pyapi-1.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a5d426a72df10a341fd0aa34ad582c4e95b8dd6f22d36aee7939d8fa50fcd67
MD5 137607fc2ea28f3793cb4e4012330b70
BLAKE2b-256 1880014d1297f04fa6e43bb283e0fd967a6ecefddfff05250b4d616bba8bb1d9

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