Giter Club home page Giter Club logo

shub_cli's Introduction

Scrapinghub CLI

A Command Line Interface at your hands to deal with the features of ScrapingHub.

Code Health Build Status

start-using

Python Package Index

Install

You must install it using pip...

$ pip install shub-cli

... or pipsi

$ pipsi install shub-cli

Configuration

Shub CLI will look for the .scrapinghub.yml created by ScrapingHub in your home directory and read the default API_KEY and PROJECT_ID. If you do not have that file, set it up according to the example below:

~/.scrapinghub.yml

apikeys:
  default: <API_KEY>
projects:
  default: <PROJECT_ID>

Start

If you set up ~/.scrapinghub.yml file

$ shub-cli repl

Otherwise...

$ shub-cli -api <API KEY> -project <PROJECT_ID> repl

If you just want to run a command

$ shub-cli [credentials|spiders|job|jobs|schedule]

Cheatsheet

> credentials
> spiders
> job [-show|-cancel|-delete id]
> jobs [-spider spider] [-tag tag] [-lacks tag] [-state pending|running|finished|deleted] [-count count]
> schedule [-spider spider] [-tags tag1,tag2] [-priority 1|2|3|4]

Commands

Credentials

Check what credentials are being used to connect to Scrapinghub.

> credentials

Spiders

List all spiders available.

> spiders

Jobs

List the last 10 jobs or the ones according to your criteria.

> jobs
> jobs -spider <spider> -tag <tag> -lacks <lacks> -state <[pending,finished,running,deleted]> -count <[0,1000]>

Example:

> jobs
> jobs -spider example -tag production -lacks consumed -state finished -count 100

Attention: By default, shub-cli will prompt the last 10 jobs. To override that behaviour use the -count parameter with the number of jobs you intend to show.

Job

Show, delete or cancel a id.

> job -show <id>
> job -show <id> --with-log
> job -delete <id>
> job -cancel <id>

Example:

> job -show 11/23/19801
> job -show 11/23/19801 --with-log
> job -delete 11/23/19801
> job -cancel 11/23/19801

Schedule

Schedule a spider execution.

> schedule -spider <spider> -priority <[1,2,3,4]> -tags <tag1,tag2>

Example:

> schedule -spider my-spider
> schedule -spider my-spider -priority 4 -tags production,periodic
> schedule -spider my-spider -priority 3 -tags test

Help:

For help or suggestion please open an issue at the Github Issues page.

shub_cli's People

Contributors

victormartinez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

shub_cli's Issues

Check a specific job

It is important to allow the user to see the information with regard to a specific job.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.