scrapy-redis-bf


Namescrapy-redis-bf JSON
Version 0.1.2 PyPI version JSON
download
home_page
Summaryscrapy_redis use bloomfilter
upload_time2023-03-28 03:40:31
maintainer
docs_urlNone
author
requires_python>=3.7
licenseCopyright (c) 2018 The Python Packaging Authority Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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`添加如下设置:

```python
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


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "scrapy-redis-bf",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "kanade <kanade@blisst.cn>",
    "download_url": "https://files.pythonhosted.org/packages/eb/bd/9803bdaf6865d6a5cfd3fcc0690148bfff0d06dd9cdcd6de1f496983a77f/scrapy_redis_bf-0.1.2.tar.gz",
    "platform": null,
    "description": "# Scrapy-Redis-BloomFilter\n\n\u8fd9\u662f\u4e2ascrapy_redis\u7684\u5e03\u9686\u8fc7\u6ee4\u5668\u7248\u672c\uff0c\u4e0e`https://github.com/Python3WebSpider/ScrapyRedisBloomFilter` \n\u4e0d\u540c\u7684\u662f\uff0c\u8be5\u9879\u76ee\u4f7f\u7528redis\u91cc\u7684\u5e03\u9686\u8fc7\u6ee4\u5668\uff0c\u800c\u4e0d\u662f\u4f7f\u7528bit\u6765\u5b9e\u73b0\n\n## \u5fc5\u8981\u6761\u4ef6\n\n\u9700\u8981redis\u52a0\u8f7d\u4e86\u5e03\u9686\u8fc7\u6ee4\u5668\u7684\u63d2\u4ef6\uff0c\u9ed8\u8ba4\u5b89\u88c5\u7684redis\u662f\u6ca1\u6709\u52a0\u8f7d\u7684\n\u5177\u4f53\u8bf7\u770b\uff1ahttps://redis.io/docs/stack/bloom/quick_start/\n\n\n## \u5b89\u88c5\n\n\u4f7f\u7528pip: `pip install scrapy-redis-bf`\n\n## \u4f7f\u7528\n\n\u5728scrapy\u9879\u76ee\u91cc\u7684 `settings.py`\u6dfb\u52a0\u5982\u4e0b\u8bbe\u7f6e:\n\n```python\nSCHEDULER = \"scrapy_redis_bf.scheduler.Scheduler\"\n\nDUPEFILTER_CLASS = \"scrapy_redis_bf.dupefilter.RFPDupeFilter\"\n# \u9ed8\u8ba4\u662f\u901a\u8fc7spider\u7684name\u6765\u521b\u5efaredis key\nSCHEDULER_DUPEFILTER_ATTR = \"name\"\n\n# \u683c\u5f0f\uff1aredis://[:password@]host[:port][/database][?[timeout=timeout[d|h|m|s|ms|us|ns]][&database=database]]\nREDIS_URL = 'redis://localhost:6379'\n# \u9519\u8bef\u7387\nBLOOMFILTER_ERRORRATE = 0.001\n# \u53bb\u91cd\u91cf\nBLOOMFILTER_CAPACITY = 10000\n\n\n```\n\n## \u6d4b\u8bd5\n\n\u4e0b\u8f7d\u8be5\u9879\u76ee\uff0c\u7136\u540e\u8fd0\u884c\u91cc\u9762\u7684test spider\u5373\u53ef\n\n## Github\n\nhttps://github.com/kanadeblisst/scrapy_redis_bf\n\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2018 The Python Packaging Authority  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "scrapy_redis use bloomfilter",
    "version": "0.1.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "01d544b7e6cf67c2c140ee17330343caa4751bbb39be36fb31afcb8ca9e96589",
                "md5": "a4d220e3f7b70750f29e7fd36c2ef9e4",
                "sha256": "de56aea8da64a955c03303b3f5fc468823724a1a2eedc92b75706e42b09188ea"
            },
            "downloads": -1,
            "filename": "scrapy_redis_bf-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a4d220e3f7b70750f29e7fd36c2ef9e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7457,
            "upload_time": "2023-03-28T03:40:27",
            "upload_time_iso_8601": "2023-03-28T03:40:27.019295Z",
            "url": "https://files.pythonhosted.org/packages/01/d5/44b7e6cf67c2c140ee17330343caa4751bbb39be36fb31afcb8ca9e96589/scrapy_redis_bf-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ebbd9803bdaf6865d6a5cfd3fcc0690148bfff0d06dd9cdcd6de1f496983a77f",
                "md5": "984c4aa20a9a0db861604c0cbcf34d9c",
                "sha256": "36ff938f7378195fadeff7f4fb4e19caff7cc9f39fc1a1a30593b0d7822d682c"
            },
            "downloads": -1,
            "filename": "scrapy_redis_bf-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "984c4aa20a9a0db861604c0cbcf34d9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6311,
            "upload_time": "2023-03-28T03:40:31",
            "upload_time_iso_8601": "2023-03-28T03:40:31.223401Z",
            "url": "https://files.pythonhosted.org/packages/eb/bd/9803bdaf6865d6a5cfd3fcc0690148bfff0d06dd9cdcd6de1f496983a77f/scrapy_redis_bf-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-28 03:40:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "scrapy-redis-bf"
}
        
Elapsed time: 0.08781s