Skip to content

Object catalog

Every object group and variation in IEEE 1815-2012 Annex A, by number, name and size, and a report of which of them this library serves, accepts and reads.

Run the report with:

python -m py1815.object_coverage            # one line for each variation
python -m py1815.object_coverage --json     # the same rows as JSON
python -m py1815.object_coverage --subset-tables "Request-Response Subset Tables.xlsx"

Each variation is marked in three columns. Served: the outstation can put the object in a response. Requested: the outstation accepts the object in a request, as the header of a read, the body of a write or a control, or a class object. Parsed: the master reads the object out of a response. The marks are read from the tables the library uses, not counted by hand, so the report changes when the code does. The marks cover every subset level: an object that only a Level 3 or Level 4 outstation serves or accepts is marked all the same. A read answered in another variation, such as a 16-bit counter answered in 32 bits, marks the variation read as requested and the variation sent as served.

The subset level at which an object is required is not kept in this repository. Give the command your copy of the DNP Users Group subset tables, with --subset-tables or the PY1815_SUBSET_TABLES environment variable, and it adds a level column holding the lowest level whose tables list the object. Without the tables the column is left out.

Catalog

py1815.catalog

Every object group and variation IEEE 1815-2012 defines, by number and name.

Annex A of the standard is the object library: one subclause for each group, and one for each variation in it. This module names them all, whether or not this library reads or writes them, so that code that adds support for a group starts from the standard's numbers and not from a guess. It also gives each object's size where the standard fixes one.

The table below is written out, not read from conformance/ieee-1815-2012.json, because the library does not read that file at run time. tests/test_conformance.py diffs this table against the file, which scripts/extract_conformance.py reads from the standard, so a group, variation, name, type or size that disagrees with the standard fails the test suite.

Names are the standard's own headings, with its dashes written " - ". Which objects the outstation serves and the master reads is a separate question, answered from the code that does the work by :mod:py1815.object_coverage.

Copyright 2026 DER Security Corp. Licensed under the Apache License, Version 2.0.

ObjectKind

Bases: Enum

What an object is for, as the header of its subclause names it.

Source code in src/py1815/catalog.py
class ObjectKind(Enum):
    """What an object is for, as the header of its subclause names it."""

    STATIC = "Static"
    EVENT = "Event"
    COMMAND = "Cmnd"
    INFO = "Info"
    #: A file-control object that serves both purposes.
    INFO_EVENT = "Info/Event"
    #: A device attribute.
    ATTRIBUTE = "Attrib"
    #: A private data set object, which may be used for any of them.
    ANY = "Any"

SizeKind

Bases: Enum

How the standard fixes the size of an object.

Source code in src/py1815/catalog.py
class SizeKind(Enum):
    """How the standard fixes the size of an object."""

    #: A whole number of octets.
    FIXED = "fixed"
    #: Bits, packed from bit 0 of the first octet, one object per point.
    PACKED = "packed"
    #: Set by the sender: a string, a list or a body of other objects.
    VARIABLE = "variable"

Size dataclass

The size of one object.

Source code in src/py1815/catalog.py
@dataclass(frozen=True)
class Size:
    """The size of one object."""

    kind: SizeKind
    #: Octets for a fixed size, bits for a packed one, None for a variable one.
    amount: int | None = None

    @property
    def octets(self) -> int | None:
        """The octets of a fixed size, or None for any other."""
        return self.amount if self.kind is SizeKind.FIXED else None

    @property
    def bits(self) -> int | None:
        """The bits one object takes in a packed format, or None for any other."""
        return self.amount if self.kind is SizeKind.PACKED else None
octets property
octets: int | None

The octets of a fixed size, or None for any other.

bits property
bits: int | None

The bits one object takes in a packed format, or None for any other.

ObjectVariation dataclass

One variation of an object group.

Source code in src/py1815/catalog.py
@dataclass(frozen=True)
class ObjectVariation:
    """One variation of an object group."""

    group: int
    #: The variation number, or ALL for a group that gives none of its own.
    variation: int | None
    kind: ObjectKind
    size: Size
    name: str

ObjectGroup dataclass

One object group and the variations the standard defines for it.

Source code in src/py1815/catalog.py
@dataclass(frozen=True)
class ObjectGroup:
    """One object group and the variations the standard defines for it."""

    number: int
    name: str
    variations: dict[int | None, ObjectVariation]

fixed

fixed(octets: int) -> Size

A size of a whole number of octets.

Source code in src/py1815/catalog.py
def fixed(octets: int) -> Size:
    """A size of a whole number of octets."""
    return Size(SizeKind.FIXED, octets)

packed

packed(bits: int) -> Size

A packed size of this many bits for each object.

Source code in src/py1815/catalog.py
def packed(bits: int) -> Size:
    """A packed size of this many bits for each object."""
    return Size(SizeKind.PACKED, bits)

objects

objects() -> Iterator[ObjectVariation]

Every variation of every group, in group and variation order.

Source code in src/py1815/catalog.py
def objects() -> Iterator[ObjectVariation]:
    """Every variation of every group, in group and variation order."""
    for group in GROUPS.values():
        yield from group.variations.values()

find

find(
    group: int, variation: int | None
) -> ObjectVariation | None

The variation the standard defines under this number, or None.

Pass ALL for the one description of groups 100 and 110 to 113.

Source code in src/py1815/catalog.py
def find(group: int, variation: int | None) -> ObjectVariation | None:
    """The variation the standard defines under this number, or None.

    Pass ``ALL`` for the one description of groups 100 and 110 to 113.
    """
    entry = GROUPS.get(group)
    if entry is None:
        return None
    return entry.variations.get(variation)

Coverage report

py1815.object_coverage

Report which object groups and variations this library serves, accepts and reads.

For every variation :mod:py1815.catalog names, the report says three things:

served the outstation can put the object in a response; requested the outstation accepts the object in a request, as the header of a read, the body of a write or a control, or a class object; parsed the master reads the object out of a response.

The answers are read from the tables the code itself uses, so the report changes when the code does and nothing here is counted by hand: the outstation's variation tables, the session's event tables, the device attributes a Level 4 outstation builds, the master's object layouts and the control parser. A variation that no table mentions is reported as supported by none.

The marks cover every subset level and setting the tables hold: an object that only a Level 3 or Level 4 outstation serves or accepts is marked as served or requested, so a mark says the library can do it, not that every configuration does. A read that is answered in another variation marks the variation read as requested and the variation sent as served.

The subset level at which a variation is required comes from the DNP Users Group's subset tables, which this repository does not carry. Name a copy with --subset-tables or PY1815_SUBSET_TABLES and the report adds the column, read at run time; without one the column is left out.

Run it as python -m py1815.object_coverage.

Copyright 2026 DER Security Corp. Licensed under the Apache License, Version 2.0.

Coverage dataclass

What this library does with one object variation.

Source code in src/py1815/object_coverage.py
@dataclass(frozen=True)
class Coverage:
    """What this library does with one object variation."""

    group: int
    #: The variation number, or None for a group that gives none of its own.
    variation: int | None
    name: str
    served: bool
    requested: bool
    parsed: bool
    #: The lowest DNP3 subset level that requires the object, or None when the
    #: subset tables were not given or do not list it.
    level: int | None = None

served

served() -> set[Key]

Every object the outstation can put in a response.

Source code in src/py1815/object_coverage.py
def served() -> set[Key]:
    """Every object the outstation can put in a response."""
    found: set[Key] = set()
    found.update(outstation._DEFAULT_VARIATIONS.items())
    found.update(outstation._LEVEL_2_VARIATIONS.items())
    for table in (outstation._SERVED_VARIATIONS, outstation._LEVEL_4_VARIATIONS):
        for group, variations in table.items():
            found.update((group, variation) for variation in variations)
    for widened in _widened():
        for group, answers in widened.items():
            found.update((group, variation) for variation in answers.values())
    found.update(session._EVENT_SIZES)
    for group, answers in session._WIDENED_EVENT_VARIATIONS.items():
        found.update((group, variation) for variation in answers.values())
    found.update(session._OWN_OBJECTS)
    found.add((session.TIME_DELAY_GROUP, session.TIME_DELAY_FINE_VARIATION))
    found.update(
        (GROUP_COMMON_TIME, variation)
        for variation in (COMMON_TIME_SYNCHRONIZED, COMMON_TIME_UNSYNCHRONIZED)
    )
    found.update(_attributes())
    found.add((GROUP_DEVICE_ATTRIBUTES, Variation.LIST_OF_VARIATIONS))
    return found | _controls()

requested

requested() -> set[Key]

Every object the outstation accepts in a request.

Source code in src/py1815/object_coverage.py
def requested() -> set[Key]:
    """Every object the outstation accepts in a request."""
    found: set[Key] = set()
    found.update(outstation._DEFAULT_VARIATIONS.items())
    found.update(outstation._LEVEL_2_VARIATIONS.items())
    for table in (outstation._SERVED_VARIATIONS, outstation._LEVEL_4_VARIATIONS):
        for group, variations in table.items():
            found.update((group, variation) for variation in variations)
    for widened in _widened():
        for group, answers in widened.items():
            found.update((group, variation) for variation in answers)
    for event_table in (
        session._EVENT_VARIATIONS,
        session._EXTENDED_EVENT_VARIATIONS,
        session._OUTPUT_EVENT_VARIATIONS,
    ):
        for group, named in event_table.items():
            found.update((group, variation) for variation in named if variation)
    for group, answers in session._WIDENED_EVENT_VARIATIONS.items():
        found.update((group, variation) for variation in answers)
    found.update(session._OWN_OBJECTS)
    found.update((CLASS_GROUP, variation) for variation in CLASS_VARIATIONS)
    # The writes a session honors: the clock, and the restart indication.
    found.add((session.TIME_GROUP, session.TIME_VARIATION))
    found.add((session.TIME_GROUP, session.LAST_RECORDED_TIME_VARIATION))
    found.add((session.RESTART_GROUP, session.RESTART_VARIATION))
    # A read names each attribute, all of them or the list; a write is of one served.
    found.update(_attributes())
    found.update(
        (GROUP_DEVICE_ATTRIBUTES, variation)
        for variation in (Variation.ALL_ATTRIBUTES, Variation.LIST_OF_VARIATIONS)
    )
    return found | _controls()

parsed

parsed() -> set[Key]

Every object the master reads out of a response.

Source code in src/py1815/object_coverage.py
def parsed() -> set[Key]:
    """Every object the master reads out of a response."""
    # The master reads any device attribute by the length it states (D121).
    # A response never carries variation 254, which only asks for the others.
    attributes = {
        (item.group, item.variation)
        for item in catalog.objects()
        if item.group == GROUP_DEVICE_ATTRIBUTES and item.variation != Variation.ALL_ATTRIBUTES
    }
    return set(decode.LAYOUTS) | _controls() | attributes

subset_levels

subset_levels(path: Path) -> dict[Key, int]

The lowest subset level at which each variation appears in the subset tables.

Reads the workbook as the subset-table tests do. A row lists a function code and its qualifiers, and the levels that require them are marked in four columns; the object it belongs to is named by the nearest row above that gives a group and a variation. Variation 0, "any variation", names no object.

Source code in src/py1815/object_coverage.py
def subset_levels(path: pathlib.Path) -> dict[Key, int]:
    """The lowest subset level at which each variation appears in the subset tables.

    Reads the workbook as the subset-table tests do. A row lists a function code
    and its qualifiers, and the levels that require them are marked in four
    columns; the object it belongs to is named by the nearest row above that
    gives a group and a variation. Variation 0, "any variation", names no object.
    """
    book = xlsx.load_workbook(path)
    levels: dict[Key, int] = {}
    for name in book.sheetnames:
        group: int | None = None
        variation: int | None = None
        for row in book[name].iter_rows():
            cells = ["" if cell is None else str(cell).strip() for cell in row] + [""] * 12
            if cells[0].startswith("Table"):
                group = variation = None
                continue
            if cells[0].isdigit():
                group = int(cells[0])
            if re.fullmatch(r"\d+", cells[1]):
                variation = int(cells[1])
            marks = [int(cell) for cell in cells[5:9] if cell in {"1", "2", "3", "4"}]
            if group is None or not variation or not marks:
                continue
            key = (group, variation)
            levels[key] = min(levels.get(key, 4), *marks)
    return levels

coverage

coverage(
    levels: dict[Key, int] | None = None,
) -> list[Coverage]

One entry for every variation of every group in the catalog.

Source code in src/py1815/object_coverage.py
def coverage(levels: dict[Key, int] | None = None) -> list[Coverage]:
    """One entry for every variation of every group in the catalog."""
    can_serve, accepts, reads = served(), requested(), parsed()
    return [
        Coverage(
            item.group,
            item.variation,
            item.name,
            served=(item.group, item.variation) in can_serve,
            requested=(item.group, item.variation) in accepts,
            parsed=(item.group, item.variation) in reads,
            level=None if levels is None else levels.get((item.group, item.variation)),
        )
        for item in catalog.objects()
    ]

format_report

format_report(
    rows: Sequence[Coverage], *, with_levels: bool = False
) -> str

The report as text: a heading for each group and a line for each variation.

Source code in src/py1815/object_coverage.py
def format_report(rows: Sequence[Coverage], *, with_levels: bool = False) -> str:
    """The report as text: a heading for each group and a line for each variation."""
    lines: list[str] = []
    for group in catalog.GROUPS.values():
        mine = [row for row in rows if row.group == group.number]
        if not mine:
            continue
        counts = ", ".join(
            f"{label} {sum(getattr(row, label) for row in mine)} of {len(mine)}"
            for label in ("served", "requested", "parsed")
        )
        lines.append(f"Group {group.number}: {group.name} ({counts})")
        for row in mine:
            number = "all" if row.variation is None else str(row.variation)
            marks = "  ".join(
                f"{'yes' if getattr(row, label) else '-':3}"
                for label in ("served", "requested", "parsed")
            )
            level = ""
            if with_levels:
                level = f"  L{row.level}" if row.level is not None else "  -"
            lines.append(f"  {number:>4}  {marks}{level}  {row.name}")
        lines.append("")
    header = "served  requested  parsed" + ("  level" if with_levels else "")
    return f"Columns, left to right: {header}\n\n" + "\n".join(lines).rstrip() + "\n"

main

main(argv: Sequence[str] | None = None) -> int

Print the report; return 0, or 2 when the subset tables cannot be read.

Source code in src/py1815/object_coverage.py
def main(argv: Sequence[str] | None = None) -> int:
    """Print the report; return 0, or 2 when the subset tables cannot be read."""
    parser = argparse.ArgumentParser(
        prog="python -m py1815.object_coverage",
        description="Report which IEEE 1815-2012 objects this library serves, accepts and reads.",
    )
    parser.add_argument(
        "--subset-tables",
        type=pathlib.Path,
        default=os.environ.get(SUBSET_TABLES_ENV) or None,
        metavar="WORKBOOK",
        help=f"your copy of the DNP Users Group subset tables, to add the level column "
        f"(default: ${SUBSET_TABLES_ENV})",
    )
    parser.add_argument("--json", action="store_true", help="print the rows as JSON")
    args = parser.parse_args(argv)

    levels = None
    if args.subset_tables is not None:
        try:
            levels = subset_levels(args.subset_tables)
        except (OSError, xlsx.WorkbookError) as error:
            print(f"cannot read the subset tables: {error}", file=sys.stderr)
            return 2
    rows = coverage(levels)
    if args.json:
        print(json.dumps([asdict(row) for row in rows], indent=2))
    else:
        print(format_report(rows, with_levels=levels is not None), end="")
    return 0