Installation

Installation

Installation

Install

Beta. The 2026.9 line is a pre-release, so pip skips it unless you ask for it with --pre.

pip install --pre nomad-media-pip

Upgrading from 0.1.x? Failed calls now raise NomadApiException instead of returning None, and
calls are no longer retried automatically. See the SDK changelog for the full list.

Construct an authenticated client

Nomad_SDK(config) auto-logs in on first use when username + password are present
(real username/password login - no token minting). Keep credentials in gitignored config.

from nomad_media_pip.src.nomad_sdk import Nomad_SDK

config = {
    "serviceApiUrl": "https://nomad-admin-api.yourdomain.com/api",
    "apiType": "admin",          # "admin" | "portal"
    "username": "<from-config>", # never hard-code
    "password": "<from-config>", # never hard-code
    "disableLogging": True,      # the SDK logs the username unless disabled
}

sdk = Nomad_SDK(config)
asset = sdk.get_asset("<asset-id>")  # login happens here on the first call

Notes / gotchas

  • apiType must be "admin" for the asset/folder ops in this catalog; they raise
    InvalidAPITypeException on a portal client.
  • The SDK logs datetime lines (one echoes the username). Set "disableLogging": True.
  • Method names are snake_case (create_folder_asset, get_asset). See
    ../reference/naming-map.md for the Python ↔ JS map.
  • Auth fields stored on the instance: token, refreshToken, expirationSeconds, id.
    Refresh with sdk.refresh_token.
  • See Authentication for the login/secret-hygiene rules.

Did this page help you?