Metadata-Version: 2.4
Name: scraperack
Version: 0.1.0a3
Summary: Python SDK for self-hosted ScrapeRack clusters
License-Expression: Apache-2.0
Project-URL: Repository, https://github.com/damadjan/scraperack
Project-URL: Issues, https://github.com/damadjan/scraperack/issues
Classifier: Development Status :: 3 - Alpha
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cloudpickle>=3
Requires-Dist: httpx>=0.27
Dynamic: license-file

# ScrapeRack SDK

Python client for submitting trusted Python functions to a self-hosted ScrapeRack cluster.

> ScrapeRack is alpha software. Use it on trusted infrastructure and expect breaking changes.

## Install

```sh
pip install scraperack
```

## Run a function

The environment must already exist on the cluster.

```python
from scraperack import Cluster


def add(a, b):
    from scraperack_runtime import secret, variable

    print(variable("LOG_LEVEL", "INFO"))
    database_url = secret("DATABASE_URL")
    return a + b


cluster = Cluster("http://controller:7070")
try:
    execution = cluster.run(
        "python",
        add,
        (2, 3),
        variables={"LOG_LEVEL": "DEBUG"},
        secrets={"DATABASE_URL": "postgresql://..."},
    )
    print(cluster.result(execution["id"]))
finally:
    cluster.close()
```

Installation, cluster setup, and source code are available at [github.com/damadjan/scraperack](https://github.com/damadjan/scraperack).
