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

Uploaded Python 3

File details

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

File metadata

  • Download URL: analog_fetcher-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 185118a969f7b54c094c3b9e394dce9eed0925b528d9a9ad93aa14daf52fb1fe
MD5 10f206583db7d7c269711b660a349043
BLAKE2b-256 afc020905a15e8828c81aaa6235bff0414734b4400d5bfa83a5ae67e31d2b617

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: analog_fetcher-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 efd3fa0c8c99520b7333d13c3813b2fcdc8c2e6e9250c2bc3ef2ea887b6e7204
MD5 f52654bb06d7445636a8317b6626b354
BLAKE2b-256 6e499acd8ec5b8c8abe26a7f80f329ab63290f6bfcc5cebd40893116806c4e86

See more details on using hashes here.

Provenance

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