Metadata-Version: 2.1
Name: gzspidertools
Version: 0.0.22
Summary: 魔改使用工具库
Keywords: crawler,scraping,scrapy-extension
Author: George
Author-email: persistencehoo@gmail.com
Maintainer: George
Maintainer-email: persistencehoo@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Provides-Extra: all
Provides-Extra: database
Requires-Dist: DBUtils (>=3.0.2,<4.0.0)
Requires-Dist: Pillow (>=9.2.0,<10.0.0) ; extra == "all"
Requires-Dist: PyMySQL (>=1.0.2,<2.0.0)
Requires-Dist: SQLAlchemy (>=2.0.23,<3.0.0)
Requires-Dist: Scrapy (==2.12.0)
Requires-Dist: aiohttp (>=3.10.6,<3.11.0)
Requires-Dist: aiomysql (>=0.1.1,<0.2.0)
Requires-Dist: elasticsearch-dsl (>=8.11.0,<9.0.0) ; extra == "all" or extra == "database"
Requires-Dist: itemadapter (>=0.7.0,<0.8.0)
Requires-Dist: kafka-python (==2.0.2)
Requires-Dist: loguru (>=0.7.0,<0.8.0)
Requires-Dist: mmh3 (>=3.0.0,<4.0.0) ; extra == "all"
Requires-Dist: motor (>=3.5.1,<3.6.0)
Requires-Dist: numpy (>=1.26.0,<1.27.0) ; extra == "all"
Requires-Dist: opencv-python (>=4.8.0.74,<4.9.0.0) ; extra == "all"
Requires-Dist: oracledb (>=1.4.2,<2.0.0) ; extra == "all" or extra == "database"
Requires-Dist: oss2 (>=2.18.4,<3.0.0) ; extra == "all"
Requires-Dist: pika (>=1.3.2,<1.4.0)
Requires-Dist: psycopg[binary,pool] (<=3.1.13) ; extra == "all" or extra == "database"
Requires-Dist: pycryptodome (>=3.15.0,<4.0.0) ; extra == "all"
Requires-Dist: python-hcl2 (>=4.3.0,<5.0.0) ; extra == "all"
Requires-Dist: pyyaml (>=6.0,<6.1) ; extra == "all"
Requires-Dist: retrying (>=1.3.3,<2.0.0)
Description-Content-Type: text/markdown

安装
====

   可以直接输入以下命令：

.. code:: bash

   pip install gzspidertools

-------------------------------

   可选安装1，安装数据库相关的所有依赖：

.. code:: bash

   pip install gzspidertools[database]

-----------------------------------------

   可选安装2，通过以下命令安装所有依赖：

.. code:: bash

   pip install gzspidertools[all]

注：详细的安装介绍请查看 `安装指南`_。

用法
====

   开发人员只需根据命令生成示例模板，再配置相关设置即可。


用法
::

   # 查看库版本
   gzcmd version

   # 创建项目
   gzcmd startproject <project_name>

   # 进入项目根目录
   cd <project_name>

   # 替换(覆盖)为真实的配置 .conf 文件：
   # 这里是为了演示方便，正常情况是直接在 VIT 中的 .conf 文件填上你需要的配置即可
   cp /root/mytemp/.conf DemoSpider/VIT/.conf

   # 生成爬虫脚本
   gzcmd genspider <spider_name> <example.com>

   # 运行脚本
   scrapy crawl <spider_name>
   # 注：也可以使用 gzcmd crawl <spider_name>


跑通测试
=======

前提：需要在 tests 的 VIT 目录下创建 .conf 文件，已给出示例文件，请填写测试所需内容，然后：

- 可以直接使用 tox 来运行测试。
- 本库以 `poetry`_ 开发，那么直接新环境下运行 poetry install 后，手动运行目标测试或 pytest 命令来测\
  试等皆可。
- 也可以使用 make 工具，make start 然后 make test 即可。

