Aevum Python SDK

The official Python client for the Aevum Encyclopedia API. Search, analyze, and integrate verified knowledge into your applications with just a few lines of code.

pip install aevum-sdk

Quick Start

Initialize the client and make your first API call. The SDK handles authentication, retries, and pagination automatically.

import os
from aevum import AevumClient

# Initialize with your API key
client = AevumClient(api_key=os.getenv("AEVUM_API_KEY"))

# Fetch a verified article
article = client.articles.get("quantum_computing")
print(article.title)
print(article.summary)
print(article.last_updated)
# Explore connected concepts
graph = client.graph.explore("behavioral_economics", depth=2)

for node in graph.nodes:
    print(f"Concept: {node.id}")
    for edge in node.edges:
        print(f"  └─ {edge.type} → {edge.target}")

Authentication

Authenticate using an API key from your Aevum Dashboard. We recommend using environment variables for security.

# .env file
AEVUM_API_KEY=your_live_api_key_here

# Python
import os
from aevum import AevumClient

client = AevumClient(
    api_key=os.getenv("AEVUM_API_KEY"),
    environment="production" # or "sandbox"
)
💡 Tip: Sandbox keys expire after 30 days and have rate limits. Production keys require account verification.

Core Features

Async Example

import asyncio
from aevum import AsyncAevumClient

async def main():
    client = AsyncAevumClient(api_key="...")
    # Fetch multiple articles concurrently
    tasks = [client.articles.get(slug) for slug in [
        "machine_learning", "renaissance_art", "climate_science"
    ]]
    results = await asyncio.gather(*tasks)
    print(f"Fetched {len(results)} articles")

asyncio.run(main())

Error Handling & Rate Limits

The SDK raises specific exceptions for network issues, authentication failures, and API limits. All clients include automatic retry logic with exponential backoff.

from aevum.exceptions import AevumError, RateLimitError, NotFoundError

try:
    data = client.search.query("nonexistent_topic")
except NotFoundError:
    print("Topic not found in the encyclopedia.")
except RateLimitError as e:
    print(f"Retry after {e.retry_after} seconds")
except AevumError as e:
    print(f"API Error: {e.message}")

Advanced Configuration

Customize timeouts, proxies, caching, and request headers to match your infrastructure.

client = AevumClient(
    api_key="...",
    timeout=15.0,
    retries=3,
    cache_enabled=True,
    proxy="http://proxy.internal:8080",
    headers={"X-Custom-App": "my-research-tool"}
)