Skip to main content

scrapy_redis use bloomfilter

Project description

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_bloomfilter.scheduler.Scheduler"

DUPEFILTER_CLASS = "scrapy_redis_bloomfilter.dupefilter.RFPDupeFilter"

# 格式: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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapy_redis_bf-0.0.8.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

scrapy_redis_bf-0.0.8-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file scrapy_redis_bf-0.0.8.tar.gz.

File metadata

  • Download URL: scrapy_redis_bf-0.0.8.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for scrapy_redis_bf-0.0.8.tar.gz
Algorithm Hash digest
SHA256 e737c5c3f73fae121d31ac8c148dbdc170dda1039d6c19bc667594a52bf01daa
MD5 206cb188add2a1234874d21789fe4cf5
BLAKE2b-256 7a56c279e8e57235156598c2ca9bcbf0e634d43713aa6837b4e140fceb8830d6

See more details on using hashes here.

File details

Details for the file scrapy_redis_bf-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for scrapy_redis_bf-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0c82f4c50ceaf622e67c5db5fd323d51d61acec58b9c4717eeb17b2405ef1ce0
MD5 a6fcd6d8f2468bd36b195b648872411a
BLAKE2b-256 f50eab58146a273a32dd9c02f7f6202d048b40e0e502004b86f01d4fab2a4a5c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page