This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_geodatabase_path(input_table): | |
'''Return the Geodatabase path from the input table or feature class. | |
:param input_table: path to the input table or feature class | |
''' | |
workspace = os.path.dirname(input_table) | |
if [any(ext) for ext in ('.gdb', '.mdb', '.sde') if ext in os.path.splitext(workspace)]: | |
return workspace | |
else: | |
return os.path.dirname(workspace) | |