Duplicate an entity via Python API

Is there a simple way in the API to duplicate an entity with all field values? (i.e. Duplicate a single Asset)
From the API, it seems the steps would be:

  1. Get the schema of the entity
  2. Determine editable fields by iterating over schema, discarding non-editable fields
  3. Find the single source Asset, supplying editable schema as fields argument
  4. Create a new Asset, supplying the list of fields/values from the Find result above

Is there an easier/faster way?

Hi @schicky,

I don’t think there is a simpler way to do this unfortunately, the duplicate selected in the webUI doesn’t really have a counterpart in the API, you would need to do the steps much like you have mentioned above.

You might be able to streamline this with a Shotgun.schema_field_read() call, but still will need a bit of massaging to get all the values you want.