Skip to main content

anaella

A small Python client for the Anaella /v1 API, one API for agents: typed tools (web research, SEO, images and video, documents, phone, meetings) plus the accounts you connect (mail, calendars, Drive, Slack, ads, payments, social, WordPress and Ghost sites, any MCP server). It mirrors @anaella/client: same calls, same response shapes.

pip install anaella

One runtime dependency (httpx), Python 3.9+.

from anaella import AnaellaClient

anaella = AnaellaClient()  # reads ANAELLA_API_KEY (create one under Settings → API keys)

tools = anaella.find("unread emails")                      # capabilities for a task
spec = anaella.explain("email.messages.list")              # its input schema and price
job = anaella.do("email.messages.list", {"query": "is:unread"})
done = anaella.wait_for_job(job["id"])                     # async tools return a queued job

Async code uses AsyncAnaellaClient, which has the same methods, awaited:

from anaella import AsyncAnaellaClient

async with AsyncAnaellaClient() as anaella:
    job = await anaella.do("web.search", {"query": "anaella"})

What it covers

  • Tools: find(q), explain(id), do(id, input), job(id), wait_for_job(id), balance().
  • Accounts: list_channels(), create_connect_session(), connect_with_credentials(), import_connection(), delete_channel(id), request() for raw calls to a connected account's API.
  • Social posts: create_post, update_post, list_posts, get_post, delete_post, get_analytics, get_post_analytics, plus upload_urls / upload_files for media.
  • Webhooks: create_webhook, list_webhooks, delete_webhook, get_webhook_deliveries, and verify_webhook_signature for the requests Anaella sends you.

Responses are plain dicts with the API's own keys (job["costUsd"]), typed with TypedDicts in anaella.types for editors and type checkers. Request bodies are plain dicts too, so a new API field works before the client knows about it.

Using it from an agent

If your agent can speak MCP, use the MCP server: the tools and workflow skills arrive with no code. If you are writing the agent loop yourself, give the model three function tools and keep the whole catalog behind them:

from anaella import AnaellaApiError, AnaellaClient

anaella = AnaellaClient()

def anaella_find(query: str):            # "unread emails" -> ids, prices, input schemas
    return anaella.find(query, limit=8)

def anaella_do(id: str, input: dict, approved: bool = False):
    if not anaella.explain(id)["readOnly"] and not approved:
        return {"error": "not_approved"}  # sending, posting, editing: ask the user first
    try:
        job = anaella.do(id, input)
        return anaella.wait_for_job(job["id"])["output"]
    except AnaellaApiError as e:
        # `next` is a connect or reconnect link; `schema` is what the tool wanted
        return {"error": e.code, "message": e.message, "next": e.next, "schema": e.schema}

Returning API errors as data, not exceptions, lets the model fix its input or send the user a connect link. The sdist ships complete versions in examples/: agent_tools.py (the three tools as JSON Schema, for OpenAI-style or Anthropic-style function calling, with an approval hook), langchain_tools.py, and webhook_fastapi.py (a signature-checked webhook receiver).

Building for your own users

If your app lets its users connect their accounts, pass external_user_id on every call made for one of them, or set it once on the client (AnaellaClient(external_user_id="user_42")) so every call it makes is scoped to that user; a per-call value still wins. Anaella then refuses a channel that isn't theirs (403 end_user_mismatch):

link = anaella.create_connect_session(
    {"platform": "gmail", "externalUserId": "user_42", "returnUrl": "https://app.example.com/done"}
)
anaella.do("email.messages.list", {}, external_user_id="user_42")
anaella.list_channels(external_user_id="user_42")

Errors

Any non-2xx response, and any network failure, raises AnaellaApiError with status, code, message, and when present details, next (a connect or reconnect link) and schema (the JSON Schema an invalid_input input should have matched):

from anaella import AnaellaApiError

try:
    anaella.do("gsc.queries.list", {})
except AnaellaApiError as e:
    if e.code == "channel_required":
        print("Connect Search Console:", e.next)
    elif e.code == "reconnect_required":
        print("Reconnect:", e.next)
    else:
        raise

Reads retry a gateway error (502, 503, 504) on their own. A write is sent once, since it may have run.

Webhooks

from anaella import verify_webhook_signature

# raw_body: the request body exactly as received, before JSON parsing
if not verify_webhook_signature(raw_body, request.headers["X-Anaella-Signature"], secret):
    return Response(status_code=401)

Configuration

AnaellaClient(api_key=None, *, base_url=None, timeout=60.0, http_client=None). The key falls back to ANAELLA_API_KEY and the address to ANAELLA_API_URL (default https://api.anaella.com). Pass your own httpx.Client / httpx.AsyncClient for proxies, retries at the transport level, or tests. Use the client as a context manager (or call close()) to release its connections.

License

MIT

Metadata

Release files for anaella 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anaella 0.2.0
File Size Uploaded Provenance Actions
anaella-0.2.0.tar.gz 18.0 kB Without provenance Details for anaella-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anaella 0.2.0
File Interpreter ABI Platform Actions
anaella-0.2.0-py3-none-any.whl Python 3 none any Details for anaella-0.2.0-py3-none-any.whl

Total release size: 32.4 kB

Release files / anaella-0.2.0.tar.gz

Download URL anaella-0.2.0.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
433b1a0e36747ec85bb3ddaa5104993b74728dcba2dbdf2fc2cf6b348cfde742
BLAKE2b-256 checksum
How to use checksums
ac24566b4c8996f7d55f601b82188be1421ee9b128c6bc3f1fcad614b6ff1315
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / anaella-0.2.0-py3-none-any.whl

Download URL anaella-0.2.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b67001a7534c0f1230aeb4f9ce06af5da9288d1a647b1b186590ddc4e4241c9
BLAKE2b-256 checksum
How to use checksums
0f86127c3fb9740363486835667424a6f1c388c36f55345321906583da3c69d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for anaella 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page