Skip to main content

No project description provided

Project description

CrawLsy-Spider

简介

CrawLsy-Spider 是一个基于 Redis 的分布式任务系统,旨在极度简化任务的提交和管理。

安装

  1. 确保已安装 Python 3.9 或更高版本。
  2. 安装依赖库:
pip install crawlsy-spider

使用方法

task.py 中编写任务逻辑

import requests

def task_func(url):
    return requests.get(url).text

produce.py 提交任务

from crawlsy_spider import CrawLsy

from task import task_func  # 导入test函数

with CrawLsy(
        name="test",
        host="127.0.0.1",
        db=0,
        password="test",
    ) as craw:
    job_id = craw.put(task_func, 'https://baidu.com')

工作节点部署

python consumers.py

运行生产节点

由于框架是生产消费分离模式,所以在多服务器(集群中启动 worker),此时服务并不能运行,还需要在新启动一个节点用来启动生产服务

python producer.py

开源协议

GNU General Public License v2.0

Crawlsy 是自由软件,您可以根据自由软件基金会发布的 GNU 通用公共许可证(版本 2)的条款重新分发或修改它。

发布此程序是希望它有用,但不提供任何保证;甚至没有对适销性或特定用途适用性的暗示保证。有关更多详细信息,请参阅 GNU 通用公共许可证。

您应该已经收到了 GNU 通用公共许可证的副本;如果没有,请参阅 http://www.gnu.org/licenses/

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

crawlsy_spider-0.1.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crawlsy_spider-0.1.3-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file crawlsy_spider-0.1.3.tar.gz.

File metadata

  • Download URL: crawlsy_spider-0.1.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.21 Linux/6.8.0-1020-azure

File hashes

Hashes for crawlsy_spider-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c0043d751c5414cc2c73482ccf5b483f971f07b2ce8a5fe47072d3c607e88a3f
MD5 607e7989f5b0a8ef5823251571441892
BLAKE2b-256 98737e791cb1d56300f4ac3b0eae3c317e353a75000dba1c0261f93b7e53894b

See more details on using hashes here.

File details

Details for the file crawlsy_spider-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: crawlsy_spider-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.21 Linux/6.8.0-1020-azure

File hashes

Hashes for crawlsy_spider-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 256eeb8c2122a5e6e3daf3442c9c4431754a11d863322dec05ab14214e6525da
MD5 57583729523a4ac944fdb47d3dd2a1ef
BLAKE2b-256 86122485b9f20ae4b11da77ec60b3fc628b5bb3bee88df1c6ae6854de41e70d9

See more details on using hashes here.

Supported by

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