Python Reference Guide

The smis Python package provides a simple interface to access Autodesk InfraWorks 360 Model Information Service, which exposes a REST API to access model data from Autodesk InfraWorks 360 models stored in the cloud. The package removes the complexity of authorizing an application to use the service and simplifies the process of sending HTTP requests to the service to access the resource information.

smis.connect(key, secret, login_callback)[source]

This function authorizes the application to access.

Parameters:
  • key – Consumer key for an authorized application.
  • secret – Consumer secret for an authorized application.
  • login_callback – Login callback to authenticate user.
Returns:

Client object that provides interface to access the service

The following example shows the connect method use:

import smis

def my_login_callback(url):
    # display provided url to allow user to enter credentials.
    #
    show_browser(url) # not implemented

client = smis.connect('consumer-key', 'consumer-secret', my_login_callback)
class smis._client.Client(service)[source]

Model Information Service client application.

This class is provided as entry point for all interfaces that communicate with the Autodesk InfraWorks 360 Model Information Service. The class is instantiated with a service proxy that knows how to communicate with the on-line service REST API.

Client applications should not instantiate this class directly, and they should use the connect() method instead to access the Client object.

get()[source]

Returns the service payload.

Returns:Returns the service end-point payload as a python object (a dict).

Todo

Finalize behavior and complete documentation with sample code.

response

Returns the response object from the service. This property returns None if get() has not been invoked yet. The property becomes handy in case of exceptions where it can provide more information about what went wrong.

Returns:The response object from accessing the client end-point.
url

Provides the end-point URL of the Autodesk InfraWorks 360 Model Information Service.

Returns:A string containing the URL to the Autodesk InfraWorks 360 Model Information Service.

Todo

Provide sample code.

class smis._client._Resource(url_token, service, parent=None)[source]

This internal class is accessed through the Client interface an allows accessing resources in the service.

get()[source]

Provides the resource representation as a python object (dict for single resources, list for collections).

Returns:Returns the resource representation.

Todo

Finalize behavior and complete documentation with sample code.

item(identity)[source]

Temporary item() method documentation. :param identity: :return:

Todo

Finalize behavior and complete documentation with sample code.

path

Provides the relative path to the resource from the base end-point.

Returns:Returns a string containing the relative path to the resource.

Todo

Provide sample code.

response

Returns the response object for the resource. This property returns None if get() has not been invoked yet. The property becomes handy in case of exceptions where it can provide more information about what went wrong.

Returns:The response object from accessing the resource.
url

Provides the full URL to the resource.

Returns:A string containing the full URL to the resource.

Todo

Provide sample code.