nxp_monkey.models

design / api / models

ApiVersion

Kind: frozen dataclass.

One tool-version row as published by NXP's KEX npidb endpoint. The name field is the canonical version string (for example "25.12.10"). The stable property is True when the row carries a non-empty version field.

Fields

NameTypeDescription
api_idintInternal NXP numeric id.
namestrVersion name (e.g. "25.12.10").
versionstrPublished version string; empty for unpublished.

Why a dataclass

Frozen dataclass keeps the row equality- and hash-comparable so callers can dedupe and store version lists in sets. Immutable shape avoids accidental mutation while passing rows around.

StorageEntry

Kind: frozen dataclass.

One entry returned by the KEX storage directory listing. Includes both files and directories; directory=True for subdirectories.

Fields

NameTypeDescription
file_idstrNXP internal id.
full_pathstrFull upstream path of the entry.
directoryboolTrue if this is a directory.
timeint | NoneUpstream mtime, if available.
sizeint | NoneByte size, if available.
compressionstrCompression label, often empty.

PartInfo

Kind: frozen dataclass.

What the index records about a single part: canonical identifier, family root, last-seen tool version, and the SDK variants observed for that family. Returned by get_part().

Fields

NameTypeDescription
partstrCanonical part identifier.
familystrFamily root.
versionstrLast-seen tool version publishing this part.
variantstuple[str, ...]SDK variants available for the part.

SearchHit

Kind: frozen dataclass.

One ranked search result. score is in [0.0, 1.0]; higher is better. Exact scoring rules are documented in cli/search; treat individual scores as opaque beyond their ordering.

Fields

NameTypeDescription
partstrMatched part.
familystrMatched part's family root.
scorefloatMatch score in [0.0, 1.0].
matched_fieldstr"part" or "family".

Processor

Kind: frozen dataclass.

Top-level processor header parsed from <PART>.xml (swtools.freescale.net/XSD/processor/2.0). Carries the basic_facts attributes plus the enabled-tools list.

Fields

NameTypeDescription
partstrProcessor id.
producerstrVendor (typically "NXP").
familystrFamily root (e.g. "MCX").
seriesstrSeries label (e.g. "MCX MCXA").
default_partstrVariant id NXP marks as default SKU.
target_productstuple[str, ...]Product programs (e.g. ("MCUX",)).
enabled_toolstuple[str, ...]Enabled Config Tools modules.

DbLink

Kind: frozen dataclass.

One row of the per-variant manifest in <PART_VARIANT>.xml (swtools.freescale.net/XSD/part_number/4.0). Captures NXP's typed pointer to one of the variant's data files.

Fields

NameTypeDescription
typestrLogical kind (e.g. "package", "registers", "pins_model").
linkstrRelative path or sentinel (e.g. "$COMMON").
format_versionstrSchema version reported by upstream.
descriptionstrFree-text description; may be empty.

CpuCore

Kind: frozen dataclass.

One CPU core entry from common/cores_info.xml.

Fields

NameTypeDescription
namestrHuman core name (e.g. "Cortex-M33").
core_idstrStable identifier (e.g. "cm33_core0").
descriptionstrFree-text description; may be empty.

PackageVariant

Kind: frozen dataclass.

One per-package SKU of a processor. Parsed from <PART_VARIANT>.xml. The db_links tuple is the verbatim manifest; package is a convenience copy of the type="package" link target.

Fields

NameTypeDescription
variantstrVariant id (e.g. "MCXA132VFM").
packagestrRelative package XML link (e.g. "packages/QFN32.xml").
db_linkstuple[DbLink, ...]All manifest links in document order.
rootpathlib.PathAbsolute path to the variant subdirectory.

Helpers

link_by_type(t) returns the first matching DbLink or None.

PartDetails

Kind: frozen dataclass.

Structured view of a part's KEX data tree. Returned by details(). Combines the small spine readers (processor header, per-variant manifests, cores) with the cache root path so callers reach heavier payloads lazily.

Fields

NameTypeDescription
partstrProcessor id described by this view.
variant_idstrSDK variant loaded (e.g. "ksdk2_0").
versionstrTool version data was sourced from.
headerProcessorParsed top-level processor file.
corestuple[CpuCore, ...]CPU cores.
variantstuple[PackageVariant, ...]Per-package SKUs.
propertiesdict[str, str]Key/value pairs from processor.properties.
rootpathlib.PathAbsolute cache path for <part>/<variant>/.
is_application_processorboolTrue for i.MX-8-class parts (no clocks/ tree).

IndexMeta

Kind: frozen dataclass.

Metadata describing the current state of the local index. Returned by index_meta() and written alongside the SQLite database as a JSON sidecar.

Fields

NameTypeDescription
built_atstrISO-8601 UTC timestamp of last build.
source_versionstrSource tool version (or "portfolio-latest").
part_countintNumber of indexed parts.
family_countintNumber of indexed families.