{"id":24584,"library":"shub","title":"Scrapinghub Command Line Client","description":"shub is the official command-line client for Scrapinghub, enabling users to deploy, schedule, and manage Scrapy spiders on the Scrapinghub cloud platform. Current version: 2.17.1. Release cadence is irregular.","status":"active","version":"2.17.1","language":"python","source_language":"en","source_url":"https://github.com/scrapinghub/shub","tags":["scraping","scrapy","scrapinghub","deployment"],"install":[{"cmd":"pip install shub","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"shub","correct":"import shub"}],"quickstart":{"code":"import shub\nimport os\n\n# Login using API key from environment variable\napi_key = os.environ.get('SHUB_APIKEY', '')\nif not api_key:\n    raise Exception(\"Please set SHUB_APIKEY environment variable\")\n\nshub.login(api_key)\n\n# List all projects\nprojects = shub.projects.list()\nprint(\"Projects:\", projects)\n\n# Deploy a spider (run from project directory)\n# shub.deploy(project_id, target='prod')","lang":"python","description":"Basic usage: login with API key and list projects."},"warnings":[{"fix":"Upgrade Python to 3.10 or later.","message":"shub requires Python 3.10+. Older Python versions are no longer supported.","severity":"gotcha","affected_versions":">=2.17.0"},{"fix":"Use the numeric project ID in your config or command line instead of the project name.","message":"The old shub deploy command using a YAML config file with a 'project' field is deprecated in favor of using the project ID directly. The 'project' field may be removed in future versions.","severity":"deprecated","affected_versions":">=2.14.0"},{"fix":"Set SHUB_APIKEY environment variable and call shub.login(api_key) programmatically.","message":"API key authentication via environment variable SHUB_APIKEY is the recommended method. Using the interactive login command in automated scripts will cause failures.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use correct syntax: shub deploy [project-id] [--target]","cause":"Typo or old command syntax. The correct subcommand is 'deploy' but sometimes used incorrectly with extra arguments.","error":"shub: error: argument command: invalid choice: 'deploy'"},{"fix":"Set SHUB_APIKEY environment variable or pass key via shub.login(api_key) with a valid key.","cause":"API key is missing or incorrect. Not set in environment or passed incorrectly.","error":"shub.exceptions.ShubException: Invalid API key"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}