<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using arcpy to access Pro map layer metadata in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193955#M14880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then just make a def out of what you need, so you can reuse it when you need it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Sep 2020 09:20:57 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-09-03T09:20:57Z</dc:date>
    <item>
      <title>Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193952#M14877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to access the metadata for a map layer in ArcGIS Pro via arcpy. When I have a map layer, all of its properties from the Pro metadata tab of the layer properties are null. Here is a screenshot of my Python editor when I&amp;nbsp;look at the map layer object in debug mode:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/506268_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a layer that has its own metadata attached to the data source feature class. I copied the metadata to the layer, so it looks like the screenshot below, but I get the same result with null values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/506269_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I go to the feature class (in a file geodatabase), I do get values:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; metadata &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; md
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; tgt_item_md &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Metadata&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; tgt_item_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isReadOnly
&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; tgt_item_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title
&lt;SPAN class="string token"&gt;'NOAA_WRC_Fish2015'&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; tgt_item_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;description
&lt;SPAN class="string token"&gt;'&amp;lt;DIV STYLE="text-align:Left;"&amp;gt;&amp;lt;DIV&amp;gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;SPAN&amp;gt;The base geospatial information is the Watershed Boundary Dataset (WBD) [...etc...]'&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me how to correctly read the metadata from the layer properties metadata tab?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:43:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193952#M14877</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2021-12-11T09:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193953#M14878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All I see is...&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/metadata/metadata-class.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/metadata/metadata-class.htm"&gt;Metadata—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the last code example&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Get a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;Metadata&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;object from a map layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;pulling out the properties as needed.&amp;nbsp; So you can read from various start levels of info (project, map, layer) if you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 03:27:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193953#M14878</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-03T03:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193954#M14879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, that's the example I was following. The layer and metadata objects in the screenshot above from my IDE came from that code sample. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 05:06:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193954#M14879</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2020-09-03T05:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193955#M14880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then just make a def out of what you need, so you can reuse it when you need it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 09:20:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193955#M14880</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-03T09:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193956#M14881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;‌, &lt;A href="https://community.esri.com/migrated-users/3420" target="_blank"&gt;Joshua Bixby&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;I'm connecting to a Pro map layer that has metadata, but arcpy is returning all &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;None&lt;/SPAN&gt; values in the metadata properties. I'm not seeing how making a reusable def is going to&amp;nbsp;help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought the screenshot from my IDE would help, but it looks like it's a distraction. Here is what I am doing. This is a map layer that has metadata defined. Assume &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;in_project&lt;/SPAN&gt; (path to aprx), &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;map_name&lt;/SPAN&gt;, and &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;map_layer_name&lt;/SPAN&gt; are strings defined above.&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_project&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
map_out &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map_name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
layers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; map_out&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; layer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; layers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; map_layer_name&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        map_layer_out &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer
map_layer_out
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Layer object at &lt;SPAN class="number token"&gt;0x000001D64CFCFC50&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
layer_md &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; map_layer_out&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;metadata
layer_md
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;metadata&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Metadata object at &lt;SPAN class="number token"&gt;0x000001D64CFC0438&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
layer_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title   &lt;SPAN class="comment token"&gt;# has no output&lt;/SPAN&gt;
type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
layer_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;description   &lt;SPAN class="comment token"&gt;# has no output&lt;/SPAN&gt;
type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;description&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;tags&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer_md&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;summary&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shouldn't I be getting actual values there, like what I see in the Pro screenshot I posted?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193956#M14881</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2021-12-11T09:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193957#M14882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share a layer or layer package?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried several different scenarios, and all of them work as expected with metadata.&amp;nbsp; I am using Pro 2.6.1, what version are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 22:21:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193957#M14882</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-09-03T22:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193958#M14883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/message/951861-re-issue-with-arcpy-metadata?commentID=951861#comment-951861" title="https://community.esri.com/message/951861-re-issue-with-arcpy-metadata?commentID=951861#comment-951861"&gt;https://community.esri.com/message/951861-re-issue-with-arcpy-metadata?commentID=951861#comment-951861&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my recent post there.&lt;/P&gt;&lt;P&gt;I am using 2.6.1&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 22:31:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193958#M14883</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-03T22:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using arcpy to access Pro map layer metadata</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193959#M14884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm on 2.5, I think that bug must be it. Ugh. Waiting for my agency to approve a higher version. Thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 00:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-to-access-pro-map-layer-metadata/m-p/193959#M14884</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2020-09-04T00:22:36Z</dc:date>
    </item>
  </channel>
</rss>

