Metadata-Version: 2.4
Name: analog-sdk
Version: 0.1.2
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

```bash
analog login
```

Opens browser-based sign-in (no credential is ever shown in the
terminal). Subsequent SDK usage picks up the stored key
automatically; the LLM driving your session never sees it.

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.

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

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