smarter-types
smarter-types holds the plain-Python type definitions that the Smarter platform and its Python SDK share, so that each is defined once rather than copied into both, where the copies drift apart.
Its first release holds the enumerations that Smarter’s manifest brokers are built on: every kind of Smarter Application Manifest (SAM), the order in which to apply manifests of several kinds, and the Smarter Journal’s things and cli commands.
from smarter_types import SAMKinds
SAMKinds.str_to_kind("sqlplugin") # "SqlPlugin"
SAMKinds.plural(SAMKinds.API_CONNECTION) # "ApiConnections"
# apply a set of manifests so that each resource comes after the ones it names.
manifests.sort(key=lambda m: SAMKinds.apply_rank(m["kind"]))
Features
SAMKinds, the single source of truth for which SAM kinds exist.
The apply order:
apply_order()andapply_rank()sort a set of manifests so that every resource is applied after the resources it names.The Smarter Journal’s enumerations: the things it records, whose values come from SAMKinds, and the verbs of the
/api/v1/cli/api.Plain Python: no Django, no Pydantic. Its only dependency is
inflection. Typed (py.typed).
Getting Started
User Guide