Skip to main content

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.

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.0.tar.gz (59.6 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.0-py3-none-any.whl (111.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ezx_pyapi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d19907c23dbffc5673ada46a53ef237951c0c87597c8b3effa36c1d1bb8ae88a
MD5 2cd9973910e45439228de8961a07f6f0
BLAKE2b-256 44f49a0614eb21dd06f6f844619d8d84ad713dcff6f8217e38be3b363883fb1a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ezx_pyapi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f843ece840184d62238f3dec85208f87777df55ae5e695d7a7800dba6ae9e32a
MD5 c9c3b80e9ab8c208250dadc5f635a46c
BLAKE2b-256 fc13233a168d75868c0df2044d04fcf017474d7fa23b33658b06f0e27bc3a1c2

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