Skip to main content

quickly build your crawler

Project description

license prs issues release

简介

Bricks 旨在将爬虫开发变得像搭建积木一样简单而有趣。这个框架的核心理念是提供一个直观、高效的方式来构建复杂的网络爬虫,同时保持代码的简洁和可维护性。无论您是刚入门的新手还是经验丰富的专家,Bricks 都能让您轻松地搭建起强大的爬虫,满足从简单数据抓取到复杂网络爬取的各种需求。

通过精心设计的接口和模块化的结构,Bricks 使得组合、扩展和维护爬虫变得前所未有的容易。您可以像搭积木一样,快速组合出适合您需求的爬虫结构,无需深入底层细节,同时也能享受到定制化和控制的乐趣。使用 Bricks,您将体验到无与伦比的开发效率和灵活性,让爬虫开发不再是一件费时费力的任务。

特性

Bricks 拥有以下特性

  • 基于事件触发的可拓展爬虫:在定义好自己爬虫主体逻辑的情况下,可以不修改核心代码,在请求前后,存储前后等多个事件接口进行拓展,让爬虫流程更加清晰,且插槽也可拓展
  • 爬虫基类丰富:内置纯代码开发的 air 爬虫、流程化自定义配置式的 form 爬虫、固定流程配置式的 template 爬虫
  • 丰富的解析器:包括 json / xpath / jsonpath / regex / 自定义,简单解析 0 代码
  • 丰富的下载器:目前内置的下载器为 curl-cffi ,并且还有可选的 requests / requests-go / pycurl / Playwright / dp / httpx / tls_client, 且开发者可以根据规范自己定制拓展
  • 灵活的调度器:调度器支持处理同步任务和异步任务,并且支持根据当前任务数量自动调节 Worker 数量(可伸缩线程池)
  • 多种任务队列:内置 LocalRedis 两种任务队列,以便应用单机和分布式爬虫,且开发者可以根据规范自己定制拓展
  • 爬虫API化:内置rpclistener 模式,可以将爬虫一键转化为可远程调用的 api,方便外部调用

安装

安装最新代码

pip install -U git+https://github.com/KKKKKKKEM/bricks.git

安装正式版

pip install -U bricks-py

安装测试版

# beta 版本全部都发布在 test.pypi.org
pip install -i https://test.pypi.org/simple/ -U bricks-py

使用文档

具体文档请查看 Bricks Docs

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

bricks_py-0.0.29.tar.gz (137.4 kB view details)

Uploaded Source

Built Distribution

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

bricks_py-0.0.29-py3-none-any.whl (180.9 kB view details)

Uploaded Python 3

File details

Details for the file bricks_py-0.0.29.tar.gz.

File metadata

  • Download URL: bricks_py-0.0.29.tar.gz
  • Upload date:
  • Size: 137.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for bricks_py-0.0.29.tar.gz
Algorithm Hash digest
SHA256 29e35a3eb69b238523804093e2d1f0a4581b254d75321ff9489c949acd2cc9ce
MD5 aa1b304021b4a1ce71d2e48bb095ffad
BLAKE2b-256 d6564a67d9da0943cf6ff26dd050f217853fe9ee8d4f299e6f03ae3a59385842

See more details on using hashes here.

File details

Details for the file bricks_py-0.0.29-py3-none-any.whl.

File metadata

  • Download URL: bricks_py-0.0.29-py3-none-any.whl
  • Upload date:
  • Size: 180.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for bricks_py-0.0.29-py3-none-any.whl
Algorithm Hash digest
SHA256 41f8719a2b6639b26194c73ebbd6bab891d3a780d01efef7af469c265d7225f5
MD5 95573c7a7767e3d154c0d1d7ead3e20b
BLAKE2b-256 d8fa4252b8a1a2efa1b880c2cd026e6a6697af8bc543e6d143957b59ea85fb3a

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