scrapely 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -1
- package/dist/actor.d.ts +703 -0
- package/dist/actor.js +1441 -0
- package/dist/browser-configuration.d.ts +58 -0
- package/dist/browser-configuration.js +128 -0
- package/dist/browser-locations.d.ts +5 -0
- package/dist/browser-locations.js +5469 -0
- package/dist/charging.d.ts +153 -0
- package/dist/charging.js +782 -0
- package/dist/charging_client.d.ts +18 -0
- package/dist/charging_client.js +49 -0
- package/dist/configuration.d.ts +121 -0
- package/dist/configuration.js +128 -0
- package/dist/crypto/secrets.d.ts +44 -0
- package/dist/crypto/secrets.js +164 -0
- package/dist/events/events-client.d.ts +59 -0
- package/dist/events/events-client.js +120 -0
- package/dist/events/scrapely-event-manager.d.ts +13 -0
- package/dist/events/scrapely-event-manager.js +61 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +95 -0
- package/dist/log-env.d.ts +1 -0
- package/dist/log-env.js +12 -0
- package/dist/manifest.d.ts +30 -0
- package/dist/manifest.js +47 -0
- package/dist/patch-browser-pool.d.ts +66 -0
- package/dist/patch-browser-pool.js +827 -0
- package/dist/proxy-configuration.d.ts +118 -0
- package/dist/proxy-configuration.js +88 -0
- package/dist/request-list.d.ts +57 -0
- package/dist/request-list.js +79 -0
- package/dist/runner/docker-manager.d.ts +88 -0
- package/dist/runner/docker-manager.js +283 -0
- package/dist/runner/index.d.ts +2 -0
- package/dist/runner/index.js +7 -0
- package/dist/runner/timeout-manager.d.ts +43 -0
- package/dist/runner/timeout-manager.js +90 -0
- package/dist/scrapely-proxy-configuration.d.ts +99 -0
- package/dist/scrapely-proxy-configuration.js +559 -0
- package/dist/storage/api-storage-client.d.ts +199 -0
- package/dist/storage/api-storage-client.js +910 -0
- package/dist/storage/billing-tracker.d.ts +163 -0
- package/dist/storage/billing-tracker.js +260 -0
- package/dist/storage/dataset-client.d.ts +43 -0
- package/dist/storage/dataset-client.js +232 -0
- package/dist/storage/dataset-collection-client.d.ts +8 -0
- package/dist/storage/dataset-collection-client.js +75 -0
- package/dist/storage/dataset-push-script.d.ts +18 -0
- package/dist/storage/dataset-push-script.js +38 -0
- package/dist/storage/dragonfly-client.d.ts +94 -0
- package/dist/storage/dragonfly-client.js +167 -0
- package/dist/storage/index.d.ts +11 -0
- package/dist/storage/index.js +25 -0
- package/dist/storage/key-value-store-client.d.ts +61 -0
- package/dist/storage/key-value-store-client.js +306 -0
- package/dist/storage/kv-store-collection-client.d.ts +8 -0
- package/dist/storage/kv-store-collection-client.js +76 -0
- package/dist/storage/kvs-iteration.d.ts +17 -0
- package/dist/storage/kvs-iteration.js +126 -0
- package/dist/storage/log-manager.d.ts +114 -0
- package/dist/storage/log-manager.js +244 -0
- package/dist/storage/patch-storage.d.ts +11 -0
- package/dist/storage/patch-storage.js +177 -0
- package/dist/storage/request-queue-client.d.ts +93 -0
- package/dist/storage/request-queue-client.js +522 -0
- package/dist/storage/rq-collection-client.d.ts +8 -0
- package/dist/storage/rq-collection-client.js +89 -0
- package/dist/storage/rq-list-requests.d.ts +59 -0
- package/dist/storage/rq-list-requests.js +114 -0
- package/dist/storage/rq-lock-script.d.ts +56 -0
- package/dist/storage/rq-lock-script.js +127 -0
- package/dist/storage/run-metadata.d.ts +98 -0
- package/dist/storage/run-metadata.js +256 -0
- package/dist/storage/s3-client.d.ts +103 -0
- package/dist/storage/s3-client.js +302 -0
- package/dist/storage/ttl-manager.d.ts +70 -0
- package/dist/storage/ttl-manager.js +115 -0
- package/dist/storage/utils.d.ts +3 -0
- package/dist/storage/utils.js +19 -0
- package/dist/storage-identifiers.d.ts +20 -0
- package/dist/storage-identifiers.js +6 -0
- package/dist/utils.d.ts +54 -0
- package/dist/utils.js +63 -0
- package/dist/validator.d.ts +24 -0
- package/dist/validator.js +158 -0
- package/package.json +90 -9
package/README.md
CHANGED
|
@@ -1 +1,119 @@
|
|
|
1
|
-
|
|
1
|
+
# Scrapely
|
|
2
|
+
|
|
3
|
+
Scrapely is an Actor-based web scraping platform. Developers push an Actor (a scraping program), the platform builds it into a Docker image, runs it with structured input, and keeps its output in datasets, key-value stores and request queues. The API and SDKs follow Apify's shape, so most Apify Actors run with few or no changes.
|
|
4
|
+
|
|
5
|
+
This repo holds the platform server, the Actor SDKs, the API clients, the CLI and the MCP servers.
|
|
6
|
+
|
|
7
|
+
## Repo layout
|
|
8
|
+
|
|
9
|
+
| Path | What it is |
|
|
10
|
+
|------|------------|
|
|
11
|
+
| `src/` → `dist/` | Node.js Actor SDK, published as `scrapely`. `dist/` is committed because it is the package output. |
|
|
12
|
+
| `scrapely-python/` | Python Actor SDK (`scrapely` on PyPI) |
|
|
13
|
+
| `scrapely-server/` | API server, build/run workers, autoscaler, egress proxy |
|
|
14
|
+
| `scrapely-cli/` | `scrapely` CLI: login, create/init, push, pull, run, builds, runs, storages, secrets |
|
|
15
|
+
| `scrapely-client/` | JavaScript API client (`scrapely-client`, drop-in for `apify-client`) |
|
|
16
|
+
| `scrapely-client-python/` | Python API client (`scrapely-client-python`) |
|
|
17
|
+
| `scrapely-mcp/` | MCP server (TypeScript) |
|
|
18
|
+
| `scrapely-mcp-python/` | MCP server (Python) |
|
|
19
|
+
| `docker/` | Runner and Actor base images, Dragonfly compose file, Kaniko patch |
|
|
20
|
+
| `docs/` | Platform documentation. Start at [docs/README.md](docs/README.md). |
|
|
21
|
+
| `scripts/` | Server setup, deploy, migrations, benchmarks |
|
|
22
|
+
| `tests/` | SDK/runtime tests |
|
|
23
|
+
| `examples/basic-actor/` | Smallest working Actor |
|
|
24
|
+
| `Apify_Docs/` | Apify API reference copies, fetched by `getdocs.py` |
|
|
25
|
+
| `npm-claim-scrapely/` | Old placeholder for the `scrapely` npm name, now superseded by the SDK itself (1.2.4+). |
|
|
26
|
+
|
|
27
|
+
Each package has its own README with install and usage details.
|
|
28
|
+
|
|
29
|
+
## How it fits together
|
|
30
|
+
|
|
31
|
+
- The **API server** (`scrapely-server/`) serves the Apify-style `/v2` API: auth, Actors and versions, builds, runs, tasks, schedules, webhooks, storages, billing and admin routes.
|
|
32
|
+
- **Builds and runs** are queued with BullMQ and picked up by workers. Builds produce Docker images that go to a private registry. Runs execute in Docker on worker servers.
|
|
33
|
+
- **The autoscaler** adds and removes worker servers based on load. See [docs/autoscaling.md](docs/autoscaling.md).
|
|
34
|
+
- **Storage**: run state and storages live in DragonflyDB (Redis-compatible). Accounts, Actors, runs and billing live in SingleStore. Both are backed up to S3.
|
|
35
|
+
- **Browsers**: remote browsers come from Evomi over CDP. See [docs/evomi-integration.md](docs/evomi-integration.md).
|
|
36
|
+
- **Actor code** imports the SDK, which patches Crawlee storage to go through the platform:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { Actor, PlaywrightCrawler, Dataset } from 'scrapely';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from scrapely import Actor
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Local development
|
|
47
|
+
|
|
48
|
+
### Prerequisites
|
|
49
|
+
|
|
50
|
+
- Node.js 22
|
|
51
|
+
- Docker
|
|
52
|
+
- Doppler CLI with access to the `scrapely` project (all secrets come from Doppler; there are no `.env.example` files)
|
|
53
|
+
- Reachable DragonflyDB and SingleStore instances (Doppler `stg` points at staging)
|
|
54
|
+
|
|
55
|
+
### Install
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install
|
|
59
|
+
cd scrapely-server && npm install
|
|
60
|
+
cd ../scrapely-cli && npm install
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Run the API server
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
cd scrapely-server
|
|
67
|
+
doppler run -p scrapely -c stg -- npm run dev
|
|
68
|
+
curl http://localhost:3000/health
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
To run a local Dragonfly instead of staging: `docker compose -f docker/docker-compose.dragonfly.yml up -d`.
|
|
72
|
+
|
|
73
|
+
### Build the runner image
|
|
74
|
+
|
|
75
|
+
Needed before the server can run Actors locally:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
make build-runner
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Push and run an Actor
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
scrapely login
|
|
85
|
+
cd examples/basic-actor
|
|
86
|
+
scrapely push
|
|
87
|
+
scrapely run --wait
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Tests
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm test # root SDK
|
|
94
|
+
cd scrapely-server && npm test
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Both packages have many more targeted `test:*` scripts in their `package.json`. Most tests are integration-style, and some need a valid `CDP_URL` or live services.
|
|
98
|
+
|
|
99
|
+
## Deploy
|
|
100
|
+
|
|
101
|
+
| Command | What it does |
|
|
102
|
+
|---------|--------------|
|
|
103
|
+
| `npm run prod` | Full production deploy (`scripts/deploy-prod.sh`) |
|
|
104
|
+
| `npm run prod:update` | Update-only deploy |
|
|
105
|
+
| `npm run setup:server` | Bootstrap a fresh Linux server |
|
|
106
|
+
| `npm run setup:gvisor` | Install gVisor on a Linux host |
|
|
107
|
+
| `npm run migrate` | Run a SingleStore migration |
|
|
108
|
+
|
|
109
|
+
The main server uses `scrapely-server/docker-compose.yml` and workers use `docker-compose.worker.yml`. Secrets are injected at container start with `doppler run`.
|
|
110
|
+
|
|
111
|
+
`make start` / `stop` / `restart` / `logs` wrap the server compose stack.
|
|
112
|
+
|
|
113
|
+
## Where to look next
|
|
114
|
+
|
|
115
|
+
- [docs/README.md](docs/README.md): documentation index (getting started, SDKs, CLI, webhooks, troubleshooting)
|
|
116
|
+
- [scrapely-server/docs/API_ENDPOINTS.md](scrapely-server/docs/API_ENDPOINTS.md): API reference
|
|
117
|
+
- [docs/network-architecture.md](docs/network-architecture.md): fleet topology and data path
|
|
118
|
+
- `scrapely-server/src/index.ts`: server startup and route wiring
|
|
119
|
+
- `src/actor.ts`: Node SDK Actor runtime
|