Official Python SDK for Anakin (anakin.io) — web scraping, crawling, search, and Wire actions.
Project description
anakin-sdk
Official Python SDK for Anakin — web scraping, crawling, search, and Wire actions.
Status: alpha (v0.1.x). Public API may change between minor versions until v1.0.
Install
pip install anakin-sdk
Note: distribution name is anakin-sdk on PyPI; the Python import name is anakin. So you pip install anakin-sdk but from anakin import Anakin in your code.
Quickstart
from anakin import Anakin
client = Anakin(api_key="ak-...") # or set ANAKIN_API_KEY env var
# Scrape a single URL
doc = client.scrape("https://example.com", formats=["markdown"])
print(doc.markdown)
# Discover URLs on a site
sitemap = client.map("https://example.com", limit=200)
print(sitemap.links)
# Crawl pages and get content
crawl = client.crawl("https://example.com", max_pages=20)
for page in crawl.pages:
print(page.url, len(page.markdown or ""))
The SDK polls long-running jobs internally — you get the final result back from a single sync method call. No job IDs to manage, no polling loops to write.
Configuration
client = Anakin(
api_key="ak-...", # or ANAKIN_API_KEY env var
timeout=60.0, # per-request HTTP timeout
max_retries=4, # retries on 429/5xx
poll_interval=1.0, # initial polling delay
poll_max_interval=10.0, # max polling delay
poll_timeout=300.0, # total wait before JobTimeoutError
)
Errors
from anakin import (
AnakinError, # base for everything below
AuthenticationError, # bad/missing API key
InsufficientCreditsError, # 402 (exposes .balance, .required)
InvalidRequestError, # 400
JobFailedError, # job came back with status="failed"
JobTimeoutError, # poll_timeout exceeded
RateLimitError, # 429 (exposes .retry_after)
ServerError, # 5xx after retries
NetworkError, # DNS/connection/timeout
)
Development
pip install -e ".[dev]"
ruff check .
mypy src/
pytest
License
Apache 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anakin_sdk-0.1.0.tar.gz.
File metadata
- Download URL: anakin_sdk-0.1.0.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0efe80c10722009aa39d58db054b84c883935396c624a5da7fc28e44233fd499
|
|
| MD5 |
e67688422b2412c9ae68d9f8c0d32ae1
|
|
| BLAKE2b-256 |
32a4a1f82db858208417857751b7f249bd86bb797a61e958d5e35c24a01d7878
|
File details
Details for the file anakin_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anakin_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a60035fe427d09e8966f5b533b1455fd9d59967f3956aac3551f96da1f1b9157
|
|
| MD5 |
bf342df9a0a97f6251973f3e65058934
|
|
| BLAKE2b-256 |
298f7b748d3f3123598dd4d02104aba0473c600692ff45dde2f57b5d4c1c32ba
|