Module: __init__.py

Author:

Stefan Eletzhofer

Date:

2012-05-17

Abstract

This is the main module.

Usage Example

Getting the ‘api’ object

To get the API use get_api() function:

>>> from nexiles.toola.api import get_api
>>> api = get_api("http://example.com", "fred", "kaputnik")

Getting a resource object

First get the api:

>>> from nexiles.toola.api import get_api, get_resource
>>> api = get_api("http://example.com", "fred", "kaputnik")

then the resource using the nexiles.tools.api.get_resource() function:

>>> documents_resource = get_resource(api, "documents")

Module Documentation

nexiles.tools.api.get_api(base_url, username, password) api

Initializes and returns a new client API object.

Parameters:
  • base_url – the base URL, e.g. the Windchill App root

  • username – the user name

  • password – the password

Returns:

New API object

nexiles.tools.api.get_resource(api, resource_type) resource

Returns a resource object for the given resource string.

Parameters:
  • api – The API object – see get_api()

  • resource_type – The resource type string – see Resources

Returns:

resource

nexiles.tools.api.get_root_api(base_url, username, password) api

Initializes and returns a new client API object.

Parameters:
  • base_url – the base URL, e.g. the Windchill App root

  • username – the user name

  • password – the password

Returns:

New API object

nexiles.tools.api.get_service(base_url, service, username, password) api

Initializes and returns a new client service object.

Parameters:
  • base_url – the base URL, e.g. the Windchill App root

  • service – the service name

  • username – the user name

  • password – the password

Returns:

New API object