Python SDK for Analog — Analog lets any AI understand websites as code. Webpages in, structured records out: deterministic, local-first, honest.
Project description
analog-sdk
Python SDK and command-line app for Analog. Analog lets any AI understand websites as code — webpages in, structured records out: deterministic, zero-shot, local-first. The extraction pipeline contains no LLMs. Given the same page URL and HTML, the same engine produces the same records. A live page's HTML can change between fetches.
Install
macOS, Linux, or WSL:
curl -LsSf https://getanalog.io/install.sh | sh
Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://getanalog.io/install.ps1 | iex"
The installer puts the analog command on your PATH as an isolated
uv tool. If uv is already installed, use
uv tool install analog-sdk. Homebrew users can instead run
brew install getanalog/tap/analog; pipx install analog-sdk and
pip install analog-sdk in a managed virtual environment also work with
Python 3.10+.
Analog's browser downloads automatically on first use. To install it
ahead of time, run analog browser install. The complete installation
options and CI guidance live in the installation guide.
Create an account and connect this terminal with analog signup (an
invite code is required during the private alpha). Use analog login
for an existing account or another machine. The credential is stored
locally and picked up automatically by the SDK, CLI, and MCP server; see
authentication for its storage,
scope, and revocation model.
Extract a page
From the shell:
analog get https://quotes.toscrape.com/js/
Analog renders the page, returns its structured records, saves the result
locally, and prints a handle such as 20260719-k7m2p9. Use that handle
with analog open, describe, find, distinct, export, or diff
without fetching the page again. Run analog --help for the complete
command surface.
The same call in Python:
from analog import analog
result = analog("https://quotes.toscrape.com/js/")
print(result.preview())
for section in result.structured_content:
print(section.label, section.records)
analog() uses the built-in browser by default. Its main controls are
reveal_all, load_all, expand_all, and pages; the
Fetching guide explains when to
use each. Pass fetcher=HttpFetcher() for a plain HTTP request, supply
your own Fetcher, or use html= when you already have the page content.
For a local markdown conversion with no extraction or account, set
mode="local".
Result shape
An AnalogResponse is an orientation view plus the page's data:
structured_contentis the ordered list of extractedSectionobjects.- Each section carries
records, field metadata, and its own markdown. collectionsprovides high-confidence unions over compatible physical sections, with one identity-deduplicated local records view and pointers back to every placement.outlinereports the significant page areas and what happened to them.navigationpreserves the page's labeled link trees.warnings, pagination details, and browse actions disclose partial or uncertain coverage.handleidentifies the local saved result.
Read result.preview() first. Then use result.section(label),
sections_by_kind(kind), or find(...) to narrow the data before pulling
whole record sets. Export helpers include to_json(), to_yaml(),
to_csv(), and the optional pandas-backed to_dataframe().
A page can contain several unrelated sections: for example, a catalog,
a reviews area, and a comparison table. Analog preserves those boundaries
instead of silently pooling unlike records. When several physical sections
are confidently parts of the same dataset, result.collections[0].records
offers the combined view while collection.sections preserves every authored
placement. Work with one section, one Collection, all sections of a shared
kind, or project common fields explicitly. Field names are a best-effort
starting point when the page supplies no useful label; field values preserve
what the page rendered. Coverage notes call out withheld content, unusual
rows, page-owned truncation, pagination, and interactive controls that were
available but not used.
Results are saved by default as structured records and page markdown,
never raw HTML. Reopen them with analog.open(handle), latest(), and
history(); pass save=False to skip persistence. The
Results guide covers querying,
field statistics, filters, numeric values, exports, renaming, several
sections on one page, retention, and CLI exit codes. Exact Python names,
parameters, and return types are in the compact
Python API reference.
Data flow and privacy
Pages are fetched on your machine. The SDK uses a local headless browser, which visits as an unauthenticated user by default. Analog receives the URL and rendered page content for extraction. The structured result comes back and, unless disabled, is saved in your local cache alongside the page's markdown. Raw HTML is used for the request and local markdown conversion, then dropped rather than written to the result store.
Authenticated content is sent only when you explicitly provide it through
html= or a custom fetcher. Point Analog at content that is acceptable to
send, or use mode="local" to keep the page entirely on your machine.
Local and private-network addresses are declined by default; reaching a
development server or intranet host requires the explicit
allow_private=True opt-in.
Library failures derive from AnalogError, with narrower types for
authentication, connectivity, rate limits, version skew, fetch refusals,
robots.txt decisions, incompatible sections, and saved-result problems.
Catch the narrow type when your application has a specific recovery path;
otherwise catch AnalogError at the integration boundary. The API
reference lists the complete exception inventory.
Extraction URLs are never logged. A quality report includes the URL you explicitly submit; it never includes page content. Read Privacy & security for the complete data, credential, fetching-identity, and network-boundary contracts.
Where to go next
- Quickstart — the shortest path from installation to a useful saved result.
- Fit check — decide whether a page belongs in a structured extraction workflow before spending one.
- Fetching and Results — control page capture, then query and export what came back.
- MCP server — expose the same workflow as tools to an MCP client.
- Limitations and Troubleshooting — known boundaries and fixes for common failures.
The docs site is the durable owner for task guidance; this README stays a
short landing page. analog docs prints its URL when you need to hand the
documentation to another process, and the core docs are also included in
the site's /llms.txt and /llms-full.txt views.
Use analog feedback to report a poor extraction or request a feature.
Use analog contact or email hello@getanalog.io
for support.
License
MIT — 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 analog_sdk-0.17.1.tar.gz.
File metadata
- Download URL: analog_sdk-0.17.1.tar.gz
- Upload date:
- Size: 410.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1044e8e730fb13a63a7f53c870e1df28ce702bd30c04251ed7c777fe006f2401
|
|
| MD5 |
cd53a55d7cc8efe93e44fe31074bdf9d
|
|
| BLAKE2b-256 |
1969ab9fe9df2308f3dc7a7b1e63002fe8ce61af62d438702da568a74a0f1452
|
Provenance
The following attestation bundles were made for analog_sdk-0.17.1.tar.gz:
Publisher:
release-sdk-python.yml on getanalog/monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
analog_sdk-0.17.1.tar.gz -
Subject digest:
1044e8e730fb13a63a7f53c870e1df28ce702bd30c04251ed7c777fe006f2401 - Sigstore transparency entry: 2256698518
- Sigstore integration time:
-
Permalink:
getanalog/monorepo@75439c14160a4b6681453b4731cc1281f986b790 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/getanalog
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-python.yml@75439c14160a4b6681453b4731cc1281f986b790 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file analog_sdk-0.17.1-py3-none-any.whl.
File metadata
- Download URL: analog_sdk-0.17.1-py3-none-any.whl
- Upload date:
- Size: 272.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac20b43b46e49911e100aca6a01ec262f40f6227c97de7584d62d8b7beb171c4
|
|
| MD5 |
6c2f3e9e06b2d5c3ceb1486c7f09dcd1
|
|
| BLAKE2b-256 |
4fa5613f4e8b55d97beb766e0b5a54ecada2dba2e689fc4a4711b6b21a0d81e7
|
Provenance
The following attestation bundles were made for analog_sdk-0.17.1-py3-none-any.whl:
Publisher:
release-sdk-python.yml on getanalog/monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
analog_sdk-0.17.1-py3-none-any.whl -
Subject digest:
ac20b43b46e49911e100aca6a01ec262f40f6227c97de7584d62d8b7beb171c4 - Sigstore transparency entry: 2256698520
- Sigstore integration time:
-
Permalink:
getanalog/monorepo@75439c14160a4b6681453b4731cc1281f986b790 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/getanalog
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-python.yml@75439c14160a4b6681453b4731cc1281f986b790 -
Trigger Event:
workflow_dispatch
-
Statement type: