Skip to main content

Describe object properties

Resumen

The Describe function returns the following properties for all Describe objects.

Propiedades

Propiedad Explicación Tipo de datos

baseName

(Solo lectura)

The file base name.

String

catalogPath

(Solo lectura)

The path of the data.

String

children

(Solo lectura)

A list of sub elements.

If describing a workspace, the children property returns the contents of that workspace, including various data types such as feature classes, tables, rasters, and feature datasets.

Describe

childrenExpanded

(Solo lectura)

Indicates whether the children have been expanded.

Boolean

dataElementType

(Solo lectura)

The element type of the element.

String

dataType

(Solo lectura)

The type of the element.

String

extension

(Solo lectura)

The file extension.

String

file

(Solo lectura)

The file name.

String

fullPropsRetrieved

(Solo lectura)

Indicates whether full properties have been retrieved.

Boolean

metadataRetrieved

(Solo lectura)

Indicates whether the metadata has been retrieved.

Boolean

name

(Solo lectura)

The user-assigned name for the element.

String

path

(Solo lectura)

The file path.

String

Muestra de código

Describe object properties example

Display some Describe object properties for a file geodatabase.

import arcpy

# Create a Describe object
desc = arcpy.Describe("C:/Data/chesapeake.gdb")

# Print some Describe Object properties
if hasattr(desc, "name"):
    print("Name:        " + desc.name)
if hasattr(desc, "dataType"):
    print("DataType:    " + desc.dataType)
if hasattr(desc, "catalogPath"):
    print("CatalogPath: " + desc.catalogPath)

# Examine children and print their name and dataType
print("Children:")
for child in desc.children:
    print("\t%s = %s" % (child.name, child.dataType))