Skip to content

Latest commit

 

History

History
102 lines (64 loc) · 1.54 KB

File metadata and controls

102 lines (64 loc) · 1.54 KB

Artheadain SDK Python Reference

Client

arthedain.Artheadain

The main client for interacting with the Artheadain API.

Constructor

Artheadain(
    client_id: str,
    client_secret: str,
    environment: Environment = Environment.PRODUCTION,
    timeout: float = 60.0,
)

Properties

  • entity - Entity client
  • object - Object client
  • objects - Objects client
  • task - Task client
  • tasks - Tasks client
  • oauth - OAuth client
  • entities - Entities client

Environment

arthedain.Environment

class Environment:
    PRODUCTION = "https://api.arthedain.ai"
    STAGING = "https://staging.api.arthedain.ai"
    LOCAL = "http://localhost:8080"

Entity Client

client.entity.list()

List all entities.

client.entity.get(id: str)

Get an entity by ID.

client.entity.create(**kwargs)

Create a new entity.

Task Client

client.task.list()

List all tasks.

client.task.get(id: str)

Get a task by ID.

client.task.create(**kwargs)

Create a new task.

Object Client

client.object.list()

List all objects.

client.object.get(id: str)

Get an object by ID.

OAuth Client

client.oauth.get_token()

Get an OAuth token.

Error Handling

from artained.core.api_error import ApiError

try:
    client.entity.get("invalid-id")
except ApiError as e:
    print(f"API Error: {e.status_code} - {e.body}")

Types

All types are available under arthedain.types:

from artained.types import Entity, Task, Object