Need to Export a Simple Summary List of a GDB

509
2
09-13-2011 03:55 PM
ChristopherStebbins1
New Contributor II
Is there a tool or script that produces a list, either as a table or text file, of all the classes of a GDB?

Feature classes, data model type (poly, line, point), anno classes, networks, etc.
0 Kudos
2 Replies
VinceAngelo
Esri Esteemed Contributor
There was a recent thread on counting feature classes -- the Python script could be trivially modified to
display the objects counted.

- V
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Here is an example of the script.  I could not find a way to list networks (i.e. geometric, topology, etc) within the database.  The below script will list all feature datasets, feature classes (including geometry and data type), and tables and write the output to a txt file.  You will just need to change the 'env.workspace' variable to the path of your GDB and the 'outtable' variable to a directory.  The text file will automatically be created.

import arcpy, os
from arcpy import env
env.workspace = r"C:\temp\python\test.gdb"

outtable = open(r"C:\temp\python\results.txt", "w")

for dataset in arcpy.ListDatasets("*"):
    desc = arcpy.Describe(dataset)
    outtable.write(dataset + " " + desc.datasetType + "\n")
    for fc in arcpy.ListFeatureClasses("*", "", dataset):
         desc = arcpy.Describe(fc)
         outtable.write(fc + " " + desc.datasetType + " " + desc.featureType + " " + desc.shapeType + "\n")


for fc in arcpy.ListFeatureClasses("*"):
    desc = arcpy.Describe(fc)
    outtable.write(fc + " " + desc.dataType + " " + desc.featureType + " " + desc.shapeType + "\n")

for table in arcpy.ListTables("*"):
    desc = arcpy.Describe(table)
    outtable.write(table + " " + desc.dataType + "\n")    

outtable.close() 
0 Kudos