[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:

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, ""),
            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:

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.

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)
        shapeType = arcpy.Describe(path).shapeType
        print (shapeType)

Database ConnectionsGISUSER.sdeLayers.GISUSER.Street_LightsCP
Database ConnectionsGISUSER.sdeLayers.SDE.penny_parcel
Database ConnectionsGISUSER.sdeLayers.SDE.Subdivision_Circuits
Database ConnectionsGISUSER.sdeLayers.SDE.waterlines2
Database ConnectionsGISUSER.sdeLayers.SDE.Parks_old
Database ConnectionsGISUSER.sdeLayers.SDE.Trails_old
Database ConnectionsGISUSER.sdelayers.SDE.StSenateDstrcts
Database ConnectionsGISUSER.sdelayers.SDE.StHouseDstrct
Database ConnectionsGISUSER.sdelayers.SDE.USHouseRep

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.