Skip to main content

Scrapy-Redis-BloomFilter

这是个scrapy_redis的布隆过滤器版本,与https://github.com/Python3WebSpider/ScrapyRedisBloomFilter 不同的是,该项目使用redis里的布隆过滤器,而不是使用bit来实现

必要条件

需要redis加载了布隆过滤器的插件,默认安装的redis是没有加载的 具体请看:https://redis.io/docs/stack/bloom/quick_start/

安装

使用pip: pip install scrapy-redis-bf

使用

在scrapy项目里的 settings.py添加如下设置:

SCHEDULER = "scrapy_redis_bf.scheduler.Scheduler"

DUPEFILTER_CLASS = "scrapy_redis_bf.dupefilter.RFPDupeFilter"
# 默认是通过spider的name来创建redis key
SCHEDULER_DUPEFILTER_ATTR = "name"

# 格式:redis://[:password@]host[:port][/database][?[timeout=timeout[d|h|m|s|ms|us|ns]][&database=database]]
REDIS_URL = 'redis://localhost:6379'
# 错误率
BLOOMFILTER_ERRORRATE = 0.001
# 去重量
BLOOMFILTER_CAPACITY = 10000

测试

下载该项目,然后运行里面的test spider即可

Github

https://github.com/kanadeblisst/scrapy_redis_bf

Metadata

Release files for scrapy-redis-bf 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapy-redis-bf 0.1.2
File Size Uploaded Provenance Actions
scrapy_redis_bf-0.1.2.tar.gz 6.3 kB Without provenance Details for scrapy_redis_bf-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scrapy-redis-bf 0.1.2
File Interpreter ABI Platform Actions
scrapy_redis_bf-0.1.2-py3-none-any.whl Python 3 none any Details for scrapy_redis_bf-0.1.2-py3-none-any.whl

Total release size: 13.8 kB

Release files / scrapy_redis_bf-0.1.2.tar.gz

Download URL scrapy_redis_bf-0.1.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
36ff938f7378195fadeff7f4fb4e19caff7cc9f39fc1a1a30593b0d7822d682c
BLAKE2b-256 checksum
How to use checksums
ebbd9803bdaf6865d6a5cfd3fcc0690148bfff0d06dd9cdcd6de1f496983a77f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / scrapy_redis_bf-0.1.2-py3-none-any.whl

Download URL scrapy_redis_bf-0.1.2-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de56aea8da64a955c03303b3f5fc468823724a1a2eedc92b75706e42b09188ea
BLAKE2b-256 checksum
How to use checksums
01d544b7e6cf67c2c140ee17330343caa4751bbb39be36fb31afcb8ca9e96589
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for scrapy-redis-bf 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page