An extension that allows a user to display all or some of their scrapy spider settings at runtime.
Project description
Scrapy Settings Log
An extension that allows a user to display all or some of their scrapy spider settings at runtime. It will add a logline with some or all settings for your spider in JSON compatible format.
Install
pip install scrapy-settings-log
Quick-Start
Add the following to your settings:
EXTENSIONS = {
'scrapy_settings_log.SpiderSettingsLogging': 999,
}
SETTINGS_LOGGING_ENABLED = True
When you run your spider you will see a log like below when spider is closing:
[scrapy_settings_log] INFO: {"SETTINGS_LOGGING_ENABLED": true, ...}
Additional Options
SETTINGS_LOGGING_REGEX
- Add a regular expression to only show some settings - for exampleSETTINGS_LOGGING_REGEX = "SPIDERMON"
will show settings with SPIDERMON in their name.SETTINGS_LOGGING_INDENT
- Add indentation to make log more human-readable.
Advanced
Subclass and override the output_settings
method if you want the settings to be reported in another way.
from scrapy_settings_log import SpiderSettingsLogging
class CustomSettingsLogger(SpiderSettingsLogging):
def output_settings(self, settings: dict, spider: scrapy.Spider):
# custom code 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
scrapy-settings-log-1.3.3.tar.gz
(15.4 kB
view hashes)
Built Distribution
Close
Hashes for scrapy-settings-log-1.3.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 296d356ae065663d610216aa86be8be646bcdd2acbc3c8a88561edfb0bab1d09 |
|
MD5 | 6a6561adf49f7ec9612007f871cc9d16 |
|
BLAKE2b-256 | 3e6640ff775d3ad5a633e8310b8da841850b9acb63c341a7db44a59510c18c88 |
Close
Hashes for scrapy_settings_log-1.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36d331fae3706197f4deda45fdc0736654b918914468e72a123814676622b29 |
|
MD5 | 11cebbba456f8e0585fdd970fc8ccf1b |
|
BLAKE2b-256 | cfaef31ba8662a7be06a41a753e0289a8c6902918ea14c10390c804a4b4dc2a2 |