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.3.0.tar.gz (33.3 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.3.0-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: analog_fetcher-0.3.0.tar.gz
  • Upload date:
  • Size: 33.3 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.3.0.tar.gz
Algorithm Hash digest
SHA256 a39b7b970dd9f9a15a0eaf62a050a6fedc0d26682929c92d5eb7a7e56c384334
MD5 642acfedba915f49a4cfccdb3ca85b47
BLAKE2b-256 afa92edd27ec4c0ee0f38f2f5108dda9acda521c584da19ca079a5d57833604b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: analog_fetcher-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 27.3 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c0d0e80823ebf04088f3a56aa8bc6d54f747efa897a2f9adb6c85e7ceaab556
MD5 0d74ea06de5cde4e489e6b3f79dffd02
BLAKE2b-256 f9a7991989b1998de4edd86154331d5271335fc1ba1a0377cc3d24b3d9376ec9

See more details on using hashes here.

Provenance

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