<?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: Storing domian coded values in a dictionary in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285134#M67576</link>
    <description>&lt;P&gt;Can you be more specific? What are you trying to do with the "stored" domain? Does it need to be in any particular format?&lt;/P&gt;&lt;P&gt;Once you get the list of domains from &lt;STRONG&gt;arcpy.da.ListDomains&lt;/STRONG&gt;, you should just be able to iterate through the response and do whatever you need it to.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;doms = arcpy.da.ListDomains('some gdb')

dom_dict = {}

for d in doms:
    dom_dict[d.name] = {
        'type': d.domainType,
        'codedValues': d.codedValues,
        'range': d.range
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2023 13:42:28 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2023-05-03T13:42:28Z</dc:date>
    <item>
      <title>Storing domian coded values in a dictionary</title>
      <link>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285121#M67574</link>
      <description>&lt;P&gt;How to store the arcpy.da.ListDomains(gdb) domaincoded values inside a dictionary using python/arcpy&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 13:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285121#M67574</guid>
      <dc:creator>kumarprince8071</dc:creator>
      <dc:date>2023-05-03T13:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Storing domian coded values in a dictionary</title>
      <link>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285134#M67576</link>
      <description>&lt;P&gt;Can you be more specific? What are you trying to do with the "stored" domain? Does it need to be in any particular format?&lt;/P&gt;&lt;P&gt;Once you get the list of domains from &lt;STRONG&gt;arcpy.da.ListDomains&lt;/STRONG&gt;, you should just be able to iterate through the response and do whatever you need it to.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;doms = arcpy.da.ListDomains('some gdb')

dom_dict = {}

for d in doms:
    dom_dict[d.name] = {
        'type': d.domainType,
        'codedValues': d.codedValues,
        'range': d.range
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 13:42:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285134#M67576</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-05-03T13:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Storing domian coded values in a dictionary</title>
      <link>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285337#M67581</link>
      <description>&lt;P&gt;Suppose i get the codedValues from arcpy.da.ListDomains(gdb) by iterating over it then in codedValues we get code and value like a dictionary of values {0:'value1',1:'value2'} so i want to store this dictionary value into another dictionary from i can access these values as key,value .&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 17:54:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285337#M67581</guid>
      <dc:creator>kumarprince8071</dc:creator>
      <dc:date>2023-05-03T17:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Storing domian coded values in a dictionary</title>
      <link>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285353#M67582</link>
      <description>&lt;P&gt;You could do that. You'd have to be careful, in case there were duplicate codes in your database.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;values_dict = {}

for d in doms:
    for c in d.codedValues:
        values_dict[c] = d.codedValues[c]&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 May 2023 18:26:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/storing-domian-coded-values-in-a-dictionary/m-p/1285353#M67582</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-05-03T18:26:33Z</dc:date>
    </item>
  </channel>
</rss>

