niobium_sdk.client
niobium_sdk.client — client surface.
Currently implements the cloud/remote target: submit(). Local replay (the default target) is the bundled fhetch_sim, driven by the recorder's replay() — a separate path. submit() mirrors the C++ nbcc_fhetch_replay forwarder (src/fhetch_transport/ client.cpp): pack the project dir (excluding serialized_probes/), POST it to the replay server, unpack the returned archive into serialized_probes/.
Framing is the bound C++ archive (niobium_sdk._archive) — no Python reimpl of the wire format. HTTP is stdlib urllib; HTTPS verifies against certifi's CA bundle when installed (else the default context).
configure
def configure(*, endpoint=None, token=None)Set defaults for submit(): server URL and/or API token.
submit
def submit(project_dir, target, *, endpoint=None, opt_level=None, token=None, job_id=None, timeout=7200)Ship a recorded fhetch project dir to a replay server; unpack the probes.
This is the data plane — the Python peer of the C++ nbcc_fhetch_replay client. It POSTs to whatever endpoint it is given; job provisioning (fog-api /jobs/) is the control plane, owned by niobium_sdk.fog, which calls this with the worker URL + per-job ticket it obtained.
project_dir : the recorded project directory (contains the .fhetch + inputs).
target : device id forwarded as X-Target (e.g. "FUNC_SIM", "fpga5.2").
endpoint : server URL (else configure()/NBCC_FHETCH_SERVER/default). A bare
origin gets /replay; a Fog worker URL (/jobs/<id>/run) is used as-is.
opt_level : optional "O0".."O3" (X-Opt-Level); omit → server defaults O0.
token : Fog per-job ticket (else configure()/NBCC_FHETCH_TOKEN) → Bearer.
job_id : optional Fog job id, forwarded as X-Job-Id (server-side telemetry).
Returns the number of probe files unpacked into <project_dir>/serialized_probes.Something not looking right? Suggest a change on GitHub.