A package providing code generation command for scrapy CLI
Project description
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.
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
Built Distribution
Hashes for scrapy_new-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb310aacebdf9eae5dca72a37e813346fdd7f459d330f97cf011da15fdc3b85d |
|
MD5 | c161152972360c26167449f1d38f120a |
|
BLAKE2b-256 | 43b06f46a5ff9da9d02215762a5e4bdbaff5ea16fff0f52488d0a8f52d606f6e |