Python SDK Problems

Python SDK Problems

@Andreas Gudmundsson

I’ve been using the NodeJS SDK for almost a year now and am very comfortable with how it works. I wanted to implement the Python SDK to some pre-existing code but have had a lot of problems with running them externally.

I created a sample Python file which gets 2 values from a device and prints them. When running as an Analysis within Tago, it originally worked but now says:

[2021-05-27 13:11:42] [TagoIO Analysis] init function not found
[2021-05-27 13:11:41] Starting analysis .....

Here is a screenshot of CMD when I attempt to run it on my machine. I have been unable to get a “Connected” message,

The traceback occurs when I use CTRL-C to exit and points to this:

Analysis('ANALYSIS-TOKEN').init(myFunction);

The Python SDK documentation has been pretty disappointing; the articles that should explain how to do this are incorrect or document the JavaScript SDK.

This Python page mentions using npm and the module.exports JavaScript format. https://docs.tago.io/en/articles/367

This page refers to Python analysis in general, but does not seem to work: https://docs.tago.io/en/articles/363-python-analysis-setting-up-analysis

It says that the syntax is: *new Analysis(/function/, /analysis_token/)*
but the sample code says: Analysis(ANALYSYS_TOKEN).init(my_analysis)

Any ideas where I should look or what I should try? Thanks for any assistance.