Metadata-Version: 2.4
Name: analog-sdk
Version: 0.4.0
Summary: Python SDK for Analog — instantly distill webpages into structured data.
Project-URL: Homepage, https://getanalog.io
Author-email: Marcus Campbell <marcus@getanalog.io>
License: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: click>=8.1
Requires-Dist: httpx>=0.27
Requires-Dist: keyring>=24.0
Requires-Dist: lxml>=5.2
Requires-Dist: markdownify>=0.11
Requires-Dist: protego>=0.4
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Provides-Extra: fetcher
Requires-Dist: analog-fetcher<0.3.0,>=0.2.0; extra == 'fetcher'
Description-Content-Type: text/markdown

# analog-sdk

Python SDK for [Analog](https://getanalog.io) — instantly distill
webpages into structured data.

## Installation

```bash
pip install analog-sdk
```

For JS-heavy pages (single-page apps, infinite scroll, content that
hydrates client-side), also install the companion fetcher:

```bash
pip install "analog-sdk[fetcher]"
```

This gives you the `AnalogFetcher`, which is used as the default
automatically — cheap HTTP fetch on first contact, escalates to a
Playwright-rendered fetch only when the page actually needs it, and
caches the decision per-domain so subsequent visits skip the probe.

## Authenticate

New to Analog? `analog signup` opens the account-creation page
(invite code required during the private alpha). Then:

```bash
analog login
```

Opens browser-based sign-in. Your browser authenticates; your
terminal shows which account is about to be connected and asks you
to confirm — only then is a credential created, and it is never
shown on screen. Subsequent SDK usage picks up the stored key
automatically; the LLM driving your session never sees it. (In
non-interactive shells, pass `--yes` to accept the confirmation.)

Other auth paths if `analog login` doesn't suit you:

- `analog login --api-key <KEY>` — paste a key you already have.
- `export ANALOG_API_KEY=<KEY>` — env-var override; wins over the
  stored credential. Useful for one-off scripts or CI runs that
  need a different identity than your interactive session.
- `Client(api_key=<KEY>)` — constructor argument, wins over
  everything. Useful for tests and embedded scenarios where you
  pass the key explicitly.

Try it straight from the shell:

```bash
analog get https://news.ycombinator.com
```

Run `analog --help` to see all commands (`signup`, `login`,
`logout`, `whoami`, `status`, `get`).

If you don't want a globally-installed `analog` binary, use
`pipx install analog-sdk` or `uv tool install analog-sdk` instead
of plain `pip install`.

## Usage

```python
from analog import analog

result = analog("https://example.com")
```

Same one-liner whether or not the JS-aware fetcher is installed. When
it is, JS-heavy pages just work.

See https://getanalog.io for full documentation.

## License

MIT — see [LICENSE](./LICENSE).
