Skip to main content

CoreClaw Python SDK client.

Project description

CoreClaw Python SDK

CoreClaw Python SDK for running scraper scripts and reading run results.

Install

pip install coreclaw-client

Run a Scraper

from coreclaw import CoreClawClient

client = CoreClawClient(api_key="YOUR_API_KEY")

run = client.scraper("SCRAPER_SLUG").run(
    input={
        "parameters": {
            "system": {
                "proxy_region": "US",
                "cpus": 0.125,
                "memory": 512,
                "execute_limit_time_seconds": 1800,
                "max_total_charge": 0,
                "max_total_traffic": 0,
            },
            "custom": {
                "keyword": "python",
            },
        }
    },
)

print(run["run_slug"])
client.close()

To run a specific version:

run = client.scraper("SCRAPER_SLUG").run(
    input={...},
    version="v1.0.1",
)

If version is not provided, CoreClaw uses the latest available version.

Get Run Results

from coreclaw import CoreClawClient

client = CoreClawClient(api_key="YOUR_API_KEY")

results = client.run("RUN_SLUG").list_results(limit=10, offset=0)

print(results["count"])
for item in results["list"]:
    print(item)

client.close()

Async Usage

Run a scraper:

from coreclaw import CoreClawAsyncClient

client = CoreClawAsyncClient(api_key="YOUR_API_KEY")
run = await client.scraper("SCRAPER_SLUG").run(input={...})
await client.close()

Get run results:

from coreclaw import CoreClawAsyncClient

client = CoreClawAsyncClient(api_key="YOUR_API_KEY")
results = await client.run("RUN_SLUG").list_results(limit=10, offset=0)
await client.close()

More

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

coreclaw_client-1.0.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

coreclaw_client-1.0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file coreclaw_client-1.0.1.tar.gz.

File metadata

  • Download URL: coreclaw_client-1.0.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for coreclaw_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8ca34ba310ee228e9563d9df76bcc8e4f452825dba80751c32a81119a40c5579
MD5 416e9dc2cb6043f0b33bfbd6419cd8df
BLAKE2b-256 00d4ecfbf91a5bb4871518f306effb6add3bac90aef8f749bdce1426f63ebc77

See more details on using hashes here.

File details

Details for the file coreclaw_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for coreclaw_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b0e333d4924eb93bb808fb5eff45452580628ca0bae4f6db29b868827fdb4fa
MD5 cf6374014ae7abfd5342d91f447d9210
BLAKE2b-256 18ac1c9a1239ca94447507a8c59cce995ee56868db9fe69774e13ca2311ee487

See more details on using hashes here.

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