1

I'm looking for a similar functionality as this tool: Import Metadata in ArcGIS Pro. I am upgrading some of our older scripts and I can't seem to find a similar tool or even one that could do something somewhat similar.

Does ArcGIS Pro have any ArcPy options for this at 2.6 (which I am currently using)?

2
  • 1
    What version of ArcGIS Pro are you using?
    – PolyGeo
    Sep 4, 2020 at 20:23
  • @PolyGeo 2.6, probably 2.6.1 next week or so.
    – Cody Brown
    Sep 6, 2020 at 12:54

1 Answer 1

1

It is discussed in the documentation here: https://pro.arcgis.com/en/pro-app/arcpy/metadata/migrating-from-arcmap-to-arcgis-pro.htm

I just use a simple wrapper:

import arcpy
from arcpy import metadata as md

def pro_import_metadata(source_metadata:str, import_type:str, target_metadata:str, enable_automatic_updates:bool):  
    target_item_md = md.Metadata(target_metadata)
    target_item_md.importMetadata(source_metadata,import_type)

    if enable_automatic_updates:
        target_item_md.metadata_sync_option = 'ALWAYS'
        target_item_md.reload()
    target_item_md.save()

Do note that the Import_Type strings has changed from Desktop.

2
  • This works fantastic thank you!
    – Cody Brown
    Sep 8, 2020 at 13:10
  • So for the impossibly ignorant...how does this work, and could it be adapted to take parameters and be used flexibly in a model?
    – TravisB
    Oct 14, 2021 at 18:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.