Skip to main content

JS-aware HTML fetcher for Analog that probes-then-renders only when needed. Uses Playwright.

Reason this release was yanked:

Merged into analog-sdk; install analog-sdk instead.

Project description

analog-fetcher

JS-aware fetching for Analog. Two fetchers, both implementing the analog.fetcher.Fetcher protocol:

  • AnalogFetcher — the recommended default. Does a cheap HTTP fetch first, analyzes the HTML to decide if rendering is actually needed, and only escalates to a real browser when it is. Caches the decision per-domain so subsequent fetches skip the probe.
  • PlaywrightFetcher — direct Playwright access. Use when you know you want JS rendering on every fetch and don't want the probe overhead.

When analog-fetcher is installed alongside analog-sdk, AnalogFetcher becomes the SDK's default automatically — no code change required on the caller side.

Installation

pip install "analog-sdk[fetcher]"   # installs analog-sdk + analog-fetcher
# or
pip install analog-fetcher           # standalone (pulls analog-sdk too)

Then install the browser binaries Playwright uses:

playwright install chromium

Usage

The simplest path — let the SDK use the smart default:

from analog import analog

# AnalogFetcher is the default when analog-fetcher is installed.
result = analog("https://example.com")

Or construct one explicitly with custom behavior:

from analog import analog
from analog_fetcher import AnalogFetcher, PlaywrightFetcher

# Customize the rich fetcher used during escalation.
fetcher = AnalogFetcher(
    rich=PlaywrightFetcher(wait_for=".loaded", headless=True),
)
result = analog("https://example.com", fetcher=fetcher)

Or force Playwright on every fetch:

from analog_fetcher import PlaywrightFetcher

with PlaywrightFetcher(headless=True) as fetcher:
    r1 = analog("https://example.com/a", fetcher=fetcher)
    r2 = analog("https://example.com/b", fetcher=fetcher)
    # Browser launches once, is reused across both fetches.

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

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

analog_fetcher-0.2.0.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

analog_fetcher-0.2.0-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file analog_fetcher-0.2.0.tar.gz.

File metadata

  • Download URL: analog_fetcher-0.2.0.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for analog_fetcher-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a4490bd6893a420029edc75719230fe131b1939e386d312240bbc8d815569c00
MD5 93efd5a25b6b15bcc2bd7c1925cce662
BLAKE2b-256 d3d8efb2f2eb7e09ee1003debff36cbb254fbdcd48d5d8534dfe62bc223903a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for analog_fetcher-0.2.0.tar.gz:

Publisher: release-fetcher-python.yml on getanalog/monorepo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file analog_fetcher-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: analog_fetcher-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for analog_fetcher-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68529e43a7e2b4b9ef5ecf7b9a91ae4dfc1f6df35c4f740a4cdf202cc2613a8d
MD5 b008527bc6e87d551803319abf37dfcb
BLAKE2b-256 25baa04e57c90887fe9a254c828021aa8b8cade31de5ccda34f185217af257b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for analog_fetcher-0.2.0-py3-none-any.whl:

Publisher: release-fetcher-python.yml on getanalog/monorepo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page