Skip to main content

The Connection object

The Connection class is one of the most important parts of the Python ArupCompute client. It controls all authentication and most settings related to the client. It is a required input in most other functions related to ArupCompute.

This object also controls when to use AC Local.

Older authentication methods

The Connection object also replaces the old authentication methods. If you are working on an older Python script that has not yet updated to use the Connection object then you should perform this upgrade as older authentication methods may stop working.

Constructor properties

NameDescriptionDefault
jobnumber: strThe job number to use for all calculations run with this Connection instanceN/A, value must be provided
id: strThe name of the environment variable that contains the Azure Client Id that should be used for authentication, in most cases this should not be changedCOMPUTE_CLIENTID
secret: strThe name of the environment variable that contains the Azure Client Secret that should be used for authentication, in most cases this should not be changedCOMPUTE_CLIENTSECRET
serverConfig: ServerConfigA set of settings for use when the Python Client is running on a server, more info on this object can be found hereNone

Example use

The Connection object is very easy to use. In most cases, simply create and instance, pass in your job number, and then pass it into any method that requires it. The object will handle all authentication and find where to send your request for you.

Creating the object:

jobNumber = "00000000" # please use a real job number

connection = arupcomputepy.Connection(jobNumber)