<?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: batch domain list in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680061#M75056</link>
    <description>&lt;P&gt;Something like this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;egdb = r"GDB.sde"
badDomains = []

for dom in arcpy.da.ListDomains(egdb):
    if dom.domainType == "Range":
        continue
    for key in dom.codedValues:
        if key!= dom.codedValues[key]:
            badDomains.append(dom.name)
print("done")
print(badDomains)&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 26 Jan 2026 21:11:28 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2026-01-26T21:11:28Z</dc:date>
    <item>
      <title>batch domain list</title>
      <link>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680051#M75054</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I am looking for python script that extract all domains where&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;code &amp;lt;&amp;gt; description &lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;from SDE(oracle) database. any sample code that I could reuse is greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ram&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2026 20:55:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680051#M75054</guid>
      <dc:creator>rami_shah</dc:creator>
      <dc:date>2026-01-26T20:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: batch domain list</title>
      <link>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680055#M75055</link>
      <description>&lt;P&gt;The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/listdomains.htm" target="_self"&gt;List Domains&lt;/A&gt; function is what you're looking for, this will work on any EGDB. The sample code on that page should get you started.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2026 20:59:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680055#M75055</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2026-01-26T20:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: batch domain list</title>
      <link>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680061#M75056</link>
      <description>&lt;P&gt;Something like this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;egdb = r"GDB.sde"
badDomains = []

for dom in arcpy.da.ListDomains(egdb):
    if dom.domainType == "Range":
        continue
    for key in dom.codedValues:
        if key!= dom.codedValues[key]:
            badDomains.append(dom.name)
print("done")
print(badDomains)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 26 Jan 2026 21:11:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680061#M75056</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2026-01-26T21:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: batch domain list</title>
      <link>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680316#M75057</link>
      <description>&lt;P&gt;NOTE: In your version, if a domain has multiple non-matching values, it is added multiple times.&lt;/P&gt;&lt;P&gt;You can also do this in a dictionary comprehension:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def bad_domain(dataset: str):
    from arcpy.da import ListDomains
    return {
        d.name: d 
        for d in ListDomains(dataset) 
        if d.domainType == 'CodedValue' 
        and not all(
            value_key == value_description 
            for value_key, value_description in d.codedValues.items()
        )
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I usually like to unroll these types of filters into multiple functions so it's clear exactly what checks are being made:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from typing import Any
from arcpy.da import Domain

def is_bad_values(val: dict[Any, str]):
    any(k != v for k, v in val.items())

def is_bad_domain(d: Domain):
    return d.domainType == 'CodedValue' and is_bad_values(d.codedValues)

def bad_domains(dataset: str):
    from arcpy.da import ListDomains
    return {d.name: d for d in ListDomains(dataset) if is_bad_domain(d)}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to get REALLY re-usable, you can use a registration pattern:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from collections.abc import Callable
from functools import wraps
from typing import Any
from arcpy.da import Domain

type DomainValidator = Callable[[Domain], bool]

Validators: list[DomainValidator] = []

VALID = True
INVALID = False

def register_validator(func: DomainValidator):
    Validators.append(func)
    @wraps
    def _wrapper(*args: Any, **kwargs: Any):
        return func(*args, **kwargs)
    return _wrapper


@register_validator
def domain_value_check(d: Domain):
    if d.domainType == 'CodedValue' :
        if any(k != v for k, v in d.codedValues.items()):
            return INVALID
    return VALID

@register_validator
def domain_range_check(d: Domain):
    if d.domainType == 'Range':
        min, max = d.range
        if not isinstance(min, (int, float)):
            return INVALID
        if not isinstance(max, (int, float)):
            return INVALID
        if min &amp;lt; 0 or max &amp;gt; 100:
            return INVALID
    return VALID

def bad_domains(dataset: str, validators: list[DomainValidator]=Validators):
    from arcpy.da import ListDomains
    return {
        d.name: d 
        for d in ListDomains(dataset) 
        if any(validator(d) is INVALID for validator in validators)
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you can just add and remove validations as you please.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2026 20:03:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-domain-list/m-p/1680316#M75057</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2026-01-27T20:03:00Z</dc:date>
    </item>
  </channel>
</rss>

