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. 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.1.1

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.1.1
File Size Uploaded Provenance Actions
anaella-0.1.1.tar.gz 17.3 kB Without provenance Details for anaella-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 31.4 kB

Release files / anaella-0.1.1.tar.gz

Download URL anaella-0.1.1.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b8e104020d2616632546f084486f8a37be1cebf37cd2aca1d5bf23813b070628
BLAKE2b-256 checksum
How to use checksums
99f39736bc2271405042d9cfbdd6530d15c146ccb0a7c8a382d4d833cd07cb64
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.1.1-py3-none-any.whl

Download URL anaella-0.1.1-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94cc9b05600ce00056c93a4bc5cea8860b9277562d1b9d2eb0c3aba0347fbe69
BLAKE2b-256 checksum
How to use checksums
fd727c905083ea994cb97af11985f48ad5481719fe1fc53ce7bfd1080cf36123
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.1.1

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