Skip to main content

A set of tools for controlling processing workflow with spiders and script running in scrapinghub ScrapyCloud.

Installation

pip install shub-workflow

If you want to support s3 tools:

pip install shub-workflow[with-s3-tools]

For google cloud storage tools support:

pip install shub-workflow[with-gcs-tools]

For Hubstorage Crawl Frontier (HCF) tools support (shub_workflow.utils.hcf):

pip install shub-workflow[with-hcf-backend]

Usage

Check Project Wiki for documentation. You can also see code tests for lots of examples of usage.

Claude Code plugin

shub-workflow ships a Claude Code plugin, shub-workflow-toolkit, that gives Claude working knowledge of shub-workflow tooling. It currently bundles ten skills:

  • scanjobs-programs — authoring and running the scanjobs job-scanning + plotting tool and its command-line "programs".
  • shub-workflow-scripts — writing or fixing scripts built on the shub_workflow.script base classes (BaseScript / BaseLoopScript / BaseLoopScriptAsyncMixin), i.e. any script that runs on or operates on Scrapy Cloud.
  • shub-workflow-crawl-managers — building, updating or understanding crawl managers (CrawlManager / PeriodicCrawlManager / GeneratorCrawlManager / AsyncSchedulerCrawlManagerMixin): the set_parameters_gen() pattern, outcome/retry hooks, and async scheduling.
  • shub-workflow-graph-managers — building, updating or understanding graph managers (GraphManager + Task / SpiderTask): declaring a DAG of tasks in configure_workflow(), dependency linking, on_finish/retry routing, resources, and parallelization.
  • shub-workflow-monitors — building, updating or understanding monitors (BaseMonitor): cross-job stat aggregation over a time window, ratios, reports, custom checks, and threshold alerts via Slack / Sentry.
  • shub-workflow-fshelper — reading/writing/listing files through the cloud-agnostic filesystem layer (shub_workflow.utils.futils / FSHelper): prefix-based s3:///gs:///local dispatch, role-assumed credentials, the listing variants, and op_kwargs/ACLs.
  • shub-workflow-issuers — building data-pipeline issuers (IssuerScript / IssuerScriptWithFileSystemInput / IssuerScriptWithSCJobInput): reading job/file input, dedup, batch output slots, and issuer-based delivery (replacing the deprecated BaseDeliverScript).
  • shub-workflow-hcf — working with a Hubstorage Crawl Frontier (shub_workflow.utils.hcf / FrontierTool): running and extending the frontier tool script (list/count/dump/add/delete/move slots), the HCF semantics that bite, and reading/writing seeds from crawl managers and consumers (HCFSeedsCrawlManager, HCFSeedsWriterMixin).
  • shub-workflow-architectures — designing (or redesigning) a project's workflow architecture in an interactive session: interviews the developer about the requirements, maps them to the independent agents + role separation architecture, writes a design document, checks it against known pitfalls, and scaffolds the script skeletons of the chosen roles.
  • shub-workflow-diagrams — generating a project's architecture diagrams from an editable model: banded workflow/pipeline diagrams and UML class-hierarchy diagrams, in the house style shared by these projects, with the rendering engine to copy, the Graphviz constraints that keep the output stable, and the common class-hierarchy conventions with a render-time check of the edges against the code.

Install it from this repository's plugin marketplace, from inside Claude Code:

/plugin marketplace add scrapinghub/shub-workflow
/plugin install shub-workflow-toolkit@shub-workflow

To enable it automatically for a project, add it to that project's .claude/settings.json:

{
  "enabledPlugins": ["shub-workflow-toolkit@shub-workflow"]
}

Updates

The plugin is unversioned (its plugin.json has no version field), so each commit pushed to this repository is a new version. When Claude Code installs the plugin it copies it into a local cache (~/.claude/plugins/cache/) and uses that copy — it does not read your working tree or re-pull from GitHub on every session. You choose how new commits reach you:

  • Automatic. Turn on auto-update for this marketplace: run /plugin, open the Marketplaces tab, and enable auto-update for shub-workflow (or set it in settings — see below). With this on, Claude Code re-pulls the marketplace from GitHub and updates installed plugins at startup, so a new session always loads the latest pushed commit. This is the low-friction option for staying current.

    {
      "extraKnownMarketplaces": {
        "shub-workflow": {
          "source": { "source": "github", "repo": "scrapinghub/shub-workflow" },
          "autoUpdate": true
        }
      },
      "enabledPlugins": ["shub-workflow-toolkit@shub-workflow"]
    }
    
  • Manual. Leave auto-update off (the default for third-party marketplaces). The cached copy stays pinned until you explicitly update — nothing changes under you between sessions. To pull the latest when you want it:

    /plugin marketplace update shub-workflow            # refresh the catalog from GitHub
    /plugin update shub-workflow-toolkit@shub-workflow  # update the installed plugin
    

The plugin lives in plugins/shub-workflow-toolkit/; the marketplace manifest is .claude-plugin/marketplace.json.

Note

The requirements for this library are defined in setup.py as usual. The Pipfile files in the repository don't define dependencies. It is only used for setting up a development environment for shub-workflow library development and testing.

For developers

For installing a development environment for shub-workflow, the package comes with Pipfile and Pipfile.lock files. So, clone or fork the repository and do:

> pipenv install --dev
> cp pre-commit .git/hooks/

for installing the environment, and:

> pipenv shell

for initiating it.

There is a script, lint.sh, that you can run everytime you need from the repo root folder, but it is also executed each time you do git commit (provided you installed the pre-commit hook during the installation step described above). It checks code pep8 and typing integrity, via flake8 and mypy.

> ./lint.sh

Metadata

Release files for shub-workflow 1.14.48.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shub-workflow 1.14.48.1
File Size Uploaded Provenance Actions
shub_workflow-1.14.48.1.tar.gz 123.4 kB Without provenance Details for shub_workflow-1.14.48.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shub-workflow 1.14.48.1
File Interpreter ABI Platform Actions
shub_workflow-1.14.48.1-py3-none-any.whl Python 3 none any Details for shub_workflow-1.14.48.1-py3-none-any.whl

Total release size: 257.4 kB

Release files / shub_workflow-1.14.48.1.tar.gz

Download URL shub_workflow-1.14.48.1.tar.gz
Size 123.4 kB
Tags Source
SHA-256 checksum
How to use checksums
48e5a33df7cc0a056e266aa0adc82661ef3d7001738fff0ace7a97b90b6f9e98
BLAKE2b-256 checksum
How to use checksums
1d66d99b153d5bdedc9e0bcd3384da7b5d8f2a5b6085613215ca1d5e6b9b7cc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.16

Release files / shub_workflow-1.14.48.1-py3-none-any.whl

Download URL shub_workflow-1.14.48.1-py3-none-any.whl
Size 134.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
967e9351c40d5bb1e6a580c9a6095b15d1a75847a517f310fe8e686c562e636d
BLAKE2b-256 checksum
How to use checksums
ff8c5ed1c5b643ca9ce83cad2bbdac63d2cd709045f08f76b1b5e01615a8f6d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.16

Security for shub-workflow 1.14.48.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.14.48.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page