Sg.create() ...path?

Hi guys,
I am trying to use sg.create() instead of sgtk.util.register_publish().
I have a small problem with a path. I am not sure how to add it to the dictionary for sg.create().

an example:

path = '/a/b/'
  {"path":{"local_path_windows": path}

Does anyone know what should be there?



Hi @lukasb,

Here is the Python API documentation for the create method.

First off, I’m noticing that you’re missing the entity type in your create() call. The entity type is the first argument to the method.

Given that you’re trying to set the path value and that you mentioned register_publish(), I’ll go ahead and assume that you want to create a PublishedFile record. To do this, you’d need a call that looks like this:

data = {
  'code': 'someFile',
  'path': {
    'link_type': 'local',
    'local_path': '/a/b/'
  'project': {'type':'Project', 'id':project_id}
sg.create('PublishedFile', data)

Let me know if this sets you down the right path.