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.0.1.tar.gz (59.0 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.0.1-py3-none-any.whl (109.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezx_pyapi-1.0.1.tar.gz
  • Upload date:
  • Size: 59.0 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.0.1.tar.gz
Algorithm Hash digest
SHA256 aaa62f32c6df0a8ad56b7290a5bf3415ddeff20fed66e0eff3fcf0d48a511fc2
MD5 0f7d877273cb6ea4766f923c6896054f
BLAKE2b-256 4e53e074ce847b96d80411057770a2c9993a86e81b3a64ed4712e173b7ef17d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezx_pyapi-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 109.5 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1263d182ee76f934dbb1798cc6121281bfde934059118b7e06bc5361e1045a61
MD5 62dd928ca93c6e7c6deaec8368e5d338
BLAKE2b-256 50745b47d0e10a50b386697eaec65d5672098bfa8fb318b4bc3115766688ac75

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