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.MASKED_SENSITIVE_SETTINGS_ENABLED- Default isTrue- if settings logging is enabled it will mask the value of settings that may be sensitive (password, apikey). For example AWS_SECRET_ACCESS_KEY will have their value shown as **********
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
Metadata
Release files for scrapy-settings-log 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scrapy_settings_log-1.4.0.tar.gz | 16.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scrapy_settings_log-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.0 kB
Release files / scrapy_settings_log-1.4.0.tar.gz
| Download URL | scrapy_settings_log-1.4.0.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7dbac1be30e5eb92d05bd9f7812202702459309ea4c06de0353f29339d497dc
|
|
BLAKE2b-256 checksum How to use checksums |
7c2f338af11430818db3e1bf879f6fe6c4cc4e1ff128d28de4faa7d572a0c62a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|
Release files / scrapy_settings_log-1.4.0-py3-none-any.whl
| Download URL | scrapy_settings_log-1.4.0-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
881bc113cb30226e2d7db961febee48a438eecb4ed42ab49c34b2ede88a929be
|
|
BLAKE2b-256 checksum How to use checksums |
eea6c7b36ab18351ca85ff474212d577c2470b442dd1db5a421b61e29d8e0a27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|