NEUE LINEMETRICS WEBSEITE ONLINE! www.linemetrics.com

Bereich Entwickler

Übersicht > Entwickler > API > SDKs > Python SDK > Beispiel 1

Beispiel 1

Letzte Änderung am 16.08.2017

Dieser Artikel zeigt einige Beispiele zur Verwendung der Python SDK.

Beispiel 1:

Laden eines Objektes mit allen Messpunkten mit Letztwert

Laden eines Objekts mit Custom-Key

import lmapi
from lmapi.LMApi import LMApi        
   
# client instanciation, auth-tokens will automatically be renewd if necessary
client = LMApi(your_api_client_id, your_api_client_secret)
   
# load a single asset with custom-key
asset1 = client.load('mycustomkey')

Laden aller Messpunkte dieses Objektes

# from this asset load all datastreams and then their latest value
datatstreams = asset1.load_datastreams()

Laden des Letzwertes der Messpunktes

for ds in datastreams:
       print(ds.load_last_value())

Gesamtes Codebeispiel

import lmapi
from lmapi.LMApi import LMApi        
   
# client instanciation, auth-tokens will automatically be renewd if necessary
client = LMApi(your_api_client_id, your_api_client_secret)
   
# load a single asset with custom-key
asset1 = client.load('mycustomkey')
   
# from this asset load all datastreams and then their latest value
datatstreams = asset1.load_datastreams()
   
for ds in datastreams:
       print(ds.load_last_value())

Nichts im Service Center gefunden?

Wenn Sie bereits die Suchfunktion versucht haben, können Sie gerne mit uns in Kontakt treten.