Python

  • You do not have permissions to view this page - please try logging in.

Version as of 12:38, 29 Mar 2026

to this version.

Return to Version archive.

View current version

Follow these steps to integrate the Shared Data Access System in your Python code. All the examples were successfully tested in Windows and some linux distributions like Gentoo, Fedora and Red Hat.

Download the libraries

Download the following libraries into a folder of your system:

Download a Python Numeric package

In case you don’t already a numeric Python package installed in your system (Numpy, numarray or Numeric )
Download Numpy

Set the PYTHONPATH

:sdas:documentation:windows.gif

:sdas:documentation:linux.gif
Supposing you have the sdas directory in /home/user/python :

export PYTHONPATH ="/home/user/python/sdas"

Get a connection to the sdas server

In a the python interpreter:

>>> from sdas.core.client.SDASClient import SDASClient
>>> from sdas.core.SDAStime import Date, Time, TimeStamp
>>> host='baco.ipfn.ist.utl.pt'
>>> port=8888
>>> client = SDASClient(host,port)

Search events

>>> found = client.searchDeclaredEventsByName('S');

>>> found = client.searchDeclaredEventsByName('SHOT', 'pt');

>>> found = client.searchDeclaredEventsByUniqueID('SHOT', 'pt');

>>> found = client.searchDeclaredEventsByDescription('SHOT');

>>> found = client.searchDeclaredEventsByDescription('SHOT', 'pt');

>>> for item in found:
>>>     print 'item', item
>>> max = client.searchMaxEventNumber('0x0000')

>>> min = client.searchMinEventNumber('0x0000')
Powered by MindTouch Core