7

How can I check whether or not a feature class is versioned using Python?

I'm trying to register feature classes using a python script. Before I do this I need to check whether a feature class is versioned. Are there keywords that we can use in coding while looping through the feature classes?

nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
asked Nov 16, 2011 at 18:37

1 Answer 1

16

If you call the method arcpy.Describe() on your feature class - e.g. arcpy.Describe("path/to/my/feature/class"), you will get a Dataset properties object. You can then use the isVersioned property of this object to get a boolean, whether or not your dataset is versioned.

Code snippet:

import arcpy
datasetVersioned = arcpy.Describe("path/to/my/feature/class").isVersioned

Remember to use escaped backslash characters, forward slashes, or a raw string in the path

More details in the docs: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Dataset_properties/000v0000002m000000/

answered Nov 16, 2011 at 23:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.