Giter Site home page Giter Site logo

kristobaljunta / scrapy-command-new Goto Github PK

View Code? Open in Web Editor NEW

This project forked from groupbwt/scrapy-command-new

0.0 1.0 0.0 55 KB

A package providing code generation command for scrapy CLI. This is a personal fork, main repo in url

Home Page: https://github.com/groupbwt/scrapy-command-new

License: MIT License

Mako 54.80% Python 45.20%

scrapy-command-new's Introduction

scrapy-command-new

A package providing code generation command for scrapy CLI.

The project is a WIP, so expect major changes and additions (latter, mostly). Master branch is to be considered as always ready to use, with major changes/features introduced in feature branches.

This is a part of a bigger project - Scrapy Boilerplate.

The command works with a specific scrapy project structure (not the default one). Rationale for this is described here.

Usage

This is a scrapy command to generate class files and automatically add imports to respective module's __init__ files. It can be used as follows:

scrapy new spider SampleSpider

The first argument (spider) is a type of class file to be generated, and can be one of the following:

  • command
  • extension
  • item
  • middleware
  • model
  • pipeline
  • spider_middleware
  • spider

The second argument is class name.

Also for pipeline and spider class an option --rabbit can be used to add RabbitMQ connection code to generated source.

Option --item with value CLASSNAME is supported for generating pipelines, which adds an import and type-check for a provided item class to the resulting code.

Option --settings is also supported for pipelines, with an optional integer value PRIORITY that adds the pipeline being generated to scrapy settings.py file with specified priority (default 300).

Installation

This command is included in the Scrapy Boilerplate out of the box. If you want to install it manually, you can get it from PyPi:

pip install scrapy-new

Please note that this package won't work with default Scrapy project structure, it requires a specific custom one, as described here.

scrapy-command-new's People

Contributors

kristobaljunta avatar

Watchers

James Cloos avatar

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.