Installation
Installation
Installation
Install
pip install nomad_media_pipConstruct 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 callNotes / gotchas
apiTypemust be"admin"for the asset/folder ops in this catalog; they raiseInvalidAPITypeExceptionon 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.mdfor the Python ↔ JS map. - Auth fields stored on the instance:
token,refreshToken,expirationSeconds,id. Refresh withsdk.refresh_token. - See Authentication for the login/secret-hygiene rules.
