nxp_monkey.fetch

design / api / fetch

fetch

Kind: function.

Fetch one part's data tree into the local cache, returning the path to the unpacked processors/<part>/<variant>/ directory. The part argument may be an exact portfolio key or a unique concrete orderable alias for a masked key.

Rationale

This is the primary library entry point. It is idempotent: if the target directory already exists and is non-empty, fetch returns immediately without hitting the network. Pass force=True to refetch.

Working definition

"Give me part's SDK data on disk." The function selects the right upstream tool version automatically (portfolio-latest) so callers rarely need to specify version. If the input is ambiguous as a prefix, callers should use fetch_all(family=...) or the CLI's positional prefix expansion.

Tests

fetch_all

Kind: function.

Fetch every part in the portfolio, optionally restricted to a family prefix. Continues past per-part errors and returns the list of successfully fetched paths. The CLI uses this behavior for --family and additionally expands positional prefixes before calling the single-part fetch path.

Rationale

Bulk acquisition for index builds and offline analysis. Errors on a single family must not abort the run because the API occasionally returns 500-class responses for individual families.