Repository: digital-asset/dazl-client (language: python)

Issue:
python: Backport dazl.util from v7.
Type fixes and more resurrection of dead code in `dazl.util`.

This code will still be removed as part of dazl v8, but will remain in dazl v7.5.


Discussion / hints:

Fix patch:
diff --git a/python/dazl/__init__.py b/python/dazl/__init__.py
index 675978bd..a021f49e 100644
--- a/python/dazl/__init__.py
+++ b/python/dazl/__init__.py
@@ -53,9 +53,8 @@
     exercise_by_key,
 )
 from .ledger import Command, connect
-from .model.core import ContractId
 from .pretty.table import write_acs
-from .prim import ContractData, DazlError, FrozenDict as frozendict, Party
+from .prim import ContractData, ContractId, DazlError, FrozenDict as frozendict, Party
 from .util.logging import setup_default_logger
 
 try:
diff --git a/python/dazl/client/_network_client_impl.py b/python/dazl/client/_network_client_impl.py
index d39a0197..034a5533 100644
--- a/python/dazl/client/_network_client_impl.py
+++ b/python/dazl/client/_network_client_impl.py
@@ -590,7 +590,6 @@ async def _init(
                 None,
                 metadata.ledger_id,
                 self._network_impl.lookup,
-                metadata._store,
             )
             init_futs.append(ensure_future(self._network_impl.emit_event(init_evt)))
         for party_impl in party_impls:
@@ -614,7 +613,6 @@ async def _init(
                 None,
                 metadata.ledger_id,
                 self._network_impl.lookup,
-                metadata._store,
                 offset,
             )
             ready_futs.append(ensure_future(self._network_impl.emit_event(ready_evt)))
diff --git a/python/dazl/client/_party_client_impl.py b/python/dazl/client/_party_client_impl.py
index 6bd4d927..0f55392f 100644
--- a/python/dazl/client/_party_client_impl.py
+++ b/python/dazl/client/_party_client_impl.py
@@ -173,7 +173,6 @@ def initialize(
             current_time,
             metadata.ledger_id,
             self.parent.lookup,
-            metadata._store,
         )
         return self.emit_event(evt)
 
@@ -224,13 +223,13 @@ async def emit_ready(
             have been processed.
         """
         ready_event = ReadyEvent(
-            self, self.party, time, metadata.ledger_id, self.parent.lookup, metadata._store, offset
+            self, self.party, time, metadata.ledger_id, self.parent.lookup, offset
         )
         self._known_packages.update(self.parent.lookup.package_ids())
         await self.emit_event(ready_event)
 
         pkg_event = PackagesAddedEvent(
-            self, self.party, time, metadata.ledger_id, self.parent.lookup, metadata._store, True
+            self, self.party, time, metadata.ledger_id, self.parent.lookup, True
         )
         await self.emit_event(pkg_event)
 
@@ -379,7 +378,6 @@ async def read_transactions(
                     None,
                     metadata.ledger_id,
                     self.parent.lookup,
-                    metadata._store,
                     False,
                 )
                 self._known_packages.update(all_packages)
diff --git a/python/dazl/client/api.py b/python/dazl/client/api.py
index 169c971b..3204f7bc 100644
--- a/python/dazl/client/api.py
+++ b/python/dazl/client/api.py
@@ -76,10 +76,6 @@
 from .ledger import LedgerMetadata
 from .state import ContractContextualData, ContractContextualDataCollection, ContractsState
 
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-    from ..model.types import TemplateNameLike
-
 __all__ = [
     "DEFAULT_TIMEOUT_SECONDS",
     "simple_client",
@@ -874,7 +870,7 @@ async def create(
 
     def submit_create(
         self,
-        template_name: TemplateNameLike,
+        template_name: Union[str, TypeConName],
         arguments: Optional[dict] = None,
         workflow_id: Optional[str] = None,
         deduplication_time: Optional[TimeDeltaLike] = None,
@@ -1054,7 +1050,7 @@ async def exercise_by_key(
 
     def submit_exercise_by_key(
         self,
-        template_name: TemplateNameLike,
+        template_name: Union[str, TypeConName],
         contract_key: Any,
         choice_name: str,
         arguments: Optional[dict] = None,
@@ -1154,7 +1150,7 @@ async def create_and_exercise(
 
     def submit_create_and_exercise(
         self,
-        template_name: TemplateNameLike,
+        template_name: Union[str, TypeConName],
         arguments: dict,
         choice_name: str,
         choice_arguments: Optional[dict] = None,
@@ -1715,7 +1711,7 @@ def create(
 
     def submit_create(
         self,
-        template_name: TemplateNameLike,
+        template_name: Union[str, TypeConName],
         arguments: Optional[dict] = None,
         workflow_id: Optional[str] = None,
         deduplication_time: Optional[TimeDeltaLike] = None,
@@ -1891,7 +1887,7 @@ def exercise_by_key(
 
     def submit_exercise_by_key(
         self,
-        template_name: TemplateNameLike,
+        template_name: Union[str, TypeConName],
         contract_key: Any,
         choice_name: str,
         arguments: Optional[dict] = None,
@@ -1988,7 +1984,7 @@ def create_and_exercise(
 
     def submit_create_and_exercise(
         self,
-        template_name: TemplateNameLike,
+        template_name: Union[str, TypeConName],
         arguments: dict,
         choice_name: str,
         choice_arguments: Optional[dict] = None,
diff --git a/python/dazl/client/ledger.py b/python/dazl/client/ledger.py
index da8fe650..5506c656 100644
--- a/python/dazl/client/ledger.py
+++ b/python/dazl/client/ledger.py
@@ -7,15 +7,10 @@
 from __future__ import annotations
 
 from dataclasses import dataclass
-from typing import TYPE_CHECKING
-import warnings
 
 from ..ledger.aio import PackageLoader
 from ..protocols.serializers import Serializer
 
-if TYPE_CHECKING:
-    from ..model.types_store import PackageStore
-
 __all__ = ["LedgerMetadata"]
 
 
@@ -29,24 +24,15 @@ class LedgerMetadata:
     package_loader: "PackageLoader"
     serializer: "Serializer"
     protocol_version: str
-    _store: "PackageStore"
 
-    def __init__(self, ledger_id, package_loader, serializer, protocol_version, store):
+    def __init__(
+        self,
+        ledger_id: str,
+        package_loader: PackageLoader,
+        serializer: Serializer,
+        protocol_version: str,
+    ):
         object.__setattr__(self, "ledger_id", ledger_id)
         object.__setattr__(self, "package_loader", package_loader)
         object.__setattr__(self, "serializer", serializer)
         object.__setattr__(self, "protocol_version", protocol_version)
-        object.__setattr__(self, "_store", store)
-
-    @property
-    def store(self) -> "PackageStore":
-        if self._store is None:
-            raise Exception("eager_package_fetch is disabled, which disables the PackageStore")
-
-        warnings.warn(
-            "PackageStore is deprecated; use SymbolLookup "
-            "(accessible from Network.lookup) instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return self._store
diff --git a/python/dazl/damlast/_builtins_meta.py b/python/dazl/damlast/_builtins_meta.py
index d74a5a85..0bfc696e 100644
--- a/python/dazl/damlast/_builtins_meta.py
+++ b/python/dazl/damlast/_builtins_meta.py
@@ -9,15 +9,10 @@
 from __future__ import annotations
 
 from typing import Any, Optional, Sequence, Type as PyType, Union
-import warnings
 
 from .daml_lf_1 import BuiltinFunction, Expr, Type, ValName
 from .util import package_local_name
 
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-    from ..model.types import TypeReference
-
 
 class _BuiltinMeta(type):
     def __new__(mcs, name, bases, dct):
@@ -66,16 +61,14 @@ def add(self, builtin: "PyType[Builtin]"):
         else:
             raise ValueError(f"A builtin could not be registered! {builtin!r}")
 
-    def resolve(
-        self, ref: "Union[str, ValName, TypeReference, BuiltinFunction]"
-    ) -> "Optional[Builtin]":
+    def resolve(self, ref: "Union[str, ValName, BuiltinFunction]") -> "Optional[Builtin]":
         """
         Return a :class:`Builtin` implementation for the name or reference if one is defined.
         """
         if isinstance(ref, BuiltinFunction):
             # All BuiltinFunctions MUST be defined
             return self.by_builtin[ref]
-        elif isinstance(ref, (ValName, TypeReference)):
+        elif isinstance(ref, ValName):
             return self.by_name.get(package_local_name(ref))
         elif isinstance(ref, str):
             return self.by_name.get(ref)
diff --git a/python/dazl/damlast/compat.py b/python/dazl/damlast/compat.py
deleted file mode 100644
index 95970ae1..00000000
--- a/python/dazl/damlast/compat.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-Compatibility methods
----------------------
-
-These functions should only be used internally by code that is helping in the transition from the
-deprecated :class:`dazl.model.types.Type` hierarchy to :class:`dazl.damlast.daml_lf_1.Type`.
-These functions will be removed WITHOUT an intermediate deprecation warning, as they are considered
-internal only.
-"""
-from __future__ import annotations
-
-from typing import TYPE_CHECKING, Tuple, Union
-import warnings
-
-from .daml_lf_1 import TypeConName
-
-if TYPE_CHECKING:
-    # avoid import cycles; `dazl.model` should depend on `dazl.damlast`, and not the other way
-    # around
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from ..model.types import Type as DeprecatedType, TypeReference as DeprecatedTypeReference
-
-
-def parse_template(
-    template_id: "Union[str, DeprecatedType, TypeConName]",
-) -> "Tuple[TypeConName, DeprecatedTypeReference]":
-    """
-    Return both the "new-style" Type and the "old-style" Type for _either_ a string, "new-style"
-    Type, or "old-style" Type. This is used in places where we can't easily mark a symbol as
-    deprecated (particularly, constructors for types that are NOT to be deprecated as part of this
-    transition).
-    """
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from ..model.types import (
-            Type as DeprecatedType,
-            TypeReference as DeprecatedTypeReference,
-            UnresolvedTypeReference,
-            RecordType,
-        )
-    from ..damlast.lookup import parse_type_con_name
-
-    if isinstance(template_id, str):
-        name = parse_type_con_name(template_id, allow_deprecated_identifiers=True)
-        return name, DeprecatedTypeReference(name)
-
-    elif isinstance(template_id, TypeConName):
-        return template_id, DeprecatedTypeReference(template_id)
-
-    elif isinstance(template_id, DeprecatedType):
-        warnings.warn(
-            "usage of dazl.model.types.Type is deprecated; use TypeConName instead",
-            DeprecationWarning,
-            stacklevel=3,
-        )
-
-        if isinstance(template_id, DeprecatedTypeReference):
-            return template_id.con, template_id
-
-        elif isinstance(template_id, UnresolvedTypeReference):
-            name = parse_type_con_name(template_id.name, allow_deprecated_identifiers=True)
-            return name, DeprecatedTypeReference(name)
-
-        elif isinstance(template_id, RecordType):
-            if template_id.name is None:
-                raise ValueError(
-                    "template_id must point to a named record that corresponds to a template"
-                )
-
-            return template_id.name.con, DeprecatedTypeReference(template_id.name.con)
-        else:
-            raise ValueError("unknown dazl.model.types.Type implementation")
-    else:
-        raise ValueError("template_id must be a TypeConName")
diff --git a/python/dazl/damlast/eval_scope.py b/python/dazl/damlast/eval_scope.py
deleted file mode 100644
index 9604a1c5..00000000
--- a/python/dazl/damlast/eval_scope.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-from __future__ import annotations
-
-from types import MappingProxyType
-from typing import Collection, Mapping, Optional
-import warnings
-
-from .daml_lf_1 import Expr, Type, ValName
-
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-    from ..model.types_store import PackageStore
-
-
-warnings.warn(
-    "dazl.damlast.eval_scope is deprecated; there is no replacement.",
-    DeprecationWarning,
-    stacklevel=2,
-)
-
-
-class EvaluationScope:
-    def __init__(
-        self,
-        store: "PackageStore",
-        bindings: "Mapping[str, Expr]",
-        blocked_value_refs: "Collection[ValName]" = (),
-        depth: int = 0,
-    ):
-        warnings.warn(
-            "EvaluationScope is deprecated; there is no replacement.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self.store = store
-        self.depth = depth
-        self._vars = MappingProxyType(dict(bindings))
-        self._blocked_value_refs = frozenset(blocked_value_refs)
-
-    def without(self, var_name: str) -> "EvaluationScope":
-        """
-        Return a child scope with the specified variable name _unbound_.
-
-        :param var_name:
-        :return:
-        """
-        new_bindings = dict(self._vars)
-        del new_bindings[var_name]
-        return EvaluationScope(self.store, new_bindings, self._blocked_value_refs, self.depth + 1)
-
-    def without_value(self, value_ref) -> "EvaluationScope":
-        """
-        Return a child scope where the value corresponding to the specified value reference will
-        NOT be returned. (This is used to handle breaking otherwise recursive calls.)
-
-        :param value_ref: The value to withhold.
-        """
-        values = set(self._blocked_value_refs)
-        values.discard(value_ref)
-
-        return EvaluationScope(self.store, self._vars, frozenset(values), self.depth + 1)
-
-    def child_scope(self, new_bindings: "Mapping[str, Expr]") -> "EvaluationScope":
-        bindings = dict(self._vars)
-        bindings.update(new_bindings)
-        return EvaluationScope(self.store, bindings, self._blocked_value_refs, self.depth + 1)
-
-    def get_bound(self, var_name) -> "Expr":
-        return self._vars[var_name]
-
-    def resolve_type(self, type_ref) -> "Type":
-        pass
-
-    def resolve_value(self, value_ref) -> "Optional[Expr]":
-        if value_ref in self._blocked_value_refs:
-            return None
-        else:
-            return self.store.resolve_value_reference(value_ref)
diff --git a/python/dazl/damlast/lookup.py b/python/dazl/damlast/lookup.py
index 2be1141f..c738eb20 100644
--- a/python/dazl/damlast/lookup.py
+++ b/python/dazl/damlast/lookup.py
@@ -67,11 +67,11 @@
 STAR = PackageRef("*")
 
 
-def parse_type_con_name(val: str, allow_deprecated_identifiers: bool = False) -> TypeConName:
+def parse_type_con_name(val: str) -> TypeConName:
     """
     Parse the given string as a type constructor.
     """
-    pkg, name = validate_template(val, allow_deprecated_identifiers=allow_deprecated_identifiers)
+    pkg, name = validate_template(val)
     module_name, _, entity_name = name.rpartition(":")
     if module_name:
         module_ref = ModuleRef(pkg, DottedName(module_name.split(".")))
@@ -88,9 +88,7 @@ def empty_lookup_impl(ref: Any) -> NoReturn:
         raise NameNotFoundError(ref)
 
 
-def validate_template(
-    template: Any, allow_deprecated_identifiers: bool = False
-) -> Tuple[PackageRef, str]:
+def validate_template(template: Any) -> Tuple[PackageRef, str]:
     """
     Return a module and type name component from something that can be interpreted as a template.
 
@@ -109,20 +107,6 @@ def validate_template(
     if template == "*" or template is None:
         return STAR, "*"
 
-    if allow_deprecated_identifiers:
-        warnings.warn(
-            "validate_template(..., allow_deprecated_identifiers=True) will be removed in dazl v8",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            from ..model.types import UnresolvedTypeReference
-
-        if isinstance(template, UnresolvedTypeReference):
-            template = template.name
-
     if isinstance(template, str):
         components = template.split(":")
         if len(components) == 3:
@@ -134,7 +118,7 @@ def validate_template(
             # one colon, so assume the package ID is unspecified UNLESS the second component is a
             # wildcard; then we assume the wildcard means any module name and entity name
             m, e = components
-            if m == STAR and e != STAR and not allow_deprecated_identifiers:
+            if m == STAR and e != STAR:
                 # strings that look like "*:SOMETHING" are explicitly not allowed unless deprecated
                 # identifier support is requested; this is almost certainly an attempt to use
                 # periods instead of colons as a delimiter between module name and entity name
@@ -142,12 +126,6 @@ def validate_template(
 
             return (STAR, f"{m}:{e}") if e != "*" else (PackageRef(m), "*")
 
-        elif len(components) == 1 and allow_deprecated_identifiers:
-            # no colon whatsoever
-            # TODO: Add a deprecation warning in the appropriate place
-            m, _, e = components[0].rpartition(".")
-            return STAR, f"{m}:{e}"
-
         else:
             raise ValueError("string must be in the format PKG_REF:MOD:ENTITY or MOD:ENTITY")
 
@@ -521,11 +499,10 @@ class PackageExceptionTracker:
     retryable.
     """
 
-    def __init__(self, allow_deprecated_identifiers: bool = False):
+    def __init__(self):
         self._seen_types = set()  # type: Set[str]
         self._seen_packages = set()  # type: Set[PackageRef]
         self._pkg_refs = list()  # type: List[PackageRef]
-        self._allow_deprecated_identifiers = allow_deprecated_identifiers
         self.done = False
 
     def __enter__(self):
@@ -560,9 +537,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
 
             with warnings.catch_warnings():
                 warnings.simplefilter("ignore", DeprecationWarning)
-                pkg_id, name = validate_template(
-                    exc_val.ref, allow_deprecated_identifiers=self._allow_deprecated_identifiers
-                )
+                pkg_id, name = validate_template(exc_val.ref)
             if pkg_id == "*":
                 # we don't know what package contains this type, so we have no
                 # choice but to look in all known packages
diff --git a/python/dazl/damlast/pkgfile.py b/python/dazl/damlast/pkgfile.py
index 8fb3941d..1341447e 100644
--- a/python/dazl/damlast/pkgfile.py
+++ b/python/dazl/damlast/pkgfile.py
@@ -13,6 +13,7 @@
 
 from .._gen.com.daml.daml_lf_1_14 import daml_lf_pb2 as pb
 from .daml_lf_1 import Archive, Package, PackageRef
+from .errors import PackageNotFoundError
 from .parse import parse_archive
 
 # Wherever the API expects a DAR, we can take a file path, `bytes`, or a byte buffer.
@@ -222,11 +223,7 @@ def archives(self) -> "Collection[Archive]":
                         self._archives = dar.archives()
         return self._archives
 
-    def package(self, package_id: "PackageRef") -> "Package":
-        # TODO: This import needs to be local as long as the dazl.util.dar module still exists
-        #  to avoid import cycles. Move this to the top of the file when dazl.util.dar is removed.
-        from .errors import PackageNotFoundError
-
+    def package(self, package_id: PackageRef) -> Package:
         for archive in self.archives():
             if archive.hash == package_id:
                 return archive.package
diff --git a/python/dazl/damlast/types.py b/python/dazl/damlast/types.py
index 71d7c51a..423ffc1d 100644
--- a/python/dazl/damlast/types.py
+++ b/python/dazl/damlast/types.py
@@ -3,22 +3,12 @@
 
 from __future__ import annotations
 
-from typing import TYPE_CHECKING, Callable, Optional, no_type_check
-import warnings
+from typing import Callable
 
-from ..util.typing import safe_cast
 from ._base import T
 from .daml_lf_1 import PrimType, Type
 
-if TYPE_CHECKING:
-    from ..model.types import Type as OldType
-
-
-def var(var_: str) -> "Type":
-    warnings.warn("dazl.damlast.types.var is deprecated; use dazl.damlast.daml_types.var instead.")
-    from .daml_types import var as _var
-
-    return _var(var_)
+__all__ = ["match_prim_type"]
 
 
 def match_prim_type(
@@ -89,198 +79,3 @@ def match_prim_type(
         return on_any_exception()
     else:
         raise ValueError(f"undefined PrimType: {prim_type}")
-
-
-def get_old_type(daml_type: "Type") -> "OldType":
-    warnings.warn(
-        "get_old_type is deprecated; use the types of dazl.damlast.daml_lf_1 instead",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from ..model.types import UnsupportedType
-
-        return safe_cast(Type, daml_type).Sum_match(
-            _old_type_var,
-            _old_type_con,
-            _old_type_prim,
-            _old_forall_type,
-            lambda tuple_: UnsupportedType("Tuple"),
-            lambda nat: UnsupportedType("Nat"),
-            lambda _: UnsupportedType("Syn"),
-        )
-
-
-def _old_type_var(var_: "Type.Var") -> "OldType":
-    from ..model.types import TypeApp, TypeVariable
-
-    core_type = TypeVariable(var_.var)
-    return (
-        TypeApp(core_type, [get_old_type(var_) for var_ in var_.args]) if var_.args else core_type
-    )
-
-
-def _old_type_con(con: "Type.Con") -> "OldType":
-    from ..model.types import TypeApp, TypeReference
-
-    core_type = TypeReference(con.tycon)
-    return TypeApp(core_type, [get_old_type(var) for var in con.args]) if con.args else core_type
-
-
-def _old_type_prim(prim: "Type.Prim") -> "OldType":
-    from ..model.types import UnsupportedType
-
-    return match_prim_type(
-        prim,
-        _old_scalar_type_unit,
-        _old_scalar_type_bool,
-        _old_scalar_type_integer,
-        _old_scalar_type_decimal,
-        _old_scalar_type_text,
-        _old_scalar_type_datetime,
-        _old_scalar_type_reltime,
-        _old_scalar_type_party,
-        _old_list_type,
-        _old_update_type,
-        lambda *args: UnsupportedType("Scenario"),
-        _old_scalar_type_date,
-        _old_scalar_contract_id_type,
-        _old_optional_type,
-        lambda *args: UnsupportedType("Arrow"),
-        _old_textmap_type,
-        _old_scalar_type_numeric,
-        _old_scalar_type_any,
-        _old_scalar_type_type_rep,
-        _old_genmap_type,
-        lambda *args: UnsupportedType("AnyException"),
-    )
-
-
-@no_type_check
-def _old_type_syn(tysyn: "Type.Syn") -> "OldType":
-    from ..model.types import TypeApp, TypeReference
-
-    core_type = tysyn.tysyn
-    return (
-        TypeApp(TypeReference(core_type), [get_old_type(arg) for arg in tysyn.args])
-        if tysyn.args
-        else core_type
-    )
-
-
-def _old_forall_type(forall: "Type.Forall") -> "OldType":
-    from ..model.types import ForAllType
-
-    return ForAllType(forall.vars, get_old_type(forall.body))
-
-
-def _old_scalar_type_unit() -> "OldType":
-    from ..model.types import SCALAR_TYPE_UNIT
-
-    return SCALAR_TYPE_UNIT
-
-
-def _old_scalar_type_bool() -> "OldType":
-    from ..model.types import SCALAR_TYPE_BOOL
-
-    return SCALAR_TYPE_BOOL
-
-
-def _old_scalar_type_integer() -> "OldType":
-    from ..model.types import SCALAR_TYPE_INTEGER
-
-    return SCALAR_TYPE_INTEGER
-
-
-def _old_scalar_type_decimal() -> "OldType":
-    from ..model.types import SCALAR_TYPE_DECIMAL
-
-    return SCALAR_TYPE_DECIMAL
-
-
-def _old_scalar_type_numeric(nat: int = 10) -> "OldType":
-    from ..model.types import SCALAR_TYPE_NUMERIC
-
-    return SCALAR_TYPE_NUMERIC
-
-
-def _old_scalar_type_text() -> "OldType":
-    from ..model.types import SCALAR_TYPE_TEXT
-
-    return SCALAR_TYPE_TEXT
-
-
-def _old_scalar_type_datetime() -> "OldType":
-    from ..model.types import SCALAR_TYPE_DATETIME
-
-    return SCALAR_TYPE_DATETIME
-
-
-def _old_scalar_type_reltime() -> "OldType":
-    from ..model.types import SCALAR_TYPE_RELTIME
-
-    return SCALAR_TYPE_RELTIME
-
-
-def _old_scalar_type_party() -> "OldType":
-    from ..model.types import SCALAR_TYPE_PARTY
-
-    return SCALAR_TYPE_PARTY
-
-
-def _old_scalar_type_any() -> "OldType":
-    from ..model.types import SCALAR_TYPE_ANY
-
-    return SCALAR_TYPE_ANY
-
-
-def _old_list_type(arg: "Type") -> "OldType":
-    from ..model.types import ListType
-
-    return ListType(get_old_type(arg))
-
-
-def _old_update_type(arg: "Type") -> "OldType":
-    from ..model.types import UpdateType
-
-    return UpdateType(get_old_type(arg))
-
-
-def _old_scalar_type_date() -> "OldType":
-    from ..model.types import SCALAR_TYPE_DATE
-
-    return SCALAR_TYPE_DATE
-
-
-def _old_scalar_contract_id_type(arg: "Type") -> "OldType":
-    from ..model.types import ContractIdType
-
-    return ContractIdType(get_old_type(arg))
-
-
-def _old_optional_type(arg: "Type") -> "OldType":
-    from ..model.types import OptionalType
-
-    return OptionalType(get_old_type(arg))
-
-
-def _old_textmap_type(value_type: "Type") -> "OldType":
-    from ..model.types import TextMapType
-
-    return TextMapType(get_old_type(value_type))
-
-
-def _old_scalar_type_type_rep(arg: "Optional[Type]" = None) -> "OldType":
-    from ..model.types import TypeRefType, UnsupportedType
-
-    if arg is not None:
-        return TypeRefType(get_old_type(arg))
-    else:
-        return UnsupportedType("TypeRef")
-
-
-def _old_genmap_type(key_type: "Type", value_type: "Type") -> "OldType":
-    from ..model.types import GenMapType
-
-    return GenMapType(get_old_type(key_type), get_old_type(value_type))
diff --git a/python/dazl/damlast/util.py b/python/dazl/damlast/util.py
index 8c72524c..aa900988 100644
--- a/python/dazl/damlast/util.py
+++ b/python/dazl/damlast/util.py
@@ -3,7 +3,7 @@
 
 from __future__ import annotations
 
-from typing import TYPE_CHECKING, Mapping, Optional, Sequence, Union
+from typing import Optional, Sequence, Union
 import warnings
 
 from .daml_lf_1 import (
@@ -22,29 +22,6 @@
     _Name,
 )
 
-if TYPE_CHECKING:
-    from ..model.types import Type as OldType, TypeReference
-    from ..model.types_store import PackageStore
-
-
-def var(var: str) -> "Type":
-    warnings.warn("dazl.damlast.util.var is deprecated; use dazl.damlast.daml_types.var instead.")
-    from .daml_types import var as _var
-
-    return _var(var)
-
-
-def values_by_module(
-    store: "PackageStore",
-) -> "Mapping[ModuleRef, Mapping[Sequence[str], Union[Expr, OldType]]]":
-    warnings.warn(
-        "dazl.damlast.util.values_by_module is deprecated; there is no replacement.",
-        DeprecationWarning,
-    )
-    from ..pretty.render_python import values_by_module  # type: ignore
-
-    return values_by_module(store)  # type: ignore
-
 
 # noinspection PyShadowingBuiltins
 def unpack_arrow_type(type: "Optional[Type]") -> "Sequence[Type]":
@@ -125,12 +102,10 @@ def def_value(name: "Union[str, Sequence[str]]", daml_type: "Type", expr: "Expr"
     return DefValue(name_with_type, expr, True, False, None)
 
 
-def package_ref(obj: "Union[ModuleRef, _Name, TypeReference]") -> "PackageRef":
+def package_ref(obj: "Union[ModuleRef, _Name]") -> "PackageRef":
     """
     Return the package ID for a :class:`ModuleRef` or a DAML name.
     """
-    from ..model.types import TypeReference
-
     # TODO: Rewrite for dazl 7.0.0 when the internal structure of a ModuleRef is changed.
     if isinstance(obj, ModuleRef):
         # noinspection PyProtectedMember
@@ -138,19 +113,14 @@ def package_ref(obj: "Union[ModuleRef, _Name, TypeReference]") -> "PackageRef":
     elif isinstance(obj, _Name):
         # noinspection PyProtectedMember
         return obj._module._package_id
-    elif isinstance(obj, TypeReference):
-        # noinspection PyProtectedMember
-        return obj.con._module._package_id
     else:
         raise ValueError(f"Could not extract a package_ref from {obj!r}")
 
 
-def module_name(obj: "Union[ModuleRef, _Name, TypeReference]") -> "DottedName":
+def module_name(obj: "Union[ModuleRef, _Name]") -> "DottedName":
     """
     Return the module name of a :class:`ModuleRef` or a DAML name.
     """
-    from ..model.types import TypeReference
-
     # TODO: Rewrite for dazl 7.0.0 when the internal structure of ModuleRefs and _Name are changed.
     if isinstance(obj, ModuleRef):
         # noinspection PyProtectedMember
@@ -158,42 +128,29 @@ def module_name(obj: "Union[ModuleRef, _Name, TypeReference]") -> "DottedName":
     elif isinstance(obj, _Name):
         # noinspection PyProtectedMember
         return obj._module._module_name
-    elif isinstance(obj, TypeReference):
-        # noinspection PyProtectedMember
-        return obj.con._module._module_name
     else:
         raise ValueError(f"Could not extract a module_name from {obj!r}")
 
 
-def module_ref(obj: "Union[_Name, TypeReference]") -> "ModuleRef":
+def module_ref(obj: "_Name") -> "ModuleRef":
     """
     Return the :class:`ModuleRef` of a DAML name.
     """
-    from ..model.types import TypeReference
-
     # TODO: Rewrite for dazl 7.0.0 when the internal structure of ModuleRefs and _Name are changed.
     if isinstance(obj, _Name):
         # noinspection PyProtectedMember
         return obj._module
-    elif isinstance(obj, TypeReference):
-        # noinspection PyProtectedMember
-        return obj.con._module
     else:
         raise ValueError(f"Could not extract a module_ref from {obj!r}")
 
 
 # noinspection PyProtectedMember
-def package_local_name(obj: "Union[_Name, TypeReference]") -> str:
+def package_local_name(obj: "_Name") -> str:
     """
     Return the name of a DAML object, assuming that the referent exists in the same package as the
     target (i.e., _not_ scoped with a package ID).
     """
-    from ..model.types import TypeReference
-
     # TODO: Rewrite for dazl 7.0.0 when the internal structure of a ModuleRef is changed.
-    if isinstance(obj, TypeReference):
-        obj = obj.con
-
     if isinstance(obj, _Name):
         name_str = ".".join(obj._name)
         if obj._module._module_name:
@@ -204,20 +161,15 @@ def package_local_name(obj: "Union[_Name, TypeReference]") -> str:
         raise ValueError(f"Could not extract a package_local_name from {obj!r}")
 
 
-def module_local_name(obj: "Union[_Name, TypeReference]") -> str:
+def module_local_name(obj: "_Name") -> str:
     """
     Return the name of a DAML object, assuming that the referent exists in the same module as the
     target (i.e., in the same package and in the same module).
     """
     # TODO: Rewrite for dazl 7.0.0 when the internal structure of ModuleRefs and _Name are changed.
-    from ..model.types import TypeReference
-
     if isinstance(obj, _Name):
         # noinspection PyProtectedMember
         return ".".join(obj._name)
-    elif isinstance(obj, TypeReference):
-        # noinspection PyProtectedMember
-        return ".".join(obj.con._name)
     else:
         raise ValueError(f"Could not extract a module_local_name from {obj!r}")
 
diff --git a/python/dazl/ledger/aio/pkgloader.py b/python/dazl/ledger/aio/pkgloader.py
index 9a41451b..879f5456 100644
--- a/python/dazl/ledger/aio/pkgloader.py
+++ b/python/dazl/ledger/aio/pkgloader.py
@@ -65,9 +65,7 @@ async def do_with_retry(self, fn: "Callable[[], T]") -> "T":
         :param fn: A function to invoke.
         :return: The result of that function.
         """
-        guard = PackageExceptionTracker(
-            allow_deprecated_identifiers=self._allow_deprecated_identifiers
-        )
+        guard = PackageExceptionTracker()
         while True:
             pkg_ref = guard.pop_package()
             while pkg_ref is not None:
diff --git a/python/dazl/model/__init__.py b/python/dazl/model/__init__.py
deleted file mode 100644
index 33fc3436..00000000
--- a/python/dazl/model/__init__.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-:mod:`dazl.model` package
-=========================
-
-This module is deprecated. These types have generally moved to :mod:`dazl.client` (for the API
-introduced in dazl v5) or :mod:`dazl.protocols` (for the API introduced in dazl v8).
-
-.. automodule:: dazl.model.core
-.. automodule:: dazl.model.ledger
-.. automodule:: dazl.model.lookup
-.. automodule:: dazl.model.network
-.. automodule:: dazl.model.reading
-.. automodule:: dazl.model.types
-.. automodule:: dazl.model.types_store
-.. automodule:: dazl.model.writing
-
-"""
-
-from __future__ import annotations
-
-import warnings
-
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-    from . import core, ledger, lookup, network, reading, types, writing
-
-__all__ = ["core", "ledger", "lookup", "network", "reading", "writing"]
-
-warnings.warn(
-    "dazl.model is deprecated; these types have moved to either dazl.ledger or dazl.client.",
-    DeprecationWarning,
-    stacklevel=2,
-)
diff --git a/python/dazl/model/core.py b/python/dazl/model/core.py
deleted file mode 100644
index 4d997be6..00000000
--- a/python/dazl/model/core.py
+++ /dev/null
@@ -1,177 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-This module has been relocated to ``dazl.client``, ``dazl.damlast``, ``dazl.protocols``, or
-``dazl.query``.
-"""
-from __future__ import annotations
-
-from typing import TYPE_CHECKING, TypeVar, Union
-import warnings
-
-from ..client.errors import ConfigurationError, DazlPartyMissingError, UnknownTemplateWarning
-from ..client.state import (
-    ContractContextualData,
-    ContractContextualDataCollection,
-    ContractsHistoricalState,
-    ContractsState,
-)
-from ..damlast.daml_lf_1 import TypeConName
-from ..damlast.pkgfile import Dar
-from ..prim import ContractData, ContractId as ContractId_, DazlError, DazlWarning, Party
-from ..prim.errors import DazlImportError
-from ..protocols.errors import ConnectionTimeoutError, UserTerminateRequest
-from ..query import ContractMatch
-from ..util.proc_util import ProcessDiedException
-
-if TYPE_CHECKING:
-    from .types import Type, TypeReference
-
-T = TypeVar("T")
-
-
-__all__ = [
-    "ConfigurationError",
-    "ConnectionTimeoutError",
-    "ContractContextualData",
-    "ContractContextualDataCollection",
-    "ContractData",
-    "ContractId",
-    "ContractMatch",
-    "ContractsHistoricalState",
-    "ContractsState",
-    "Dar",
-    "DazlError",
-    "DazlImportError",
-    "DazlPartyMissingError",
-    "DazlWarning",
-    "Party",
-    "ProcessDiedException",
-    "UnknownTemplateWarning",
-    "UserTerminateRequest",
-]
-
-
-class ContractId(ContractId_):
-    __slots__ = ("_value_type_deprecated",)
-    _value_type_deprecated: "TypeReference"
-
-    def __init__(self, contract_id: str, template_id: "Union[str, Type, TypeConName]"):
-        warnings.warn(
-            "dazl.model.core.ContractId is deprecated; use dazl.prim.ContractId instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        from ..damlast.compat import parse_template
-
-        if not isinstance(contract_id, str):
-            raise ValueError("contract_id must be a string")
-
-        value = contract_id
-        value_type, value_type_deprecated = parse_template(template_id)
-
-        super().__init__(value_type, value)
-        object.__setattr__(self, "_value_type_deprecated", value_type_deprecated)
-
-    @property
-    def contract_id(self) -> str:
-        """
-        Get the raw contract ID value (for example, ``"#4:1"``).
-        """
-        warnings.warn(
-            "ContractId.contract_id is deprecated; use ContractId.value instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return self.value
-
-    @property
-    def template_id(self) -> "TypeReference":
-        """
-        Get the type of template that is pointed to by this :class:`ContractId` as a
-        :class:`TypeReference`. Note that usage of :class:`Type` and :class:`TypeReference` are
-        deprecated, and :meth:`value_type` should be used instead.
-
-        As of dazl 7.3.0, the :class:`TemplateId` is always normalized to a :class:`TypeReference`,
-        regardless of what the :class:`ContractId` was constructed with.
-        """
-        warnings.warn(
-            "ContractId.template_id is deprecated; use ContractId.value_type instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return self._value_type_deprecated
-
-    def exercise(self, choice_name, arguments=None):
-        """
-        Create an :class:`ExerciseCommand` that represents the result of exercising a choice on this
-        contract with the specified choice.
-
-        :param choice_name:
-            The name of the choice to exercise.
-        :param arguments:
-            (optional) A ``dict`` of named values to send as parameters to the choice exercise.
-        """
-        warnings.warn(
-            "ContractId.exercise is deprecated; prefer calling dazl.ledger.Connection.exercise or "
-            "dazl.client.PartyClient.submit_exercise, or use dazl.ledger.ExerciseCommand instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        from .writing import ExerciseCommand
-
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            return ExerciseCommand(self, choice_name, arguments=arguments)
-
-    def replace(self, contract_id=None, template_id=None):
-        """
-        Return a new :class:`ContractId` instance replacing specified fields with values.
-        """
-        warnings.warn(
-            "ContractId.replace is deprecated; simply construct a ContractId with the desired "
-            "values instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            return ContractId(
-                contract_id if contract_id is not None else self.value,
-                template_id if template_id is not None else self.value_type,
-            )
-
-    def for_json(self):
-        """
-        Return the JSON representation of this contract. This is currently just the contract ID
-        string itself.
-        """
-        return self.value
-
-
-class CommandTimeoutError(DazlError):
-    """
-    Raised when a corresponding event for a command was not seen in the appropriate time window.
-    """
-
-    def __init__(self):
-        warnings.warn(
-            "This error is never raised; this symbol will be removed in dazl v9",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-
-class ConnectionClosedError(DazlError):
-    """
-    Raised when trying to do something that requires a connection after connection pools have been
-    closed.
-    """
-
-    def __init__(self):
-        warnings.warn(
-            "This error is never raised; this symbol will be removed in dazl v9",
-            DeprecationWarning,
-            stacklevel=2,
-        )
diff --git a/python/dazl/model/ledger.py b/python/dazl/model/ledger.py
deleted file mode 100644
index 5f65fbdc..00000000
--- a/python/dazl/model/ledger.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-This module has been relocated to ``dazl.client.ledger``.
-"""
-from __future__ import annotations
-
-import warnings
-
-from ..client.ledger import LedgerMetadata
-
-__all__ = ["LedgerMetadata"]
-
-warnings.warn("dazl.model.ledger is deprecated; use dazl.client.ledger instead", DeprecationWarning)
diff --git a/python/dazl/model/lookup.py b/python/dazl/model/lookup.py
deleted file mode 100644
index 8b6d0f68..00000000
--- a/python/dazl/model/lookup.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-This module has been relocated to ``dazl.damlast.lookup``.
-"""
-
-from __future__ import annotations
-
-from typing import Iterator, Tuple
-import warnings
-
-from ..damlast.daml_lf_1 import PackageRef
-from ..damlast.lookup import validate_template as _validate_template
-
-__all__ = ["validate_template", "template_reverse_globs"]
-
-warnings.warn(
-    "dazl.model.lookup is deprecated; use dazl.damlast.lookup instead.",
-    DeprecationWarning,
-    stacklevel=2,
-)
-
-
-def validate_template(template) -> "Tuple[PackageRef, str]":
-    """
-    Return a module and type name component from something that can be interpreted as a template.
-
-    This function is deprecated and will be removed in dazl v8; please use
-    ``dazl.damlast.lookup.validate_template`` instead.
-
-    :param template:
-        Any object that can be interpreted as an identifier for a template.
-    """
-    warnings.warn(
-        "dazl.model.lookup.validate_template is deprecated and will be removed in dazl v8; "
-        "use dazl.damlast.lookup.validate_template instead",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    return _validate_template(template, allow_deprecated_identifiers=True)
-
-
-def template_reverse_globs(primary_only: bool, package_id: str, type_name: str) -> "Iterator[str]":
-    """
-    Return an iterator over strings that glob to a specified type.
-    """
-    # noinspection PyProtectedMember
-    from ..client.events import _template_reverse_globs
-
-    warnings.warn(
-        "template_reverse_globs is deprecated; use either "
-        "dazl.damlast.lookup.matching_normalizations (for template_reverse_globs(False, ...)) or "
-        "dazl.damlast.lookup.normalize(for template_reverse_globs(True, ...)). "
-        "Note that the new functions do NOT support periods as a delimiter between "
-        "module names and entity names; you MUST use a colon.",
-        DeprecationWarning,
-    )
-    return _template_reverse_globs(primary_only, package_id, type_name)
diff --git a/python/dazl/model/network.py b/python/dazl/model/network.py
deleted file mode 100644
index c0965706..00000000
--- a/python/dazl/model/network.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-This module has been relocated to ``dazl.client._conn_settings``.
-"""
-
-from __future__ import annotations
-
-__all__ = ["HTTPConnectionSettings", "SSLSettings", "OAuthSettings", "connection_settings"]
-
-from ..client._conn_settings import (
-    HTTPConnectionSettings,
-    OAuthSettings,
-    SSLSettings,
-    connection_settings,
-)
diff --git a/python/dazl/model/reading.py b/python/dazl/model/reading.py
deleted file mode 100644
index 8180a045..00000000
--- a/python/dazl/model/reading.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-This module has been relocated to ``dazl.client.events``, though if possible you should move to
-``dazl.protocol.events``.
-"""
-
-from __future__ import annotations
-
-from ..client._reader_sync import max_offset
-from ..client.events import EventKey, create_dispatch
-from ..protocols.events import (
-    ActiveContractSetEvent,
-    BaseEvent,
-    BaseTransactionEvent,
-    ContractArchiveEvent,
-    ContractCreateEvent,
-    ContractEvent,
-    ContractExercisedEvent,
-    ContractFilter,
-    InitEvent,
-    OffsetEvent,
-    PackagesAddedEvent,
-    ReadyEvent,
-    TransactionEndEvent,
-    TransactionFilter,
-    TransactionStartEvent,
-)
-
-__all__ = [
-    "ActiveContractSetEvent",
-    "BaseEvent",
-    "BaseTransactionEvent",
-    "ContractArchiveEvent",
-    "ContractCreateEvent",
-    "ContractEvent",
-    "ContractExercisedEvent",
-    "ContractFilter",
-    "EventKey",
-    "InitEvent",
-    "OffsetEvent",
-    "PackagesAddedEvent",
-    "ReadyEvent",
-    "TransactionEndEvent",
-    "TransactionFilter",
-    "TransactionStartEvent",
-    "create_dispatch",
-    "max_offset",
-]
diff --git a/python/dazl/model/types.py b/python/dazl/model/types.py
deleted file mode 100644
index 3b835f6f..00000000
--- a/python/dazl/model/types.py
+++ /dev/null
@@ -1,1006 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-Type system types
-------------------
-
-The :mod:`dazl.model.types` module contains the Python classes used to represent the DAML type
-system.
-
-+----------------------+---------------------------+
-| DAML type            | Python type               |
-+======================+===========================+
-| ``Bool``             | ``bool``                  |
-+----------------------+---------------------------+
-| ``Int``              | ``int``                   |
-+----------------------+---------------------------+
-| ``Decimal``          | ``decimal.Decimal``       |
-+----------------------+---------------------------+
-| ``[a]``              | ``list``                  |
-+----------------------+---------------------------+
-
-.. autoclass:: Type
-.. autoclass:: ScalarType
-.. autoclass:: ListType
-.. autoclass:: RecordType
-.. autoclass:: VariantType
-.. autoclass:: UnsupportedType
-"""
-from __future__ import annotations
-
-from typing import (
-    TYPE_CHECKING,
-    AbstractSet,
-    Any,
-    Callable,
-    ClassVar,
-    Collection,
-    Dict,
-    Mapping,
-    NewType,
-    Optional,
-    Sequence,
-    Tuple,
-    TypeVar,
-    Union,
-)
-import warnings
-
-from .. import LOG
-from ..damlast.daml_lf_1 import DottedName, Expr, ModuleRef, PackageRef, TypeConName
-from ..prim import ContractData, Party
-from ..util.typing import safe_cast, safe_dict_cast, safe_optional_cast
-
-warnings.warn("The symbols in dazl.model.types are deprecated", DeprecationWarning, stacklevel=2)
-
-DottedNameish = Union[str, Sequence[str]]
-
-T_co = TypeVar("T_co", covariant=True)
-
-if TYPE_CHECKING:
-    from .types_store import PackageStore
-
-
-# Reference to a ledger ID.
-LedgerId = NewType("LedgerId", str)
-
-# Reference to a package via a package identifier. The identifier is the ascii7
-# lowercase hex-encoded hash of the package contents found in the DAML LF Archive.
-#
-# This is re-exported from the daml_lf_1 as PackageId for backwards compatibility, and will
-# be removed in dazl v8.
-PackageId = PackageRef
-
-# A set of PackageId.
-PackageIdSet = AbstractSet[PackageId]
-
-
-def type_ref(s: str) -> "TypeReference":
-    """
-    Convenience method for creating a fully-qualified :class:`TypeReference`. A few formats are
-    supported:
-
-    "packageId:module:entity"
-    "module:entity@pkgid"
-    "module.entity@pkgid"
-    """
-    warnings.warn(
-        "type_ref is deprecated; there is no replacement", DeprecationWarning, stacklevel=2
-    )
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-
-        # Attempt to parse in an older format still used by Navigator for display purposes.
-        me, is_at, pkgid = s.partition("@")
-        if is_at:
-            # encourage people to use the new format
-            m, has_colon, e = me.partition(":")
-            if not has_colon:
-                m, _, e = me.rpartition(".")
-
-            pkg_ref = PackageRef(pkgid)
-            module_name = DottedName(m.split("."))
-            entity_name = e.split(".")
-        else:
-            components = s.split(":")
-            if len(components) != 3:
-                raise ValueError(f"could not parse as a template reference: {s!r}")
-
-            pkg_ref = PackageRef(components[0])
-            module_name = DottedName(components[1].split("."))
-            entity_name = components[2].split(".")
-
-        return TypeReference(
-            con=TypeConName(module=ModuleRef(pkg_ref, module_name), name=entity_name)
-        )
-
-
-def dotted_name(obj: DottedNameish) -> "Sequence[str]":
-    """
-    Sanitize a string or a tuple of strings to a dotted name.
-
-    :param obj: A string or tuple of strings.
-    :return: A tuple of strings.
-    """
-    if obj is None:
-        raise ValueError("DottedName must be a non-None value")
-    if isinstance(obj, str):
-        return tuple(obj.split("."))
-    if isinstance(obj, Collection):
-        for item in obj:
-            if not isinstance(item, str):
-                raise ValueError("DottedName's components must all be strings")
-        return tuple(obj)
-    else:
-        raise ValueError("could not convert to a sequence of str: {obj!r}")
-
-
-class NamedArgumentList(tuple):
-    """
-    A simple tuple to storing (name, value) pairs.
-    """
-
-    @property
-    def names(self):
-        return set(name for name, _ in self)
-
-
-def type_dispatch_table(
-    on_type_ref: Callable[["TypeReference"], T_co],
-    on_type_var: Callable[["TypeVariable"], T_co],
-    on_type_app: Callable[["TypeApp"], T_co],
-    on_scalar: Callable[["ScalarType"], T_co],
-    on_contract_id: Callable[["ContractIdType"], T_co],
-    on_optional: Callable[["OptionalType"], T_co],
-    on_list: Callable[["ListType"], T_co],
-    on_text_map: "Callable[[TextMapType], T_co]",
-    on_record: Callable[["RecordType"], T_co],
-    on_variant: Callable[["VariantType"], T_co],
-    on_enum: "Callable[[EnumType], T_co]",
-    on_unsupported: Callable[["UnsupportedType"], T_co],
-) -> Callable[["Type"], T_co]:
-    def _impl(tt: Type):
-        if isinstance(tt, TypeReference):
-            return on_type_ref(tt)
-        elif isinstance(tt, TypeVariable):
-            return on_type_var(tt)
-        elif isinstance(tt, TypeApp):
-            return on_type_app(tt)
-        elif isinstance(tt, ScalarType):
-            return on_scalar(tt)
-        elif isinstance(tt, ContractIdType):
-            return on_contract_id(tt)
-        elif isinstance(tt, OptionalType):
-            return on_optional(tt)
-        elif isinstance(tt, ListType):
-            return on_list(tt)
-        elif isinstance(tt, TextMapType):
-            return on_text_map(tt)
-        elif isinstance(tt, RecordType):
-            return on_record(tt)
-        elif isinstance(tt, VariantType):
-            return on_variant(tt)
-        elif isinstance(tt, EnumType):
-            return on_enum(tt)
-        elif isinstance(tt, UnsupportedType):
-            return on_unsupported(tt)
-        else:
-            # note to maintainers: if you modify the Type hierarchy, you must also maintain this
-            # poor man's pattern match over the hierarchy
-            LOG.error("Incomplete implementation of type_match! (when handling %r)", tt)
-            raise Exception(f"unknown Type subclass: {tt!r}")
-
-    return _impl
-
-
-def scalar_type_dispatch_table(
-    on_unit: "Callable[[], T_co]",
-    on_bool: "Callable[[], T_co]",
-    on_text: "Callable[[], T_co]",
-    on_int: "Callable[[], T_co]",
-    on_decimal: "Callable[[], T_co]",
-    on_party: "Callable[[], T_co]",
-    on_date: "Callable[[], T_co]",
-    on_datetime: "Callable[[], T_co]",
-    on_timedelta: "Callable[[], T_co]",
-) -> "Callable[[ScalarType], T_co]":
-    def _impl(tt: ScalarType):
-        st = safe_cast(ScalarType, tt)
-        if st == SCALAR_TYPE_UNIT:
-            return on_unit()
-        elif tt == SCALAR_TYPE_BOOL:
-            return on_bool()
-        elif tt == SCALAR_TYPE_TEXT or tt == SCALAR_TYPE_CHAR:
-            return on_text()
-        elif tt == SCALAR_TYPE_INTEGER:
-            return on_int()
-        elif tt == SCALAR_TYPE_DECIMAL or tt == SCALAR_TYPE_NUMERIC:
-            return on_decimal()
-        elif tt == SCALAR_TYPE_PARTY:
-            return on_party()
-        elif tt == SCALAR_TYPE_DATE:
-            return on_date()
-        elif tt == SCALAR_TYPE_DATETIME:
-            return on_datetime()
-        elif tt == SCALAR_TYPE_RELTIME:
-            return on_timedelta()
-        else:
-            # note to maintainers: if you modify the set of ScalarType instances, you must also
-            # maintain this poor man's pattern match over the hierarchy
-            LOG.error(
-                "Incomplete implementation of scalar_type_dispatch_table! (when handling %r)", tt
-            )
-            raise Exception(f"unknown ScalarType: {tt!r}")
-
-    return _impl
-
-
-class Type:
-    """
-    A DAML-defined type.
-    """
-
-    def __init__(self):
-        warnings.warn(
-            "dazl.model.types.Type and its subclasses are deprecated. "
-            "Use dazl.damlast.daml_lf_1.Type instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-    def __str__(self):
-        from ..pretty import DAML_PRETTY_PRINTER
-
-        return DAML_PRETTY_PRINTER.visit_type(self)
-
-
-class TypeApp(Type):
-    """
-    An application of one or more types to an open type.
-
-    This is basically Type.Con in the Protobuf declaration.
-    """
-
-    def __init__(self, body: Type, arguments: Sequence[Type]):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-
-        warnings.warn(
-            "dazl.model.types.TypeApp and its subclasses are deprecated. "
-            "Use dazl.damlast.daml_lf_1.Type instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        if not isinstance(body, Type):
-            raise ValueError(f"a Type is required here (got {body} instead)")
-        if not arguments:
-            raise ValueError("at least one type argument is required in a TypeApp")
-        self.body = body
-        self.arguments = tuple(arguments)
-
-    def __repr__(self):
-        return f"<TypeApp(body={self.body}, arguments={self.arguments}>"
-
-
-class TypeVariable(Type):
-    """
-    An unbound type in a Type expression.
-    """
-
-    __slots__ = ("name",)
-
-    def __init__(self, name: str):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-
-        warnings.warn(
-            "dazl.model.types.TypeVar is deprecated. " "Use dazl.damlast.daml_lf_1.Type instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self.name = safe_cast(str, name)
-
-    def __str__(self):
-        return self.name
-
-    def __repr__(self):
-        return f"TypeVariable({self.name})"
-
-    def __eq__(self, other):
-        return isinstance(other, TypeVariable) and self.name == other.name
-
-    def __hash__(self):
-        return hash(self.name)
-
-
-class TypeReference(Type):
-    def __init__(self, con: "TypeConName"):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "TypeReference is deprecated; in most cases, use TypeConName instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self.con = con
-
-    def __str__(self):
-        return str(self.con)
-
-    def __eq__(self, other):
-        return isinstance(other, TypeReference) and self.con == other.con
-
-    def __hash__(self):
-        return hash(self.con)
-
-
-class UnresolvedTypeReference(Type):
-    """
-    A reference that may or may not ultimately resolve to a type.
-    """
-
-    def __init__(self, name: str):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "UnresolvedTypeReference is deprecated; in most cases, use TypeConName instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self.name = safe_cast(str, name)
-
-    def __str__(self):
-        return self.name
-
-    def __repr__(self):
-        return f"<UnresolvedTypeReference({self.name!r})>"
-
-    def __eq__(self, other):
-        return isinstance(other, UnresolvedTypeReference) and self.name == other.name
-
-    def __hash__(self):
-        return hash((UnresolvedTypeReference, self.name))
-
-
-class ConcreteType(Type):
-    pass
-
-
-class ScalarType(ConcreteType):
-    """
-    A DAML-defined type that represents a simple scalar value. You should not need to ever
-    construct instances of this directly; all scalar types are builtins.
-    """
-
-    __slots__ = ("name",)
-    name: str
-    BUILTINS: "ClassVar[Sequence[ScalarType]]"
-
-    def __init__(self, name: str):
-        """
-        Construct an object that references a scalar DAML type.
-
-        :param name: The name of this type as it is known in DAML.
-        """
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "ScalarType is deprecated; in most cases, use dazl.damlast.daml_lf_1 types instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self.name = safe_cast(str, name)
-
-    def __repr__(self):
-        """
-        Return the DAML name of this type.
-        """
-        return self.name
-
-    def __hash__(self):
-        return hash((ScalarType, self.name))
-
-    def __eq__(self, other):
-        return isinstance(other, ScalarType) and self.name == other.name
-
-
-class _BuiltInParameterizedType(ConcreteType):
-    """
-    Convenience class that encapsulates commonalities for the built-in types that have one type
-    parameter.
-    """
-
-    __slots__ = ("type_parameter",)
-
-    def __init__(self, type_parameter: Type):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-
-        warnings.warn(
-            "ContractIdType, and ListType, TypeRefType are deprecated; use dazl.damlast.daml_lf_1 types instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self.type_parameter = safe_cast(Type, type_parameter)
-
-    def __repr__(self):
-        py_type = type(self).__name__
-        return f"<{py_type}({self.type_parameter!r})>"
-
-
-class ContractIdType(_BuiltInParameterizedType):
-    pass
-
-
-class ListType(_BuiltInParameterizedType):
-    pass
-
-
-class TypeRefType(_BuiltInParameterizedType):
-    pass
-
-
-class TextMapType(ConcreteType):
-    """
-    A DAML-defined TextMap.
-
-    Instance attributes:
-
-    .. attribute: TextMapType.value_type
-
-        The type of values in this map.
-    """
-
-    __slots__ = ("value_type",)
-
-    def __init__(self, value_type: Type):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "TextMapType is deprecated; use dazl.damlast.daml_lf_1 types instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        self.value_type = safe_cast(Type, value_type)
-
-    def __repr__(self):
-        py_type = type(self).__name__
-        return f"<{py_type}({self.value_type!r})>"
-
-
-class GenMapType(ConcreteType):
-    """
-    A DAML-defined GenMap.
-
-    Instance attributes:
-
-    .. attribute: TextMapType.key_type
-
-        The type of keys in this map.
-
-    .. attribute: TextMapType.value_type
-
-        The type of values in this map.
-    """
-
-    __slots__ = "key_type", "value_type"
-
-    def __init__(self, key_type: Type, value_type: Type):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "GenMapType is deprecated; use dazl.damlast.daml_lf_1 types instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        self.key_type = safe_cast(Type, key_type)
-        self.value_type = safe_cast(Type, value_type)
-
-    def __repr__(self):
-        py_type = type(self).__name__
-        return f"<{py_type}({self.key_type!r}, {self.value_type!r})>"
-
-
-class OptionalType(_BuiltInParameterizedType):
-    """
-    A DAML-defined Optional.
-
-    Instance attributes:
-
-    .. attribute: OptionalType.type_parameter
-
-        The type of value in the Optional.
-    """
-
-
-class UpdateType(_BuiltInParameterizedType):
-    pass
-
-
-class ForAllType(Type):
-    def __init__(self, type_vars, body_type):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "ForAllType is deprecated; there is no replacement", DeprecationWarning, stacklevel=2
-        )
-
-        self.type_vars = type_vars
-        self.body_type = body_type
-
-    def __repr__(self):
-        return f"<ForAllType({self.type_vars}, {self.body_type})>"
-
-
-class _CompositeDataType(ConcreteType):
-    """
-    Either a :class:`RecordType` (product type) or a :class:`VariantType` (sum type).
-    """
-
-    def __init__(
-        self,
-        named_args: "NamedArgumentList",
-        name: "Optional[TypeReference]",
-        type_args: "Sequence[TypeVariable]",
-    ):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "RecordType and VariantType are deprecated; use dazl.damlast.daml_lf_1 types instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        if type(self) == _CompositeDataType:
-            raise Exception("_CompositeDataType cannot be constructed")
-        if not isinstance(named_args, NamedArgumentList):
-            raise TypeError("NamedArgumentList required here")
-        if name is not None and not isinstance(name, TypeReference):
-            raise TypeError("name must be a TypeReference or None")
-
-        self.named_args = named_args
-        self.name = name
-        self.type_args = tuple(type_args)
-
-    def field_type(self, name: str) -> Type:
-        for key, value_type in self.named_args:
-            if key == name:
-                return value_type
-
-        raise ValueError(f"field or constructor {name!r} not found in {self}")
-
-    def __repr__(self):
-        py_type = type(self).__name__
-
-        name = "(anonymous)" if self.name is None else self.name
-        full_name = "".join(f" {v}" for v in ((name,) + self.type_args))
-
-        return f"<{py_type}:{full_name} {self.named_args}>"
-
-
-class FunctionType(Type):
-    """
-    Representation of a DAML function signature.
-
-    Instances of this type aren't practically usable from this library. They are merely recorded in
-    order to faithfully pretty-print metadata.
-    """
-
-    def __init__(self, parameters: Sequence[Type], result: Type):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-        warnings.warn(
-            "FunctionType is deprecated; there is no replacement", DeprecationWarning, stacklevel=2
-        )
-
-        self.parameters = tuple(parameters)
-        self.result = safe_cast(Type, result)
-
-    def __str__(self):
-        from io import StringIO
-
-        with StringIO() as buf:
-            for param in self.parameters:
-                buf.write(str(param))
-                buf.write(" -> ")
-            buf.write(str(self.result))
-            return buf.getvalue()
-
-    def __repr__(self):
-        return f"<FunctionType({self})>"
-
-
-class RecordType(_CompositeDataType):
-    def as_args_list(self):
-        return self.named_args
-
-
-class VariantType(_CompositeDataType):
-    def as_args_list(self):
-        return self.named_args
-
-    def _find_ctor(self, constructor_name: str) -> Type:
-        return self.field_type(constructor_name)
-
-
-class EnumType(ConcreteType):
-
-    __slots__ = ("constructors",)
-
-    def __init__(self, name: "Optional[TypeReference]", constructors: "Collection[str]"):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            # noinspection PyDeprecation
-            super().__init__()
-
-        warnings.warn(
-            "EnumType is deprecated; use dazl.damlast.daml_lf_1 types instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        self.name = name
-        self.constructors = constructors
-
-
-class UnsupportedType(Type):
-    """
-    A DAML type that is currently unparseable by the Python client library.
-    """
-
-    __slots__ = ("name",)
-
-    def __init__(self, name):
-        self.name = safe_cast(str, name)
-
-    def __repr__(self):
-        return f"<UnsupportedType({self.name})>"
-
-
-class Template:
-    """
-    Definition of a contract template.
-    """
-
-    def __init__(
-        self,
-        data_type: "RecordType",
-        key_type: "Optional[Type]",
-        choices: "Collection[TemplateChoice]",
-        observers: "Expr",
-        signatories: "Expr",
-        agreement: "Expr",
-        ensure: "Expr",
-    ):
-        if not isinstance(data_type, RecordType) or data_type.name is None:
-            raise ValueError(
-                f"data_type is required and must be a named record type " f"(got {data_type})"
-            )
-        self.data_type = safe_cast(RecordType, data_type)
-        self.key_type = safe_optional_cast(Type, key_type)
-        self.choices = choices
-        self._observers = observers
-        self._signatories = signatories
-        self._agreement = agreement
-        self._ensure = ensure
-
-
-class TemplateChoice:
-    __slots__ = ("name", "consuming", "data_type", "return_type", "_controllers")
-
-    def __init__(
-        self, name: str, consuming: bool, data_type: Type, return_type: Type, controllers: "Expr"
-    ):
-        self.name = name
-        self.consuming = consuming
-        self.data_type = data_type
-        self.return_type = return_type
-        self._controllers = controllers
-
-    @property
-    def type(self):
-        return self.data_type
-
-    def controllers(self, cdata: ContractData) -> Collection[Party]:
-        """
-        Return every :class:`Party` that can exercise this choice given the specified contract data.
-        """
-
-
-def as_commands(commands_ish, allow_callables=False):
-    """
-    Converts something that is either ``None``, a single :class:`Command`, or an iterable over
-    :class:`Command` objects to a ``list`` of :class:`Command`.
-
-    :param commands_ish:
-        Something that might be construed as either a :class:`Command` or an iterable over
-        :class:`Command`.
-    :param allow_callables:
-        If callables are encountered, invoke them and expect them to return something that can be
-        easily serialized to a :class:`Command`.
-    """
-    from .writing import Command
-
-    if commands_ish is None:
-        return ()
-    elif isinstance(commands_ish, Command):
-        return (commands_ish,)
-    elif allow_callables and callable(commands_ish):
-        return as_commands(commands_ish(), allow_callables=False)
-
-    # assume this is some kind of iterable structure, where everything needs to be a Command
-    cmds = []
-    for command in commands_ish:
-        if allow_callables and callable(command):
-            cmds.extend(as_commands(command(), allow_callables=False))
-        elif isinstance(command, Command):
-            cmds.append(command)
-        else:
-            raise TypeError(f"{command!r} is not a Command")
-    return tuple(cmds)
-
-
-def as_contract_id(cid, template_id=None):
-    """
-    Convert something that resembles a contract ID to a :class:`ContractId` or
-    :class:`RelativeContractRef`.
-    """
-    warnings.warn(
-        "as_contract_id is deprecated; there is no replacement", DeprecationWarning, stacklevel=2
-    )
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from .core import ContractId
-
-        if cid is None:
-            raise ValueError("cid is required")
-        elif isinstance(cid, str):
-            return ContractId(cid, template_id)
-        elif isinstance(cid, ContractId):
-            return cid
-
-        raise TypeError("Could not serialize an object to a contract ID: {!r}".format(cid))
-
-
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-    SCALAR_TYPE_UNIT = ScalarType("Unit")
-    SCALAR_TYPE_BOOL = ScalarType("Bool")
-    SCALAR_TYPE_CHAR = ScalarType("Char")
-    SCALAR_TYPE_INTEGER = ScalarType("Integer")
-    SCALAR_TYPE_DECIMAL = ScalarType("Decimal")
-    SCALAR_TYPE_NUMERIC = ScalarType("Numeric")
-    SCALAR_TYPE_TEXT = ScalarType("Text")
-    SCALAR_TYPE_PARTY = ScalarType("Party")
-    SCALAR_TYPE_RELTIME = ScalarType("RelTime")
-    SCALAR_TYPE_DATE = ScalarType("Date")
-    SCALAR_TYPE_TIME = ScalarType("Time")
-    SCALAR_TYPE_ANY = ScalarType("Any")
-    SCALAR_TYPE_DATETIME = SCALAR_TYPE_TIME
-
-ScalarType.BUILTINS = [
-    SCALAR_TYPE_BOOL,
-    SCALAR_TYPE_CHAR,
-    SCALAR_TYPE_INTEGER,
-    SCALAR_TYPE_DECIMAL,
-    SCALAR_TYPE_NUMERIC,
-    SCALAR_TYPE_TEXT,
-    SCALAR_TYPE_PARTY,
-    SCALAR_TYPE_RELTIME,
-    SCALAR_TYPE_DATE,
-    SCALAR_TYPE_TIME,
-    SCALAR_TYPE_ANY,
-]
-
-
-class TypeEvaluationContext:
-    references: Dict[TypeConName, ConcreteType]
-    variables: Dict[TypeVariable, Type]
-    path: Sequence[Union[TypeReference, str]]
-
-    __slots__ = ("references", "variables", "path")
-
-    @classmethod
-    def from_store(cls, store: "PackageStore") -> "TypeEvaluationContext":
-        return cls(store.types(), {}, ())
-
-    def __init__(self, references: "Mapping[TypeConName, ConcreteType]", variables, path):
-        self.references = safe_dict_cast(TypeConName, ConcreteType, references)
-        self.variables = safe_dict_cast(TypeVariable, Type, variables)
-        self.path = path
-
-    def append_path(self, component: Union[TypeReference, str]) -> "TypeEvaluationContext":
-        return TypeEvaluationContext(
-            references=self.references,
-            variables=self.variables,
-            path=tuple((*self.path, component)),
-        )
-
-    def resolve_var(self, var: TypeVariable) -> Type:
-        return self.variables[var]
-
-    def with_vars(self, new_vars: "Dict[TypeVariable, Type]") -> "TypeEvaluationContext":
-        confirmed_new_vars = {}
-        for new_var, new_var_value in new_vars.items():
-            if new_var == new_var_value:
-                # TODO: Why do these cases happen?
-                continue
-            confirmed_new_vars[new_var] = new_var_value
-
-        return TypeEvaluationContext(
-            references=self.references,
-            variables={**self.variables, **confirmed_new_vars},
-            path=self.path,
-        )
-
-
-def type_evaluate_dispatch(
-    on_scalar: "Callable[[TypeEvaluationContext, ScalarType], T_co]",
-    on_contract_id: "Callable[[TypeEvaluationContext,  ContractIdType], T_co]",
-    on_optional: "Callable[[TypeEvaluationContext, OptionalType], T_co]",
-    on_list: "Callable[[TypeEvaluationContext, ListType], T_co]",
-    on_text_map: "Callable[[TypeEvaluationContext, TextMapType], T_co]",
-    on_record: "Callable[[TypeEvaluationContext, RecordType], T_co]",
-    on_variant: "Callable[[TypeEvaluationContext, VariantType], T_co]",
-    on_enum: "Callable[[TypeEvaluationContext, EnumType], T_co]",
-    on_unsupported: "Callable[[TypeEvaluationContext, UnsupportedType], T_co]",
-) -> "Callable[[TypeEvaluationContext, Type], T_co]":
-    """
-    Produce a function that defers handling of core types to the passed in functions.
-
-    The cases of :class:`TypeReference, :class:`TypeApp`, and :class:`TypeVariable` are handled
-    automatically. Note, though that ultimately type evaluation is only performed at one level
-    deep, and the produced function may need to be called multiple types at multiple depths of an
-    object or type hierarchy.
-    """
-
-    def _impl(context, tt):
-        resolve_depth = 0
-        while isinstance(tt, (TypeReference, TypeVariable, TypeApp)):
-            context, tt = single_reduce(context, tt)
-            resolve_depth += 1
-            if resolve_depth > 10:
-                raise Exception("hit our max resolve depth, which is probably not so great")
-
-        def error(_: Any) -> "T_co":
-            raise Exception()
-
-        context, tt = annotate_context(context, tt)
-
-        return type_dispatch_table(
-            error,
-            error,
-            error,
-            lambda st: on_scalar(context, st),
-            lambda ct: on_contract_id(context, ct),
-            lambda ot: on_optional(context, ot),
-            lambda lt: on_list(context, lt),
-            lambda mt: on_text_map(context, mt),
-            lambda rt: on_record(context, rt),
-            lambda vt: on_variant(context, vt),
-            lambda et: on_enum(context, et),
-            lambda ut: on_unsupported(context, tt),
-        )(tt)
-
-    return _impl
-
-
-def _type_evaluate_dispatch_error(_, __):
-    raise Exception()
-
-
-def type_evaluate_dispatch_default_error(
-    on_scalar: "Callable[[TypeEvaluationContext, ScalarType], T_co]" = _type_evaluate_dispatch_error,
-    on_contract_id: "Callable[[TypeEvaluationContext,  ContractIdType], T_co]" = _type_evaluate_dispatch_error,
-    on_optional: "Callable[[TypeEvaluationContext,  OptionalType], T_co]" = _type_evaluate_dispatch_error,
-    on_list: "Callable[[TypeEvaluationContext, ListType], T_co]" = _type_evaluate_dispatch_error,
-    on_text_map: "Callable[[TypeEvaluationContext, TextMapType], T_co]" = _type_evaluate_dispatch_error,
-    on_record: "Callable[[TypeEvaluationContext, RecordType], T_co]" = _type_evaluate_dispatch_error,
-    on_variant: "Callable[[TypeEvaluationContext, VariantType], T_co]" = _type_evaluate_dispatch_error,
-    on_enum: "Callable[[TypeEvaluationContext, EnumType], T_co]" = _type_evaluate_dispatch_error,
-    on_unsupported: "Callable[[TypeEvaluationContext, UnsupportedType], T_co]" = _type_evaluate_dispatch_error,
-):
-    return type_evaluate_dispatch(
-        on_scalar,
-        on_contract_id,
-        on_optional,
-        on_list,
-        on_text_map,
-        on_record,
-        on_variant,
-        on_enum,
-        on_unsupported,
-    )
-
-
-def single_reduce(context: TypeEvaluationContext, tt: Type) -> "Tuple[TypeEvaluationContext, Type]":
-    """
-    Apply a single substitution/reduction/unwrapping. The context may be augmented with additional
-    variables if a TypeApp is encountered.
-    """
-
-    def identity(t):
-        return context, t
-
-    def reduce_app(ta: TypeApp) -> "Tuple[TypeEvaluationContext, Type]":
-        body = context.references[ta.body.con] if isinstance(ta.body, TypeReference) else ta.body
-        if not isinstance(body, (RecordType, VariantType)):
-            raise Exception("Can't apply types to non-generic data structures")
-
-        return context.with_vars(dict(zip(body.type_args, ta.arguments))), ta.body
-
-    return type_dispatch_table(
-        lambda tr: (context, context.references[tr.con]),
-        lambda tv: (context, context.resolve_var(tv)),
-        reduce_app,
-        identity,
-        identity,
-        identity,
-        identity,
-        identity,
-        identity,
-        identity,
-        identity,
-        identity,
-    )(tt)
-
-
-def annotate_context(
-    context: TypeEvaluationContext, tt: Type
-) -> Tuple[TypeEvaluationContext, Type]:
-    def identity(t):
-        return context, t
-
-    def error(_: Any) -> Any:
-        raise Exception()
-
-    def annotate_path(t: Union[RecordType, VariantType]) -> Tuple[TypeEvaluationContext, Type]:
-        if t.name is None:
-            raise ValueError("cannot annotate a path with an anonymous type")
-
-        return context.append_path(t.name), t
-
-    return type_dispatch_table(
-        error,
-        error,
-        error,
-        identity,
-        identity,
-        identity,
-        identity,
-        identity,
-        annotate_path,
-        annotate_path,
-        identity,
-        identity,
-    )(tt)
-
-
-# types that can be used to refer to templates
-TemplateNameLike = Union[str, TypeConName, TypeReference, UnresolvedTypeReference, Template]
diff --git a/python/dazl/model/types_store.py b/python/dazl/model/types_store.py
deleted file mode 100644
index 6e79cdce..00000000
--- a/python/dazl/model/types_store.py
+++ /dev/null
@@ -1,530 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-from __future__ import annotations
-
-from collections import defaultdict
-from dataclasses import dataclass
-from functools import reduce
-from operator import add
-import sys
-from threading import RLock
-from types import MappingProxyType
-from typing import (
-    Any,
-    Collection,
-    DefaultDict,
-    Dict,
-    Generic,
-    Iterable,
-    List,
-    Mapping,
-    Optional,
-    TypeVar,
-    Union,
-    no_type_check,
-)
-import warnings
-
-from ..damlast.daml_lf_1 import Archive, Expr, Package, PackageRef, TypeConName, ValName, _Name
-from ..damlast.lookup import validate_template
-from ..util.typing import safe_cast, safe_dict_cast
-
-if sys.version_info >= (3, 8):
-    from typing import Protocol, runtime_checkable
-else:
-    from typing_extensions import Protocol, runtime_checkable
-
-
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-
-    from .types import (
-        ConcreteType,
-        PackageIdSet,
-        Template,
-        TemplateChoice,
-        Type,
-        TypeReference,
-        UnresolvedTypeReference,
-    )
-
-K = TypeVar("K", bound=_Name)
-T = TypeVar("T")
-S = TypeVar("S")
-
-warnings.warn(
-    "The types of dazl.model.types_store are deprecated", DeprecationWarning, stacklevel=2
-)
-
-
-class PackageStoreBuilder:
-    """
-    Convenience class for building up a :class:`PackageStore`.
-    """
-
-    def __init__(self):
-        warnings.warn(
-            "PackageStoreBuilder is deprecated; there is no direct replacement.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        self._archives = list()  # type: List[Archive]
-        self._value_types = dict()  # type: Dict[ValName, Expr]
-        self._data_types = dict()  # type: Dict[TypeConName, Type]
-        self._templates = dict()  # type: Dict[TypeConName, Template]
-        self._expected_package_ids = None  # type: Optional[Collection[PackageRef]]
-
-    def add_archive(self, archive: "Archive") -> None:
-        self._archives.append(archive)
-
-    def add_type(self, name: "TypeConName", data_type: Type):
-        safe_cast(TypeConName, name)
-        self._data_types[name] = safe_cast(Type, data_type)
-
-    def add_value(self, name: "ValName", value: "Expr"):
-        safe_cast(ValName, name)
-        self._value_types[name] = safe_cast(Expr, value)
-
-    def add_template(self, template: Template):
-        name = template.data_type.name
-        if name is None:
-            raise ValueError("template cannot be defined with an anonymous type")
-        self._templates[name.con] = safe_cast(Template, template)
-
-    def add_expected_package_ids(self, expected_package_ids: "Collection[PackageRef]"):
-        self._expected_package_ids = expected_package_ids
-
-    def get_type(self, name: TypeConName) -> "Optional[Type]":
-        return self._data_types.get(name)
-
-    def build(self) -> "PackageStore":
-        return PackageStore(
-            self._archives,
-            self._value_types,
-            self._data_types,
-            self._templates,
-            self._expected_package_ids,
-        )
-
-
-class PackageStore:
-    """
-    A thread-safe store of type information.
-    """
-
-    @classmethod
-    def empty(cls):
-        """
-        Create an empty store.
-        """
-        warnings.warn(
-            "PackageStore is deprecated; use PackageLoader/SymbolLookup instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        return cls([], {}, {}, {}, None)
-
-    def __init__(
-        self,
-        archives: "Collection[Archive]",
-        value_types: "Dict[ValName, Expr]",
-        data_types: "Dict[TypeConName, Type]",
-        templates: "Dict[TypeConName, Template]",
-        expected_package_ids: "Optional[Collection[PackageRef]]" = None,
-    ):
-        warnings.warn(
-            "PackageStore is deprecated; use PackageLoader/SymbolLookup instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self._lock = RLock()
-        self._archives = list(archives)
-        self._cache = PackageStoreCache(EMPTY_TYPE_CACHE, EMPTY_TYPE_CACHE, EMPTY_TYPE_CACHE)
-        self._value_types = safe_dict_cast(ValName, Expr, value_types)
-        self._data_types = safe_dict_cast(TypeConName, Type, data_types)
-        self._templates = safe_dict_cast(TypeConName, Template, templates)
-        self._expected_package_ids = expected_package_ids
-
-    def archives(self) -> "Collection[Archive]":
-        """
-        Return a copy of the collection of the set of loaded :class:`Archive`s.
-        """
-        warnings.warn(
-            "PackageStore.archives() is deprecated; use SymbolLookup.archives() instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        with self._lock:
-            return list(self._archives)
-
-    def packages(self) -> "Collection[Package]":
-        """
-        Return a copy of the collection of the set of loaded :class:`Package`s.
-        """
-        warnings.warn(
-            "PackageStore.packages() is deprecated; use SymbolLookup.archives() instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        with self._lock:
-            return [a.package for a in self._archives]
-
-    def package_ids(self) -> "Collection[PackageRef]":
-        """
-        Return a copy of the collection of the set of loaded :class:`Package`s.
-        """
-        warnings.warn(
-            "PackageStore.package_ids() is deprecated; use SymbolLookup.package_ids() instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        with self._lock:
-            return [a.hash for a in self._archives]
-
-    def expected_package_ids(self) -> "Optional[Collection[PackageRef]]":
-        """
-        Return package IDs that are expected to be found on the ledger.
-        """
-        warnings.warn(
-            "PackageStore.expected_package_ids() is deprecated; there is no replacement.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return self._expected_package_ids
-
-    def register_all(self, other_store: "PackageStore") -> "PackageStore":
-        """
-        Register all types declared in the other :class:`PackageStore`.
-
-        :param other_store: A package store to copy types, templates, and choices from.
-        :return: A reference to this object.
-        """
-        warnings.warn(
-            "PackageStore.register_all() is deprecated; use PackageLoader instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        if self is not other_store:
-            with self._lock:
-                self._archives.extend(other_store._archives)
-                self._value_types.update(other_store._value_types)
-                self._data_types.update(other_store._data_types)
-                self._templates.update(other_store._templates)
-                self._cache = PackageStoreCache(
-                    TypeCache.build(self._value_types),
-                    TypeCache.build(self._data_types),
-                    TypeCache.build(self._templates),
-                )
-        return self
-
-    def resolve_value_reference(self, value_ref: "ValName") -> "Expr":
-        warnings.warn(
-            "PackageStore.resolve_value_reference() is deprecated; "
-            "use SymbolLookup.value() instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        with self._lock:
-            return self._value_types[value_ref]
-
-    def resolve_type_reference(self, template_ref: "Union[TypeConName, TypeReference]") -> Type:
-        """
-        Resolve a type based on its reference.
-
-        :param template_ref:
-            A :class:`TypeReference` that refers to a type.
-        :return:
-            The :class:`Type` that is referred to by this type reference.
-        :raise KeyError:
-            If the :class:`TypeReference` does not have a corresponding value in this store.
-        """
-        warnings.warn(
-            "PackageStore.resolve_value_reference() is deprecated; "
-            "use SymbolLookup.data_type() instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        if isinstance(template_ref, TypeReference):
-            con = template_ref.con
-        elif isinstance(template_ref, TypeConName):
-            con = template_ref
-        else:
-            raise ValueError("template_ref must either by a TypeConName or TypeReference")
-
-        with self._lock:
-            return self._data_types[con]
-
-    def types(self) -> "Mapping[TypeConName, ConcreteType]":
-        warnings.warn(
-            'PackageStore.types() is deprecated; use SymbolLookup.data_type("*") instead.',
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        with self._lock:
-            return MappingProxyType(dict(self._data_types))  # type: ignore
-
-    def get_templates_for_packages(
-        self, package_ids: "Iterable[PackageRef]"
-    ) -> "Collection[Template]":
-        """
-        Return a collection of :class:`Template` instances from the given set of package IDs.
-
-        :param package_ids:
-            The set of package IDs to restrict templates to.
-        :return:
-            A collection of matching templates, or an empty collection if none match. This method
-            never returns ``None``.
-        """
-        warnings.warn(
-            "PackageStore.get_templates_for_packages() is deprecated; "
-            'use [SymbolLookup.templates(f"{pkg}:*") for pkg in package_ids] instead.',
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        match = []  # type: List[Template]
-        for pkg_id in package_ids:
-            match.extend(self._cache.templates.lookup(pkg_id, "*"))
-        return match
-
-    def resolve_template(
-        self, template: "Union[None, str, TypeReference, UnresolvedTypeReference, TypeConName]"
-    ) -> Collection[Template]:
-        """
-        Return a collection of :class:`Template` instances that match the specified template name.
-
-        Some special parameters:
-         * If ``"*"`` is passed in, all templates are returned.
-         * If ``None`` is passed in, an empty collection is returned.
-
-        :param template:
-            A template name or a :class:`TypeReference`.
-        :return:
-            A collection of matching templates, or an empty collection if none match. This method
-            never returns ``None``.
-        """
-        warnings.warn(
-            "PackageStore.resolve_template() is deprecated; use SymbolLookup.template() instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        if isinstance(template, Template):
-            # if we were given a Template for some strange reason, just simply return a single-item
-            # tuple of that given Template
-            return [template]
-
-        package_id, template_name = validate_template(template, allow_deprecated_identifiers=True)
-        return self._cache.templates.lookup(package_id, template_name)
-
-    def resolve_template_type(
-        self, template: "Union[None, str, TypeReference, UnresolvedTypeReference, TypeConName]"
-    ) -> Dict[TypeReference, Type]:
-        """
-        Return a collection of types that match for the template.
-
-        :param template:
-            A template name or a :class:`TypeReference`.
-        :return:
-            A dictionary of possible matches, or empty if there are no matches. This method never
-            returns ``None``.
-        """
-        warnings.warn(
-            "PackageStore.resolve_template() is deprecated; use SymbolLookup.template() instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-
-            return {
-                template.data_type.name: template.data_type
-                for template in self.resolve_template(template)
-                if template.data_type.name is not None
-            }
-
-    def resolve_choice(self, template: Any, choice: str) -> Dict[TypeReference, TemplateChoice]:
-        """
-        Return all possible choices for the combination of template identifier and choice name.
-        If template is ``'*'`` or ``None``, all choices with the specified name are returned.
-        """
-        warnings.warn(
-            'PackageStore.resolve_choice() is deprecated; use SymbolLookup.template("*") instead, '
-            "and lookup the choice within the returned Template.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-
-            matches = dict()  # type: Dict[TypeReference, TemplateChoice]
-            for t in self.resolve_template(template):
-                for c in t.choices:
-                    if c.name == choice and t.data_type.name is not None:
-                        matches[t.data_type.name] = c
-            return matches
-
-
-@runtime_checkable
-class PackageProvider(Protocol):
-    """
-    Interface to an object that can provide package information.
-    """
-
-    def __init__(self):
-        warnings.warn(
-            "PackageProvider is deprecated; use PackageLookup instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-    def get_package_ids(self) -> "PackageIdSet":
-        """
-        Return the current universe of package IDs.
-        """
-        raise NotImplementedError
-
-    def fetch_package(self, package_id: "PackageRef") -> bytes:
-        """
-        Retrieve the bytes that correspond to a package.
-        """
-        raise NotImplementedError
-
-    def get_all_packages(self) -> "Mapping[PackageRef, bytes]":
-        raise NotImplementedError
-
-
-class MemoryPackageProvider:
-    def __init__(self, mapping: "Mapping[PackageRef, bytes]"):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            super().__init__()
-        warnings.warn(
-            "MemoryPackageProvider is deprecated; there is no replacement.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self.mapping = mapping
-
-    def get_package_ids(self) -> "PackageIdSet":
-        return frozenset(self.mapping.keys())
-
-    # fetch_package is actually supposed to throw an error on missing packages, but people may
-    # be reliant on the old behavior; anyway this entire file is deprecated; changing the behavior
-    # of a soon-to-be-removed class seems unnecessary
-    @no_type_check
-    def fetch_package(self, package_id: "PackageRef") -> bytes:
-        return self.mapping.get(package_id)
-
-    def get_all_packages(self) -> "Mapping[PackageRef, bytes]":
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            return {pkg_id: self.fetch_package(pkg_id) for pkg_id in self.get_package_ids()}
-
-
-@dataclass(frozen=True)
-class PackageStoreCache:
-    value_types: "TypeCache[ValName, Expr]"
-    data_types: "TypeCache[TypeConName, Type]"
-    templates: "TypeCache[TypeConName, Template]"
-
-
-@dataclass(frozen=True)
-class TypeCache(Generic[K, T]):
-    """
-    Immutable cache of type information.
-
-    Instance attributes:
-
-    .. attribute:: TypeCache.by_package_lookup
-
-        A mapping from package ID strings to another mapping, where keys are fully-qualified type
-        names for templates to a collection of matching Template instances. These collections are
-        never non-empty; they will only ever contain multiple entries if there is a collision in
-        dot-separated names.
-
-    .. attribute:: TypeCache.by_name_lookup
-
-        A mapping from fully-qualified type names (excluding package IDs) to ``Collection[T]``.
-        These subcollections will only contain multiple values if names are not unique with respect
-        to package IDs.
-    """
-
-    everything: "Collection[T]"
-    by_package_lookup: "Mapping[PackageRef, Mapping[str, Collection[T]]]"
-    by_name_lookup: "Mapping[str, Collection[T]]"
-
-    @classmethod
-    def build(cls, objects: "Mapping[K, T]") -> "TypeCache[K, T]":
-        from ..damlast.util import package_local_name, package_ref
-
-        everything = tuple(objects.values())
-        by_package_lookup: DefaultDict[PackageRef, DefaultDict[str, List[T]]] = defaultdict(
-            lambda: defaultdict(list)
-        )
-        by_name_lookup = defaultdict(list)
-
-        for k, v in objects.items():
-            package_id = package_ref(k)
-            module_entity_name = package_local_name(k)
-            # This is kept here for backwards compatibility, but its use should be discouraged
-            module_entity_name_deprecated = module_entity_name.replace(":", ".")
-            for valid_name in (module_entity_name, module_entity_name_deprecated):
-                by_package_lookup[package_id][valid_name].append(v)
-                by_name_lookup[valid_name].append(v)
-
-        return TypeCache(
-            everything,
-            _immutable_mmc(by_package_lookup),
-            MappingProxyType({k: tuple(v) for k, v in by_name_lookup.items()}),
-        )
-
-    def lookup(self, package_id: PackageRef, type_name: str) -> "Collection[T]":
-        """
-        Look up items based on package ID and type name. The values cannot be ``None``, but they
-        can be the special-meaning ``'*'`` value.
-        """
-        safe_cast(str, package_id)
-        safe_cast(str, type_name)
-
-        if package_id == "*":
-            if type_name == "*":
-                # *:* means return everything
-                return self.everything
-            else:
-                # *:Specific.Module:Entity means return all matches of the requested name, but
-                # under any package
-                return self.by_name_lookup.get(type_name, ())
-        elif type_name == "*":
-            # PKG_ID:* means return all matches in a specific package
-            return reduce(add, self.by_package_lookup.get(package_id, {}).values(), ())
-        else:
-            # PKG_ID:Specific.Module:Entity; we are looking for a very specific type
-            return self.by_package_lookup.get(package_id, {}).get(type_name, ())
-
-
-def _immutable_mmc(
-    mapping: "Mapping[S, Mapping[str, Collection[T]]]",
-) -> "Mapping[S, Mapping[str, Collection[T]]]":
-    """
-    Create an immutable copy of :class:`TemplateStoreCache` data structures.
-    """
-    return MappingProxyType(
-        {k1: MappingProxyType({k2: tuple(v) for k2, v in v1.items()}) for k1, v1 in mapping.items()}
-    )
-
-
-EMPTY_MAPPING = MappingProxyType({})  # type: ignore
-EMPTY_TYPE_CACHE = TypeCache((), EMPTY_MAPPING, EMPTY_MAPPING)  # type: ignore
diff --git a/python/dazl/model/writing.py b/python/dazl/model/writing.py
deleted file mode 100644
index ac564b1c..00000000
--- a/python/dazl/model/writing.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-This module has been relocated to ``dazl.client.commands``, though if possible you should move to
-the command types defined in ``dazl.ledger`` instead.
-"""
-from __future__ import annotations
-
-import warnings
-
-from ..client.commands import (
-    CommandBuilder,
-    CommandDefaults,
-    CommandPayload,
-    CommandsOrCommandSequence,
-    CreateAndExerciseCommand,
-    CreateCommand,
-    EventHandlerResponse,
-    ExerciseByKeyCommand,
-    ExerciseCommand,
-    create,
-    create_and_exercise,
-    exercise,
-    exercise_by_key,
-    flatten_command_sequence,
-)
-from ..ledger import Command
-from ..protocols.serializers import AbstractSerializer, Serializer
-
-warnings.warn(
-    "dazl.model.writing is deprecated; please use the types of dazl.ledger.api_types instead.",
-    DeprecationWarning,
-    stacklevel=2,
-)
-
-__all__ = [
-    "AbstractSerializer",
-    "Command",
-    "CommandBuilder",
-    "CommandDefaults",
-    "CommandPayload",
-    "CommandsOrCommandSequence",
-    "CreateAndExerciseCommand",
-    "CreateCommand",
-    "EventHandlerResponse",
-    "ExerciseByKeyCommand",
-    "ExerciseCommand",
-    "Serializer",
-    "create",
-    "create_and_exercise",
-    "exercise",
-    "exercise_by_key",
-    "flatten_command_sequence",
-]
diff --git a/python/dazl/pretty/_module_builder.py b/python/dazl/pretty/_module_builder.py
index 52e9bf5f..7dc4e93d 100644
--- a/python/dazl/pretty/_module_builder.py
+++ b/python/dazl/pretty/_module_builder.py
@@ -6,9 +6,10 @@
 
 from typing import Dict, List, Sequence
 
-from ..damlast.daml_lf_1 import DottedName, Module
+from ..damlast.daml_lf_1 import DottedName, Module, ModuleRef
 from ..damlast.util import module_name, package_ref
-from ..model.types import ModuleRef
+
+__all__ = ["ModuleHierarchy"]
 
 
 class ModuleHierarchy:
diff --git a/python/dazl/pretty/render_csv.py b/python/dazl/pretty/render_csv.py
index 95d19177..ee94f9d1 100644
--- a/python/dazl/pretty/render_csv.py
+++ b/python/dazl/pretty/render_csv.py
@@ -7,9 +7,6 @@
 from io import StringIO
 from typing import Dict, List, Tuple
 
-from dazl.model.types import ContractIdType, ListType, RecordType, Type, TypeReference
-from dazl.model.types_store import PackageStore
-
 
 def write_csv(store: PackageStore) -> str:
     templates = {
diff --git a/python/dazl/pretty/render_daml.py b/python/dazl/pretty/render_daml.py
index a036abd9..a6ad8b3f 100644
--- a/python/dazl/pretty/render_daml.py
+++ b/python/dazl/pretty/render_daml.py
@@ -16,45 +16,14 @@
     PrimType,
     Pure,
     Scenario,
-    Type as NewType,
+    Type,
     TypeConName,
     Update,
 )
 from ..damlast.util import module_name, package_local_name
-from ..model.types import (
-    SCALAR_TYPE_BOOL,
-    SCALAR_TYPE_CHAR,
-    SCALAR_TYPE_DATE,
-    SCALAR_TYPE_DECIMAL,
-    SCALAR_TYPE_INTEGER,
-    SCALAR_TYPE_PARTY,
-    SCALAR_TYPE_RELTIME,
-    SCALAR_TYPE_TEXT,
-    SCALAR_TYPE_TIME,
-    SCALAR_TYPE_UNIT,
-    ContractIdType,
-    EnumType,
-    ForAllType,
-    ListType,
-    OptionalType,
-    RecordType,
-    ScalarType,
-    TextMapType,
-    Type as OldType,
-    TypeApp,
-    TypeReference,
-    TypeVariable,
-    UpdateType,
-    VariantType,
-    type_dispatch_table,
-)
 from ._render_base import PrettyPrintBase
 from .util import maybe_parentheses
 
-_OldTypePrim = Union[
-    ScalarType, ContractIdType, ListType, OptionalType, TextMapType, UpdateType, NewType.Prim
-]
-
 
 class DamlPrettyPrinter(PrettyPrintBase):
 
@@ -344,15 +313,12 @@ def visit_expr_optional_some(self, optional_some: "Expr.OptionalSome") -> str:
 
     # region visit_type_* methods
 
-    def visit_type(
-        self, type: "Union[str, NewType, OldType, TypeConName]", parenthesize: bool = False
-    ) -> str:
+    def visit_type(self, type: "Union[str, Type, TypeConName]", parenthesize: bool = False) -> str:
         from ..damlast.daml_lf_1 import TypeConName
-        from ..model.types import TypeReference
 
         if isinstance(type, str):
             type_str = type
-        elif isinstance(type, NewType):
+        elif isinstance(type, Type):
             type_str = type.Sum_match(
                 var=self.visit_type_var,
                 con=self.visit_type_con,
@@ -362,76 +328,47 @@ def visit_type(
                 nat=self.visit_type_nat,
                 syn=self.visit_type_syn,
             )
-        elif isinstance(type, UpdateType):
-            type_str = self.visit_type_prim(type)
-        elif isinstance(type, ForAllType):
-            type_str = self.visit_type_forall(type)
-        elif isinstance(type, OldType):
-            type_str = type_dispatch_table(
-                on_type_var=self.visit_type_var,
-                on_type_ref=self.visit_type_con,
-                on_scalar=self.visit_type_prim,
-                on_contract_id=self.visit_type_prim,
-                on_list=self.visit_type_prim,
-                on_optional=self.visit_type_prim,
-                on_text_map=self.visit_type_prim,
-                on_record=self.visit_type_con,
-                on_variant=self.visit_type_con,
-                on_enum=self.visit_type_con,
-                on_type_app=self._visit_type_app,
-                on_unsupported=repr,
-            )(type)
         elif isinstance(type, TypeConName):
-            type_str = self.visit_type_con(TypeReference(type))
+            type_str = self.visit_type_con(type)
         else:
             raise TypeError(f"A DAML Type is required here (got {type!r} instead")
 
         return maybe_parentheses(type_str) if parenthesize else type_str
 
-    def visit_type_var(self, var: "Union[str, TypeVariable, NewType.Var]"):
-        if isinstance(var, NewType.Var):
+    def visit_type_var(self, var: "Union[str, Type.Var]"):
+        if isinstance(var, Type.Var):
             return self._visit_type_app((var.var, *var.args))
-        elif isinstance(var, TypeVariable):
-            return var.name
         elif isinstance(var, str):
             return var
         else:
             raise TypeError(f"A DAML Type variable is required here (got {var!r} instead")
 
-    def visit_type_con(
-        self, con: "Union[TypeReference, RecordType, VariantType, EnumType, NewType.Con]"
-    ) -> str:
-        if isinstance(con, TypeReference):
-            return package_local_name(con.con)
-        elif isinstance(con, (RecordType, VariantType, EnumType)):
-            if con.name is None:
-                raise ValueError("A named Record, Variant, or Enum type is required here")
-            return package_local_name(con.name.con)
-        elif isinstance(con, NewType.Con):
+    def visit_type_con(self, con: "Type.Con") -> str:
+        if isinstance(con, Type.Con):
             return self._visit_type_app((package_local_name(con.tycon), *con.args))
         else:
             raise TypeError(f"A DAML Type constructor is required here (got {con!r} instead")
 
-    def visit_type_prim(self, prim: "_OldTypePrim") -> str:
-        prim_type = prim.prim if isinstance(prim, NewType.Prim) else None
+    def visit_type_prim(self, prim: "Type.Prim") -> str:
+        prim_type = prim.prim if isinstance(prim, Type.Prim) else None
 
-        if PrimType.UNIT == prim_type or SCALAR_TYPE_UNIT == prim:
+        if PrimType.UNIT == prim_type:
             return "Unit"
-        elif PrimType.BOOL == prim_type or SCALAR_TYPE_BOOL == prim:
+        elif PrimType.BOOL == prim_type:
             return "Bool"
-        elif PrimType.INT64 == prim_type or SCALAR_TYPE_INTEGER == prim:
+        elif PrimType.INT64 == prim_type:
             return "Int"
-        elif PrimType.DECIMAL == prim_type or SCALAR_TYPE_DECIMAL == prim:
+        elif PrimType.DECIMAL == prim_type:
             return "Decimal"
-        elif PrimType.CHAR == prim_type or SCALAR_TYPE_CHAR == prim:
+        elif PrimType.CHAR == prim_type:
             return "Char"
-        elif PrimType.TEXT == prim_type or SCALAR_TYPE_TEXT == prim:
+        elif PrimType.TEXT == prim_type:
             return "Text"
-        elif PrimType.TIMESTAMP == prim_type or SCALAR_TYPE_TIME == prim:
+        elif PrimType.TIMESTAMP == prim_type:
             return "Time"
-        elif PrimType.RELTIME == prim_type or SCALAR_TYPE_RELTIME == prim:
+        elif PrimType.RELTIME == prim_type:
             return "RelTime"
-        elif PrimType.PARTY == prim_type or SCALAR_TYPE_PARTY == prim:
+        elif PrimType.PARTY == prim_type:
             return "Party"
 
         elif PrimType.LIST == prim_type:
@@ -439,29 +376,21 @@ def visit_type_prim(self, prim: "_OldTypePrim") -> str:
                 return "List"
             else:
                 return f"[{self.visit_type(prim.args[0])}]"
-        elif isinstance(prim, ListType):
-            return f"[{self.visit_type(prim.type_parameter)}]"
 
         elif PrimType.UPDATE == prim_type:
             return self._visit_type_app(("Update", *prim.args))
-        elif isinstance(prim, UpdateType):
-            return self._visit_type_app(("Update", prim.type_parameter))
 
         elif PrimType.SCENARIO == prim_type:
             return self._visit_type_app(("Scenario", *prim.args))
 
-        elif PrimType.DATE == prim_type or SCALAR_TYPE_DATE == prim:
+        elif PrimType.DATE == prim_type:
             return "Date"
 
         elif PrimType.CONTRACT_ID == prim_type:
             return self._visit_type_app(("ContractId", *prim.args))
-        elif isinstance(prim, ContractIdType):
-            return self._visit_type_app(("ContractId", prim.type_parameter))
 
         elif PrimType.OPTIONAL == prim_type:
             return self._visit_type_app(("Optional", *prim.args))
-        elif isinstance(prim, OptionalType):
-            return self._visit_type_app(("Optional", prim.type_parameter))
 
         elif PrimType.ARROW == prim_type:
             arrow_operator = " -> "
@@ -490,25 +419,17 @@ def visit_type_prim(self, prim: "_OldTypePrim") -> str:
         else:
             raise TypeError(f"A DAML Type primitive is required here (got {prim!r} instead")
 
-    def visit_type_forall(self, forall: "Union[ForAllType, NewType.Forall]") -> str:
-        if isinstance(forall, NewType.Forall):
+    def visit_type_forall(self, forall: "Type.Forall") -> str:
+        if isinstance(forall, Type.Forall):
             return f'forall {" ".join(self.visit_type_var(v.var) for v in forall.vars)}. {self.visit_type(forall.body)}'
-        elif isinstance(forall, ForAllType):
-            return (
-                f'forall {" ".join(self.visit_type_var(v.var) for v in forall.type_vars)}. '
-                f"{self.visit_type(forall.body_type)}"
-            )
         else:
             raise TypeError(f"A DAML forall Type is required here (got {forall!r} instead")
 
     # noinspection PyShadowingBuiltins
-    def visit_type_tuple(self, struct: "NewType.Struct") -> str:
+    def visit_type_tuple(self, struct: "Type.Struct") -> str:
         return "(" + ",".join(self.visit_type(t.type) for t in struct.fields) + ")"
 
-    def _visit_type_app(self, types: "Union[TypeApp, Sequence[Union[str, NewType, OldType]]]"):
-        if isinstance(types, TypeApp):
-            types = (types.body, *types.arguments)
-
+    def _visit_type_app(self, types: "Sequence[Union[str, Type]]"):
         return " ".join(self.visit_type(c, True) for c in types)
 
     # endregion
diff --git a/python/dazl/pretty/render_python.py b/python/dazl/pretty/render_python.py
index 5aa8c57e..5f89b2b1 100644
--- a/python/dazl/pretty/render_python.py
+++ b/python/dazl/pretty/render_python.py
@@ -5,8 +5,7 @@
 from __future__ import annotations
 
 from io import StringIO
-from typing import Mapping, Optional, Sequence, Union
-import warnings
+from typing import Optional, Sequence
 
 from .. import LOG
 from ..damlast import daml_types as daml
@@ -26,24 +25,6 @@
 from ._render_base import PrettyPrintBase, pretty_print_syntax
 from .util import indent, maybe_parentheses
 
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-    from ..model.types import ModuleRef, Type as OldType
-    from ..model.types_store import PackageStore
-
-
-def values_by_module(
-    store: "PackageStore",
-) -> "Mapping[ModuleRef, Mapping[Sequence[str], Union[Expr, OldType]]]":
-    from collections import defaultdict
-
-    d = defaultdict(defaultdict)
-    for vn, vv in store._value_types.items():
-        d[vn.module][vn.name] = vv
-    for vn, vv in store._data_types.items():
-        d[vn.module][vn.name] = vv
-    return d
-
 
 @pretty_print_syntax("python")
 class PythonPrettyPrint(PrettyPrintBase):
diff --git a/python/dazl/protocols/events.py b/python/dazl/protocols/events.py
index 51e91cdb..eb6536ed 100644
--- a/python/dazl/protocols/events.py
+++ b/python/dazl/protocols/events.py
@@ -67,7 +67,6 @@
 
 if TYPE_CHECKING:
     from ..client.state import ContractContextualData
-    from ..model.types_store import PackageStore
 
 __all__ = [
     "BaseEvent",
@@ -99,7 +98,6 @@ class BaseEvent:
     time: "Optional[datetime]"
     ledger_id: str
     lookup: "SymbolLookup"
-    package_store: "PackageStore"
 
     def acs_find_active(self, template: "Union[str, TypeConName]", match=None):
         return self.client.find_active(template, match)
diff --git a/python/dazl/protocols/v0/__init__.py b/python/dazl/protocols/v0/__init__.py
deleted file mode 100644
index 5fb7ae66..00000000
--- a/python/dazl/protocols/v0/__init__.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-from __future__ import annotations
-
-import warnings
-
-warnings.warn("dazl.protocols.v0 is deprecated", DeprecationWarning, stacklevel=2)
diff --git a/python/dazl/protocols/v0/json_ser_command.py b/python/dazl/protocols/v0/json_ser_command.py
deleted file mode 100644
index e051bbff..00000000
--- a/python/dazl/protocols/v0/json_ser_command.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-Methods for serializing domain objects and other things into basic primitive
-types over the wire on the REST interface using JSON.
-"""
-
-from __future__ import annotations
-
-from datetime import datetime
-from typing import TYPE_CHECKING, Any
-import warnings
-
-from ...damlast.daml_lf_1 import TypeConName
-from ...model.writing import AbstractSerializer
-from ...prim import ContractId, JSONEncoder
-from ...values.json import JsonEncoder
-
-if TYPE_CHECKING:
-    from ...model.writing import CommandPayload
-
-__all__ = ["LedgerJSONEncoder", "to_api_datetime", "JsonSerializer"]
-
-
-class LedgerJSONEncoder(JSONEncoder):
-    """
-    Convert some known Ledger API primitive types into their appropriate JSON
-    representations.
-    """
-
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-        warnings.warn(
-            "dazl.protocols.v0.json_ser_command.LedgerJSONEncoder is deprecated; "
-            "use dazl.prim.JSONEncoder instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-
-def to_api_datetime(obj):
-    """
-    Converts the object to an ISO8601 datetime string.
-
-    :param obj:
-        A datetime. If the datetime is "naive" (no timezone information), it is
-        assumed to refer to UTC. If the datetime has timezone information, the
-        datetime will be converted to UTC before serializing.
-    :return: An ISO8601 string that represents the time in UTC.
-    """
-    from ...prim import datetime_to_str
-
-    warnings.warn(
-        "dazl.protocols.v0.json_ser_command.to_api_datetime is deprecated; "
-        "use dazl.prim.datetime_to_str instead.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-    return datetime_to_str(obj) if isinstance(obj, datetime) else obj
-
-
-class JsonSerializer(AbstractSerializer):
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-        warnings.warn(
-            "dazl.protocols.v0.json_ser_command.JsonSerializer is deprecated; "
-            "there is no replacement.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-    mapper = JsonEncoder()
-
-    def serialize_command_request(self, command_payload: "CommandPayload") -> dict:
-        commands = [self.serialize_command(command) for command in command_payload.commands]
-        return dict(
-            businessIntent=command_payload.command_id,
-            commands=commands,
-            application=command_payload.application_id,
-        )
-
-    def serialize_create_command(self, template_name: "TypeConName", template_args: "Any") -> "Any":
-        # the package_id in ModuleRef is a convenient place to
-        # stash legacy template IDs in the REST endpoint
-        return {"create": {"template": str(template_name), "arguments": template_args}}
-
-    def serialize_exercise_command(
-        self, contract_id: ContractId, choice_name: str, choice_args: "Any"
-    ) -> "Any":
-        return {
-            "exercise": {
-                "contract": contract_id.value,
-                "choice": choice_name,
-                "arguments": choice_args,
-            }
-        }
diff --git a/python/dazl/protocols/v1/grpc.py b/python/dazl/protocols/v1/grpc.py
index dcc20459..7d8ca18e 100644
--- a/python/dazl/protocols/v1/grpc.py
+++ b/python/dazl/protocols/v1/grpc.py
@@ -25,8 +25,8 @@
 from ... import LOG
 from ..._gen.com.daml.ledger.api import v1 as lapipb
 from ..._gen.com.daml.ledger.api.v1 import admin as lapiadminpb, testing as lapitestingpb
+from ...client._conn_settings import HTTPConnectionSettings
 from ...damlast.daml_lf_1 import PackageRef
-from ...damlast.parse import parse_archive_payload
 from ...ledger.aio.pkgloader_compat import PackageLoader
 from ...prim import Party, datetime_to_timestamp, to_party
 from ...scheduler import Invoker, RunLevel
@@ -34,6 +34,7 @@
 from ...util.typing import safe_cast
 from .._base import LedgerClient, LedgerConnectionOptions, _LedgerConnection
 from ..errors import ConnectionTimeoutError, UserTerminateRequest
+from ..events import BaseEvent, ContractFilter, TransactionFilter
 from .pb_parse_event import (
     BaseEventDeserializationContext,
     serialize_acs_request,
@@ -48,9 +49,6 @@
     if TYPE_CHECKING:
         from ...client.commands import CommandPayload
         from ...client.ledger import LedgerMetadata
-        from ...model.network import HTTPConnectionSettings
-        from ...model.reading import BaseEvent, ContractFilter, TransactionFilter
-        from ...model.types_store import PackageProvider, PackageStore
 
 
 __all__ = [
@@ -60,7 +58,6 @@
     "grpc_detect_ledger_id",
     "grpc_main_thread",
     "GRPCPackageProvider",
-    "grpc_package_sync",
     "grpc_create_channel",
     "GRPCv1Connection",
 ]
@@ -108,7 +105,6 @@ async def active_contracts(self, contract_filter: "ContractFilter") -> "Sequence
             context = BaseEventDeserializationContext(
                 None,
                 self.connection.options.lookup,
-                self.ledger._store,
                 self.party,
                 self.ledger.ledger_id,
             )
@@ -153,7 +149,6 @@ async def events(self, transaction_filter: "TransactionFilter") -> "Sequence[Bas
         context = BaseEventDeserializationContext(
             None,
             self.connection.options.lookup,
-            self.ledger._store,
             self.party,
             self.ledger.ledger_id,
         )
@@ -254,34 +249,22 @@ def grpc_detect_ledger_id(connection: "GRPCv1Connection") -> str:
 
 
 # noinspection PyDeprecation
-def grpc_main_thread(connection: "GRPCv1Connection", ledger_id: str) -> "Iterable[LedgerMetadata]":
+def grpc_main_thread(connection: GRPCv1Connection, ledger_id: str) -> Iterable[LedgerMetadata]:
     from ...client.ledger import LedgerMetadata
     from .pb_ser_command import ProtobufSerializer
 
     LOG.info("grpc_main_thread...")
 
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from ...model.types_store import PackageStore
-
-        store = PackageStore.empty()
-
-        package_provider = GRPCPackageProvider(connection, ledger_id)
-
-        if connection.options.eager_package_fetch:
-            grpc_package_sync(package_provider, store)
-
     with warnings.catch_warnings():
         warnings.simplefilter("ignore", DeprecationWarning)
         package_loader = PackageLoader(
             package_lookup=connection.options.lookup,
-            conn=package_provider,
+            conn=GRPCPackageProvider(connection, ledger_id),
             timeout=connection.options.connect_timeout,
         )
 
     yield LedgerMetadata(
         ledger_id=ledger_id,
-        store=store,
         package_loader=package_loader,
         serializer=ProtobufSerializer(connection.options.lookup),
         protocol_version="v1",
@@ -293,7 +276,6 @@ def grpc_main_thread(connection: "GRPCv1Connection", ledger_id: str) -> "Iterabl
             if connection.options.eager_package_fetch:
                 with warnings.catch_warnings():
                     warnings.simplefilter("ignore", DeprecationWarning)
-                    grpc_package_sync(package_provider, store)
         except Exception as ex:
             if not isinstance(ex, RpcError) or ex.code() != StatusCode.CANCELLED:
                 LOG.warning("Package syncing raised an exception.", exc_info=True)
@@ -328,57 +310,6 @@ def get_all_packages(self) -> "Mapping[PackageRef, bytes]":
             return {pkg_id: self.fetch_package(pkg_id) for pkg_id in self.get_package_ids()}
 
 
-# noinspection PyDeprecation
-def grpc_package_sync(package_provider: "PackageProvider", store: "PackageStore") -> "None":
-    warnings.warn(
-        "grpc_package_sync is deprecated; there is no replacement", DeprecationWarning, stacklevel=2
-    )
-
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from .pb_parse_metadata import find_dependencies, parse_daml_metadata_pb
-
-        LOG.debug("grpc_package_sync started...")
-
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        all_package_ids = package_provider.get_package_ids()
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            loaded_package_ids = {a.hash for a in store.archives()}
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            expected_package_ids = store.expected_package_ids()
-
-        def should_load(p: str) -> bool:
-            # TODO: Filtering by expected package IDs may cause packages to never fully load due to
-            #  transitive dependencies; here we put the onus on the app writer to ensure that they
-            #  supply the complete graph, and we don't even warn them if there is an issue (but
-            #  we could only actually warn them if we parse the archive, which is the expensive
-            #  operation we're trying to avoid).
-            return (
-                expected_package_ids is None or p in expected_package_ids
-            ) and p not in loaded_package_ids
-
-        metadatas_pb = {}
-        for package_id in all_package_ids:
-            if should_load(package_id):
-                archive_payload = package_provider.fetch_package(package_id)
-                metadatas_pb[package_id] = parse_archive_payload(package_id, archive_payload)
-
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        adr = find_dependencies(metadatas_pb, loaded_package_ids)
-
-    for package_id, archive_bytes in adr.sorted_archives.items():
-        m = parse_daml_metadata_pb(package_id, archive_bytes)
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-            store.register_all(m)
-
-    LOG.debug("grpc_package_sync ended.")
-
-
 def grpc_create_channel(settings: "HTTPConnectionSettings") -> Channel:
     target = f"{settings.host}:{settings.port}"
     options = [("grpc.max_send_message_length", -1), ("grpc.max_receive_message_length", -1)]
diff --git a/python/dazl/protocols/v1/model/__init__.py b/python/dazl/protocols/v1/model/__init__.py
deleted file mode 100644
index cec87c11..00000000
--- a/python/dazl/protocols/v1/model/__init__.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-from __future__ import annotations
-
-import warnings
-
-warnings.warn(
-    "dazl.protocols.v1.model is deprecated; use the types in dazl._gen instead",
-    DeprecationWarning,
-    stacklevel=2,
-)
-
-from ...._gen.com.daml.daml_lf_1_14.daml_lf_1_pb2 import (
-    DefDataType,
-    DefTemplate,
-    PrimType,
-    TemplateChoice,
-)
-from ...._gen.com.daml.daml_lf_1_14.daml_lf_pb2 import ArchivePayload
-from ...._gen.com.daml.ledger.api.v1.active_contracts_service_pb2 import (
-    GetActiveContractsRequest,
-    GetActiveContractsResponse,
-)
-from ...._gen.com.daml.ledger.api.v1.active_contracts_service_pb2_grpc import (
-    ActiveContractsServiceStub,
-)
-from ...._gen.com.daml.ledger.api.v1.admin.package_management_service_pb2 import (
-    UploadDarFileRequest,
-    UploadDarFileResponse,
-)
-from ...._gen.com.daml.ledger.api.v1.admin.package_management_service_pb2_grpc import (
-    PackageManagementServiceStub,
-)
-from ...._gen.com.daml.ledger.api.v1.command_service_pb2_grpc import CommandServiceStub
-from ...._gen.com.daml.ledger.api.v1.command_submission_service_pb2 import SubmitRequest
-from ...._gen.com.daml.ledger.api.v1.commands_pb2 import (
-    Command,
-    Commands,
-    CreateAndExerciseCommand,
-    CreateCommand,
-    ExerciseByKeyCommand,
-    ExerciseCommand,
-)
-from ...._gen.com.daml.ledger.api.v1.event_pb2 import Event
-from ...._gen.com.daml.ledger.api.v1.ledger_identity_service_pb2 import GetLedgerIdentityRequest
-from ...._gen.com.daml.ledger.api.v1.ledger_identity_service_pb2_grpc import (
-    LedgerIdentityServiceStub,
-)
-from ...._gen.com.daml.ledger.api.v1.ledger_offset_pb2 import LedgerOffset
-from ...._gen.com.daml.ledger.api.v1.package_service_pb2 import (
-    GetPackageRequest,
-    ListPackagesRequest,
-)
-from ...._gen.com.daml.ledger.api.v1.package_service_pb2_grpc import PackageServiceStub
-from ...._gen.com.daml.ledger.api.v1.testing.time_service_pb2 import GetTimeRequest, SetTimeRequest
-from ...._gen.com.daml.ledger.api.v1.testing.time_service_pb2_grpc import TimeServiceStub
-from ...._gen.com.daml.ledger.api.v1.transaction_filter_pb2 import (
-    Filters,
-    InclusiveFilters,
-    TransactionFilter,
-)
-from ...._gen.com.daml.ledger.api.v1.transaction_pb2 import Transaction
-from ...._gen.com.daml.ledger.api.v1.transaction_service_pb2 import (
-    GetLedgerEndRequest,
-    GetTransactionByEventIdRequest,
-    GetTransactionsRequest,
-    GetTransactionsResponse,
-)
-from ...._gen.com.daml.ledger.api.v1.transaction_service_pb2_grpc import TransactionServiceStub
-from ...._gen.com.daml.ledger.api.v1.value_pb2 import (
-    Identifier,
-    List,
-    Record,
-    RecordField,
-    Value,
-    Variant,
-)
diff --git a/python/dazl/protocols/v1/pb_parse_event.py b/python/dazl/protocols/v1/pb_parse_event.py
index 3b4482f3..1238b0f3 100644
--- a/python/dazl/protocols/v1/pb_parse_event.py
+++ b/python/dazl/protocols/v1/pb_parse_event.py
@@ -8,7 +8,7 @@
 
 from dataclasses import dataclass
 from datetime import datetime
-from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Sequence, Union, cast
+from typing import Any, Dict, Iterable, List, Optional, Sequence, Union, cast
 import warnings
 
 from ... import LOG
@@ -33,10 +33,6 @@
     TransactionStartEvent,
 )
 
-if TYPE_CHECKING:
-    from ...model.types_store import PackageStore
-
-
 DECODER = ProtobufDecoder()
 
 
@@ -48,7 +44,6 @@ class BaseEventDeserializationContext:
 
     client: "Any"
     lookup: "SymbolLookup"
-    store: "PackageStore"
     party: "Party"
     ledger_id: str
 
@@ -56,15 +51,13 @@ def deserializer_context(self) -> "Context":
         return Context(DECODER, self.lookup)
 
     def offset_event(self, time: Optional[datetime], offset: str) -> OffsetEvent:
-        return OffsetEvent(
-            self.client, self.party, time, self.ledger_id, self.lookup, self.store, offset
-        )
+        return OffsetEvent(self.client, self.party, time, self.ledger_id, self.lookup, offset)
 
     def active_contract_set(
         self, offset: str, workflow_id: str
     ) -> "ActiveContractSetEventDeserializationContext":
         return ActiveContractSetEventDeserializationContext(
-            self.client, self.lookup, self.store, self.party, self.ledger_id, offset, workflow_id
+            self.client, self.lookup, self.party, self.ledger_id, offset, workflow_id
         )
 
     def transaction(
@@ -73,7 +66,6 @@ def transaction(
         return TransactionEventDeserializationContext(
             self.client,
             self.lookup,
-            self.store,
             self.party,
             self.ledger_id,
             time,
@@ -101,7 +93,6 @@ def active_contract_set_event(
             None,
             self.ledger_id,
             self.lookup,
-            self.store,
             self.offset,
             contract_events,
         )
@@ -113,7 +104,6 @@ def contract_created_event(self, cid, cdata, event_id, witness_parties) -> Contr
             time=None,
             ledger_id=self.ledger_id,
             lookup=self.lookup,
-            package_store=self.store,
             offset=self.offset,
             command_id="",
             workflow_id=self.workflow_id,
@@ -142,7 +132,6 @@ def transaction_start_event(self, contract_events) -> TransactionStartEvent:
             self.time,
             self.ledger_id,
             self.lookup,
-            self.store,
             self.offset,
             self.command_id,
             self.workflow_id,
@@ -156,7 +145,6 @@ def transaction_end_event(self, contract_events) -> TransactionEndEvent:
             self.time,
             self.ledger_id,
             self.lookup,
-            self.store,
             self.offset,
             self.command_id,
             self.workflow_id,
@@ -170,7 +158,6 @@ def contract_created_event(self, cid, cdata, event_id, witness_parties) -> Contr
             time=self.time,
             ledger_id=self.ledger_id,
             lookup=self.lookup,
-            package_store=self.store,
             offset=self.offset,
             command_id=self.command_id,
             workflow_id=self.workflow_id,
@@ -200,7 +187,6 @@ def contract_exercised_event(
             time=self.time,
             ledger_id=self.ledger_id,
             lookup=self.lookup,
-            package_store=self.store,
             offset=self.offset,
             command_id=self.command_id,
             workflow_id=self.workflow_id,
@@ -226,7 +212,6 @@ def contract_archived_event(
             time=self.time,
             ledger_id=self.ledger_id,
             lookup=self.lookup,
-            package_store=self.store,
             offset=self.offset,
             command_id=self.command_id,
             workflow_id=self.workflow_id,
diff --git a/python/dazl/protocols/v1/pb_parse_metadata.py b/python/dazl/protocols/v1/pb_parse_metadata.py
deleted file mode 100644
index 8c5e90ef..00000000
--- a/python/dazl/protocols/v1/pb_parse_metadata.py
+++ /dev/null
@@ -1,363 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-from __future__ import annotations
-
-from collections import OrderedDict, defaultdict
-from dataclasses import dataclass
-from typing import (
-    TYPE_CHECKING,
-    AbstractSet,
-    Any,
-    Collection,
-    DefaultDict,
-    List,
-    Mapping,
-    Optional,
-    Set,
-    Union,
-)
-import warnings
-
-from toposort import toposort_flatten
-
-from ... import LOG
-from ..._gen.com.daml.daml_lf_1_14 import daml_lf_pb2 as lfpb
-from ...damlast.daml_lf_1 import (
-    Archive,
-    DefDataType,
-    DottedName,
-    ModuleRef,
-    PackageRef,
-    TypeConName,
-    ValName,
-)
-
-with warnings.catch_warnings():
-    warnings.simplefilter("ignore", DeprecationWarning)
-    from ...damlast.types import get_old_type
-
-    if TYPE_CHECKING:
-        from ...model.types import EnumType, RecordType, ScalarType, VariantType
-        from ...model.types_store import PackageStore
-
-__all__ = [
-    "parse_archive_payload",
-    "ArchiveDependencyResult",
-    "find_dependencies",
-    "parse_daml_metadata_pb",
-]
-
-warnings.warn(
-    "The symbols in dazl.protocols.v1.pb_parse_metadata are deprecated",
-    DeprecationWarning,
-    stacklevel=2,
-)
-
-
-def parse_archive_payload(raw_bytes: bytes, package_id: "Optional[PackageRef]" = None):
-    """
-    Convert ``bytes`` into a :class:`G_ArchivePayload`.
-
-    Note that this function will temporarily increase Python's recursion limit to handle cases where
-    parsing a DAML-LF archive requires deeper recursion limits.
-    """
-    warnings.warn(
-        "Use dazl.damlast.parse.parse_archive_payload instead.", DeprecationWarning, stacklevel=2
-    )
-
-    from ...damlast.parse import parse_archive_payload as pav
-
-    return pav(package_id, raw_bytes)
-
-
-@dataclass(frozen=True)
-class ArchiveDependencyResult:
-    sorted_archives: "Mapping[PackageRef, lfpb.ArchivePayload]"
-    unresolvable_archives: "Mapping[PackageRef, lfpb.ArchivePayload]"
-
-
-# noinspection PyDeprecation
-def find_dependencies(
-    metadatas_pb: "Mapping[PackageRef, lfpb.ArchivePayload]",
-    existing_package_ids: "Collection[PackageRef]",
-) -> "ArchiveDependencyResult":
-    """
-    Return a topologically-sorted list of dependencies for the package IDs.
-
-    :param metadatas_pb:
-        The collection of gRPC ArchivePayload to re-order, indexed by package ID.
-    :param existing_package_ids:
-        Collection of package IDs that are to be treated as pre-existing.
-    :return:
-        A topologically-sorted dictionary of package IDs to ArchivePayload objects. Iterations
-        through the dictionary are guaranteed to be in the correct order.
-    """
-    warnings.warn(
-        "find_dependencies is deprecated; there is no replacement.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    dependencies = defaultdict(set)  # type: DefaultDict[PackageRef, Set[PackageRef]]
-    for package_id, archive_payload in metadatas_pb.items():
-        for module_pb in archive_payload.daml_lf_1.modules:
-            for data_type_pb in module_pb.data_types:
-                deps = None
-                if data_type_pb.HasField("record"):
-                    deps = find_dependencies_of_fwts(data_type_pb.record.fields)
-                elif data_type_pb.HasField("variant"):
-                    deps = find_dependencies_of_fwts(data_type_pb.variant.fields)
-                if deps is not None:
-                    deps = set(deps)
-                    deps.difference_update(existing_package_ids)
-                    dependencies[package_id].update(deps)
-
-    # identify any completely missing dependencies
-    # TODO: This doesn't handle transitive missing dependencies; this will be a problem once
-    #  DAML has proper dependency support
-    unresolvable_package_ids = []  # type: List[PackageRef]
-    for package_id, package_dependencies in dependencies.items():
-        if not package_dependencies.issubset(metadatas_pb):
-            unresolvable_package_ids.append(package_id)
-
-    m_pb = {}
-    sorted_package_ids = toposort_flatten(dependencies)
-
-    # packages with no dependencies or dependents can safely be added in the front
-    remainders = set(metadatas_pb) - set(unresolvable_package_ids) - set(sorted_package_ids)
-    sorted_package_ids[0:0] = sorted(remainders)
-
-    for package_id in sorted_package_ids:
-        if package_id not in unresolvable_package_ids:
-            required_package = metadatas_pb.get(package_id)
-            if required_package is not None:
-                m_pb[package_id] = required_package
-            else:
-                LOG.warning("Failed to find a package %r", package_id)
-
-    if unresolvable_package_ids:
-        # This isn't a major problem in the grand scheme of things because the caller continually
-        # retries all unknown packages, so if the missing dependent packages are eventually
-        # uploaded, we will end up back in this function and all of the packages will be parsed.
-        LOG.warning(
-            "Some package IDs could not be resolved, so packages that depend on these IDs "
-            "will be unavailable: %r",
-            unresolvable_package_ids,
-        )
-
-    return ArchiveDependencyResult(
-        sorted_archives=m_pb,
-        unresolvable_archives={pkg_id: metadatas_pb[pkg_id] for pkg_id in unresolvable_package_ids},
-    )
-
-
-# noinspection PyDeprecation
-def find_dependencies_of_fwts(fwts_pb) -> "AbstractSet[PackageRef]":
-    warnings.warn(
-        "find_dependencies_of_fwts is deprecated; there is no replacement.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-
-        dependencies = set()  # type: Set[PackageRef]
-        for fwt in fwts_pb:
-            dependencies.update(find_dependencies_of_fwt(fwt))
-        return dependencies
-
-
-# noinspection PyDeprecation
-def find_dependencies_of_fwt(fwt_pb) -> "Collection[PackageRef]":
-    warnings.warn(
-        "find_dependencies_of_fwt is deprecated; there is no replacement.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-
-        return find_dependencies_of_type(fwt_pb.type)
-
-
-# noinspection PyDeprecation
-def find_dependencies_of_type(type_pb) -> "Collection[PackageRef]":
-    warnings.warn(
-        "find_dependencies_of_type is deprecated; there is no replacement.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-
-        dependencies = set()  # type: Set[PackageRef]
-        t = type_pb.WhichOneof("Sum")  # type: str
-        if t == "prim":
-            for arg in type_pb.prim.args:
-                dependencies.update(find_dependencies_of_type(arg))
-            return sorted(dependencies)
-        elif t == "con":
-            if type_pb.con.tycon.module.package_ref.WhichOneof("Sum") == "package_id":
-                dependencies.add(type_pb.con.tycon.module.package_ref.package_id)
-            for arg in type_pb.con.args:
-                dependencies.update(find_dependencies_of_type(arg))
-            return sorted(dependencies)
-        elif t == "var":
-            for arg in type_pb.var.args:
-                dependencies.update(find_dependencies_of_type(arg))
-            return sorted(dependencies)
-        elif t == "fun":
-            for arg in type_pb.fun.params:
-                dependencies.update(find_dependencies_of_type(arg))
-            dependencies.update(find_dependencies_of_type(type_pb.fun.result))
-            return dependencies
-        elif t == "forall":
-            return find_dependencies_of_type(type_pb.forall.body)
-        elif t == "tuple":
-            return find_dependencies_of_fwts(type_pb.tuple.fields)
-        elif t == "nat":
-            return ()
-        elif t == "interned":
-            # This isn't strictly correct, but we're catching this here to suppress errors
-            # ahead of removal of this deprecated function
-            return ()
-        else:
-            LOG.warning("Unknown DAML-LF Type: %s (when evaluating %s)", t, type_pb)
-            return ()
-
-
-def parse_daml_metadata_pb(package_id: "PackageRef", metadata_pb: Any) -> "PackageStore":
-    """
-    Parse the contents of the given DAML-LF archive.
-
-    :param package_id:
-        The package to associate "self"-modules to.
-    :param metadata_pb:
-        The Protobuf-generated Archive object.
-    :return:
-        A :class:`PackageStore` with additional entries resulting from the parse of this archive.
-    """
-    warnings.warn(
-        "parse_daml_metadata_pb and PackageStore are deprecated; "
-        "use dazl.damlast.parse_archive instead",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    LOG.debug("Parsing package ID: %r", package_id)
-
-    from ...damlast.pb_parse import ProtobufParser
-
-    parser = ProtobufParser(package_id)
-    package = parser.parse_Package(metadata_pb.daml_lf_1)
-
-    return _parse_daml_metadata_pb(Archive(package_id, package))
-
-
-# noinspection PyDeprecation
-def _parse_daml_metadata_pb(archive: "Archive") -> "PackageStore":
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from ...model.types import EnumType, RecordType, Template, TemplateChoice, VariantType
-        from ...model.types_store import PackageStoreBuilder
-
-        psb = PackageStoreBuilder()
-        psb.add_archive(archive)
-
-        for module in archive.package.modules:
-            current_module = ModuleRef(archive.hash, DottedName(module.name.segments))
-            for vv in module.values:
-                vt = ValName(current_module, vv.name_with_type.name)
-                psb.add_value(vt, vv.expr)
-
-            for dt in module.data_types:
-                tt = create_data_type(current_module, dt)
-                if isinstance(tt, (RecordType, VariantType, EnumType)) and tt.name is not None:
-                    psb.add_type(tt.name.con, tt)
-                else:
-                    LOG.warning("Unexpected non-complex type will be ignored: %r", tt)
-
-            for template_pb in module.templates:
-                con = TypeConName(current_module, template_pb.tycon.segments)
-                data_type = psb.get_type(con)
-                if isinstance(data_type, RecordType):
-                    psb.add_template(
-                        Template(
-                            data_type=data_type,
-                            key_type=get_old_type(template_pb.key.type)
-                            if template_pb.key is not None
-                            else None,
-                            choices=[
-                                TemplateChoice(
-                                    c.name,
-                                    c.consuming,
-                                    get_old_type(c.arg_binder.type),
-                                    get_old_type(c.ret_type),
-                                    c.controllers,
-                                )
-                                for c in template_pb.choices
-                            ],
-                            observers=template_pb.observers,
-                            signatories=template_pb.signatories,
-                            agreement=template_pb.agreement,
-                            ensure=template_pb.precond,
-                        )
-                    )
-                elif data_type is None:
-                    LOG.warning(
-                        "The template %s did not have a corresponding data definition; "
-                        "it will be ignored",
-                        con,
-                    )
-                else:
-                    LOG.warning(
-                        "The template %s was of type %s; only records are supported for templates",
-                        con,
-                        data_type,
-                    )
-
-        LOG.debug("Fully registered all types for package ID %r", archive.hash)
-        return psb.build()
-
-
-# noinspection PyDeprecation
-def create_data_type(
-    current_module_ref: "ModuleRef", dt: "DefDataType"
-) -> "Union[RecordType, VariantType, EnumType, ScalarType]":
-    warnings.warn(
-        "create_data_type is deprecated; there is no replacement.", DeprecationWarning, stacklevel=2
-    )
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore", DeprecationWarning)
-        from ...damlast.types import get_old_type
-        from ...model.types import (
-            SCALAR_TYPE_UNIT,
-            EnumType,
-            NamedArgumentList,
-            RecordType,
-            TypeReference,
-            TypeVariable,
-            VariantType,
-        )
-
-        type_vars = tuple(TypeVariable(type_var.var) for type_var in dt.params)
-        tt = TypeReference(con=TypeConName(current_module_ref, dt.name.segments))
-
-        if dt.record is not None:
-            d = OrderedDict()
-            for fwt in dt.record.fields:
-                d[fwt.field] = get_old_type(fwt.type)
-            return RecordType(NamedArgumentList(d.items()), tt, type_vars)
-        elif dt.variant is not None:
-            d = OrderedDict()
-            for fwt in dt.variant.fields:
-                d[fwt.field] = get_old_type(fwt.type)
-            return VariantType(NamedArgumentList(d.items()), tt, type_vars)
-        elif dt.enum is not None:
-            return EnumType(tt, dt.enum.constructors)
-        else:
-            return SCALAR_TYPE_UNIT
diff --git a/python/dazl/protocols/v1/pb_ser_command.py b/python/dazl/protocols/v1/pb_ser_command.py
index e15de728..ab40cf5d 100644
--- a/python/dazl/protocols/v1/pb_ser_command.py
+++ b/python/dazl/protocols/v1/pb_ser_command.py
@@ -6,34 +6,19 @@
 """
 from __future__ import annotations
 
-from typing import TYPE_CHECKING, Any, Union
-import warnings
+from typing import TYPE_CHECKING, Any
 
 from ..._gen.com.daml.ledger.api import v1 as lapipb
 from ...damlast.daml_lf_1 import TypeConName
 from ...damlast.util import module_local_name, module_name, package_ref
-from ...ledger.grpc.codec_aio import Codec
 from ...prim import ContractId, timedelta_to_duration
 from ...values.protobuf import ProtobufEncoder, set_value
 from ..serializers import AbstractSerializer
 
 if TYPE_CHECKING:
     from ...client.commands import CommandPayload
-    from ...model.types import TypeReference
-    from ...model.writing import CommandPayload
 
-__all__ = ["as_identifier", "ProtobufSerializer"]
-
-
-def as_identifier(tref: "Union[TypeReference, TypeConName]") -> "lapipb.Identifier":
-    from ...model.types import TypeReference
-
-    warnings.warn("Use Codec.encode_identifier instead.", DeprecationWarning, stacklevel=2)
-
-    if isinstance(tref, TypeReference):
-        tref = tref.con
-
-    return Codec.encode_identifier(tref)
+__all__ = ["ProtobufSerializer"]
 
 
 class ProtobufSerializer(AbstractSerializer):
diff --git a/python/dazl/util/__init__.py b/python/dazl/util/__init__.py
index 7c689d62..0a2d023d 100644
--- a/python/dazl/util/__init__.py
+++ b/python/dazl/util/__init__.py
@@ -10,6 +10,7 @@
 
 from __future__ import annotations
 
-from . import dar, io
 from .io import find_free_port
 from .proc_util import ProcessLogger, kill_process_tree, wait_for_process_port
+
+__all__ = ["find_free_port", "ProcessLogger", "kill_process_tree", "wait_for_process_port"]
diff --git a/python/dazl/util/dar.py b/python/dazl/util/dar.py
deleted file mode 100644
index dd0037bb..00000000
--- a/python/dazl/util/dar.py
+++ /dev/null
@@ -1,168 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-from __future__ import annotations
-
-from io import BytesIO
-from typing import TYPE_CHECKING, AbstractSet, Collection, Mapping, Optional, Sequence
-import warnings
-
-from ..damlast.daml_lf_1 import PackageRef
-from ..damlast.parse import parse_archive
-from ..damlast.pkgfile import Dar, DarFile as _DarFile
-
-if TYPE_CHECKING:
-    from ..model.types_store import PackageProvider, PackageStore
-
-
-def get_archives(contents: bytes) -> "Mapping[PackageRef, bytes]":
-    """
-    Attempt to parse the specified contents as either a DALF or a DAR, and return a mapping of
-    package IDs to DALF bytes.
-    This class is deprecated as it assumes and expose use of a :class:`PackageStore` and
-
-    :class:`Type`, all of which are deprecated.
-
-    :param contents: A byte array to attempt to parse.
-    :return: Return a mapping from package ID to byte contents.
-    """
-    warnings.warn(
-        "get_archives is deprecated. For DAR parsing, use dazl.damlast.DarFile instead. "
-        "There is no replacement for DALF parsing.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    if contents[0:4] == b"PK\03\04":
-        with BytesIO(contents) as buf:
-            with _DarFile(buf) as dar:
-                # noinspection PyProtectedMember
-                return {name: dar._zip.read(name) for name in dar._dalf_names()}
-
-    raise Exception(
-        "get_archives(...) only works on DAR files, and is additionally deprecated. "
-        "Use dazl.damlast.DarFile instead."
-    )
-
-
-class DarFile(_DarFile):
-    """
-    Provides access to the contents of a .dar file.
-    """
-
-    def __init__(self, dar: "Dar"):
-        super().__init__(dar)
-        warnings.warn(
-            "dazl.util.dar.DarFile is deprecated; please use dazl.damlast.DarFile instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-
-    def read_metadata(self) -> "PackageStore":
-        warnings.warn(
-            "read_metadata is deprecated. For DAR parsing, use dazl.damlast.DarFile instead. "
-            "There is no replacement for DALF parsing.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        # noinspection PyProtectedMember
-        from ..model.types_store import PackageStore
-        from ..protocols.v1.pb_parse_metadata import _parse_daml_metadata_pb
-
-        store = PackageStore.empty()
-
-        for archive in self.archives():
-            store.register_all(_parse_daml_metadata_pb(archive))
-        return store
-
-    def get_archives(self) -> "Mapping[PackageRef, bytes]":
-        """
-        Return a mapping from package ID to byte contents.
-        """
-        warnings.warn(
-            "get_archives is deprecated; there is no replacement.", DeprecationWarning, stacklevel=2
-        )
-        return {PackageRef(a.hash): a.payload for a in self._pb_archives()}
-
-    def get_dalf_names(self) -> "Sequence[PackageRef]":
-        warnings.warn(
-            "get_dalf_names is deprecated; there is no replacement.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return list(self._dalf_names())
-
-    def get_manifest(self) -> "Optional[Mapping[str, str]]":
-        """
-        Return the contents of the manifest of this DAR.
-        """
-        warnings.warn(
-            "get_manifest() is deprecated; use manifest() instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return self.manifest()
-
-    def get_sdk_version(self) -> "Optional[str]":
-        """
-        Return the SDK version used to compile this dar (if this information is available).
-
-        This method is deprecated; use dazl.damlast..DarFile
-        """
-        warnings.warn(
-            "get_sdk_version() is deprecated; use sdk_versions() instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return self.sdk_version()
-
-    def get_package_ids(self) -> "AbstractSet[PackageRef]":
-        """
-        Return the set of package IDs from this DAR.
-        """
-        warnings.warn(
-            "get_package_ids() is deprecated; please use package_ids() instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return self.package_ids()
-
-    def get_package_provider(self) -> "PackageProvider":
-        warnings.warn(
-            "get_package_provider() is deprecated; use the methods of the "
-            "dazl.damlast.PackageProvider protocol as implemented on DarFile directly.",
-            DeprecationWarning,
-        )
-        from ..model.types_store import MemoryPackageProvider
-
-        return MemoryPackageProvider(self.get_archives())
-
-
-def parse_dalf(contents: bytes) -> "PackageStore":
-    warnings.warn(
-        "parse_dalf is deprecated, as PackageStore and Type are deprecated.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-    # noinspection PyProtectedMember
-    from .._gen.com.daml.daml_lf_1_14.daml_lf_pb2 import Archive
-    from ..protocols.v1.pb_parse_metadata import _parse_daml_metadata_pb
-
-    a = Archive()
-    a.ParseFromString(contents)
-    return _parse_daml_metadata_pb(parse_archive(PackageRef(a.hash), a.payload))
-
-
-def get_dar_package_ids(dar: "Dar") -> "Collection[PackageRef]":
-    warnings.warn(
-        "dazl.util.dar.get_dar_package_ids is deprecated; "
-        "please use dazl.damlast.get_dar_package_ids instead.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-
-    # This is a local import to get around circular dependencies; also the replacement function
-    # is the same name as our own
-    from ..damlast.pkgfile import get_dar_package_ids
-
-    return get_dar_package_ids(dar)
diff --git a/python/dazl/util/dar_repo.py b/python/dazl/util/dar_repo.py
deleted file mode 100644
index 5ba8821a..00000000
--- a/python/dazl/util/dar_repo.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-from __future__ import annotations
-
-from contextlib import ExitStack
-from os import PathLike, fspath
-from pathlib import Path
-import time
-from typing import List, Sequence, Union
-import warnings
-
-from .. import LOG
-
-
-class LocalDarRepository:
-    def __init__(self):
-        warnings.warn(
-            "LocalDarRepository is deprecated; use PackageLookup instead",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        self._context = ExitStack()
-        self._dar_paths = []  # type: List[Path]
-        self._files = set()
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", DeprecationWarning)
-
-            from ..model.types_store import PackageStore
-
-            self.store = PackageStore.empty()
-
-    def _add_source(self, path: Path) -> None:
-        ext = path.suffix.lower()
-
-        if ext == ".daml":
-            LOG.error("Reading metadata directly from a DAML file is not supported.")
-            raise ValueError("Unsupported extension: .daml")
-
-        elif ext == ".dalf":
-            LOG.error("Reading metadata directly from a DALF file is not supported.")
-            raise ValueError("Unsupported extension: .dalf")
-
-        elif ext == ".dar":
-            dar_parse_start_time = time.time()
-            with warnings.catch_warnings():
-                warnings.simplefilter("ignore", DeprecationWarning)
-
-                from ..util.dar import DarFile
-
-                dar = self._context.enter_context(DarFile(path))
-            dar_package = dar.read_metadata()
-            self._dar_paths.append(path)
-            self.store.register_all(dar_package)
-            dar_parse_end_time = time.time()
-            LOG.debug("Parsed a dar in %s seconds.", dar_parse_end_time - dar_parse_start_time)
-
-        else:
-            LOG.error("Unknown extension: %s", ext)
-            raise ValueError(f"Unknown extension: {ext}")
-
-    def add_source(self, *files: Union[str, PathLike, Path]) -> None:
-        """
-        Add a source file (either a .daml file, .dalf file, or a .dar file).
-
-        Attempts to add the same file more than once will be ignored.
-
-        :param files: Files to add to the archive.
-        """
-        for file in files:
-            path = Path(fspath(file)).resolve(strict=True)
-            if path not in self._files:
-                self._files.add(path)
-                self._add_source(path)
-
-    def get_daml_archives(self) -> Sequence[Path]:
-        return self._dar_paths
-
-    def __enter__(self):
-        """
-        Does nothing.
-        """
-        self._context.__enter__()
-        return self
-
-    def __exit__(self, exc_type, exc_val, exc_tb):
-        """
-        Delete all managed resources in the reverse order that they were created.
-        """
-        self._context.__exit__(exc_type, exc_val, exc_tb)
diff --git a/python/dazl/values/context.py b/python/dazl/values/context.py
index c72a577a..6fd5e73f 100644
--- a/python/dazl/values/context.py
+++ b/python/dazl/values/context.py
@@ -3,7 +3,7 @@
 
 from __future__ import annotations
 
-from typing import TYPE_CHECKING, Any, Dict, List, Mapping, NoReturn, Optional, Sequence
+from typing import Any, Dict, List, Mapping, NoReturn, Optional, Sequence
 import warnings
 
 from ..damlast import IdentityTypeVisitor
@@ -13,10 +13,6 @@
 from ..prim import ContractId, DazlError, to_str, to_variant
 from .mapper import ValueMapper
 
-if TYPE_CHECKING:
-    from .mapper import ValueMapper
-
-
 __all__ = ["Context", "UnboundVarError"]
 
 
@@ -232,19 +228,12 @@ def convert_contract_id(self, element_type: "Type", contract_id: "Any") -> "Cont
         """
         Convert a contract ID string to a :class:`ContractId`.
         """
-        with warnings.catch_warnings():
-            # TODO: Drop this and switch to new-style ContractIds
-            warnings.simplefilter("ignore", DeprecationWarning)
-            from ..model.core import ContractId as DeprecatedContractId
-
-            if isinstance(contract_id, DeprecatedContractId):
-                return contract_id
-            elif isinstance(contract_id, ContractId):
-                # convert new-style ContractId instances to deprecated subclasses; for now, this is
-                # still the canonical form of a ContractId until the deprecated version is dropped
-                return DeprecatedContractId(contract_id.value, element_type.con.tycon)
-            else:
-                return DeprecatedContractId(contract_id, element_type.con.tycon)
+        if isinstance(contract_id, ContractId):
+            # convert new-style ContractId instances to deprecated subclasses; for now, this is
+            # still the canonical form of a ContractId until the deprecated version is dropped
+            return contract_id
+        else:
+            return ContractId(element_type.con.tycon, contract_id)
 
     def resolve_data_type(self, con: "Type.Con") -> "DefDataType":
         """
diff --git a/python/dazl_internal/__init__.py b/python/dazl_internal/__init__.py
deleted file mode 100644
index 7b11b085..00000000
--- a/python/dazl_internal/__init__.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-"""
-Internal module used by the tests and for running additional utilities that are specific to DA's
-internal infrastructure.
-"""
diff --git a/python/dazl_internal/background_http_server.py b/python/dazl_internal/background_http_server.py
deleted file mode 100644
index 875814d2..00000000
--- a/python/dazl_internal/background_http_server.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-# SPDX-License-Identifier: Apache-2.0
-
-from __future__ import annotations
-
-from http.server import HTTPServer
-from threading import Thread
-
-
-class TestHTTPServer:
-    """
-    Runner for an HTTP server in a background thread.
-    """
-
-    def __init__(self, handler, port=0):
-        self._thread = Thread(target=self._run)
-        self.server = HTTPServer(("localhost", port), handler)
-
-    @property
-    def port(self):
-        return self.server.server_port
-
-    def __enter__(self):
-        self._thread.start()
-        return self
-
-    def __exit__(self, exc_type, exc_val, exc_tb):
-        self.server.shutdown()
-        self._thread.join()
-
-    def _run(self):
-        self.server.serve_forever()
-        self.server.socket.close()
diff --git a/python/docker/Dockerfile b/python/docker/Dockerfile
deleted file mode 100644
index b4e42190..00000000
--- a/python/docker/Dockerfile
+++ /dev/null
@@ -1,1 +0,0 @@
-FROM 3.6.8-alpine3.8
diff --git a/python/docker/entrypoint.sh b/python/docker/entrypoint.sh
deleted file mode 100644
index e5a0d9b4..00000000
--- a/python/docker/entrypoint.sh
+++ /dev/null
@@ -1,1 +0,0 @@
-#!/usr/bin/env python3


Test patch:
diff --git a/python/tests/unit/test_command_compat.py b/python/tests/unit/test_command_compat.py
index c86cf2b8..01d91bea 100644
--- a/python/tests/unit/test_command_compat.py
+++ b/python/tests/unit/test_command_compat.py
@@ -16,27 +16,6 @@
 Operator = Party("Operator")
 
 
-def test_model_writing_imports():
-    """
-    The dazl.model.writing implementations have been moved to dazl.client; make sure these imports
-    refer to the desired types.
-
-    Note that DeprecationWarnings are NOT raised on imports, so pytest.warns(DeprecationWarning)
-    is not used here!
-    """
-    from dazl.model.writing import (
-        CreateAndExerciseCommand,
-        CreateCommand,
-        ExerciseByKeyCommand,
-        ExerciseCommand,
-    )
-
-    assert CreateCommand == v7.CreateCommand
-    assert CreateAndExerciseCommand == v7.CreateAndExerciseCommand
-    assert ExerciseCommand == v7.ExerciseCommand
-    assert ExerciseByKeyCommand == v7.ExerciseByKeyCommand
-
-
 def test_create_command():
     cmd_v8 = v8.CreateCommand("Mod:Tmpl", {"operator": Operator})
 
diff --git a/python/tests/unit/test_config.py b/python/tests/unit/test_config.py
index ace325d0..2a9c6856 100644
--- a/python/tests/unit/test_config.py
+++ b/python/tests/unit/test_config.py
@@ -4,11 +4,12 @@
 from __future__ import annotations
 
 import http.server
+from http.server import HTTPServer
 import tempfile
+from threading import Thread
 
 from dazl import Network, Party
 from dazl.client.config import ConfigurationError, NetworkConfig, fetch_config
-from dazl_internal.background_http_server import TestHTTPServer
 
 # Ensure the key/value pairs that initialize a manager create an appropriate configuration.
 
@@ -92,3 +93,29 @@ def do_GET(self):
 
     def log_message(self, format_, *args):
         pass
+
+
+class TestHTTPServer:
+    """
+    Runner for an HTTP server in a background thread.
+    """
+
+    def __init__(self, handler, port=0):
+        self._thread = Thread(target=self._run)
+        self.server = HTTPServer(("localhost", port), handler)
+
+    @property
+    def port(self):
+        return self.server.server_port
+
+    def __enter__(self):
+        self._thread.start()
+        return self
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        self.server.shutdown()
+        self._thread.join()
+
+    def _run(self):
+        self.server.serve_forever()
+        self.server.socket.close()
diff --git a/python/tests/unit/test_damlast_lookup_normalizations.py b/python/tests/unit/test_damlast_lookup_normalizations.py
index 940a0d0e..cdbe5c66 100644
--- a/python/tests/unit/test_damlast_lookup_normalizations.py
+++ b/python/tests/unit/test_damlast_lookup_normalizations.py
@@ -3,7 +3,6 @@
 from __future__ import annotations
 
 from dazl.damlast.lookup import matching_normalizations, normalize
-from dazl.model.lookup import template_reverse_globs
 import pytest
 
 
@@ -13,13 +12,6 @@ def test_non_primary_simple_unknown_module():
     assert actual == expected
 
 
-def test_non_primary_simple_unknown_module_deprecated():
-    with pytest.warns(DeprecationWarning):
-        expected = ["*:MyModule:MyTemplate", "*:*"]
-        actual = list(template_reverse_globs(False, "*", "MyModule:MyTemplate"))
-        assert actual == expected
-
-
 def test_normalize_unknown_package_with_explicit_star():
     expected = "*:MyModule:MyTemplate"
     actual = normalize("*:MyModule:MyTemplate")
@@ -32,33 +24,12 @@ def test_normalize_unknown_package_without_explicit_star():
     assert actual == expected
 
 
-def test_primary_simple_unknown_module_deprecated():
-    with pytest.warns(DeprecationWarning):
-        expected = ["*:MyModule:MyTemplate"]
-        actual = list(template_reverse_globs(True, "*", "MyModule:MyTemplate"))
-        assert actual == expected
-
-
 def test_non_primary_simple_unknown_module_rejects_deprecated_style():
     with pytest.raises(ValueError):
         # Period forms for template names are explicitly not allowed in the new API
         matching_normalizations("*:MyModule.MyTemplate")
 
 
-def test_non_primary_simple_unknown_module_deprecated_style():
-    with pytest.warns(DeprecationWarning):
-        expected = ["*:MyModule:MyTemplate", "*:MyModule.MyTemplate", "*:*"]
-        actual = list(template_reverse_globs(False, "*", "MyModule.MyTemplate"))
-        assert actual == expected
-
-
-def test_primary_simple_unknown_module_deprecated_style():
-    with pytest.warns(DeprecationWarning):
-        expected = ["*:MyModule:MyTemplate"]
-        actual = list(template_reverse_globs(True, "*", "MyModule.MyTemplate"))
-        assert actual == expected
-
-
 def test_non_primary_simple_known_module():
     expected = [
         "0000dead0000beef:MyModule:MyTemplate",
@@ -70,31 +41,12 @@ def test_non_primary_simple_known_module():
     assert actual == expected
 
 
-def test_non_primary_simple_known_module_deprecated():
-    with pytest.warns(DeprecationWarning):
-        expected = [
-            "0000dead0000beef:MyModule:MyTemplate",
-            "0000dead0000beef:*",
-            "*:MyModule:MyTemplate",
-            "*:*",
-        ]
-        actual = list(template_reverse_globs(False, "0000dead0000beef", "MyModule:MyTemplate"))
-        assert actual == expected
-
-
 def test_primary_simple_known_module():
     expected = "0000dead0000beef:MyModule:MyTemplate"
     actual = normalize("0000dead0000beef:MyModule:MyTemplate")
     assert actual == expected
 
 
-def test_primary_simple_known_module_deprecated():
-    with pytest.warns(DeprecationWarning):
-        expected = ["0000dead0000beef:MyModule:MyTemplate"]
-        actual = list(template_reverse_globs(True, "0000dead0000beef", "MyModule:MyTemplate"))
-        assert actual == expected
-
-
 def test_star_normalize():
     expected = "*:*"
     actual = normalize("*")
@@ -117,17 +69,3 @@ def test_star_star_matching_normalizations():
     expected = ["*:*"]
     actual = matching_normalizations("*:*")
     assert actual == expected
-
-
-def test_star_deprecated_primary_only():
-    with pytest.warns(DeprecationWarning):
-        expected = ["*:*"]
-        actual = list(template_reverse_globs(True, "*", "*"))
-        assert actual == expected
-
-
-def test_star_deprecated_all():
-    with pytest.warns(DeprecationWarning):
-        expected = ["*:*"]
-        actual = list(template_reverse_globs(False, "*", "*"))
-        assert actual == expected
diff --git a/test_dar_speed.py b/test_dar_speed.py
new file mode 100644
index 00000000..92c1a56f
--- /dev/null
+++ b/test_dar_speed.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+import cProfile
+from pathlib import Path
+import time
+
+from dazl.damlast import DarFile
+
+p = Path(".") / "_fixtures" / "archives" / "1.16.0" / "Test.dar"
+
+def parse_file():
+ dar_file = DarFile(p)
+ start_time = time.time()
+ archives = dar_file.archives()
+ end_time = time.time()
+ print(end_time - start_time)
+
+parse_file()
+
+cProfile.run('parse_file()')