[Solved] Describe FeatureClass shape type, can’t get past error (object has no attribute ‘shapeType’)

Molly Vey E Asks: Describe FeatureClass shape type, can’t get past error (object has no attribute ‘shapeType’)
My code:

Code:
import arcpy, csv, os

# Create a Describe object

gdb = r"Database ConnectionsGISUSER.sde"
desc = arcpy.Describe(gdb)

full_path = False # Specify whether dataset name should be full or relative

# Print some Describe Object properties
if hasattr(desc, "name"):
    print "Name:        " + desc.name   #Prints: GISUSER.sde
if hasattr(desc, "dataType"):
    print "DataType:    " + desc.dataType   #Prints:Workspace
if hasattr(desc, "catalogPath"):
    print "CatalogPath: " + desc.catalogPath  #prints:Database ConnectionsGISUSER.sde

# Examine children and print their name and dataType and their children's name and dataType
print "n"  
print "{},t{},t{}".format("Children:","Children.Child","DataType") #header
for child in desc.children:
    print "{},tt{}".format(child.name,child.dataType)

    #featureDatasets/folders = [child] 
    #so that means Feature classes or subfolders materials = child.children =ds
    for ds in datasets: 
        print "t{},t{},t{},t{},".format(
            ds.catalogPath.replace("" if full_path else gdb + os.path.sep, ""),
            ds.datatype,
            shapeType = str(ds.catalogPath.shapetype) #WHERE I GET MY ERROR
         )


enter image description here

I want to add another column after DataType for DataShape/telling the user if its a polygon/point/annotation/polyline/etc.

But then I get the error message:

Code:
Runtime error 
Traceback (most recent call last):
  File "<string>", line 40, in <module>
AttributeError: 'unicode' object has no attribute 'shapeType'

Describe Object
This code I adapted(shown) does gives me the ShapeType which shows that Shapetype would work for this purpose if I could get past this error.

Code:
import arcpy
import os

arcpy.env.workspace = r"Database ConnectionsGISUSER.sde"

datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []

for ds in datasets:
    for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
        path = os.path.join(arcpy.env.workspace, ds, fc)
        print(path)
        shapeType = arcpy.Describe(path).shapeType
        print (shapeType)


Results:
Database ConnectionsGISUSER.sdeLayers.GISUSER.Street_LightsCP
Point
Database ConnectionsGISUSER.sdeLayers.SDE.penny_parcel
Polygon
Database ConnectionsGISUSER.sdeLayers.SDE.Subdivision_Circuits
Polygon
Database ConnectionsGISUSER.sdeLayers.SDE.waterlines2
Polyline
Database ConnectionsGISUSER.sdeLayers.SDE.Parks_old
Polygon
Database ConnectionsGISUSER.sdeLayers.SDE.Trails_old
Polyline
Database ConnectionsGISUSER.sdelayers.SDE.StSenateDstrcts
Polygon
Database ConnectionsGISUSER.sdelayers.SDE.StHouseDstrct
Polygon
Database ConnectionsGISUSER.sdelayers.SDE.USHouseRep
Polygon

Basically, I’m trying to Print out all the FeatureDatasetes,Classes, tables, rasterbands and their type , inside a database.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.