Python SDK

Every tool as a Python method, typed errors, safe retries, and on-site helpers for Django and Flask.

Embed
Preview of the card
<a href="https://seolyticize.com/docs/python-sdk"><img src="https://seolyticize.com/docs/_api/public/orgs/71cb2b7a-a719-4003-b3ea-6321dc1db8ab/spaces/3bf2dbf7-3faa-473c-ba3b-30588f5f8de4/pages/bd16407b-7a8f-4d9b-9a88-931f1cb237b4/social-card.svg?v=3e7ae33eec8b" alt="Python SDK" width="600" height="315"></a>

seolyticize is the Python client: a method for every tool, generated from the same registry as the TypeScript SDK. Standard library only, Python 3.9+.

pip install "git+https://github.com/Seolyticize/sdk-python"

Calls

from seolyticize import Seolyticize

client = Seolyticize()  # reads SEOLYTICIZE_API_KEY; or Seolyticize(api_key="sk_seo_…")

manifest = client.onboard_site(domain="example.com", framework="html")
checklist = client.verify_site(client_id=manifest["clientId"])
summary = client.get_audit_summary(client_id=manifest["clientId"])

Arguments are keyword-only and snake_case. A name Python reserves takes a trailing underscore (from_, type_). client.call("tool_name", {...}) reaches tools newer than the package, with the API's camelCase names. client.list_tools(group="weekly") lists what your key may call.

Errors

Every failure is a SeolyticizeError carrying status, code, next and request_id:

Class

Status

ValidationError

400

AuthenticationError

401

PermissionError

403

NotFoundError

404

RefusedError

422 — the tool understood and declined; code says why

RateLimitError

429

ServerError

5xx

NetworkError

no response

Branch on code (for example unknown_client, search_console_no_access), never on the message. A 429 is retried after Retry-After. A server or network error is retried only for read-only tools, because a write that failed may already have happened.

On your site

from seolyticize.site import analytics_tag, indexnow_key_response, notify_deploy, track_event

analytics_tag("SITE_KEY", exclude=["/account/*"])   # the <script> for your base template
body, headers = indexnow_key_response("KEY")        # serve at /KEY.txt
notify_deploy(hook_url)                             # after each deploy; see create_deploy_hook
track_event("SITE_KEY", "https://example.com/pricing", name="Signup")

In Django, mark_safe(analytics_tag(...)) in a context processor; in Flask, Markup(analytics_tag(...)).

Updated