rb-spider 0.8.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. rb_spider-0.8.6/.gitignore +33 -0
  2. rb_spider-0.8.6/LICENSE +21 -0
  3. rb_spider-0.8.6/PKG-INFO +116 -0
  4. rb_spider-0.8.6/README.md +69 -0
  5. rb_spider-0.8.6/pyproject.toml +233 -0
  6. rb_spider-0.8.6/src/rb_spider/__init__.py +1 -0
  7. rb_spider-0.8.6/src/rb_spider/__main__.py +5 -0
  8. rb_spider-0.8.6/src/rb_spider/_distribution.py +24 -0
  9. rb_spider-0.8.6/src/rb_spider/cli.py +132 -0
  10. rb_spider-0.8.6/src/rb_spider/commands/__init__.py +1 -0
  11. rb_spider-0.8.6/src/rb_spider/commands/auth.py +84 -0
  12. rb_spider-0.8.6/src/rb_spider/commands/compare.py +105 -0
  13. rb_spider-0.8.6/src/rb_spider/commands/config.py +173 -0
  14. rb_spider-0.8.6/src/rb_spider/commands/crawl.py +184 -0
  15. rb_spider-0.8.6/src/rb_spider/commands/crawls.py +219 -0
  16. rb_spider-0.8.6/src/rb_spider/commands/custom.py +53 -0
  17. rb_spider-0.8.6/src/rb_spider/commands/db.py +162 -0
  18. rb_spider-0.8.6/src/rb_spider/commands/describe.py +42 -0
  19. rb_spider-0.8.6/src/rb_spider/commands/doctor.py +163 -0
  20. rb_spider-0.8.6/src/rb_spider/commands/duplicates.py +64 -0
  21. rb_spider-0.8.6/src/rb_spider/commands/enrich.py +63 -0
  22. rb_spider-0.8.6/src/rb_spider/commands/export.py +277 -0
  23. rb_spider-0.8.6/src/rb_spider/commands/fetch.py +126 -0
  24. rb_spider-0.8.6/src/rb_spider/commands/fingerprints.py +208 -0
  25. rb_spider-0.8.6/src/rb_spider/commands/hreflang.py +51 -0
  26. rb_spider-0.8.6/src/rb_spider/commands/init.py +55 -0
  27. rb_spider-0.8.6/src/rb_spider/commands/insecure.py +35 -0
  28. rb_spider-0.8.6/src/rb_spider/commands/issues.py +114 -0
  29. rb_spider-0.8.6/src/rb_spider/commands/lighthouse.py +126 -0
  30. rb_spider-0.8.6/src/rb_spider/commands/link_score.py +39 -0
  31. rb_spider-0.8.6/src/rb_spider/commands/links.py +60 -0
  32. rb_spider-0.8.6/src/rb_spider/commands/login.py +78 -0
  33. rb_spider-0.8.6/src/rb_spider/commands/options.py +87 -0
  34. rb_spider-0.8.6/src/rb_spider/commands/pagination.py +45 -0
  35. rb_spider-0.8.6/src/rb_spider/commands/profiles.py +120 -0
  36. rb_spider-0.8.6/src/rb_spider/commands/project.py +55 -0
  37. rb_spider-0.8.6/src/rb_spider/commands/projects.py +64 -0
  38. rb_spider-0.8.6/src/rb_spider/commands/redirects.py +67 -0
  39. rb_spider-0.8.6/src/rb_spider/commands/report.py +339 -0
  40. rb_spider-0.8.6/src/rb_spider/commands/serp.py +71 -0
  41. rb_spider-0.8.6/src/rb_spider/commands/sitemaps.py +107 -0
  42. rb_spider-0.8.6/src/rb_spider/commands/skill.py +139 -0
  43. rb_spider-0.8.6/src/rb_spider/commands/source.py +45 -0
  44. rb_spider-0.8.6/src/rb_spider/commands/status.py +57 -0
  45. rb_spider-0.8.6/src/rb_spider/commands/structured.py +51 -0
  46. rb_spider-0.8.6/src/rb_spider/core/__init__.py +1 -0
  47. rb_spider-0.8.6/src/rb_spider/core/compare.py +224 -0
  48. rb_spider-0.8.6/src/rb_spider/core/content.py +118 -0
  49. rb_spider-0.8.6/src/rb_spider/core/crawl.py +971 -0
  50. rb_spider-0.8.6/src/rb_spider/core/custom.py +174 -0
  51. rb_spider-0.8.6/src/rb_spider/core/custom_report.py +52 -0
  52. rb_spider-0.8.6/src/rb_spider/core/data_files.py +26 -0
  53. rb_spider-0.8.6/src/rb_spider/core/db.py +434 -0
  54. rb_spider-0.8.6/src/rb_spider/core/deps.py +165 -0
  55. rb_spider-0.8.6/src/rb_spider/core/duplicates.py +168 -0
  56. rb_spider-0.8.6/src/rb_spider/core/encoding.py +66 -0
  57. rb_spider-0.8.6/src/rb_spider/core/enrich.py +172 -0
  58. rb_spider-0.8.6/src/rb_spider/core/errors.py +340 -0
  59. rb_spider-0.8.6/src/rb_spider/core/export.py +578 -0
  60. rb_spider-0.8.6/src/rb_spider/core/extract.py +695 -0
  61. rb_spider-0.8.6/src/rb_spider/core/fetch.py +413 -0
  62. rb_spider-0.8.6/src/rb_spider/core/fetch_store.py +258 -0
  63. rb_spider-0.8.6/src/rb_spider/core/fingerprint.py +463 -0
  64. rb_spider-0.8.6/src/rb_spider/core/hreflang.py +124 -0
  65. rb_spider-0.8.6/src/rb_spider/core/issues.py +1497 -0
  66. rb_spider-0.8.6/src/rb_spider/core/lighthouse.py +398 -0
  67. rb_spider-0.8.6/src/rb_spider/core/link_score.py +118 -0
  68. rb_spider-0.8.6/src/rb_spider/core/maintenance.py +286 -0
  69. rb_spider-0.8.6/src/rb_spider/core/markdown.py +157 -0
  70. rb_spider-0.8.6/src/rb_spider/core/models.py +25 -0
  71. rb_spider-0.8.6/src/rb_spider/core/normalize.py +52 -0
  72. rb_spider-0.8.6/src/rb_spider/core/opencli.py +285 -0
  73. rb_spider-0.8.6/src/rb_spider/core/overview.py +89 -0
  74. rb_spider-0.8.6/src/rb_spider/core/pagination.py +108 -0
  75. rb_spider-0.8.6/src/rb_spider/core/proxy.py +557 -0
  76. rb_spider-0.8.6/src/rb_spider/core/proxy_state.py +110 -0
  77. rb_spider-0.8.6/src/rb_spider/core/queue.py +96 -0
  78. rb_spider-0.8.6/src/rb_spider/core/redirects.py +98 -0
  79. rb_spider-0.8.6/src/rb_spider/core/render.py +391 -0
  80. rb_spider-0.8.6/src/rb_spider/core/reports.py +287 -0
  81. rb_spider-0.8.6/src/rb_spider/core/scope.py +387 -0
  82. rb_spider-0.8.6/src/rb_spider/core/security.py +54 -0
  83. rb_spider-0.8.6/src/rb_spider/core/serp.py +112 -0
  84. rb_spider-0.8.6/src/rb_spider/core/services.py +89 -0
  85. rb_spider-0.8.6/src/rb_spider/core/settings.py +1265 -0
  86. rb_spider-0.8.6/src/rb_spider/core/sitemaps.py +219 -0
  87. rb_spider-0.8.6/src/rb_spider/core/skills.py +64 -0
  88. rb_spider-0.8.6/src/rb_spider/core/source.py +36 -0
  89. rb_spider-0.8.6/src/rb_spider/core/sqltext.py +9 -0
  90. rb_spider-0.8.6/src/rb_spider/core/storage.py +686 -0
  91. rb_spider-0.8.6/src/rb_spider/core/structured.py +315 -0
  92. rb_spider-0.8.6/src/rb_spider/core/tables.py +543 -0
  93. rb_spider-0.8.6/src/rb_spider/core/version.py +94 -0
  94. rb_spider-0.8.6/src/rb_spider/credentials/__init__.py +1 -0
  95. rb_spider-0.8.6/src/rb_spider/credentials/health.py +181 -0
  96. rb_spider-0.8.6/src/rb_spider/credentials/manager.py +119 -0
  97. rb_spider-0.8.6/src/rb_spider/data/SKILL.md +127 -0
  98. rb_spider-0.8.6/src/rb_spider/data/__init__.py +1 -0
  99. rb_spider-0.8.6/src/rb_spider/data/arial_widths.json +1 -0
  100. rb_spider-0.8.6/src/rb_spider/data/profiles/big-shop.toml +12 -0
  101. rb_spider-0.8.6/src/rb_spider/data/profiles/broken-links.toml +9 -0
  102. rb_spider-0.8.6/src/rb_spider/data/profiles/default.toml +1 -0
  103. rb_spider-0.8.6/src/rb_spider/data/profiles/fast.toml +5 -0
  104. rb_spider-0.8.6/src/rb_spider/data/profiles/googlebot.toml +5 -0
  105. rb_spider-0.8.6/src/rb_spider/data/profiles/js-site.toml +8 -0
  106. rb_spider-0.8.6/src/rb_spider/data/profiles/migration.toml +17 -0
  107. rb_spider-0.8.6/src/rb_spider/data/profiles/quick-audit.toml +17 -0
  108. rb_spider-0.8.6/src/rb_spider/data/profiles/yandexbot.toml +5 -0
  109. rb_spider-0.8.6/src/rb_spider/data/schemaorg.json +1 -0
  110. rb_spider-0.8.6/src/rb_spider/fetch.py +21 -0
  111. rb_spider-0.8.6/src/rb_spider/migrations/__init__.py +1 -0
  112. rb_spider-0.8.6/src/rb_spider/migrations/env.py +34 -0
  113. rb_spider-0.8.6/src/rb_spider/migrations/pg_baseline.py +53 -0
  114. rb_spider-0.8.6/src/rb_spider/migrations/script.py.mako +22 -0
  115. rb_spider-0.8.6/src/rb_spider/migrations/versions/0001_initial.py +50 -0
  116. rb_spider-0.8.6/src/rb_spider/migrations/versions/0002_issues.py +37 -0
  117. rb_spider-0.8.6/src/rb_spider/migrations/versions/0003_crawl_settings.py +23 -0
  118. rb_spider-0.8.6/src/rb_spider/migrations/versions/0004_onpage.py +40 -0
  119. rb_spider-0.8.6/src/rb_spider/migrations/versions/0005_directives_canonical.py +39 -0
  120. rb_spider-0.8.6/src/rb_spider/migrations/versions/0006_content.py +29 -0
  121. rb_spider-0.8.6/src/rb_spider/migrations/versions/0007_links.py +51 -0
  122. rb_spider-0.8.6/src/rb_spider/migrations/versions/0008_resources.py +25 -0
  123. rb_spider-0.8.6/src/rb_spider/migrations/versions/0009_frontier.py +34 -0
  124. rb_spider-0.8.6/src/rb_spider/migrations/versions/0010_rendered.py +23 -0
  125. rb_spider-0.8.6/src/rb_spider/migrations/versions/0011_url_metrics.py +29 -0
  126. rb_spider-0.8.6/src/rb_spider/migrations/versions/0012_response_details.py +27 -0
  127. rb_spider-0.8.6/src/rb_spider/migrations/versions/0013_link_counts.py +27 -0
  128. rb_spider-0.8.6/src/rb_spider/migrations/versions/0014_url_ids.py +85 -0
  129. rb_spider-0.8.6/src/rb_spider/migrations/versions/0015_url_checks.py +37 -0
  130. rb_spider-0.8.6/src/rb_spider/migrations/versions/0016_hreflang.py +38 -0
  131. rb_spider-0.8.6/src/rb_spider/migrations/versions/0017_pagination.py +24 -0
  132. rb_spider-0.8.6/src/rb_spider/migrations/versions/0018_security.py +31 -0
  133. rb_spider-0.8.6/src/rb_spider/migrations/versions/0019_content_measures.py +35 -0
  134. rb_spider-0.8.6/src/rb_spider/migrations/versions/0020_structured_data.py +35 -0
  135. rb_spider-0.8.6/src/rb_spider/migrations/versions/0021_sitemaps.py +39 -0
  136. rb_spider-0.8.6/src/rb_spider/migrations/versions/0022_serp_pixels.py +23 -0
  137. rb_spider-0.8.6/src/rb_spider/migrations/versions/0023_validation_mobile.py +36 -0
  138. rb_spider-0.8.6/src/rb_spider/migrations/versions/0024_crawl_limits.py +21 -0
  139. rb_spider-0.8.6/src/rb_spider/migrations/versions/0025_custom.py +50 -0
  140. rb_spider-0.8.6/src/rb_spider/migrations/versions/0026_exports.py +42 -0
  141. rb_spider-0.8.6/src/rb_spider/migrations/versions/0027_javascript.py +70 -0
  142. rb_spider-0.8.6/src/rb_spider/migrations/versions/0028_image_sizes.py +60 -0
  143. rb_spider-0.8.6/src/rb_spider/migrations/versions/0029_link_score.py +21 -0
  144. rb_spider-0.8.6/src/rb_spider/migrations/versions/0030_screenshots.py +21 -0
  145. rb_spider-0.8.6/src/rb_spider/migrations/versions/0031_lighthouse.py +33 -0
  146. rb_spider-0.8.6/src/rb_spider/migrations/versions/0032_lighthouse_source.py +22 -0
  147. rb_spider-0.8.6/src/rb_spider/migrations/versions/0033_spider_prefix.py +101 -0
  148. rb_spider-0.8.6/src/rb_spider/migrations/versions/0034_v1_views.py +41 -0
  149. rb_spider-0.8.6/src/rb_spider/migrations/versions/0035_shared_keys.py +86 -0
  150. rb_spider-0.8.6/src/rb_spider/migrations/versions/0036_fetch_storage.py +46 -0
  151. rb_spider-0.8.6/src/rb_spider/migrations/versions/__init__.py +0 -0
  152. rb_spider-0.8.6/src/rb_spider/output/__init__.py +289 -0
  153. rb_spider-0.8.6/src/rb_spider/output/human.py +693 -0
  154. rb_spider-0.8.6/src/rb_spider/output/json.py +11 -0
  155. rb_spider-0.8.6/src/rb_spider/providers/__init__.py +29 -0
  156. rb_spider-0.8.6/src/rb_spider/providers/base.py +137 -0
  157. rb_spider-0.8.6/src/rb_spider/providers/http.py +125 -0
  158. rb_spider-0.8.6/src/rb_spider/providers/secrets.py +116 -0
  159. rb_spider-0.8.6/tests/__init__.py +1 -0
  160. rb_spider-0.8.6/tests/conftest.py +174 -0
  161. rb_spider-0.8.6/tests/contracts/fixtures.yaml +11 -0
  162. rb_spider-0.8.6/tests/contracts/schema.json +89 -0
  163. rb_spider-0.8.6/tests/contracts/tools-catalog/spider.yaml +20 -0
  164. rb_spider-0.8.6/tests/data/contracts/windmill-serp.yaml +106 -0
  165. rb_spider-0.8.6/tests/data/opencli.schema.json +350 -0
  166. rb_spider-0.8.6/tests/fake_lighthouse.py +22 -0
  167. rb_spider-0.8.6/tests/help_allowlist.txt +50 -0
  168. rb_spider-0.8.6/tests/polygon.py +1406 -0
  169. rb_spider-0.8.6/tests/snapshots/describe.json +9334 -0
  170. rb_spider-0.8.6/tests/snapshots/help/analyze.txt +30 -0
  171. rb_spider-0.8.6/tests/snapshots/help/auth-login.txt +30 -0
  172. rb_spider-0.8.6/tests/snapshots/help/auth-logout.txt +21 -0
  173. rb_spider-0.8.6/tests/snapshots/help/auth-status.txt +39 -0
  174. rb_spider-0.8.6/tests/snapshots/help/auth.txt +15 -0
  175. rb_spider-0.8.6/tests/snapshots/help/compare.txt +64 -0
  176. rb_spider-0.8.6/tests/snapshots/help/config-get.txt +20 -0
  177. rb_spider-0.8.6/tests/snapshots/help/config-list.txt +18 -0
  178. rb_spider-0.8.6/tests/snapshots/help/config-schema.txt +17 -0
  179. rb_spider-0.8.6/tests/snapshots/help/config-set.txt +26 -0
  180. rb_spider-0.8.6/tests/snapshots/help/config-show.txt +27 -0
  181. rb_spider-0.8.6/tests/snapshots/help/config-validate.txt +20 -0
  182. rb_spider-0.8.6/tests/snapshots/help/config.txt +18 -0
  183. rb_spider-0.8.6/tests/snapshots/help/crawl.txt +120 -0
  184. rb_spider-0.8.6/tests/snapshots/help/crawls-delete.txt +32 -0
  185. rb_spider-0.8.6/tests/snapshots/help/crawls-list.txt +19 -0
  186. rb_spider-0.8.6/tests/snapshots/help/crawls-prune.txt +33 -0
  187. rb_spider-0.8.6/tests/snapshots/help/crawls-respider.txt +27 -0
  188. rb_spider-0.8.6/tests/snapshots/help/crawls-resume.txt +28 -0
  189. rb_spider-0.8.6/tests/snapshots/help/crawls-show.txt +23 -0
  190. rb_spider-0.8.6/tests/snapshots/help/crawls.txt +18 -0
  191. rb_spider-0.8.6/tests/snapshots/help/custom.txt +36 -0
  192. rb_spider-0.8.6/tests/snapshots/help/db-import-sqlite.txt +27 -0
  193. rb_spider-0.8.6/tests/snapshots/help/db-info.txt +31 -0
  194. rb_spider-0.8.6/tests/snapshots/help/db-migrate.txt +15 -0
  195. rb_spider-0.8.6/tests/snapshots/help/db-upgrade.txt +24 -0
  196. rb_spider-0.8.6/tests/snapshots/help/db-vacuum.txt +24 -0
  197. rb_spider-0.8.6/tests/snapshots/help/db.txt +15 -0
  198. rb_spider-0.8.6/tests/snapshots/help/describe.txt +26 -0
  199. rb_spider-0.8.6/tests/snapshots/help/doctor.txt +39 -0
  200. rb_spider-0.8.6/tests/snapshots/help/duplicates.txt +41 -0
  201. rb_spider-0.8.6/tests/snapshots/help/enrich.txt +29 -0
  202. rb_spider-0.8.6/tests/snapshots/help/enrichers.txt +22 -0
  203. rb_spider-0.8.6/tests/snapshots/help/export.txt +69 -0
  204. rb_spider-0.8.6/tests/snapshots/help/fetch.txt +84 -0
  205. rb_spider-0.8.6/tests/snapshots/help/fingerprints-add.txt +26 -0
  206. rb_spider-0.8.6/tests/snapshots/help/fingerprints-check.txt +37 -0
  207. rb_spider-0.8.6/tests/snapshots/help/fingerprints-list.txt +19 -0
  208. rb_spider-0.8.6/tests/snapshots/help/fingerprints-new.txt +38 -0
  209. rb_spider-0.8.6/tests/snapshots/help/fingerprints-show.txt +25 -0
  210. rb_spider-0.8.6/tests/snapshots/help/fingerprints.txt +17 -0
  211. rb_spider-0.8.6/tests/snapshots/help/hreflang.txt +42 -0
  212. rb_spider-0.8.6/tests/snapshots/help/init.txt +23 -0
  213. rb_spider-0.8.6/tests/snapshots/help/insecure.txt +27 -0
  214. rb_spider-0.8.6/tests/snapshots/help/issues.txt +34 -0
  215. rb_spider-0.8.6/tests/snapshots/help/lighthouse.txt +63 -0
  216. rb_spider-0.8.6/tests/snapshots/help/link-score.txt +33 -0
  217. rb_spider-0.8.6/tests/snapshots/help/links.txt +35 -0
  218. rb_spider-0.8.6/tests/snapshots/help/overview.txt +36 -0
  219. rb_spider-0.8.6/tests/snapshots/help/pagination.txt +32 -0
  220. rb_spider-0.8.6/tests/snapshots/help/profiles-init.txt +31 -0
  221. rb_spider-0.8.6/tests/snapshots/help/profiles-list.txt +21 -0
  222. rb_spider-0.8.6/tests/snapshots/help/profiles-show.txt +21 -0
  223. rb_spider-0.8.6/tests/snapshots/help/profiles.txt +15 -0
  224. rb_spider-0.8.6/tests/snapshots/help/projects-delete.txt +30 -0
  225. rb_spider-0.8.6/tests/snapshots/help/projects-list.txt +19 -0
  226. rb_spider-0.8.6/tests/snapshots/help/projects.txt +13 -0
  227. rb_spider-0.8.6/tests/snapshots/help/query.txt +44 -0
  228. rb_spider-0.8.6/tests/snapshots/help/redirects.txt +45 -0
  229. rb_spider-0.8.6/tests/snapshots/help/report-canonicals.txt +31 -0
  230. rb_spider-0.8.6/tests/snapshots/help/report-crawl-path.txt +25 -0
  231. rb_spider-0.8.6/tests/snapshots/help/report-forms.txt +24 -0
  232. rb_spider-0.8.6/tests/snapshots/help/report-headers.txt +24 -0
  233. rb_spider-0.8.6/tests/snapshots/help/report-javascript.txt +36 -0
  234. rb_spider-0.8.6/tests/snapshots/help/report-meta-keywords.txt +30 -0
  235. rb_spider-0.8.6/tests/snapshots/help/report-pagespeed.txt +36 -0
  236. rb_spider-0.8.6/tests/snapshots/help/report-response-times.txt +25 -0
  237. rb_spider-0.8.6/tests/snapshots/help/report-structure.txt +25 -0
  238. rb_spider-0.8.6/tests/snapshots/help/report.txt +28 -0
  239. rb_spider-0.8.6/tests/snapshots/help/robots-test.txt +35 -0
  240. rb_spider-0.8.6/tests/snapshots/help/serp-preview.txt +32 -0
  241. rb_spider-0.8.6/tests/snapshots/help/serp-summary.txt +28 -0
  242. rb_spider-0.8.6/tests/snapshots/help/serp.txt +13 -0
  243. rb_spider-0.8.6/tests/snapshots/help/sitemaps-build.txt +41 -0
  244. rb_spider-0.8.6/tests/snapshots/help/sitemaps-show.txt +40 -0
  245. rb_spider-0.8.6/tests/snapshots/help/sitemaps.txt +13 -0
  246. rb_spider-0.8.6/tests/snapshots/help/skill-install.txt +22 -0
  247. rb_spider-0.8.6/tests/snapshots/help/skill-list.txt +13 -0
  248. rb_spider-0.8.6/tests/snapshots/help/skill.txt +13 -0
  249. rb_spider-0.8.6/tests/snapshots/help/source.txt +31 -0
  250. rb_spider-0.8.6/tests/snapshots/help/status.txt +27 -0
  251. rb_spider-0.8.6/tests/snapshots/help/structured.txt +33 -0
  252. rb_spider-0.8.6/tests/snapshots/help/url.txt +42 -0
  253. rb_spider-0.8.6/tests/snapshots/help/urls.txt +30 -0
  254. rb_spider-0.8.6/tests/test_auth.py +498 -0
  255. rb_spider-0.8.6/tests/test_cli.py +410 -0
  256. rb_spider-0.8.6/tests/test_compare.py +154 -0
  257. rb_spider-0.8.6/tests/test_content.py +127 -0
  258. rb_spider-0.8.6/tests/test_contract_runner.py +257 -0
  259. rb_spider-0.8.6/tests/test_contracts.py +411 -0
  260. rb_spider-0.8.6/tests/test_crawl.py +302 -0
  261. rb_spider-0.8.6/tests/test_crawl_settings.py +440 -0
  262. rb_spider-0.8.6/tests/test_custom.py +148 -0
  263. rb_spider-0.8.6/tests/test_data_management.py +243 -0
  264. rb_spider-0.8.6/tests/test_db.py +348 -0
  265. rb_spider-0.8.6/tests/test_deps.py +150 -0
  266. rb_spider-0.8.6/tests/test_describe.py +206 -0
  267. rb_spider-0.8.6/tests/test_detach.py +161 -0
  268. rb_spider-0.8.6/tests/test_docs_install.py +32 -0
  269. rb_spider-0.8.6/tests/test_enrich.py +138 -0
  270. rb_spider-0.8.6/tests/test_export.py +210 -0
  271. rb_spider-0.8.6/tests/test_fetch.py +163 -0
  272. rb_spider-0.8.6/tests/test_fetch_store.py +291 -0
  273. rb_spider-0.8.6/tests/test_fingerprint.py +228 -0
  274. rb_spider-0.8.6/tests/test_help.py +495 -0
  275. rb_spider-0.8.6/tests/test_hreflang.py +96 -0
  276. rb_spider-0.8.6/tests/test_http_provider.py +114 -0
  277. rb_spider-0.8.6/tests/test_javascript.py +256 -0
  278. rb_spider-0.8.6/tests/test_keys.py +308 -0
  279. rb_spider-0.8.6/tests/test_lighthouse.py +126 -0
  280. rb_spider-0.8.6/tests/test_link_score.py +57 -0
  281. rb_spider-0.8.6/tests/test_links.py +92 -0
  282. rb_spider-0.8.6/tests/test_list_mode.py +125 -0
  283. rb_spider-0.8.6/tests/test_normalize.py +46 -0
  284. rb_spider-0.8.6/tests/test_pagespeed_insights.py +132 -0
  285. rb_spider-0.8.6/tests/test_pagination.py +85 -0
  286. rb_spider-0.8.6/tests/test_project.py +156 -0
  287. rb_spider-0.8.6/tests/test_providers.py +56 -0
  288. rb_spider-0.8.6/tests/test_proxy.py +639 -0
  289. rb_spider-0.8.6/tests/test_redirects.py +83 -0
  290. rb_spider-0.8.6/tests/test_remote_db.py +86 -0
  291. rb_spider-0.8.6/tests/test_render.py +109 -0
  292. rb_spider-0.8.6/tests/test_reports.py +185 -0
  293. rb_spider-0.8.6/tests/test_resume.py +101 -0
  294. rb_spider-0.8.6/tests/test_scripts.py +54 -0
  295. rb_spider-0.8.6/tests/test_security.py +139 -0
  296. rb_spider-0.8.6/tests/test_serp.py +72 -0
  297. rb_spider-0.8.6/tests/test_services.py +50 -0
  298. rb_spider-0.8.6/tests/test_settings.py +225 -0
  299. rb_spider-0.8.6/tests/test_sitemaps.py +145 -0
  300. rb_spider-0.8.6/tests/test_skills.py +179 -0
  301. rb_spider-0.8.6/tests/test_spider_secrets.py +87 -0
  302. rb_spider-0.8.6/tests/test_structured.py +100 -0
  303. rb_spider-0.8.6/tests/test_validation.py +67 -0
@@ -0,0 +1,33 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .coverage
7
+ htmlcov/
8
+ dist/
9
+ build/
10
+ *.egg-info/
11
+ .env
12
+ .DS_Store
13
+ # локальные данные обходов
14
+ .spider/data/
15
+ *.sqlite
16
+ *.sqlite-wal
17
+ *.sqlite-shm
18
+ storage/
19
+ .python-version
20
+ # локальные настройки Claude Code (разрешения) — у каждого свои
21
+ .claude/settings.local.json
22
+ .coverage
23
+ htmlcov/
24
+ # mutmut's working copy and results (uv run --group mutation mutmut run)
25
+ mutants/
26
+ # Local env files hold keys: keys never go into the repo (the gate's secret scan)
27
+ .env
28
+ .env.*
29
+ # The root lines Antagor adds
30
+ .DS_Store
31
+ Thumbs.db
32
+ .pdm-build/
33
+ .cache/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Roman Bolandau
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.5
2
+ Name: rb-spider
3
+ Version: 0.8.6
4
+ Summary: SEO crawler for technical site audits: a Screaming Frog alike.
5
+ Project-URL: Repository, https://github.com/bolandeu/spider
6
+ Author: Roman Bolandau
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Requires-Python: >=3.14
10
+ Requires-Dist: alembic>=1.14
11
+ Requires-Dist: charset-normalizer>=3.3
12
+ Requires-Dist: crawlee<1.11,>=1.10
13
+ Requires-Dist: httpx>=0.27
14
+ Requires-Dist: imagesize>=2.0.1
15
+ Requires-Dist: keyring>=25.0
16
+ Requires-Dist: openpyxl>=3.1
17
+ Requires-Dist: packaging>=24.0
18
+ Requires-Dist: platformdirs>=4.2
19
+ Requires-Dist: psycopg[binary]>=3.2
20
+ Requires-Dist: pydantic>=2.6
21
+ Requires-Dist: rb-credentials<1,>=0.7.1
22
+ Requires-Dist: rb-keys<0.3,>=0.2
23
+ Requires-Dist: rich>=13.7
24
+ Requires-Dist: selectolax>=0.4
25
+ Requires-Dist: sqlalchemy>=2.0
26
+ Requires-Dist: tomli-w>=1.0
27
+ Requires-Dist: typer<0.29,>=0.27
28
+ Requires-Dist: zstandard>=0.23
29
+ Provides-Extra: curl
30
+ Requires-Dist: crawlee[curl-impersonate]<1.11,>=1.10; extra == 'curl'
31
+ Provides-Extra: gsc
32
+ Requires-Dist: rb-google-oauth>=0.2; extra == 'gsc'
33
+ Requires-Dist: rb-google-search-console>=0.5; extra == 'gsc'
34
+ Provides-Extra: near
35
+ Requires-Dist: datasketch>=2.0; extra == 'near'
36
+ Provides-Extra: postgres
37
+ Requires-Dist: psycopg[binary]>=3.2; extra == 'postgres'
38
+ Provides-Extra: render
39
+ Requires-Dist: crawlee[playwright]<1.11,>=1.10; extra == 'render'
40
+ Provides-Extra: sitemaps
41
+ Requires-Dist: rb-sitemap-xml>=0.2; extra == 'sitemaps'
42
+ Provides-Extra: structured
43
+ Requires-Dist: extruct>=0.18; extra == 'structured'
44
+ Provides-Extra: xpath
45
+ Requires-Dist: lxml>=5; extra == 'xpath'
46
+ Description-Content-Type: text/markdown
47
+
48
+ # rb-spider
49
+
50
+ SEO-краулер для технического аудита сайтов — функциональный аналог [Screaming Frog SEO Spider](https://www.screamingfrog.co.uk/seo-spider/) в виде Python-библиотеки и CLI `spider`.
51
+
52
+ > **Статус: в разработке.** Готов каркас CLI (`spider doctor`, `init`, `config`, `auth`); команд обхода пока нет.
53
+
54
+ ## Что будет уметь
55
+
56
+ - Обходить сайт (до ~100 тыс. URL на обычном ноутбуке — память не растёт с размером сайта) или список URL.
57
+ - Находить SEO-проблемы: битые ссылки, редиректы и их цепочки, title / description / H1, директивы индексации, canonical, дубли, изображения — и дальше по [чеклисту](docs/features.md).
58
+ - Рендерить JavaScript через браузер — для сайтов, где это нужно.
59
+ - Работать через прокси, с любым User-Agent и заголовками.
60
+ - Хранить обходы в SQLite (по умолчанию) или в удалённой реляционной БД; сравнивать обходы.
61
+ - Гибкая настройка: профили в TOML с наследованием, любой параметр переопределяется из командной строки.
62
+ - Отдавать всё и человеку (таблицы), и ИИ-агенту (`--json`).
63
+
64
+ ## Как это будет выглядеть
65
+
66
+ ```bash
67
+ spider crawl https://example.com --profile googlebot --max-urls 50000
68
+ spider issues # сводка проблем по последнему обходу
69
+ spider urls --issue title_missing # URL с конкретной проблемой
70
+ spider url https://example.com/page # всё про одну страницу
71
+ spider export --format csv
72
+ spider crawls prune --keep-last 5 # чистка старых обходов
73
+ ```
74
+
75
+ ## Основа
76
+
77
+ [Crawlee for Python](https://crawlee.dev/python/) (обход, прокси, браузер) + [selectolax](https://github.com/rushter/selectolax) (разбор HTML) + SQLAlchemy (хранилище). Почему именно так и что отвергнуто — в [спецификации](docs/spec.md).
78
+
79
+ ## Установка
80
+
81
+ ```bash
82
+ uv tool install "rb-spider @ git+https://github.com/bolandeu/rb-spider.git@vX.Y.Z" # из git-тега вместо реестра
83
+ uv tool upgrade rb-spider # обновить
84
+ spider # список команд
85
+ ```
86
+
87
+ JS-рендеринг (`spider crawl --render always`) — дополнительно, с Playwright:
88
+
89
+ ```bash
90
+ ```
91
+
92
+ Браузер отдельно ставить не нужно, если уже есть любой Chromium в кэше Playwright (`ms-playwright`) или Google Chrome — spider найдёт его сам; другой — `--set crawl.render_browser=<путь>`. Если нет ничего: `playwright install --only-shell chromium`.
93
+
94
+ Хранилище страниц `spider fetch` (кэш, ADR 0001): индекс — таблица `cache.spider_fetches`, тела — файлы zstd в `SPIDER_CACHE_DIR` (по умолчанию кэш пользователя, на Mac `~/Library/Caches/spider/fetch`; прод — `/data/cache/spider`). Срок — `SPIDER_CACHE_TTL_DAYS` (дней, по умолчанию 90), предел файлов — `SPIDER_CACHE_MAX_GB` (по умолчанию без предела); чистит сам spider раз в сутки. Удалить каталог можно: страницы скачаются снова.
95
+ Состояние прокси между запусками — файл `proxy-state.json` в `SPIDER_CACHE_DIR` (по умолчанию кэш пользователя, на Mac `~/Library/Caches/spider/`; срок — `crawl.proxy_state_ttl_s`, 600 с); это кэш: удалить можно, цена — одна проверка прокси.
96
+
97
+ Запасной HTTP-клиент на curl (`--set crawl.http_client=curl`) — extra `curl`: `uv tool install "rb-spider[curl]" --index …`; оба extra вместе — `rb-spider[render,curl]`.
98
+
99
+ У каждой команды `--help` — это и есть документация. `--json` — вывод для агентов; `spider --ai` печатает инструкцию для ИИ-агентов, `spider skill install` ставит её в Claude Code.
100
+
101
+ ## Разработка
102
+
103
+ ```bash
104
+ uv sync
105
+ uvx --from "git+https://github.com/bolandeu/cli-generator.git@v1.27.1#subdirectory=gate" gate check # гейт; тот же шаг, что в the gate check before a commit
106
+ ```
107
+
108
+ Правила разработки — в [AGENTS.md](AGENTS.md).
109
+
110
+ ## Документы
111
+
112
+ | Файл | Что внутри |
113
+ |---|---|
114
+ | [docs/spec.md](docs/spec.md) | Архитектура и принятые решения |
115
+ | [docs/features.md](docs/features.md) | Чеклист функций по волнам MVP → v2 → v3 → бэклог |
116
+ | [docs/reference/screaming-frog.md](docs/reference/screaming-frog.md) | Справочник функций и проверок Screaming Frog |
@@ -0,0 +1,69 @@
1
+ # rb-spider
2
+
3
+ SEO-краулер для технического аудита сайтов — функциональный аналог [Screaming Frog SEO Spider](https://www.screamingfrog.co.uk/seo-spider/) в виде Python-библиотеки и CLI `spider`.
4
+
5
+ > **Статус: в разработке.** Готов каркас CLI (`spider doctor`, `init`, `config`, `auth`); команд обхода пока нет.
6
+
7
+ ## Что будет уметь
8
+
9
+ - Обходить сайт (до ~100 тыс. URL на обычном ноутбуке — память не растёт с размером сайта) или список URL.
10
+ - Находить SEO-проблемы: битые ссылки, редиректы и их цепочки, title / description / H1, директивы индексации, canonical, дубли, изображения — и дальше по [чеклисту](docs/features.md).
11
+ - Рендерить JavaScript через браузер — для сайтов, где это нужно.
12
+ - Работать через прокси, с любым User-Agent и заголовками.
13
+ - Хранить обходы в SQLite (по умолчанию) или в удалённой реляционной БД; сравнивать обходы.
14
+ - Гибкая настройка: профили в TOML с наследованием, любой параметр переопределяется из командной строки.
15
+ - Отдавать всё и человеку (таблицы), и ИИ-агенту (`--json`).
16
+
17
+ ## Как это будет выглядеть
18
+
19
+ ```bash
20
+ spider crawl https://example.com --profile googlebot --max-urls 50000
21
+ spider issues # сводка проблем по последнему обходу
22
+ spider urls --issue title_missing # URL с конкретной проблемой
23
+ spider url https://example.com/page # всё про одну страницу
24
+ spider export --format csv
25
+ spider crawls prune --keep-last 5 # чистка старых обходов
26
+ ```
27
+
28
+ ## Основа
29
+
30
+ [Crawlee for Python](https://crawlee.dev/python/) (обход, прокси, браузер) + [selectolax](https://github.com/rushter/selectolax) (разбор HTML) + SQLAlchemy (хранилище). Почему именно так и что отвергнуто — в [спецификации](docs/spec.md).
31
+
32
+ ## Установка
33
+
34
+ ```bash
35
+ uv tool install "rb-spider @ git+https://github.com/bolandeu/rb-spider.git@vX.Y.Z" # из git-тега вместо реестра
36
+ uv tool upgrade rb-spider # обновить
37
+ spider # список команд
38
+ ```
39
+
40
+ JS-рендеринг (`spider crawl --render always`) — дополнительно, с Playwright:
41
+
42
+ ```bash
43
+ ```
44
+
45
+ Браузер отдельно ставить не нужно, если уже есть любой Chromium в кэше Playwright (`ms-playwright`) или Google Chrome — spider найдёт его сам; другой — `--set crawl.render_browser=<путь>`. Если нет ничего: `playwright install --only-shell chromium`.
46
+
47
+ Хранилище страниц `spider fetch` (кэш, ADR 0001): индекс — таблица `cache.spider_fetches`, тела — файлы zstd в `SPIDER_CACHE_DIR` (по умолчанию кэш пользователя, на Mac `~/Library/Caches/spider/fetch`; прод — `/data/cache/spider`). Срок — `SPIDER_CACHE_TTL_DAYS` (дней, по умолчанию 90), предел файлов — `SPIDER_CACHE_MAX_GB` (по умолчанию без предела); чистит сам spider раз в сутки. Удалить каталог можно: страницы скачаются снова.
48
+ Состояние прокси между запусками — файл `proxy-state.json` в `SPIDER_CACHE_DIR` (по умолчанию кэш пользователя, на Mac `~/Library/Caches/spider/`; срок — `crawl.proxy_state_ttl_s`, 600 с); это кэш: удалить можно, цена — одна проверка прокси.
49
+
50
+ Запасной HTTP-клиент на curl (`--set crawl.http_client=curl`) — extra `curl`: `uv tool install "rb-spider[curl]" --index …`; оба extra вместе — `rb-spider[render,curl]`.
51
+
52
+ У каждой команды `--help` — это и есть документация. `--json` — вывод для агентов; `spider --ai` печатает инструкцию для ИИ-агентов, `spider skill install` ставит её в Claude Code.
53
+
54
+ ## Разработка
55
+
56
+ ```bash
57
+ uv sync
58
+ uvx --from "git+https://github.com/bolandeu/cli-generator.git@v1.27.1#subdirectory=gate" gate check # гейт; тот же шаг, что в the gate check before a commit
59
+ ```
60
+
61
+ Правила разработки — в [AGENTS.md](AGENTS.md).
62
+
63
+ ## Документы
64
+
65
+ | Файл | Что внутри |
66
+ |---|---|
67
+ | [docs/spec.md](docs/spec.md) | Архитектура и принятые решения |
68
+ | [docs/features.md](docs/features.md) | Чеклист функций по волнам MVP → v2 → v3 → бэклог |
69
+ | [docs/reference/screaming-frog.md](docs/reference/screaming-frog.md) | Справочник функций и проверок Screaming Frog |
@@ -0,0 +1,233 @@
1
+ [project]
2
+ name = "rb-spider"
3
+ # Version comes from the git tag vX.Y.Z (uv-dynamic-versioning) — never add `version =`.
4
+ dynamic = ["version"]
5
+ description = "SEO crawler for technical site audits: a Screaming Frog alike."
6
+ readme = "README.md"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ authors = [{ name = "Roman Bolandau" }]
10
+ requires-python = ">=3.14"
11
+ dependencies = [
12
+ "rb-credentials>=0.7.1,<1",
13
+ "typer>=0.27,<0.29",
14
+ "rich>=13.7",
15
+ "pydantic>=2.6",
16
+ "tomli-w>=1.0",
17
+ "platformdirs>=4.2",
18
+ "httpx>=0.27",
19
+ "packaging>=24.0",
20
+ "keyring>=25.0",
21
+ "crawlee>=1.10,<1.11",
22
+ "selectolax>=0.4",
23
+ "sqlalchemy>=2.0",
24
+ "alembic>=1.14",
25
+ "zstandard>=0.23",
26
+ "openpyxl>=3.1",
27
+ "imagesize>=2.0.1",
28
+ "charset-normalizer>=3.3",
29
+ "psycopg[binary]>=3.2",
30
+ # the shared keys (url_key, domain_key) other tools and Directus join pages by: the sibling package rb-keys
31
+ "rb-keys>=0.2,<0.3",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ # JS rendering (`crawl.render = "always"`): Playwright via Crawlee; the browser itself — `playwright install chromium`
36
+ render = ["crawlee[playwright]>=1.10,<1.11"]
37
+ # the fallback HTTP client (`crawl.http_client = "curl"`): curl-impersonate via Crawlee
38
+ curl = ["crawlee[curl-impersonate]>=1.10,<1.11"]
39
+ # near duplicates (`collect.near_duplicates`): MinHash signatures of page text
40
+ near = ["datasketch>=2.0"]
41
+ # Microdata and RDFa (`collect.structured_data`): extruct; JSON-LD needs nothing extra
42
+ structured = ["extruct>=0.18"]
43
+ # Custom Extraction by XPath (`custom.extract` with kind = "xpath")
44
+ xpath = ["lxml>=5"]
45
+ # XML sitemaps (`sitemaps.crawl`, `spider sitemaps`): the sibling package rb-sitemap-xml
46
+ sitemaps = ["rb-sitemap-xml>=0.2"]
47
+ # kept for old install commands: psycopg is a core dependency now (`SPIDER_DATABASE_URL`)
48
+ postgres = ["psycopg[binary]>=3.2"]
49
+ # PageSpeed Insights (`lighthouse.source = "psi"`): the sibling package gsc — it holds the API key (`gsc auth login`)
50
+ gsc = ["rb-google-search-console>=0.5", "rb-google-oauth>=0.2"] # oauth: a source line only applies to a direct dependency
51
+ # без верхних границ: rb-* разрабатываются рядом и резолвятся с диска (path), не из индекса
52
+
53
+ [project.scripts]
54
+ spider = "rb_spider.cli:main"
55
+
56
+ [project.urls]
57
+ Repository = "https://github.com/bolandeu/spider"
58
+
59
+ [build-system]
60
+ requires = ["hatchling", "uv-dynamic-versioning"]
61
+ build-backend = "hatchling.build"
62
+
63
+ [tool.hatch.version]
64
+ source = "uv-dynamic-versioning"
65
+
66
+ [tool.uv-dynamic-versioning]
67
+ vcs = "git"
68
+ style = "pep440"
69
+ fallback-version = "0.0.0"
70
+
71
+ [tool.uv]
72
+ # Rebuild the editable install when a commit or tag moves, so `--version` follows the tag.
73
+ cache-keys = [{ file = "pyproject.toml" }, { git = { commit = true, tags = true } }]
74
+
75
+ # `dependencies` and a source line per package, never a git tag. explicit = true:
76
+ # only the packages named in [tool.uv.sources] are looked up there. Against an
77
+ # unreleased package locally: `uv pip install -e ../<package>`, uncommitted.
78
+ # Siblings resolve from disk: a version range in `dependencies` plus a `path` source, never an index.
79
+ [tool.uv.sources]
80
+ rb-credentials = { path = "../rb-credentials", editable = true }
81
+ rb-sitemap-xml = { path = "../rb-sitemap-xml", editable = true }
82
+ rb-google-search-console = { path = "../rb-google-search-console", editable = true }
83
+ rb-keys = { path = "../rb-keys", editable = true }
84
+ rb-google-oauth = { path = "../rb-google-oauth", editable = true } # a dependency of rb-google-search-console
85
+
86
+ [tool.hatch.build.targets.sdist]
87
+ # What a release must not carry: the agent's own files, the forge configs and the dev tooling. The wheel is
88
+ # narrow already (`packages = ["src/<pkg>"]`); this is about the sdist, which is otherwise a copy of the repo.
89
+ exclude = [
90
+ "/.agents",
91
+ "/.claude",
92
+ "/.claude-plugin",
93
+ "/.gitea",
94
+ "/.github",
95
+ "/docs",
96
+ "/scripts",
97
+ "/uv.lock",
98
+ "/AGENTS.md",
99
+ "/CLAUDE.md",
100
+ "/CODING_STANDARDS.md",
101
+ "/CONTEXT.md",
102
+ "/.copier-answers.yml",
103
+ "^\\.gitignore$",
104
+ "/.gitleaks.toml",
105
+ ]
106
+
107
+ [tool.hatch.build.targets.wheel]
108
+ packages = ["src/rb_spider"]
109
+
110
+ [tool.hatch.build.targets.wheel.force-include]
111
+ # The installed CLI reads [[tool.rb.external]] from here (core/deps.py).
112
+ "pyproject.toml" = "rb_spider/_pyproject.toml"
113
+
114
+ [dependency-groups]
115
+ # Mutation testing, run now and then and before big releases — not in the gate:
116
+ # `uv run --group mutation mutmut run`, then `mutmut results` / `mutmut browse`.
117
+ # Needs fork(): macOS/Linux (WSL on Windows). Settings: [tool.mutmut] below.
118
+ mutation = ["mutmut>=3.3"]
119
+ dev = [
120
+ "aiohttp>=3.10",
121
+ "jsonschema>=4.23",
122
+ "pytest>=8.0",
123
+ "pyyaml>=6.0", # .copier-answers.yml, the CI workflow, tests/contracts/*.yaml
124
+ "pytest-cov>=5.0",
125
+ "ruff>=0.6",
126
+ "syrupy>=4.8",
127
+ "trustme>=1.2.1",
128
+ "ty>=0.0.80",
129
+ ]
130
+
131
+ # External (non-Python) dependencies — every CLI this tool runs (require_cli,
132
+ # shutil.which, subprocess with a literal program, npx). The gate checks this
133
+ # list against the code both ways; doctor and require_cli read it at runtime;
134
+ # the tools catalog reads it (the Standard, Technology).
135
+ # [[tool.rb.external]]
136
+ # name = "ffmpeg"
137
+ # required = true # false: the tool works without it (doctor stays healthy)
138
+ # min_version = "6.0" # optional
139
+ # check = "ffmpeg -version" # prints the version; default "<name> --version"
140
+ # why = "transcodes the downloaded videos"
141
+ # detect = false # run via an injected runner / absolute path the gate can't see
142
+ # dist = "rb-serp" # for one of our CLIs: its distribution (default rb-<name>)
143
+ # url = "https://github.com/bolandeu/serp" # its repo: DEPENDENCY_TOO_OLD then prints a pinned install
144
+
145
+ [[tool.rb.external]]
146
+ name = "lighthouse"
147
+ required = false
148
+ detect = false # run as `lighthouse.command` from settings (core/lighthouse.py), not by a literal name
149
+ why = "spider lighthouse --source local (npm install -g lighthouse)"
150
+
151
+ [[tool.rb.external]]
152
+ name = "npx"
153
+ required = false
154
+ detect = false # only when lighthouse.command = "npx --yes lighthouse"
155
+ why = "spider lighthouse without installing Lighthouse: --set lighthouse.command=\"npx --yes lighthouse\""
156
+ # Where sysadmin's tool-updater installs this tool after its first tag. The
157
+ # installation is sysadmin's; this section only says where. homeserver: users
158
+ # to install for (empty = build and publish only); mac: install on the Mac.
159
+ # extras (optional): the extras to install with, e.g. extras = ["browser"].
160
+ [tool.rb.install]
161
+ homeserver = ["rbtools"]
162
+ mac = true
163
+
164
+ [tool.cli-generator]
165
+ # Where scripts/check_command_docstrings.py (called by the project's checks)
166
+ # looks for commands: a glob or a list of globs, relative to the repo root.
167
+ commands = ["src/rb_spider/commands/*.py"]
168
+ # gate check (the gate): extras to install before ruff/ty/pytest.
169
+ # gate_extras = ["browser"]
170
+ gate_extras = ["render", "curl", "near", "structured", "sitemaps", "xpath", "postgres", "gsc"]
171
+
172
+ [tool.pytest.ini_options]
173
+ # Only tests/: mutmut leaves a copy of the tree in mutants/.
174
+ testpaths = ["tests"]
175
+ addopts = "--cov --cov-report=term-missing:skip-covered"
176
+ # tests/test_help.py keeps help snapshots at tests/snapshots/help/<command>.txt
177
+ # (the Standard, Commands), not in syrupy's own `__snapshots__/<test file>/` layout, so
178
+ # syrupy warns it "can not relate" each file to its test. It can — by name.
179
+ filterwarnings = ["ignore:(?s).*Can not relate snapshot:UserWarning"]
180
+
181
+ [tool.mutmut]
182
+ source_paths = ["src/rb_spider"]
183
+ also_copy = ["scripts/", "pyproject.toml"] # tests read them (test_scripts.py, the distribution checks)
184
+ pytest_add_cli_args = ["--no-cov"] # fail_under would kill every mutant
185
+ # only_mutate = ["*/core/normalize.py"] # one module at a time on a big tool
186
+
187
+ [tool.coverage.run]
188
+ source = ["src"]
189
+ # sysmon (default on 3.14) keeps a record per recompiled code object; Typer recompiles annotations on every invoke, so memory grows.
190
+ core = "ctrace"
191
+
192
+ [tool.coverage.report]
193
+ # The template ships at ~94%; keep the bar where it is instead of letting
194
+ # new commands land untested. Raise it, never lower it.
195
+ fail_under = 90
196
+ show_missing = true
197
+
198
+ [tool.ty.terminal]
199
+ # Only errors fail the gate; recent ty (>= 0.0.84) otherwise exits 1 on warnings too.
200
+ # Legacy code that can't be fixed yet: downgrade specific rules instead of
201
+ # ignoring them, e.g. [tool.ty.rules] possibly-unbound-attribute = "warn".
202
+ error-on-warning = false
203
+
204
+ [tool.ruff]
205
+ line-length = 120
206
+
207
+ [tool.ruff.lint]
208
+ select = ["E4", "E7", "E9", "F", "I", "UP", "B", "SIM", "RUF", "S", "T20", "TID251"]
209
+ # Help text and docstrings are in Russian: Cyrillic "с"/"а" next to Latin is intended, not a typo.
210
+ ignore = ["RUF001", "RUF002", "RUF003"]
211
+
212
+ [tool.ruff.lint.per-file-ignores]
213
+ "tests/*" = ["S101", "T201", "TID251"] # assert is the point of a test; print in code strings; httpx for mocks
214
+ "scripts/*" = ["S603", "S607", "T201"] # subprocess with fixed argv lists (git, uv), no shell; scripts print to the console
215
+ "bench/*" = ["S311", "T201"] # seeded random for a reproducible fake site, not crypto; bench prints
216
+ "src/*/providers/*" = ["TID251"] # external APIs live here
217
+
218
+ [tool.ruff.lint.flake8-tidy-imports.banned-api]
219
+ "httpx".msg = "Call external APIs through providers/ (subclass providers.HttpProvider)."
220
+
221
+ [tool.ruff.lint.flake8-bugbear]
222
+ # Typer's `param: T = typer.Option(...)` style is a call in a default on purpose.
223
+ extend-immutable-calls = ["typer.Option", "typer.Argument"]
224
+
225
+ [tool.ty.src]
226
+ # bench/ is a separate uv project (its own deps, e.g. aiohttp) — not part of the package.
227
+ exclude = ["bench"]
228
+
229
+ [tool.rb.gate]
230
+ addresses_allow = [
231
+ { pattern = "http://localhost", reason = "the pattern that finds localhost links in crawled pages" },
232
+ { pattern = "https://localhost", reason = "the pattern that finds localhost links in crawled pages" },
233
+ ]
@@ -0,0 +1 @@
1
+ """The package: its modules are the CLI (`cli`), its commands, the output and the core they share."""
@@ -0,0 +1,5 @@
1
+ """`python -m rb_spider` — how a detached crawl (`spider crawl --detach`) starts its own process."""
2
+
3
+ from .cli import main
4
+
5
+ main()
@@ -0,0 +1,24 @@
1
+ """The distribution name and the tool namespace copier writes from its answers, because an editable install cannot map
2
+ this import package to its distribution at runtime.
3
+ """
4
+
5
+ # Rendered by copier from the `dist_name` answer: the [project] name in
6
+ # pyproject.toml (`rb-<slug>`, the Standard, Technology), which may differ from this
7
+ # import package's name. importlib.metadata finds this package's version,
8
+ # summary and console script by it; an editable install (`uv sync`) can't be
9
+ # mapped from package to distribution at runtime, so it is written down here.
10
+ # tests/test_cli.py fails if it drifts from pyproject.toml.
11
+ DIST_NAME = "rb-spider"
12
+ # The previous distribution name during a rename: an install made
13
+ # under it (not yet reinstalled) still finds its own version. Drop it once
14
+ # every machine has the new name.
15
+ DIST_NAME_LEGACY: str | None = None
16
+ # The command name (`cli_name`) as an identifier: the namespace of this tool's
17
+ # shared-database names (core/db.py) — table prefix `<TOOL>_`, env var
18
+ # `<TOOL>_DATABASE_URL`, Alembic table `alembic_version_<TOOL>`. Written down,
19
+ # not derived at runtime: a bare source run falls back to the package name,
20
+ # and a table name must never depend on how the tool was started.
21
+ TOOL = "spider"
22
+ # The cli-generator release this project was generated or last updated from
23
+ # (copier's `_commit`), for `describe --json`; None for a project not made by copier.
24
+ TEMPLATE_VERSION: str | None = "v1.27.3"
@@ -0,0 +1,132 @@
1
+ """The root Typer app: global options, the command groups and the optional commands a generated package has, wired
2
+ together, and the console-script entry point.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ import typer
8
+
9
+ from . import output
10
+ from .commands import (
11
+ auth,
12
+ compare,
13
+ crawl,
14
+ crawls,
15
+ custom,
16
+ doctor,
17
+ duplicates,
18
+ enrich,
19
+ export,
20
+ fetch,
21
+ fingerprints,
22
+ hreflang,
23
+ insecure,
24
+ issues,
25
+ lighthouse,
26
+ link_score,
27
+ links,
28
+ pagination,
29
+ profiles,
30
+ projects,
31
+ redirects,
32
+ report,
33
+ serp,
34
+ sitemaps,
35
+ source,
36
+ structured,
37
+ )
38
+ from .core.version import DEV_VERSION, cli_name, installed_version, optional_module, package_summary
39
+
40
+ _PACKAGE_NAME = __name__.split(".")[0]
41
+ # Optional parts (copier questions, dropped by _exclude): each one ships a module that registers its
42
+ # commands and global options. Probed at runtime, so this file needs no template logic.
43
+ PARTS = ("project", "skill", "describe", "db")
44
+
45
+ # A bare `<cli>` is the discovery entry point for humans and agents alike:
46
+ # name + version + description, then every command with the first line of
47
+ # its docstring. No `no_args_is_help` (that exits 2) — main_options() below
48
+ # prints this and exits 0. Shell completion stays enabled.
49
+ app = typer.Typer(
50
+ cls=output.RootGroup, # a usage error under --json is the error envelope
51
+ help=f"{cli_name()} {installed_version() or DEV_VERSION} — {package_summary() or 'project-aware automation CLI'}",
52
+ )
53
+
54
+ app.add_typer(auth.app, name="auth") # `auth status` in every CLI; login/logout only with credentials
55
+ app.add_typer(crawls.app, name="crawls")
56
+ app.add_typer(profiles.app, name="profiles")
57
+ app.add_typer(fingerprints.app, name="fingerprints")
58
+ app.add_typer(projects.app, name="projects")
59
+ app.add_typer(sitemaps.app, name="sitemaps")
60
+ app.add_typer(serp.app, name="serp")
61
+ app.add_typer(report.app, name="report")
62
+ app.command(name="robots-test")(report.robots_test)
63
+ app.command(name="link-score")(link_score.link_score)
64
+ app.command(name="source")(source.source)
65
+ app.command(name="lighthouse")(lighthouse.lighthouse)
66
+
67
+ app.command(name="doctor")(doctor.doctor)
68
+ app.command(name="crawl")(crawl.crawl)
69
+ app.command(name="issues")(issues.issues)
70
+ app.command(name="urls")(issues.urls)
71
+ app.command(name="analyze")(issues.analyze)
72
+ app.command(name="redirects")(redirects.redirects)
73
+ app.command(name="hreflang")(hreflang.hreflang)
74
+ app.command(name="pagination")(pagination.pagination)
75
+ app.command(name="insecure")(insecure.insecure)
76
+ app.command(name="duplicates")(duplicates.duplicates)
77
+ app.command(name="structured")(structured.structured)
78
+ app.command(name="custom")(custom.custom)
79
+ app.command(name="compare")(compare.compare)
80
+ app.command(name="links")(links.links)
81
+ app.command(name="url")(export.url)
82
+ app.command(name="overview")(export.overview)
83
+ app.command(name="export")(export.export)
84
+ app.command(name="query")(export.query)
85
+ app.command(name="fetch")(fetch.fetch)
86
+ app.command(name="enrichers")(enrich.enrichers)
87
+ app.command(name="enrich")(enrich.enrich)
88
+ # The parts (project, skill, describe, db) add their commands and global options.
89
+ for part in PARTS:
90
+ if module := optional_module(f"{_PACKAGE_NAME}.commands.{part}"):
91
+ module.register(app)
92
+
93
+
94
+ def _version_callback(value: bool) -> None:
95
+ if not value:
96
+ return
97
+ typer.echo(installed_version() or DEV_VERSION)
98
+ raise typer.Exit()
99
+
100
+
101
+ @app.callback(invoke_without_command=True)
102
+ def main_options(
103
+ ctx: typer.Context,
104
+ json_output: bool = typer.Option(
105
+ False, "--json", help="Вывод в JSON для агентов и скриптов (одна строка-конверт `{ok, ...}`)."
106
+ ),
107
+ quiet: bool = typer.Option(False, "--quiet", help="Печатать только основной результат, без пояснений."),
108
+ verbose: bool = typer.Option(False, "--verbose", help="Подробная диагностика в stderr."),
109
+ non_interactive: bool = typer.Option(
110
+ False, "--non-interactive", help="Никогда не задавать вопросов: вместо этого завершиться с ошибкой."
111
+ ),
112
+ dry_run: bool = typer.Option(False, "--dry-run", help="Показать, что будет сделано, ничего не меняя."),
113
+ version: bool = typer.Option(
114
+ False, "--version", callback=_version_callback, is_eager=True, help="Показать версию и выйти."
115
+ ),
116
+ ) -> None:
117
+ ctx.ensure_object(dict) # a part's global option (--project) may have put its value here already
118
+ ctx.obj["json"] = json_output
119
+ ctx.obj["quiet"] = quiet
120
+ ctx.obj["verbose"] = verbose
121
+ ctx.obj["non_interactive"] = non_interactive
122
+ ctx.obj["dry_run"] = dry_run
123
+ output.configure_logging(verbose)
124
+ output.help_if_no_command(ctx)
125
+
126
+
127
+ def main() -> None:
128
+ app()
129
+
130
+
131
+ if __name__ == "__main__":
132
+ main()
@@ -0,0 +1 @@
1
+ """The commands of the CLI, one module per command or command group."""