-
Notifications
You must be signed in to change notification settings - Fork 0
Reference: Methods
Available API methods
- Shotgun()
- find()
- find_one()
- create()
- update()
- delete()
- revive()
- batch()
- upload()
- upload_thumbnail()
- download_attachment()
- schema_read()
- schema_field_read()
- schema_entity_read()
- schema_field_delete()
- schema_field_update()
- schema_field_create()
dictShotgun(stringbase_url,stringscript_name,stringapi_key,stringapi_ver,booleanconvert_datetimes_to_utc,stringhttp_proxy)
Constructor to create a new Shotgun instance.
-
stringbase_url (required)
This is the url of the Shotgun server. Make sure you include the 'http:' ('https:' if you are using SSL). Do not include the trailing slash. Example: http://example.shotgunstudio.com. -
stringscript_name (default=None)
The name of the script as defined on the Scripts page in Shotgun (see [setup](https://shotgunsoftware.zendesk.com/forums/31279/entries/21646 Set up Shotgun for API Access) ). -
stringapi_key (default=None)
The api_key this script will use for communicating with the Shotgun server. -
stringapi_ver (default='api3')
The API version to use. This is useful for when we upgrade the Shotgun API, you can incrementally update your scripts to take advantage of the new version of the API one by one. -
booleanconvert_datetimes_to_utc (default=True)
Automatically have the API convert datetimes between local time and UTC. Datetimes are stored in the database in UTC. If this is enabled, it will use local machine settings for timezone and daylight saving time to convert to and from UTC. Make sure they are correct. It is disabled by default to maintain consistency with past versions. -
stringhttp_proxy (default=None)
URL of your proxy server, like http://10.0.0.1:8080
-
dictA Shotgun object
from shotgun import Shotgun
SERVER_PATH = 'http://shotgun.examplestudio.com' # change this to https if your studio uses SSL
SCRIPT_USER = 'trigger_script'
SCRIPT_KEY = '2350acafb1826c92e4121986fe663043b77bb8da'
sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
listfind(stringentity_type,listfilters,listfields, array order,stringfilter_operator,intlimit,booleanretired_only)
Find entities
-
stringentity_type (required)
The entity type to find (in CamelCase format). Example: MocapTake. -
listfilters (required)
An array of array conditions used to filter the find query. You can find the reference for filter values here.- Each condition should be in the format [ column_name, operator, value1(, value2) ] defined as the following:
- column_name (
string): The system name of the column (not the display name) Examples: “code”, “sg_asset_type”. - operator (
string): the operator as it appears in the query builder. Examples: “is”, “is_not”, "between", “in_last”. - value (mixed): The value to compare the column on.
- value2 (optional for some operators) (
int): The second value for column comparison. This value is specified for operators such as ”between”.
-
listfields (default="id")
The column fields to return for the entities.- These are the
internal codes for the columns like sg_asset_type not ”Asset Type”.
- These are the
-
listorder (default=[])
Order results using the provided column and directionstringattributes.- The order parameter takes an array of
dictobjects to allow for multiple sorting rules. Example: [{'field_name':'created_at','direction':'asc'}, {'field_name':'id','direction':'desc'}]. - The default will return the records in whatever order the database returns them by default.
- The order parameter takes an array of
-
stringfilter_operator (default="all")
Controls how the filters are matched. There are only two valid options: all and any. You cannot currently combine the two options in the same query. -
intlimit (default=0)
Limit the number of results returned.- A value of 0 will not limit the results.
-
booleanretired_only (default=False)
Return only retired entities.- By default find() returns ONLY active entities.
- There is no way to return both active and retired entities in the same query.
-
listofdictobjects containing key/value pairs for each column specified in the fields parameter. Returns a minimum of the 'id' and 'type' fields representing the entity type and id of the record(s) returned. For fields that represent links to other entities, the value will be adictobject defining the entity with id, name, type, and valid attributes.
# ----------------------------------------------
# Get Character Assets in Sequence 100_FOO
# ----------------------------------------------
fields = ['id', 'code', 'sg_asset_type']
sequence_id = 2 # Sequence 100_FOO
project_id = 4 # Demo Project
filters = [
['project','is',{'type':'Project','id':project_id}],
['sg_asset_type','is', 'Character'],
['sequences', 'is', {'type':'Sequence','id':sequence_id}]
]
assets= sg.find("Asset",filters,fields)
if len(assets) < 1:
print "couldn't find any assets"
exit(0)
else:
print "Found "+str(len(assets))+" assets"
pprint (assets)example output:
Found 7 assets
[{'code': 'Gopher', 'id': 32, 'sg_asset_type': 'Character', 'type': 'Asset'},
{'code': 'Cow', 'id': 33, 'sg_asset_type': 'Character', 'type': 'Asset'},
{'code': 'Bird_1', 'id': 35, 'sg_asset_type': 'Character', 'type': 'Asset'},
{'code': 'Bird_2', 'id': 36, 'sg_asset_type': 'Character', 'type': 'Asset'},
{'code': 'Bird_3', 'id': 37, 'sg_asset_type': 'Character', 'type': 'Asset'},
{'code': 'Raccoon', 'id': 45, 'sg_asset_type': 'Character', 'type': 'Asset'},
{'code': 'Wet Gopher', 'id': 149, 'sg_asset_type': 'Character', 'type': 'Asset'}]
listfind_one(stringentity_type,listfilters, [listfields,listorder,stringfilter_operator) Find one entity. This is a wrapper for find() with a limit=1.
-
stringentity_type (required)
The entity type to find (in CamelCase format). Example: MocapTake. -
listfilters (required)
An array of array conditions used to filter the find query. You can find the reference for filter values here.- Each condition should be in the format [ column_name, operator, value1(, value2) ] defined as the following:
- column_name (
string): The system name of the column (not the display name). Examples: “code”, “sg_asset_type”. - operator (
string): The operator as it appears in the query builder. Examples: “is”, “is_not”, "between", “in_last”. - value (mixed): The value to compare the column on.
- value2 (optional for some operators) (
int): The second value for column comparison. This value is specified for operators such as ”between”.
-
listfields (default="id")
The column fields to return for the entities.- These are the
internal codes for the columns like sg_asset_type not ”Asset Type”.
- These are the
-
listorder (default=[])
Order results using the provided column and directionstringattributes.- The order parameter takes an array of
dictobjects to allow for multiple sorting rules. Example: [{'field_name':'created_at','direction':'asc', {'field_name':'id','direction':'desc'}]. - The default will return the records in whatever order the database returns them by default.
- The order parameter takes an array of
-
stringfilter_operator (default="all")
Controls how the filters are matched. There are only two valid options: all and any. You cannot currently combine the two options in the same query.
-
dictobject containing key/value pairs for each column specified in the fields parameter. Returns a minimum of the 'id' and 'type' fields representing the entity type and id of the record returned. For fields that represent links to other entities, the value will be adictobject defining the entity with id, name, type, and valid attributes. Note that this differs from find() which returns an array ofdicts.
# ----------------------------------------------
# Find Character Asset
# ----------------------------------------------
fields = ['id', 'code', 'sg_status_list']
asset_id = 32 # Gopher
project_id = 4 # Demo Project
filters = [
['project','is',{'type':'Project','id':project_id}],
['id','is',asset_id]
]
asset= sg.find_one("Asset",filters,fields)
if not asset:
print "couldn't find asset"
exit(0)
else:
pprint (asset)example output:
{'code': 'Gopher', 'id': 32, 'sg_status_
list': 'ip', 'type': 'Asset'}
dictcreate(stringentity_type,dictdata) Create a new entity.
-
stringentity_type (required)
The entity type to create (in CamelCase format). Example: MocapTake -
dictdata (required)
Adictof key/value pairs where key is the column name and value is the value to set for that column. Note that most entities require the project (dict) parameter that designates the project this entity belongs to. -
listreturn_fields (optional)
An array of field names to be returned, in addition to ones being sent in the data param.
-
dictobject containing key/value pairs for each column specified in the fields parameter. For fields that represent links to other entities, the value will be adictobject defining the entity with id, name, type, and valid attributes. Note that this differs from find() which returns an array ofdicts.
# ----------------------------------------------
# Create new Version
# ----------------------------------------------
project_id = 4 # Demo Project
data = {
'project': {'type':'Project','id':project_id},
'code':'JohnnyApple_Design01_FaceFinal',
'description': 'fixed rig per director final notes',
'sg_status_list':'rev',
'entity': {'type':'Asset','id':123},
'user': {'type':'User','id':'165'},
}
version = sg.create("Version",data,return_fields=[''])
pprint(version)example output:
{
'project': {'type':'Project','id':project_id},
'code':'JohnnyApple_Design01_FaceFinal',
'description': 'fixed rig per director final notes',
'sg_status_list':'rev',
'entity': {'type':'Asset','id':123},
'user': {'type':'User','id':'165'}, 'type': 'Version',
}
dictupdate(stringentity_type,intentity_id,dictdata) Update specified entity columns with paired values.
-
stringentity_type (required)
The entity type to update (in CamelCase format). Example: Asset. -
intentity_id (required)
The specific entity id to update. -
dictdata (required)
key/value pairs where key is the column name and value is the value to set for that column.
-
dictentity object with updated values.
# ----------------------------------------------
# Update Asset: link asset to shots and update status
# ----------------------------------------------
asset_id = 55
shots_asset_is_in = [
{'type':'Shot', 'id':'40435'},
{'type':'Shot', 'id':'40438'},
{'type':'Shot', 'id':'40441'}
]
data = {
'shots': shots_asset_is_in,
'sg_status_list':'rev'
}
asset = sg.update("Asset",asset_id,data)
pprint(asset)example output:
{'type': 'Shot',
'id': 55,
'sg_status_list': 'rev',
'shots': [{'id': 40435, 'name': '100_010', 'type': 'Shot', 'valid': 'valid'},
{'id': 40438, 'name': '100_040', 'type': 'Shot', 'valid': 'valid'},
{'id': 40441, 'name': '100_070', 'type': 'Shot', 'valid': 'valid'}]
}
booleandelete(stringentity_type,intentity_id) Retires the entity matching entity_type and entity_id.
-
stringentity_type (required)
The type of entity to delete (in CamelCase format). Example: Asset. -
intentity_id (required)
The id of the specific entity to delete.
-
booleanTrue if entity was deleted successfully.
# ----------------------------------------------
# Delete (retire) Asset
# ----------------------------------------------
result = sg.delete("Asset",23)
pprint(result)example output:
True
booleanrevive(stringentity_type,intentity_id) Revives (un-deletes) the entity matching entity_type and entity_id.
-
stringentity_type (required)
The type of entity to revive (in CamelCase format). Example: Asset. -
intentity_id (required)
The id of the specific entity to revive.
-
booleanTrue if entity was revived successfully. False if the entity was already revived.
# ----------------------------------------------
# Revive (un-retire) Asset
# ----------------------------------------------
result = sg.revive("Asset",23)
pprint(result)example output:
True
listbatch(listrequests) Make a batch request of several create, update, and/or delete calls at one time. This is for performance when making large numbers of requests, as it cuts down on the overhead of roundtrips to the server and back. All requests are performed within a transaction, and if any request fails, all of them will be rolled back.
-
listrequests (required)
Alistofdicts, that are the requests to be batched. The required keys of the `dictionary for each request type are similar to what you pass to the non-batched methods, with the addition of a request_type key to specify which type of request it is.- create:
-
stringrequest_type (required)
The type of request this is. Example: create -
stringentity_type (required)
The entity type to create (in CamelCase format). Example: MocapTake -
dictdata (required)
Adictof key/value pairs where key is the column name and value is the value to set for that column. Note that most entities require the project (dict) parameter that designates the project this entity belongs to.
-
- update:
-
stringrequest_type (required)
The type of request this is. Example: update -
stringentity_type (required)
The entity type to update (in CamelCase format). Example: Asset. -
intentity_id (required)
The specific entity id to update. -
dictdata (required)
Adictof key/value pairs where key is the column name and value is the value to set for that column.
-
- delete:
-
stringrequest_type (required)
The type of request this is. Example: delete -
stringentity_type (required)
The type of entity to delete (in CamelCase format). Example: Asset. -
intentity_id (required)
The id of the specific entity to delete.
-
- create:
-
listcontainingdictionaries, with the results of each batched request in the same order they were passed to the batch method. The return values for each request are the same as for their non-batched methods:- create:
-
dictobject containing key/value pairs for each column specified in the data parameter.
-
- update:
-
dictobject containing key/value pairs for each column specified in the data parameter.
-
- delete:
-
booleanTrue if entity was deleted successfully
-
- create:
# ----------------------------------------------
# Make a bunch of shots
# ----------------------------------------------
batch_data = `list`()
for i in range(1,100):
data = {
"code":"shot_%04d" % i,
"project":project
}
batch_data.append( {"request_type":"create","entity_type":"Shot","data":data} )
pprint( sg.batch(batch_data) )example output:
[{'code': 'shot_0001',
'type': 'Shot',
'id': 3624,
'project': {'id': 4, 'name': 'Demo Project', 'type': 'Project'}},
... and a bunch more ...
{'code': 'shot_0099',
'type': 'Shot',
'id': 3722,
'project': {'id': 4, 'name': 'Demo Project', 'type': 'Project'}}]
# ----------------------------------------------
# All three types of requests in one batch!
# ----------------------------------------------
requests = [
{"request_type":"create","entity_type":"Shot","data":{"code":"New Shot 1", "project":project}},
{"request_type":"update","entity_type":"Shot","entity_id":3624,"data":{"code":"Changed 1"}},
{"request_type":"delete","entity_type":"Shot","entity_id":3624}
]
pprint( sg.batch(requests) )
example output:
[{'code': 'New Shot 1', 'type': 'Shot', 'id': 3723, 'project': {'id': 4, 'name': 'Demo Project', 'type': 'Project'}},
{'code': 'Changed 1', 'type': 'Shot', 'id': 3624},
True]
None upload(
stringentity_type,intentity_id,stringpath, [stringfield_name,stringdisplay_name,stringtag_list]) Uploads a file from a local directory and links it to a specified entity. Optionally assign the file to a specific field. Optionally create a display name for the label.
-
stringentity_type (required)
The entity type to link the uploaded file to (in CamelCase format). Example: MocapTake. -
intentity_id (required)
The id of the specific entity to link the uploaded file to. -
stringpath (required)
The full path to the local file to upload. -
stringfield_name (default="sg_attachment")
Optional name of the field within Shotgun to assign the file to. Must be a field of type File/Link. -
stringdisplay_name (default=None)
Optional text to display as the link to the file. The default is the original file name. -
stringtag_list (default=None)
Optional comma separatedstringof tags to attach to the File entity when it is created in Shotgun.
-
intid of the Attachment created by the upload if it was successful. An error is raised if not.
# ----------------------------------------------
# Upload Latest Quicktime
# ----------------------------------------------
quicktime = '/data/show/ne2/100_110/anim/01.mlk-02b.mov'
shot_id = 423
result = sg.upload("Shot",shot_id,quicktime,"sg_latest_quicktime","Latest QT")
print resultexample output:
72
None upload_thumbnail(
stringentity_type,intentity_id,stringpath) Uploads a file from a local directory and assigns it as the thumbnail for the specified entity.
-
stringentity_type (required)
The entity type to link the thumbnail to (in CamelCase format). Example: MocapTake. -
intentity_id (required)
The id of the specific entity to link the thumbnail to. -
stringpath (required)
The full path to the local thumbnail file to upload.
-
intid of the Attachment entity that was created for the image if thumbnail was uploaded successfully. An error is raised if not.
# ----------------------------------------------
# Upload Thumbnail
# ----------------------------------------------
version_id = 27
thumbnail = '/data/show/ne2/100_110/anim/01.mlk-02b.jpg'
result = sg.upload_thumbnail("Version",version_id,thumbnail)
print resultexample output:
36
Binarydownload_attachment(intentity_id) Returns binary content of Attachment entity with specified id.
-
intentity_id (required)
The id of the Attachment to download.
-
binarycontent of the Attachment entity.
# ----------------------------------------------
# Download Attachment
# ----------------------------------------------
attachment_id = 12
quicktime_file = sg.download_attachment(attachment_id)example output:
None
listschema_read() Returns properties for all fields for all entities.
- none
-
dictA (nested)dictobject containing a key/value pair for all fields of all entity types. Properties that are 'editable': True, can be updated using the schema_field_update method.
# ----------------------------------------------
# Get full Shotgun schema
# ----------------------------------------------
result = sg.schema_read()
pprint(result)example output (edited for brevity):
{'ActionMenuItem': {'entity_type': {'data_type': {'editable': False, 'value': 'text'},
'description': {'editable': True, 'value': ''},
'editable': {'editable': False, 'value': True},
'entity_type': {'editable': False, 'value': 'ActionMenuItem'},
'mandatory': {'editable': False, 'value': False},
'name': {'editable': True, 'value': 'Entity Type'},
'properties': {'default_value': {'editable': False, 'value': None},
'summary_default': {'editable': False, 'value': 'none'}}},
'id': {'data_type': {'editable': False, 'value': 'number'},
'description': {'editable': True, 'value': ''},
'editable': {'editable': False, 'value': False},
'entity_type': {'editable': False, 'value': 'ActionMenuItem'},
'mandatory': {'editable': False, 'value': False},
'name': {'editable': True, 'value': 'Id'},
'properties': {'default_value': {'editable': False, 'value': None},
'summary_default': {'editable': False, 'value': 'none'}}},
...
...
...
'ApiUser': {'created_at': {'data_type': {'editable': False, 'value': 'date_time'},
'description': {'editable': True, 'value': ''},
'editable': {'editable': False, 'value': True},
'entity_type': {'editable': False, 'value': 'ApiUser'},
'mandatory': {'editable': False, 'value': False},
'name': {'editable': True, 'value': 'Date Created'},
'properties': {'default_value': {'editable': False, 'value': None},
'summary_default': {'editable': True, 'value': 'none'}}},
...
...
...
}
listschema_field_read(stringentity_type,stringfield_name) Returns properties for a specified field (or all fields if none is specified) for the specified entity.
-
stringentity_type (required)
The entity type to find (in CamelCase format). Example: HumanUser. -
stringfield_name (optional)
Specifies the field you want. If this parameter is excluded, data structures of *all* fields will be returned.
-
dicta (nested)dictobject containing a key/value pair for the field_name specified and its properties, or if no field_name is specified, for all the fields of the entity_type. Properties that are 'editable': True, can be updated using the schema_field_update method.
# ----------------------------------------------
# Get schema for the 'shots' field on Asset
# ----------------------------------------------
result = sg.schema_field_read('Asset','shots')
pprint(result)example output:
{'shots': {'data_type': {'editable': False, 'value': 'multi_entity'},
'description': {'editable': True, 'value': ''},
'editable': {'editable': False, 'value': True},
'entity_type': {'editable': False, 'value': 'Asset'},
'mandatory': {'editable': False, 'value': False},
'name': {'editable': True, 'value': 'Shots'},
'properties': {'default_value': {'editable': False,
'value': None},
'summary_default': {'editable': True,
'value': 'none'},
'valid_types': {'editable': True,
'value': ['Shot']}}}}
Unlike how the results of a find() can be pumped into a create() or update(), the results of schema_field_read() are not compatible with the format used for schema_field_create() or schema_field_update(). If you need to pipe the results from schema_field_read() into a schema_field_create() or schema_field_update(), you will need to reformat the data in your script.
listschema_entity_read() Returns all active entities and their display names.
-
dicta (nested)dictobject containing key/value containing the names and display names for all active entities.
# ----------------------------------------------
# Get all active entities and their display names
# ----------------------------------------------
result = sg.schema_entity_read()
pprint(result)example output:
{'ApiUser': {'name': {'editable': False, 'value': 'Script'}},
'Asset': {'name': {'editable': False, 'value': 'Asset'}},
'AssetLibrary': {'name': {'editable': False, 'value': 'Asset Library'}},
'Camera': {'name': {'editable': False, 'value': 'Camera'}},
'Candidate': {'name': {'editable': False, 'value': 'Candidate'}},
'CustomEntity01': {'name': {'editable': False, 'value': 'Picture'}},
'CustomEntity02': {'name': {'editable': False, 'value': 'Client'}},
'CustomEntity05': {'name': {'editable': False, 'value': 'Software'}},
'CustomEntity07': {'name': {'editable': False, 'value': 'Hardware'}},
'Cut': {'name': {'editable': False, 'value': 'Cut'}},
'CutItem': {'name': {'editable': False, 'value': 'Cut Item'}},
'DeliveryTarget': {'name': {'editable': False, 'value': 'Delivery Target'}},
'Element': {'name': {'editable': False, 'value': 'Element'}},
'EventLogEntry': {'name': {'editable': False, 'value': 'Event Log Entry'}},
'Group': {'name': {'editable': False, 'value': 'Group'}},
'HumanUser': {'name': {'editable': False, 'value': 'Person'}},
'Launch': {'name': {'editable': False, 'value': 'Launch'}},
'MocapPass': {'name': {'editable': False, 'value': 'Mocap Pass'}},
'MocapSetup': {'name': {'editable': False, 'value': 'Mocap Setup'}},
'MocapTake': {'name': {'editable': False, 'value': 'Mocap Take'}},
'MocapTakeRange': {'name': {'editable': False, 'value': 'Mocap Take Range'}},
'Note': {'name': {'editable': False, 'value': 'Note'}},
'Performer': {'name': {'editable': False, 'value': 'Performer'}},
'PhysicalAsset': {'name': {'editable': False, 'value': 'Physical Asset'}},
'Project': {'name': {'editable': False, 'value': 'Project'}},
'PublishEvent': {'name': {'editable': False, 'value': 'Publish Event'}},
'Release': {'name': {'editable': False, 'value': 'Release'}},
'Reply': {'name': {'editable': False, 'value': 'Reply'}},
'Review': {'name': {'editable': False, 'value': 'Review'}},
'ReviewItem': {'name': {'editable': False, 'value': 'Review Item'}},
'Revision': {'name': {'editable': False, 'value': 'Revision'}},
'Routine': {'name': {'editable': False, 'value': 'Mocap Routine'}},
'Scene': {'name': {'editable': False, 'value': 'Scene'}},
'Sequence': {'name': {'editable': False, 'value': 'Sequence'}},
'ShootDay': {'name': {'editable': False, 'value': 'Shoot Day'}},
'Shot': {'name': {'editable': False, 'value': 'Shot'}},
'Slate': {'name': {'editable': False, 'value': 'Slate'}},
'Task': {'name': {'editable': False, 'value': 'Task'}},
'TaskTemplate': {'name': {'editable': False, 'value': 'Task Template'}},
'TemerityNode': {'name': {'editable': False, 'value': 'Temerity Node'}},
'Ticket': {'name': {'editable': False, 'value': 'Ticket'}},
'TimeLog': {'name': {'editable': False, 'value': 'Time Log'}},
'Tool': {'name': {'editable': False, 'value': 'Tool'}},
'Version': {'name': {'editable': False, 'value': 'Version'}}}
booleanschema_field_delete(stringentity_type,stringfield_name) Will delete the field specified for the entity specified.
-
stringentity_type (required)
The entity type to find (in CamelCase format). Example: HumanUser. -
stringfield_name (required)
The specific field to be deleted, must be the system name.
-
booleanTrue if successful.
# ----------------------------------------------
# Delete sg_temp_field on Asset
# ----------------------------------------------
result = sg.schema_field_delete("Asset", "sg_temp_field")
pprint(result)example output:
True
booleanschema_field_update(stringentity_type,stringfield_name,dictproperties) Updates the specified properties for the specified field on the specified entity. Note that although the property name may be the key in a nesteddictionary, like 'summary_default', it is treated no differently than keys that are up one level, like 'description'. See example output of schema_field_read().
-
stringentity_type (required)
The entity type to find (in CamelCase format). Example: HumanUser. -
stringfield_name (required)
Specifies the field you want. -
dictproperties (required)
A dictionary with key:value pairs where the key is the property to be updated and the value is the new value.
-
booleanTrue if successful.
# ----------------------------------------------------------
# Update the display name, summary_defalut, and description
# ----------------------------------------------------------
properties = {"name":"Test Number Field Renamed", "summary_default":"sum", "description":"this is only a test"}
result = sg.schema_field_update("Asset", "sg_test_number", properties)
pprint(result)example output:
True
stringschema_field_create(stringentity_type,stringfield_type,stringdisplay_name,dictproperties) Create a field of specified type on specified Asset.
-
`string` **entity_type** (*required*) The entity type (in CamelCase format). Example: HumanUser. -
`string` **field_type** (*required*) The type of field you want to create. Valid values are: * checkbox * currency * date * date_time * duration * entity * float * list * number * percent * status_list * text * timecode * url -
`string` **display_name** (*required*) Specifies the display name of the field you are creating. The system name will be created from this display name and returned upon successful creation. -
`dict` **properties** (*optional*) Use this to specify other field properties such as the 'description' or 'summary_default'.
-
stringthe Shotgun system name for the new field.
# ------------------------------------------------------------
# Create a text field through the api
# ------------------------------------------------------------
properties = {"summary_default":"count", "description":"Complexity breakdown of Asset"}
result = sg.schema_field_create("Asset", "text", "Complexity", properties)
pprint(result)example output:
'sg_complexity'