Skip to main content

Workflow manager for Zyte ScrapyCloud tasks.

Project description

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]

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 three 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.

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

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

shub_workflow-1.14.34.1.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

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

shub_workflow-1.14.34.1-py3-none-any.whl (88.8 kB view details)

Uploaded Python 3

File details

Details for the file shub_workflow-1.14.34.1.tar.gz.

File metadata

  • Download URL: shub_workflow-1.14.34.1.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.16

File hashes

Hashes for shub_workflow-1.14.34.1.tar.gz
Algorithm Hash digest
SHA256 f3f122d66872b838124470bdde8aba27921b5c1bb33591a0a546b3a7626dddd6
MD5 d2aa2d0d760c186e6bd663b747bc97eb
BLAKE2b-256 4873c4733f5b2bec75e9bc33da2d27831534531ce7cf932bcdb42c59fe736bc3

See more details on using hashes here.

File details

Details for the file shub_workflow-1.14.34.1-py3-none-any.whl.

File metadata

File hashes

Hashes for shub_workflow-1.14.34.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4977708d6a523c7cb86fd84ac5dad14cb1f913579cf5a2d93a329660990fda34
MD5 1329f7e0335ba35ba1b9f497fb48d62f
BLAKE2b-256 f4eca8810c2ea9bdd0223d473e4b63f630c9957bbee427b32350d23d8f12276b

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