Snippets

Lucas Correia API Example - Print entity types and attributes in API schema

Created by Lucas Correia

This code to print all entities and attributes available in the API schema.

Read more in the Python API tutorial: http://ftrack-python-api.rtd.ftrack.com/en/stable/tutorial.html

import ftrack_api

session = ftrack_api.Session()

for name, entity_type in sorted(session.types.items()):
    print name
    for attribute in sorted(entity_type.attributes.keys()):
        print '\t {} ({})'.format(
            attribute,
            entity_type.attributes.get(attribute).__class__.__name__
        )
    print ''

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.