Skip to main content

APCloudy Pipeline

Scrapy integration that sends items, requests, logs, and stats to AP Cloudy with HMAC auth and full job log capture.

Install

pip install apcloudy-pipeline

Settings

APCLOUDY_URL = "https://your-api.com"
APCLOUDY_API_KEY = "your_public_api_key"
APCLOUDY_SECRET_KEY = "your_secret_key"
JOB_ID = 123
APCLOUDY_BATCH_SIZE = 50  # optional

ITEM_PIPELINES = {
    "apcloudy_pipeline.pipelines.APCloudyItemPipeline": 300,
}
DOWNLOADER_MIDDLEWARES = {
    "apcloudy_pipeline.middleware.APCloudyErrorMiddleware": 50,
}
EXTENSIONS = {
    "apcloudy_pipeline.request_logger.APCloudyRequestLogger": 100,
    "apcloudy_pipeline.extensions.APCloudyLoggingExtension": 100,
    "apcloudy_pipeline.extensions.APCloudyStatsExtension": 100,
}

Log level follows Scrapy LOG_LEVEL.

Payload

{
  "job_id": "123",
  "data": {
    "requests": [{ "url": "...", "status_code": 200, "success": true, "...": "..." }],
    "items": [{ "title": "...", "_ts": 1753358220 }],
    "logs": [{
      "index": 0,
      "time": "2026-07-01 13:02:55",
      "timestamp": 1751374975.12,
      "level": "INFO",
      "logger": "scrapy.core.engine",
      "message": "Spider opened",
      "exception": null
    }],
    "stats": { "item_scraped_count": 1, "finish_reason": "finished" }
  }
}

Logs cover startup → crawl → stats dump → closed (plus print() spider lines).

Auth

X-API-KEY / X-TIMESTAMP / X-SIGNATURE
POST {APCLOUDY_URL}/api/webhook/consume
signature = HMAC-SHA256(secret, timestamp + "." + body)

Notes

  • Yield items from callbacks (not only return inside a generator).
  • Data flushes on batch size, every 10s, and on engine/process stop.
  • Requires Python 3.8+, Scrapy 2.0+, requests, w3lib, itemadapter.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apcloudy_pipeline-0.1.9.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

apcloudy_pipeline-0.1.9-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file apcloudy_pipeline-0.1.9.tar.gz.

File metadata

  • Download URL: apcloudy_pipeline-0.1.9.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for apcloudy_pipeline-0.1.9.tar.gz
Algorithm Hash digest
SHA256 d957ffb9fa069b92f6e03583483cb6ae4c1c295e6e0f1e4d79544a804619a10c
MD5 57dc0a675f242be25bda65899b104b1d
BLAKE2b-256 6022db84746c3459b684021bb8cf1bfa30314775a104ec47cd42862fe840d8dd

See more details on using hashes here.

File details

Details for the file apcloudy_pipeline-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for apcloudy_pipeline-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 786bdcdcda9c996082e96beb075938c75a07a0593a5ba4ed255d534fc9dd8cb3
MD5 14735160f1cf7ffabad55f999bcb4f75
BLAKE2b-256 e4721be3fe6dd2c4e5a1d4d249701bdae47e4ccbc953dddbacc0f7d6dc633255

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 Sentry Error logging StatusPage Status page