Metadata-Version: 2.4
Name: nomad_media_pip
Version: 2026.9.2b0
Summary: Nomad Media SDK PIP
License-File: LICENSE
Author: Nomad Media
Requires-Python: >=3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Dist: deepdiff
Requires-Dist: requests
Description-Content-Type: text/markdown

# Nomad Media Python SDK

Official Python SDK for the [Nomad Media API](https://docs.nomad.media).

[![PyPI](https://img.shields.io/pypi/v/nomad-media-pip.svg)](https://pypi.org/project/nomad-media-pip/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

> **Beta.** The 2026.9 line is a pre-release, so `pip` skips it unless you ask for it.
> [Report problems](https://github.com/Nomad-Media/sdk-python/issues).

## Install

```bash
pip install --pre nomad-media-pip
```

Requires Python 3.12 or higher.

## Quick start

```python
from nomad_media_pip.src.nomad_sdk import Nomad_SDK

sdk = Nomad_SDK({
    "serviceApiUrl": "https://your-instance.demos.media",
    "username": "you@example.com",
    "password": "your-password",   # or "apiKey"
    "apiType": "admin"             # "admin" or "portal"
})

# The SDK logs in automatically on the first call
channels = sdk.get_live_channels()
```

Failed calls raise `NomadApiException`, which carries the HTTP `status_code`:

```python
from nomad_media_pip.src.exceptions.sdk_exceptions import NomadApiException

try:
    sdk.get_asset(asset_id)
except NomadApiException as err:
    print(err.status_code, err)
```

Uploads send the file in parts and return the new asset id:

```python
asset_id = sdk.upload_asset(None, None, None, "replace", "./video.mp4", parent_id=folder_id)
```

For large files, pass `max_workers`, `part_confirmation` or `on_progress` as keyword arguments.

## Upgrading from 0.1.x

- **Failed calls raise.** Earlier versions logged the error and returned `None`. Catch `NomadApiException`.
  `upload_asset` and `upload_related_asset` raise too, after cancelling the upload.
- **Calls are no longer retried automatically.**
- **Versions follow the API:** `YYYY.M.patch` (for example `2026.9.2`).

The full list of changes is in the [changelog](CHANGELOG.md).

## Configuration

| Key | Description |
|-----|-------------|
| `serviceApiUrl` | Your API base URL. Required. |
| `username`, `password` / `apiKey` | Your credentials. Never commit them. |
| `apiType` | `"admin"` or `"portal"`. |
| `debugMode` | Print API call details. |
| `singleton` | Reuse one SDK instance. |

SSO login is also supported; see the [documentation](https://docs.nomad.media).

## More

- [Documentation](https://docs.nomad.media)
- [Contributing](CONTRIBUTING.md)
- [Issues](https://github.com/Nomad-Media/sdk-python/issues)
- [Changelog](CHANGELOG.md)

