Official Python SDK for the Noveum.ai API - AI/ML evaluation and testing platform
Project description
Noveum SDK - Python Client
A professional Python SDK for the Noveum.ai API. Provides both high-level convenience methods and low-level access to core API endpoints for AI/ML evaluation, testing, and observability.
Features
- Core API Coverage - Essential endpoints for datasets, traces, scorers, projects, and ETL jobs
- Full IDE Support - Complete type hints, autocomplete, and docstrings
- Async & Sync - Both async/await and synchronous support
- Secure - API key authentication, HTTPS only, proper error handling
- Well-Documented - Comprehensive guides, examples, and inline documentation
- Production-Ready - Extensive test suite with integration and unit tests
- Easy to Use - High-level wrapper for common operations
Quick Start
Installation
From PyPI (Recommended)
pip install noveum-sdk-python
From Source
# Clone the repository
git clone https://github.com/Noveum/noveum-sdk-python.git
cd noveum-sdk-python
# Upgrade pip and setuptools (required for PEP 621)
pip install --upgrade pip setuptools wheel
# Install in development mode
pip install -e .
# Or install with dev dependencies for development
pip install -e ".[dev]"
Basic Usage (High-Level Client)
import os
from noveum_api_client import NoveumClient
# Get API key from environment
api_key = os.getenv("NOVEUM_API_KEY")
# Initialize client
client = NoveumClient(api_key=api_key)
# List datasets
datasets = client.list_datasets(limit=10)
print(f"Found {len(datasets['data'])} datasets")
# Get dataset items
items = client.get_dataset_items("my-dataset", limit=50)
for item in items["data"]:
print(f"Item: {item}")
# Get evaluation results
results = client.get_results(dataset_slug="my-dataset")
print(f"Results: {results['data']}")
Setting Your API Key
Option 1: Environment Variable (Recommended)
export NOVEUM_API_KEY="nv_your_api_key_here"
Then use it in code:
import os
from noveum_api_client import NoveumClient
api_key = os.getenv("NOVEUM_API_KEY")
client = NoveumClient(api_key=api_key)
Option 2: Direct Initialization
from noveum_api_client import NoveumClient
client = NoveumClient(api_key="nv_your_api_key_here")
Option 3: .env File
# Create .env file
echo "NOVEUM_API_KEY=nv_your_api_key_here" > .env
Then load it:
import os
from dotenv import load_dotenv
from noveum_api_client import NoveumClient
load_dotenv()
api_key = os.getenv("NOVEUM_API_KEY")
client = NoveumClient(api_key=api_key)
API Reference
High-Level Client (NoveumClient)
The NoveumClient class provides convenient methods for common operations. Use this for most use cases.
Methods
list_datasets(limit=20, offset=0)
List all datasets in your organization.
response = client.list_datasets(limit=10)
print(f"Status: {response['status_code']}")
print(f"Datasets: {response['data']}")
Parameters:
limit(int): Number of datasets to return (default: 20)offset(int): Pagination offset (default: 0)
Returns: Dictionary with status_code, data, and headers
get_dataset_items(dataset_slug, limit=20, offset=0)
Get items from a specific dataset.
items = client.get_dataset_items("my-dataset", limit=100)
for item in items["data"]:
print(f"Item ID: {item['id']}, Input: {item['input']}")
Parameters:
dataset_slug(str): The dataset slug (required)limit(int): Number of items to return (default: 20)offset(int): Pagination offset (default: 0)
Returns: Dictionary with status_code, data, and headers
get_results(dataset_slug=None, item_id=None, scorer_id=None, limit=100, offset=0)
Get evaluation results with optional filtering.
# Get all results
results = client.get_results()
# Filter by dataset
results = client.get_results(dataset_slug="my-dataset")
# Filter by item
results = client.get_results(item_id="item-123")
# Filter by scorer
results = client.get_results(scorer_id="factuality_scorer")
Parameters:
dataset_slug(str): Filter by dataset slug (optional)item_id(str): Filter by item ID (optional)scorer_id(str): Filter by scorer ID (optional)limit(int): Number of results to return (default: 100)offset(int): Pagination offset (default: 0)
Returns: Dictionary with status_code, data, and headers
Low-Level Client (Client)
For advanced use cases, access the generated API directly with full control.
from noveum_api_client import Client
from noveum_api_client.api.datasets import get_api_v1_datasets
# Create low-level client
client = Client(
base_url="https://api.noveum.ai",
headers={"Authorization": f"Bearer {api_key}"}
)
# Call API directly
response = get_api_v1_datasets.sync_detailed(
client=client,
limit=20,
offset=0
)
print(f"Status: {response.status_code}")
print(f"Data: {response.parsed}")
Available API Endpoints
The SDK provides access to the following API categories:
| Category | Description |
|---|---|
health/ |
Health check endpoint |
status/ |
API status endpoint |
datasets/ |
Dataset CRUD operations |
traces/ |
Trace management and querying |
scorers/ |
Scorer definitions and management |
scorer_results/ |
Evaluation results |
projects/ |
Project management |
etl_jobs/ |
ETL job operations |
Example: Using Traces API
from noveum_api_client import Client
from noveum_api_client.api.traces import get_api_v1_traces, post_api_v1_traces
client = Client(
base_url="https://api.noveum.ai",
headers={"Authorization": f"Bearer {api_key}"}
)
# List traces
response = get_api_v1_traces.sync_detailed(client=client)
print(f"Traces: {response.parsed}")
Example: Using Scorers API
from noveum_api_client.api.scorers import get_api_v1_scorers
# List scorers
response = get_api_v1_scorers.sync_detailed(client=client)
print(f"Scorers: {response.parsed}")
Example: Using ETL Jobs API
from noveum_api_client.api.etl_jobs import get_api_v1_etl_jobs
# List ETL jobs
response = get_api_v1_etl_jobs.sync_detailed(client=client)
print(f"ETL Jobs: {response.parsed}")
Common Use Cases
Use Case 1: CI/CD Regression Testing
Test your model/agent quality in CI/CD pipelines:
from noveum_api_client import NoveumClient
def test_agent_quality():
client = NoveumClient(api_key="nv_...")
# Get test dataset
items = client.get_dataset_items("regression-tests")
# Evaluate each item
failed = 0
for item in items["data"]:
# Run your agent/model
output = my_agent.run(item["input"])
# Get evaluation results
results = client.get_results(item_id=item["id"])
# Check quality
for result in results["data"]:
if result.get("score", 0) < 0.8:
print(f"Item {item['id']} failed: {result['score']}")
failed += 1
# Assert
assert failed == 0, f"{failed} items failed quality check"
print("All items passed quality check")
# Run test
test_agent_quality()
Use Case 2: Batch Processing
Process all items in a dataset:
from noveum_api_client import NoveumClient
client = NoveumClient(api_key="nv_...")
# Get all items (with pagination)
offset = 0
while True:
items = client.get_dataset_items("my-dataset", limit=100, offset=offset)
if not items["data"]:
break
# Process each item
for item in items["data"]:
print(f"Processing item {item['id']}")
# Your processing logic here
offset += 100
Use Case 3: Result Analysis
Analyze evaluation results:
from noveum_api_client import NoveumClient
client = NoveumClient(api_key="nv_...")
# Get all results
results = client.get_results(limit=1000)
# Analyze
total = len(results["data"])
passed = sum(1 for r in results["data"] if r.get("passed"))
avg_score = sum(r.get("score", 0) for r in results["data"]) / total if total > 0 else 0
print(f"Total: {total}")
print(f"Passed: {passed} ({passed/total*100:.1f}%)")
print(f"Average Score: {avg_score:.2f}")
Use Case 4: Async Operations
Use async for concurrent operations:
import asyncio
from noveum_api_client import Client
from noveum_api_client.api.datasets import get_api_v1_datasets
async def main():
api_key = "nv_..."
client = Client(
base_url="https://api.noveum.ai",
headers={"Authorization": f"Bearer {api_key}"}
)
# Async call
response = await get_api_v1_datasets.asyncio_detailed(client=client)
print(f"Status: {response.status_code}")
print(f"Datasets: {response.parsed}")
# Run
asyncio.run(main())
Configuration
Custom Base URL
client = NoveumClient(
api_key="nv_...",
base_url="https://custom.api.noveum.ai"
)
Custom Timeout
import httpx
from noveum_api_client import Client
client = Client(
base_url="https://api.noveum.ai",
timeout=httpx.Timeout(30.0) # 30 second timeout
)
Context Manager
from noveum_api_client import NoveumClient
# Automatically closes connection
with NoveumClient(api_key="nv_...") as client:
datasets = client.list_datasets()
# Connection automatically closed
Response Format
All high-level client methods return a dictionary with:
{
"status_code": 200, # HTTP status code
"data": {...}, # Response data (parsed JSON)
"headers": {...} # Response headers
}
Check status_code to verify success:
response = client.list_datasets()
if response["status_code"] == 200:
print(f"Success: {response['data']}")
else:
print(f"Error: {response['status_code']}")
Error Handling
Handle API Errors
from noveum_api_client import NoveumClient
client = NoveumClient(api_key="nv_...")
try:
response = client.list_datasets()
if response["status_code"] != 200:
print(f"API Error: {response['status_code']}")
print(f"Response: {response['data']}")
else:
print(f"Success: {response['data']}")
except Exception as e:
print(f"Error: {e}")
Handle Network Errors
import httpx
from noveum_api_client import NoveumClient
client = NoveumClient(api_key="nv_...")
try:
response = client.list_datasets()
except httpx.ConnectError:
print("Connection error - check your internet connection")
except httpx.TimeoutException:
print("Request timeout - API is slow or unreachable")
except Exception as e:
print(f"Unexpected error: {e}")
Testing
For detailed testing instructions, see TESTING.md.
Quick Start
# Install with dev dependencies
pip install -e ".[dev]"
# Run unit tests (fast, no API key needed)
pytest tests/unit/ -v
# Run integration tests (requires API key)
export NOVEUM_API_KEY="nv_your_api_key"
pytest tests/integration/ -v
# Run all tests with coverage
pytest tests/ -v --cov=noveum_api_client --cov-report=term-missing
Architecture
Project Structure
noveum-sdk-python/
├── noveum_api_client/ # Main package
│ ├── __init__.py # Public API exports
│ ├── client.py # Generated base client
│ ├── noveum_client.py # High-level wrapper
│ ├── errors.py # Error definitions
│ ├── types.py # Type definitions
│ ├── py.typed # PEP 561 type marker
│ ├── api/ # Generated API endpoints
│ │ ├── datasets/ # Dataset operations
│ │ ├── etl_jobs/ # ETL job management
│ │ ├── health/ # Health check
│ │ ├── projects/ # Project operations
│ │ ├── scorers/ # Scorer operations
│ │ ├── scorer_results/ # Evaluation results
│ │ ├── status/ # Status endpoint
│ │ └── traces/ # Trace operations
│ └── models/ # Data models
├── tests/ # Test suite
│ ├── integration/ # Integration tests with live API
│ │ ├── test_datasets.py # Dataset tests
│ │ ├── test_etl_jobs.py # ETL job tests
│ │ ├── test_projects.py # Project tests
│ │ ├── test_scorers.py # Scorer tests
│ │ ├── test_scorer_results.py # Scorer results tests
│ │ └── test_traces.py # Trace tests
│ └── unit/ # Unit tests (mocked)
├── doc/ # Documentation
├── README.md # This file
├── CHANGELOG.md # Version history
├── CONTRIBUTING.md # Contribution guidelines
└── pyproject.toml # Project configuration
Two-Layer Architecture
Layer 1: Generated API Client
- Auto-generated from OpenAPI schema
- Low-level access to all endpoints
- Full control over parameters
- Both sync and async support
Layer 2: High-Level Wrapper (NoveumClient)
- Convenient methods for common operations
- Simplified API for typical use cases
- Automatic error handling
- Better developer experience
Related Packages
The Noveum ecosystem includes multiple specialized packages:
- noveum-trace - Lightweight tracing SDK for LLM applications and multi-agent systems with decorator-based API
- noveum-sdk-python - This package - comprehensive API client for evaluation, datasets, and platform management
Support
- Platform: https://noveum.ai/
- PyPI Package: https://pypi.org/project/noveum-sdk-python/
- API Documentation: https://noveum.ai/docs
- GitHub Repository: https://github.com/Noveum/noveum-sdk-python
- GitHub Issues: https://github.com/Noveum/noveum-sdk-python/issues
- Email: support@noveum.ai
License
Apache 2.0 License - See LICENSE file for details
Contributing
Contributions welcome! Please see CONTRIBUTING.md for guidelines.
Changelog
See CHANGELOG.md for version history and updates.
Status: Production Ready
Last Updated: January 16, 2026
Version: 1.0.3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file noveum_sdk-1.1.0.tar.gz.
File metadata
- Download URL: noveum_sdk-1.1.0.tar.gz
- Upload date:
- Size: 60.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b824aa9981c6758e26a98883f39fff7ba6c96714c4d578cfa52f430368fd649b
|
|
| MD5 |
028f8f6c3183b11e75f75baccf1fd29f
|
|
| BLAKE2b-256 |
3bf816f88353e4096af18bcce01d1f1a45799822ee685ceca44ec62c0b39db02
|
File details
Details for the file noveum_sdk-1.1.0-py3-none-any.whl.
File metadata
- Download URL: noveum_sdk-1.1.0-py3-none-any.whl
- Upload date:
- Size: 174.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d1f36b4dca704dc3205ba627c0fbb5502791c287b853b634119c0b6d7771d68
|
|
| MD5 |
01dbfcc45deabdd5f8c7fd46bbad632a
|
|
| BLAKE2b-256 |
29d1479ef8f13aece10e0f52f7f0d94b9c420d230acc28b615bbc0fc6318e668
|