Tutorial: Introduction

Author:

Stefan Eletzhofer

Date:

2012-05-22

Installation

Before starting the tutorial, you need to install the API to your local computer. This is easily done:

$ pip install nexiles.tools.api

Note

we do not have a official build yet, so please see installation-source-develop

This should install nexiles.tools.api and it’s dependencies on your machine. Let’s verify that by importing the module. Fire up the Python REPL and try to import the package:

$ python
>>> import nexiles.tools.api

This should not raise a error. If you get a ImportError exception, then verify that you have the correct python in path and that the installation of the package worked.

Connecting and getting the API object

For all the following examples, you need to have API object which holds the base URL and your authentication information. To get hold of the API object, you use the nexiles.tools.api.get_api() function:

>>> from nexiles.tools.api import get_api
>>> api = get_api("http://example.com", username="stefan", password="pass")

That’s it – you’re now able to talk to Windchill (TM).