Metadata-Version: 2.4
Name: scrapely-python
Version: 0.1.3
Summary: Scrapely Python SDK - A toolkit for building Actors on the Scrapely platform
Author-email: Scrapely <support@scrape.ly>
License-Expression: MIT
Project-URL: Homepage, https://scrape.ly
Project-URL: Documentation, https://docs.scrape.ly
Project-URL: Repository, https://github.com/SandeepDev1/scrapely
Keywords: scraping,actor,serverless,apify,scrapely
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.25.0
Requires-Dist: crawlee<2.0.0,>=1.8.0
Requires-Dist: websockets>=12.0
Requires-Dist: scrapely-client-python<2,>=1.0.2
Requires-Dist: pydantic>=2.0.0
Requires-Dist: cryptography>=42.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=1.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: playwright>=1.40.0; extra == "dev"
Requires-Dist: browserforge>=1.2.0; extra == "dev"

# Scrapely Python SDK

Build Python Actors for the [Scrapely](https://scrape.ly) platform with lifecycle helpers, Crawlee-compatible storage, platform events, remote browser CDP, run control, webhooks, and pay-per-event accounting.

## Install

Scrapely requires Python 3.9 or newer.

```bash
python -m pip install scrapely-python
```

Install the appropriate Crawlee/Playwright browser dependencies separately when your Actor uses a browser.

## Quick start

```python
import asyncio

from scrapely import Actor


async def main() -> None:
    actor_input = await Actor.get_input_or_throw()
    await Actor.push_data({
        "url": actor_input["url"],
        "status": "processed",
    })


if __name__ == "__main__":
    asyncio.run(Actor.main(main))
```

`Actor.main()` initializes the Actor, awaits your callback, closes events and storage, and exits the process. For embedded applications and tests, use `async with Actor:` instead.

## Highlights

- Local file-system storage and Scrapely API-backed datasets, key-value stores, and request queues
- Crawlee request loaders and storage objects
- Platform event WebSocket integration and state persistence
- Automatic remote Chromium CDP wiring through `CDP_URL`
- Actor start, call, abort, reboot, and metamorph operations
- Ad-hoc webhooks, proxy configuration, and charging/pricing types
- Apify-compatible environment aliases and asynchronous client access

See the [complete Python SDK guide](../docs/sdk-python.md) for lifecycle details, option objects, storage selection, events, CDP behavior, run control, environment variables, errors, and the full public export list.
