Python API 3.2.0 is out

Hi!

We’ve had 2 releases of the Python API in the last few days, 3.1.2 and 3.2.0. These new releases introduced the following features:

  • Adds an optional localized property on the Shotgun object which allows to retrieve localized display names on methods schema_entity_read() , schema_field_read() , and schema_read() .

  • Adds a new project_entity parameter to schema_field_update that allows to modify field visibility for a given project.

You can grab the latest release here.

Have a great week everyone!

JF

13 Likes

Hey JF,

I’m checking out the new project_entity parameter in schema_field_update, and hitting some issues…

When adding visible to the properties, I get the following warning when I don’t include the project_entity, which is expected:

API schema_field_update(): The ‘visible’ property requires a project to be updated.

However, when I do add project_entity, it gives me this error:

got an unexpected keyword argument ‘project_entity’

1 Like

Hi Stephen!

That error seems to imply you are passing a parameter to the Python function that is not supported. Are you sure you are using the Shotgun API v3.2.0 or greater? You can check by running the following from a Python interpreter.

import shotgun_api3
print(shotgun_api3.__version__)

If you are using the Shotgun API through Toolkit, you need to do

from tank_vendor import shotgun_api3
print(shotgun_api3.__version__)

If you are using the API through Toolkit and the version is older, you’ll need to update to core v0.19.1, which is the first release of Toolkit that included a Shotgun API with that feature.

Does that solve your problem?

JF

2 Likes

Is there any more information I can read on how and where python 3 can be used instead of 2?
I knew it was coming but actually not sure how switching over will work…

1 Like

Ricardo, this doc should give you the info you’re after. :blush:

Let us know if you still have questions.

1 Like

Thanks JF,

Super helpful! I’ve got the latest Python API locally (v3.2.2), Toolkit is on latest core (v0.19.3), but it looks like the following tk-framework-desktopstartup framework (which is still on core v0.18.168) is the culprit for my error:

Will this framework get upgraded to latest core?

Stephen

2 Likes

Hi again,
We usually update this framework’s copy of the Toolkit core only when there’s a fix in the sgtk.authentication module, which is why we haven’t updated it in a while. I’m curious to learn how come the Shotgun API gets imported from there instead of from the site configuration or your project. I’ll create a support ticket so we can figure this out in private and report back our results here when we’re done.
JF

2 Likes

Hi Stephen,
Your ticket on Zendesk was auto-closed because you never replied. Do you still need help with this? :smiley: (I’m asking here in case our email got buried in your inbox).
JF

2 Likes