Skip to main content

Shared Scrapy base spider + typed service configuration registry

Project description

scrapyx-core

Shared base spider and typed service configuration utilities for Scrapy projects.

What you get

  • BaseServiceSpider — production-ready base class that:

    • exposes service_config, captcha_needed, site_key
    • collects items/errors, has yield_empty_item()
    • initializes from a typed Service registry (from settings / optional file)
  • ServiceConfig / ServiceRegistry — Pydantic models for strict config.

  • load_registry_from_settings() — merges settings["SERVICES"] with optional JSON file pointed by SCRAPYX_SERVICES_FILE.

  • validators — functions you can call (or wire from an extension) to fail fast in CI/Scrapyd.

Minimal usage

# in your spiders
from scrapyx_core.base import BaseServiceSpider

class InspectionSpider(BaseServiceSpider):
    name = "inspection"
    # use self.service_config / self.captcha_needed / self.site_key

Optionally, set SCRAPYX_SERVICES_FILE=/path/to/services.json to load/merge external config.

This package is middleware-agnostic and pairs well with scrapyx-mw (add-on + middlewares).

Install and optional extras

Base usage (BaseServiceSpider, ServiceRegistry, config) requires only the default install:

uv add scrapyx-core
# or: pip install scrapyx-core

Extensions that need extra dependencies:

  • WebhookExtension (webhook callbacks on spider close): uv add scrapyx-core[webhook] or pip install scrapyx-core[webhook]
  • CompletionPublisherExtension (FastStream/RabbitMQ/Redis): uv add scrapyx-core[completion] or pip install scrapyx-core[completion]
  • Both: uv add scrapyx-core[webhook,completion]

Project details


Download files

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

Source Distribution

scrapyx_core-0.2.1.tar.gz (119.3 kB view details)

Uploaded Source

Built Distribution

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

scrapyx_core-0.2.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file scrapyx_core-0.2.1.tar.gz.

File metadata

  • Download URL: scrapyx_core-0.2.1.tar.gz
  • Upload date:
  • Size: 119.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scrapyx_core-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e2fbca19d7a1f6c9c31a7c4b1826e4c07a07cc7f42da019c57076c4b73aa57be
MD5 13083f7a6e197e7021acc9724fbe5999
BLAKE2b-256 e253696222f3d1f83cc93d5fabbedfd67669a22dac6ccea5e7ade982c96c96ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapyx_core-0.2.1.tar.gz:

Publisher: release.yml on ArmanAvanesyan/scrapyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scrapyx_core-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: scrapyx_core-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scrapyx_core-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 369e5ad27e16ac64d7bc5ceb26e6914d9da951ac870cc9ca8791b0eb649acb12
MD5 57c983136ce07101d09b7a7fd23891ee
BLAKE2b-256 2f210316e92f7615bd39fae8f084ca4a9bbe1385a3bed523097388499f642046

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapyx_core-0.2.1-py3-none-any.whl:

Publisher: release.yml on ArmanAvanesyan/scrapyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page