Upsert to an entity type directly from python function


For 7.8.2+ server, can I upsert to an entity type directly in python?

def myFunc():
  //type.upsert({id: XXX})?
  //c3.type.upsert({id: XXX})?
  //do I need to import any package? pyc3?


You don’t need to import pyc3. The variable c3 is always available in python server code (don’t override it!).

To upset an instance:

my_object = c3.MyType(**kwargs)


read more Call C3 IoT from Python