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.1.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.1-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: analog_fetcher-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 20dea2696a0d1ca8ef0a9f37815906d2e53adf05e1e648ae7cbc0284990ebfa6
MD5 fb29989bf5c3c03a1b663a2a88c5740e
BLAKE2b-256 b565822794e1a8c6e6e3e2e87417fa0e73a4d16cf28096409450ee9458179b59

See more details on using hashes here.

Provenance

The following attestation bundles were made for analog_fetcher-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: analog_fetcher-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9e04deeaa91062abefaca600365a329cad8818f54b8e103674504c0d2cf91d8
MD5 b61a6bbc59d9fb551ff30fb6a1f054dd
BLAKE2b-256 dcfcc826029cadfe597fefeb74cba0c2f94503bad9fc33dd6509bbec9b39f96a

See more details on using hashes here.

Provenance

The following attestation bundles were made for analog_fetcher-0.2.1-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