dropbox.file_properties – File Properties

This namespace contains helpers for property and template metadata endpoints.

These endpoints enable you to tag arbitrary key/value data to Dropbox files.

The most basic unit in this namespace is the :type:`PropertyField`. These fields encapsulate the actual key/value data.

Fields are added to a Dropbox file using a :type:`PropertyGroup`. Property groups contain a reference to a Dropbox file and a :type:`PropertyGroupTemplate`. Property groups are uniquely identified by the combination of their associated Dropbox file and template.

The :type:`PropertyGroupTemplate` is a way of restricting the possible key names and value types of the data within a property group. The possible key names and value types are explicitly enumerated using :type:`PropertyFieldTemplate` objects.

You can think of a property group template as a class definition for a particular key/value metadata object, and the property groups themselves as the instantiations of these objects.

Templates are owned either by a user/app pair or team/app pair. Templates and their associated properties can’t be accessed by any app other than the app that created them, and even then, only when the app is linked with the owner of the template (either a user or team).

User-owned templates are accessed via the user-auth file_properties/templates/_for_user endpoints, while team-owned templates are accessed via the team-auth file_properties/templates/*_for_team endpoints. Properties associated with either type of template can be accessed via the user-auth properties/ endpoints.

Finally, properties can be accessed from a number of endpoints that return metadata, including files/get_metadata, and files/list_folder. Properties can also be added during upload, using files/upload.

class dropbox.file_properties.AddPropertiesArg(path=None, property_groups=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(path=None, property_groups=None)

x.__init__(…) initializes x; see help(type(x)) for signature

path

A unique identifier for the file or folder.

Return type:str
property_groups

The property groups which are to be added to a Dropbox file.

Return type:list of [file_properties.PropertyGroup]
class dropbox.file_properties.AddPropertiesError(tag, value=None)

Bases: dropbox.file_properties.InvalidPropertyGroupError

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.AddPropertiesError.property_group_already_exists – A property group associated with this template and file already exists.
is_property_group_already_exists()

Check if the union tag is property_group_already_exists.

Return type:bool
property_group_already_exists = AddPropertiesError('property_group_already_exists', None)
class dropbox.file_properties.AddTemplateArg(name=None, description=None, fields=None)

Bases: dropbox.file_properties.PropertyGroupTemplate

__init__(name=None, description=None, fields=None)

x.__init__(…) initializes x; see help(type(x)) for signature

class dropbox.file_properties.AddTemplateResult(template_id=None)

Bases: dropbox.stone_base.Struct

Variables:file_properties.AddTemplateResult.template_id – An identifier for template added by See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().
__init__(template_id=None)

x.__init__(…) initializes x; see help(type(x)) for signature

template_id

An identifier for template added by See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().

Return type:str
class dropbox.file_properties.GetTemplateArg(template_id=None)

Bases: dropbox.stone_base.Struct

Variables:file_properties.GetTemplateArg.template_id – An identifier for template added by route See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().
__init__(template_id=None)

x.__init__(…) initializes x; see help(type(x)) for signature

template_id

An identifier for template added by route See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().

Return type:str
class dropbox.file_properties.GetTemplateResult(name=None, description=None, fields=None)

Bases: dropbox.file_properties.PropertyGroupTemplate

__init__(name=None, description=None, fields=None)

x.__init__(…) initializes x; see help(type(x)) for signature

class dropbox.file_properties.InvalidPropertyGroupError(tag, value=None)

Bases: dropbox.file_properties.PropertiesError

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
does_not_fit_template = InvalidPropertyGroupError('does_not_fit_template', None)
is_does_not_fit_template()

Check if the union tag is does_not_fit_template.

Return type:bool
is_property_field_too_large()

Check if the union tag is property_field_too_large.

Return type:bool
property_field_too_large = InvalidPropertyGroupError('property_field_too_large', None)
class dropbox.file_properties.ListTemplateResult(template_ids=None)

Bases: dropbox.stone_base.Struct

Variables:file_properties.ListTemplateResult.template_ids – List of identifiers for templates added by See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().
__init__(template_ids=None)

x.__init__(…) initializes x; see help(type(x)) for signature

template_ids

List of identifiers for templates added by See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().

Return type:list of [str]
class dropbox.file_properties.LogicalOperator(tag, value=None)

Bases: dropbox.stone_base.Union

Logical operator to join search queries together.

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.LogicalOperator.or_operator – Append a query with an “or” operator.
is_or_operator()

Check if the union tag is or_operator.

Return type:bool
is_other()

Check if the union tag is other.

Return type:bool
or_operator = LogicalOperator('or_operator', None)
other = LogicalOperator('other', None)
class dropbox.file_properties.LookUpPropertiesError(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.LookUpPropertiesError.property_group_not_found – No property group was found.
is_other()

Check if the union tag is other.

Return type:bool
is_property_group_not_found()

Check if the union tag is property_group_not_found.

Return type:bool
other = LookUpPropertiesError('other', None)
property_group_not_found = LookUpPropertiesError('property_group_not_found', None)
class dropbox.file_properties.LookupError(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
get_malformed_path()

Only call this if is_malformed_path() is true.

Return type:str
is_malformed_path()

Check if the union tag is malformed_path.

Return type:bool
is_not_file()

Check if the union tag is not_file.

Return type:bool
is_not_folder()

Check if the union tag is not_folder.

Return type:bool
is_not_found()

Check if the union tag is not_found.

Return type:bool
is_other()

Check if the union tag is other.

Return type:bool
is_restricted_content()

Check if the union tag is restricted_content.

Return type:bool
classmethod malformed_path(val)

Create an instance of this class set to the malformed_path tag with value val.

Parameters:val (str) –
Return type:file_properties.LookupError
not_file = LookupError('not_file', None)
not_folder = LookupError('not_folder', None)
not_found = LookupError('not_found', None)
other = LookupError('other', None)
restricted_content = LookupError('restricted_content', None)
class dropbox.file_properties.ModifyTemplateError(tag, value=None)

Bases: dropbox.file_properties.TemplateError

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
conflicting_property_names = ModifyTemplateError('conflicting_property_names', None)
is_conflicting_property_names()

Check if the union tag is conflicting_property_names.

Return type:bool
is_template_attribute_too_large()

Check if the union tag is template_attribute_too_large.

Return type:bool
is_too_many_properties()

Check if the union tag is too_many_properties.

Return type:bool
is_too_many_templates()

Check if the union tag is too_many_templates.

Return type:bool
template_attribute_too_large = ModifyTemplateError('template_attribute_too_large', None)
too_many_properties = ModifyTemplateError('too_many_properties', None)
too_many_templates = ModifyTemplateError('too_many_templates', None)
class dropbox.file_properties.OverwritePropertyGroupArg(path=None, property_groups=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(path=None, property_groups=None)

x.__init__(…) initializes x; see help(type(x)) for signature

path

A unique identifier for the file or folder.

Return type:str
property_groups

The property groups “snapshot” updates to force apply.

Return type:list of [file_properties.PropertyGroup]
class dropbox.file_properties.PropertiesError(tag, value=None)

Bases: dropbox.file_properties.TemplateError

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.PropertiesError.unsupported_folder – This folder cannot be tagged. Tagging folders is not supported for team-owned templates.
get_path()

Only call this if is_path() is true.

Return type:file_properties.LookupError
is_path()

Check if the union tag is path.

Return type:bool
is_unsupported_folder()

Check if the union tag is unsupported_folder.

Return type:bool
classmethod path(val)

Create an instance of this class set to the path tag with value val.

Parameters:val (file_properties.LookupError) –
Return type:file_properties.PropertiesError
unsupported_folder = PropertiesError('unsupported_folder', None)
class dropbox.file_properties.PropertiesSearchArg(queries=None, template_filter=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(queries=None, template_filter=None)

x.__init__(…) initializes x; see help(type(x)) for signature

queries

Queries to search.

Return type:list of [file_properties.PropertiesSearchQuery]
template_filter

Filter results to contain only properties associated with these template IDs.

Return type:file_properties.TemplateFilter
class dropbox.file_properties.PropertiesSearchContinueArg(cursor=None)

Bases: dropbox.stone_base.Struct

Variables:file_properties.PropertiesSearchContinueArg.cursor – The cursor returned by your last call to dropbox.dropbox.Dropbox.file_properties_properties_search() or dropbox.dropbox.Dropbox.file_properties_properties_search_continue().
__init__(cursor=None)

x.__init__(…) initializes x; see help(type(x)) for signature

cursor

The cursor returned by your last call to dropbox.dropbox.Dropbox.file_properties_properties_search() or dropbox.dropbox.Dropbox.file_properties_properties_search_continue().

Return type:str
class dropbox.file_properties.PropertiesSearchContinueError(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.PropertiesSearchContinueError.reset – Indicates that the cursor has been invalidated. Call dropbox.dropbox.Dropbox.file_properties_properties_search() to obtain a new cursor.
is_other()

Check if the union tag is other.

Return type:bool
is_reset()

Check if the union tag is reset.

Return type:bool
other = PropertiesSearchContinueError('other', None)
reset = PropertiesSearchContinueError('reset', None)
class dropbox.file_properties.PropertiesSearchError(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

get_property_group_lookup()

Only call this if is_property_group_lookup() is true.

Return type:file_properties.LookUpPropertiesError
is_other()

Check if the union tag is other.

Return type:bool
is_property_group_lookup()

Check if the union tag is property_group_lookup.

Return type:bool
other = PropertiesSearchError('other', None)
classmethod property_group_lookup(val)

Create an instance of this class set to the property_group_lookup tag with value val.

Parameters:val (file_properties.LookUpPropertiesError) –
Return type:file_properties.PropertiesSearchError
class dropbox.file_properties.PropertiesSearchMatch(id=None, path=None, is_deleted=None, property_groups=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(id=None, path=None, is_deleted=None, property_groups=None)

x.__init__(…) initializes x; see help(type(x)) for signature

id

The ID for the matched file or folder.

Return type:str
is_deleted

Whether the file or folder is deleted.

Return type:bool
path

The path for the matched file or folder.

Return type:str
property_groups

List of custom property groups associated with the file.

Return type:list of [file_properties.PropertyGroup]
class dropbox.file_properties.PropertiesSearchMode(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.PropertiesSearchMode.field_name (str) – Search for a value associated with this field name.
classmethod field_name(val)

Create an instance of this class set to the field_name tag with value val.

Parameters:val (str) –
Return type:file_properties.PropertiesSearchMode
get_field_name()

Search for a value associated with this field name.

Only call this if is_field_name() is true.

Return type:str
is_field_name()

Check if the union tag is field_name.

Return type:bool
is_other()

Check if the union tag is other.

Return type:bool
other = PropertiesSearchMode('other', None)
class dropbox.file_properties.PropertiesSearchQuery(query=None, mode=None, logical_operator=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(query=None, mode=None, logical_operator=None)

x.__init__(…) initializes x; see help(type(x)) for signature

logical_operator

The logical operator with which to append the query.

Return type:file_properties.LogicalOperator
mode

The mode with which to perform the search.

Return type:file_properties.PropertiesSearchMode
query

The property field value for which to search across templates.

Return type:str
class dropbox.file_properties.PropertiesSearchResult(matches=None, cursor=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(matches=None, cursor=None)

x.__init__(…) initializes x; see help(type(x)) for signature

cursor

Pass the cursor into dropbox.dropbox.Dropbox.file_properties_properties_search_continue() to continue to receive search results. Cursor will be null when there are no more results.

Return type:str
matches

A list (possibly empty) of matches for the query.

Return type:list of [file_properties.PropertiesSearchMatch]
class dropbox.file_properties.PropertyField(name=None, value=None)

Bases: dropbox.stone_base.Struct

Raw key/value data to be associated with a Dropbox file. Property fields are added to Dropbox files as a PropertyGroup.

Variables:
__init__(name=None, value=None)

x.__init__(…) initializes x; see help(type(x)) for signature

name

Key of the property field associated with a file and template. Keys can be up to 256 bytes.

Return type:str
value

Value of the property field associated with a file and template. Values can be up to 1024 bytes.

Return type:str
class dropbox.file_properties.PropertyFieldTemplate(name=None, description=None, type=None)

Bases: dropbox.stone_base.Struct

Defines how a single property field may be structured. Used exclusively by PropertyGroupTemplate.

Variables:
__init__(name=None, description=None, type=None)

x.__init__(…) initializes x; see help(type(x)) for signature

description

Description of the property field. Property field descriptions can be up to 1024 bytes.

Return type:str
name

Key of the property field being described. Property field keys can be up to 256 bytes.

Return type:str
type

Data type of the value of this property field. This type will be enforced upon property creation and modifications.

Return type:file_properties.PropertyType
class dropbox.file_properties.PropertyGroup(template_id=None, fields=None)

Bases: dropbox.stone_base.Struct

A subset of the property fields described by the corresponding PropertyGroupTemplate. Properties are always added to a Dropbox file as a PropertyGroup. The possible key names and value types in this group are defined by the corresponding PropertyGroupTemplate.

Variables:
__init__(template_id=None, fields=None)

x.__init__(…) initializes x; see help(type(x)) for signature

fields

The actual properties associated with the template. There can be up to 32 property types per template.

Return type:list of [file_properties.PropertyField]
template_id

A unique identifier for the associated template.

Return type:str
class dropbox.file_properties.PropertyGroupTemplate(name=None, description=None, fields=None)

Bases: dropbox.stone_base.Struct

Defines how a property group may be structured.

Variables:
__init__(name=None, description=None, fields=None)

x.__init__(…) initializes x; see help(type(x)) for signature

description

Description for the template. Template descriptions can be up to 1024 bytes.

Return type:str
fields

Definitions of the property fields associated with this template. There can be up to 32 properties in a single template.

Return type:list of [file_properties.PropertyFieldTemplate]
name

Display name for the template. Template names can be up to 256 bytes.

Return type:str
class dropbox.file_properties.PropertyGroupUpdate(template_id=None, add_or_update_fields=None, remove_fields=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(template_id=None, add_or_update_fields=None, remove_fields=None)

x.__init__(…) initializes x; see help(type(x)) for signature

add_or_update_fields

Property fields to update. If the property field already exists, it is updated. If the property field doesn’t exist, the property group is added.

Return type:list of [file_properties.PropertyField]
remove_fields

Property fields to remove (by name), provided they exist.

Return type:list of [str]
template_id

A unique identifier for a property template.

Return type:str
class dropbox.file_properties.PropertyType(tag, value=None)

Bases: dropbox.stone_base.Union

Data type of the given property field added.

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.PropertyType.string – The associated property field will be of type string. Unicode is supported.
is_other()

Check if the union tag is other.

Return type:bool
is_string()

Check if the union tag is string.

Return type:bool
other = PropertyType('other', None)
string = PropertyType('string', None)
class dropbox.file_properties.RemovePropertiesArg(path=None, property_template_ids=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(path=None, property_template_ids=None)

x.__init__(…) initializes x; see help(type(x)) for signature

path

A unique identifier for the file or folder.

Return type:str
property_template_ids

A list of identifiers for a template created by dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().

Return type:list of [str]
class dropbox.file_properties.RemovePropertiesError(tag, value=None)

Bases: dropbox.file_properties.PropertiesError

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

get_property_group_lookup()

Only call this if is_property_group_lookup() is true.

Return type:file_properties.LookUpPropertiesError
is_property_group_lookup()

Check if the union tag is property_group_lookup.

Return type:bool
classmethod property_group_lookup(val)

Create an instance of this class set to the property_group_lookup tag with value val.

Parameters:val (file_properties.LookUpPropertiesError) –
Return type:file_properties.RemovePropertiesError
class dropbox.file_properties.RemoveTemplateArg(template_id=None)

Bases: dropbox.stone_base.Struct

Variables:file_properties.RemoveTemplateArg.template_id – An identifier for a template created by dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().
__init__(template_id=None)

x.__init__(…) initializes x; see help(type(x)) for signature

template_id

An identifier for a template created by dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().

Return type:str
class dropbox.file_properties.TemplateError(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
get_template_not_found()

Template does not exist for the given identifier.

Only call this if is_template_not_found() is true.

Return type:str
is_other()

Check if the union tag is other.

Return type:bool
is_restricted_content()

Check if the union tag is restricted_content.

Return type:bool
is_template_not_found()

Check if the union tag is template_not_found.

Return type:bool
other = TemplateError('other', None)
restricted_content = TemplateError('restricted_content', None)
classmethod template_not_found(val)

Create an instance of this class set to the template_not_found tag with value val.

Parameters:val (str) –
Return type:file_properties.TemplateError
class dropbox.file_properties.TemplateFilter(tag, value=None)

Bases: dropbox.file_properties.TemplateFilterBase

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:file_properties.TemplateFilter.filter_none – No templates will be filtered from the result (all templates will be returned).
filter_none = TemplateFilter('filter_none', None)
is_filter_none()

Check if the union tag is filter_none.

Return type:bool
class dropbox.file_properties.TemplateFilterBase(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:of [str] file_properties.TemplateFilterBase.filter_some (list) – Only templates with an ID in the supplied list will be returned (a subset of templates will be returned).
classmethod filter_some(val)

Create an instance of this class set to the filter_some tag with value val.

Parameters:of [str] val (list) –
Return type:file_properties.TemplateFilterBase
get_filter_some()

Only templates with an ID in the supplied list will be returned (a subset of templates will be returned).

Only call this if is_filter_some() is true.

Return type:list of [str]
is_filter_some()

Check if the union tag is filter_some.

Return type:bool
is_other()

Check if the union tag is other.

Return type:bool
other = TemplateFilterBase('other', None)
class dropbox.file_properties.TemplateOwnerType(tag, value=None)

Bases: dropbox.stone_base.Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
is_other()

Check if the union tag is other.

Return type:bool
is_team()

Check if the union tag is team.

Return type:bool
is_user()

Check if the union tag is user.

Return type:bool
other = TemplateOwnerType('other', None)
team = TemplateOwnerType('team', None)
user = TemplateOwnerType('user', None)
class dropbox.file_properties.UpdatePropertiesArg(path=None, update_property_groups=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(path=None, update_property_groups=None)

x.__init__(…) initializes x; see help(type(x)) for signature

path

A unique identifier for the file or folder.

Return type:str
update_property_groups

The property groups “delta” updates to apply.

Return type:list of [file_properties.PropertyGroupUpdate]
class dropbox.file_properties.UpdatePropertiesError(tag, value=None)

Bases: dropbox.file_properties.InvalidPropertyGroupError

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

get_property_group_lookup()

Only call this if is_property_group_lookup() is true.

Return type:file_properties.LookUpPropertiesError
is_property_group_lookup()

Check if the union tag is property_group_lookup.

Return type:bool
classmethod property_group_lookup(val)

Create an instance of this class set to the property_group_lookup tag with value val.

Parameters:val (file_properties.LookUpPropertiesError) –
Return type:file_properties.UpdatePropertiesError
class dropbox.file_properties.UpdateTemplateArg(template_id=None, name=None, description=None, add_fields=None)

Bases: dropbox.stone_base.Struct

Variables:
__init__(template_id=None, name=None, description=None, add_fields=None)

x.__init__(…) initializes x; see help(type(x)) for signature

add_fields

Property field templates to be added to the group template. There can be up to 32 properties in a single template.

Return type:list of [file_properties.PropertyFieldTemplate]
description

Description for the new template. Template descriptions can be up to 1024 bytes.

Return type:str
name

A display name for the template. template names can be up to 256 bytes.

Return type:str
template_id

An identifier for template added by See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().

Return type:str
class dropbox.file_properties.UpdateTemplateResult(template_id=None)

Bases: dropbox.stone_base.Struct

Variables:file_properties.UpdateTemplateResult.template_id – An identifier for template added by route See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().
__init__(template_id=None)

x.__init__(…) initializes x; see help(type(x)) for signature

template_id

An identifier for template added by route See dropbox.dropbox.Dropbox.file_properties_templates_add_for_user() or dropbox.dropbox.Dropbox.file_properties_templates_add_for_team().

Return type:str