scrapedrive-python
Typed Python SDK for the ScrapeDrive API, built around httpx
and managed with uv.
Install
uv sync
For packaging consumers:
uv add scrapedrive
Quick Start
Set your API key in the environment:
export SCRAPEDRIVE_API_KEY=your_key
Sync client
from scrapedrive import ScrapeDrive
with ScrapeDrive() as client:
response = client.scrape(
"https://example.com",
result_type="page_text",
render_js=False,
)
print(response.text)
Async job flow
from scrapedrive import ScrapeDrive
with ScrapeDrive() as client:
job = client.submit_scrape(
"https://example.com",
render_js=True,
wait_browser="networkidle",
scrape_tier="advanced",
country_code="US",
)
completed = client.wait_for_job(job.id, poll_interval=2.0, timeout=60.0)
print(completed.result)
Native async client
import asyncio
from scrapedrive import AsyncScrapeDrive
async def main() -> None:
async with AsyncScrapeDrive() as client:
response = await client.scrape("https://example.com", result_type="page_markdown")
print(response.text)
asyncio.run(main())
Forward headers to the target site
from scrapedrive import ScrapeDrive
with ScrapeDrive() as client:
response = client.scrape(
"https://example.com/private",
target_headers={"Authorization": "Bearer token"},
)
print(response.text)
The SDK automatically rewrites forwarded target headers to the sdrive- format required by
ScrapeDrive and enables forward_sdrive_headers=true.
Geography Defaults
For advanced and hyperdrive requests, the SDK defaults country_code to US when you do not
pass one explicitly. This avoids ScrapeDrive's random geo selection. If you want a site-local
country instead, pass it per request:
from scrapedrive import ScrapeDrive
with ScrapeDrive() as client:
response = client.scrape(
"https://example.de",
scrape_tier="advanced",
country_code="DE",
)
AI Agents
Provider-agnostic agent guidance lives in AGENTS.md.
This repo does not ship provider-specific agent config.
Development
uv run ruff check
uv run ruff format
uv run pytest
Live integration tests are opt-in:
SCRAPEDRIVE_RUN_LIVE_TESTS=1 uv run pytest tests/test_live.py
Build
uv build
PyPI
The package is prepared for PyPI publishing via GitHub Actions Trusted Publishing.
See RELEASING.md for the wheel smoke-install workflow, PyPI setup, and release checklist.
Metadata
Release files for scrapedrive 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scrapedrive-0.1.1.tar.gz | 23.9 kB | Without provenance | Details for scrapedrive-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scrapedrive-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for scrapedrive-0.1.1-py3-none-any.whl |
Total release size: 33.7 kB
Release files / scrapedrive-0.1.1.tar.gz
| Download URL | scrapedrive-0.1.1.tar.gz |
|---|---|
| Size | 23.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8a5737ccc775b5449a75e0dca607245c7762108e3c2a3032e91c925a19fc049
|
|
BLAKE2b-256 checksum How to use checksums |
ae534b00530480515d9c351ec3ef1743d192a09792502f33ee7a820572ac0d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / scrapedrive-0.1.1-py3-none-any.whl
| Download URL | scrapedrive-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3220f033e6e9b453966f4b857fe2b16c14d8c08c13206ce222bc2683f762529f
|
|
BLAKE2b-256 checksum How to use checksums |
e5f729e69134ab05603ee6e7573c8292c03286a4da17267ef7b0966c965bcd2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for scrapedrive 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.