<type>[optional scope]: <description>
feat: new featurefix(scope): bug in scopefeat!: breaking change/feat(scope)!: rework APIchore(deps): update dependencies
| domains = arcpy.da.ListDomains(r'C:\temp\test.gdb') | |
| for domain in domains: | |
| print(u'\nDomain name: {0}'.format(domain.name)) | |
| if domain.domainType == 'CodedValue': | |
| coded_values = domain.codedValues | |
| for val, desc in coded_values.iteritems(): | |
| print(u'\t{0} : {1}'.format(val, desc)) | |
| elif domain.domainType == 'Range': | |
| print(u'\tMin: {0}'.format(domain.range[0])) |
| def sortValues(the_value, delimiter=','): | |
| """Sort a separated value into an order | |
| Useful to run on ArcGIS processes where there is no control on returned values. | |
| For example SpatialJoin, JOIN_ONE_TO_ONE, with FieldMapping Merge Rule = Join | |
| """ | |
| if the_value == None: | |
| return the_value | |
| # Create a Python list by splitting the string on the delimeter | |
| the_list = the_value.split(delimiter) |
| import arcpy | |
| def fieldExists(dataset: str, field_name: str) -> bool: | |
| """Return boolean indicating if field exists in the specified dataset.""" | |
| return field_name in [field.name for field in arcpy.ListFields(dataset)] |
| def strictly_increasing(L): | |
| """Returns TRUE if the values in the list are strictly increasing | |
| Always increasing; never remaining constant or decreasing or null. | |
| """ | |
| return all(x<y for x, y in zip(L, L[1:])) | |
| def strictly_decreasing(L): | |
| """Returns TRUE if the values in the list are strictly decreasing | |
| Always decreasing; never remaining constant or increasing or null. |
| import arcpy | |
| def list_join_tables(in_table): | |
| """Returns a list of tables currently joined to a table or feature class. | |
| List includes the in_table | |
| Returns empty list if no joins | |
| """ | |
| fields = [f.name for f in arcpy.Describe(in_table).fields] | |
| return = list(set([f.split(".")[0] for f in fields if "." in f])) |