omni-scraper 0.1.0__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 (71) hide show
  1. omni_scraper-0.1.0/.gitignore +50 -0
  2. omni_scraper-0.1.0/CHANGELOG.md +85 -0
  3. omni_scraper-0.1.0/LICENSE +21 -0
  4. omni_scraper-0.1.0/PKG-INFO +530 -0
  5. omni_scraper-0.1.0/README.md +456 -0
  6. omni_scraper-0.1.0/pyproject.toml +156 -0
  7. omni_scraper-0.1.0/src/omniscrape/__init__.py +340 -0
  8. omni_scraper-0.1.0/src/omniscrape/_version.py +3 -0
  9. omni_scraper-0.1.0/src/omniscrape/classifier/__init__.py +9 -0
  10. omni_scraper-0.1.0/src/omniscrape/classifier/detector.py +191 -0
  11. omni_scraper-0.1.0/src/omniscrape/classifier/strategies.py +70 -0
  12. omni_scraper-0.1.0/src/omniscrape/cli/__init__.py +5 -0
  13. omni_scraper-0.1.0/src/omniscrape/cli/main.py +442 -0
  14. omni_scraper-0.1.0/src/omniscrape/client.py +402 -0
  15. omni_scraper-0.1.0/src/omniscrape/content/__init__.py +11 -0
  16. omni_scraper-0.1.0/src/omniscrape/content/chunking.py +72 -0
  17. omni_scraper-0.1.0/src/omniscrape/content/extract.py +278 -0
  18. omni_scraper-0.1.0/src/omniscrape/content/filters.py +64 -0
  19. omni_scraper-0.1.0/src/omniscrape/content/markdown.py +257 -0
  20. omni_scraper-0.1.0/src/omniscrape/content/metadata.py +158 -0
  21. omni_scraper-0.1.0/src/omniscrape/content/tokens.py +29 -0
  22. omni_scraper-0.1.0/src/omniscrape/crawler/__init__.py +15 -0
  23. omni_scraper-0.1.0/src/omniscrape/crawler/engine.py +377 -0
  24. omni_scraper-0.1.0/src/omniscrape/crawler/links.py +90 -0
  25. omni_scraper-0.1.0/src/omniscrape/crawler/queue.py +125 -0
  26. omni_scraper-0.1.0/src/omniscrape/crawler/robots.py +230 -0
  27. omni_scraper-0.1.0/src/omniscrape/crawler/sitemap.py +106 -0
  28. omni_scraper-0.1.0/src/omniscrape/crawler/spider.py +90 -0
  29. omni_scraper-0.1.0/src/omniscrape/crawler/throttle.py +85 -0
  30. omni_scraper-0.1.0/src/omniscrape/crawler/urls.py +71 -0
  31. omni_scraper-0.1.0/src/omniscrape/curl.py +292 -0
  32. omni_scraper-0.1.0/src/omniscrape/exceptions.py +95 -0
  33. omni_scraper-0.1.0/src/omniscrape/extract/__init__.py +33 -0
  34. omni_scraper-0.1.0/src/omniscrape/extract/entities.py +778 -0
  35. omni_scraper-0.1.0/src/omniscrape/extract/listings.py +67 -0
  36. omni_scraper-0.1.0/src/omniscrape/extract/product.py +417 -0
  37. omni_scraper-0.1.0/src/omniscrape/fetchers/__init__.py +15 -0
  38. omni_scraper-0.1.0/src/omniscrape/fetchers/actions.py +195 -0
  39. omni_scraper-0.1.0/src/omniscrape/fetchers/base.py +64 -0
  40. omni_scraper-0.1.0/src/omniscrape/fetchers/browser.py +240 -0
  41. omni_scraper-0.1.0/src/omniscrape/fetchers/http.py +212 -0
  42. omni_scraper-0.1.0/src/omniscrape/fetchers/httpx_fetcher.py +88 -0
  43. omni_scraper-0.1.0/src/omniscrape/fetchers/pool.py +82 -0
  44. omni_scraper-0.1.0/src/omniscrape/fetchers/registry.py +116 -0
  45. omni_scraper-0.1.0/src/omniscrape/fetchers/stealth.py +173 -0
  46. omni_scraper-0.1.0/src/omniscrape/mcp/__init__.py +7 -0
  47. omni_scraper-0.1.0/src/omniscrape/mcp/server.py +180 -0
  48. omni_scraper-0.1.0/src/omniscrape/models.py +216 -0
  49. omni_scraper-0.1.0/src/omniscrape/normalizers/__init__.py +13 -0
  50. omni_scraper-0.1.0/src/omniscrape/normalizers/currency.py +87 -0
  51. omni_scraper-0.1.0/src/omniscrape/normalizers/dates.py +22 -0
  52. omni_scraper-0.1.0/src/omniscrape/normalizers/markdown.py +16 -0
  53. omni_scraper-0.1.0/src/omniscrape/normalizers/units.py +55 -0
  54. omni_scraper-0.1.0/src/omniscrape/observability/logging.py +38 -0
  55. omni_scraper-0.1.0/src/omniscrape/observability/metrics.py +47 -0
  56. omni_scraper-0.1.0/src/omniscrape/parsers/__init__.py +17 -0
  57. omni_scraper-0.1.0/src/omniscrape/parsers/adaptive.py +345 -0
  58. omni_scraper-0.1.0/src/omniscrape/parsers/density.py +50 -0
  59. omni_scraper-0.1.0/src/omniscrape/parsers/selector.py +762 -0
  60. omni_scraper-0.1.0/src/omniscrape/parsers/semantic.py +124 -0
  61. omni_scraper-0.1.0/src/omniscrape/parsers/structured.py +256 -0
  62. omni_scraper-0.1.0/src/omniscrape/parsers/tables.py +79 -0
  63. omni_scraper-0.1.0/src/omniscrape/py.typed +0 -0
  64. omni_scraper-0.1.0/src/omniscrape/resilience/__init__.py +11 -0
  65. omni_scraper-0.1.0/src/omniscrape/resilience/circuit_breaker.py +47 -0
  66. omni_scraper-0.1.0/src/omniscrape/resilience/dead_letter.py +52 -0
  67. omni_scraper-0.1.0/src/omniscrape/resilience/retry.py +54 -0
  68. omni_scraper-0.1.0/src/omniscrape/storage/__init__.py +11 -0
  69. omni_scraper-0.1.0/src/omniscrape/storage/base.py +28 -0
  70. omni_scraper-0.1.0/src/omniscrape/storage/duckdb_backend.py +102 -0
  71. omni_scraper-0.1.0/src/omniscrape/storage/jsonl_backend.py +51 -0
@@ -0,0 +1,50 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+
11
+ # Testing / caches
12
+ .pytest_cache/
13
+ .hypothesis/
14
+ .mypy_cache/
15
+ .ruff_cache/
16
+ .tox/
17
+ .nox/
18
+ .coverage
19
+ .coverage.*
20
+ coverage.xml
21
+ htmlcov/
22
+
23
+ # Virtual environments / local config
24
+ .venv/
25
+ venv/
26
+ env/
27
+ .env
28
+ .env.*
29
+ .python-version
30
+
31
+ # Editors / OS
32
+ .idea/
33
+ .vscode/
34
+ .DS_Store
35
+ Thumbs.db
36
+ .claude/settings.local.json
37
+
38
+ # Local runtime databases and outputs
39
+ *.db
40
+ *.sqlite
41
+ *.sqlite3
42
+ *.duckdb
43
+ *.jsonl
44
+ *.log
45
+ .omniscrape/
46
+
47
+ # Benchmarks (generated; the cited run is snapshotted in benchmarks/published/)
48
+ benchmarks/.envs/
49
+ benchmarks/results/
50
+ benchmarks/corpus/data/adaptive/
@@ -0,0 +1,85 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-11-27
10
+
11
+ First public release. Published on PyPI as **`omni-scraper`** (`import omniscrape`, command `omniscrape`).
12
+
13
+ ### Added
14
+ - **Zero-config extraction for every common page type**: `extract_recipe`, `extract_events`, `extract_jobs`,
15
+ `extract_reviews` (with aggregate rating), `extract_faq` (FAQPage markup or `<details>` accordions),
16
+ `extract_organization` (emails, phones, address, social profiles), `extract_breadcrumbs`, `find_next_page`
17
+ (`rel=next`, "Next" buttons, numbered pagers; "Next post" links are ignored), `extract_tables`, and
18
+ `extract_entities` to run them all. New models: `Recipe`, `Event`, `JobPosting`, `Review`, `FAQItem`,
19
+ `Organization`, `Breadcrumb`, `PageEntities`.
20
+ - **Page-type detection**: `detect_content_type` classifies pages as product, article, recipe, event, job,
21
+ listing, faq, organization or other (structured data first, then page signals; 141 of the 143 labelled
22
+ benchmark pages). `ScrapeResult` gains `content_type` and `entities`.
23
+ - **Browser profiles for the HTTP tier**: `FastFetcher(impersonate=...)` takes any curl_cffi profile
24
+ (`chrome`, `edge`, `safari`, `firefox`, `chrome_android`, `safari_ios`, or pinned versions) or a list to rotate
25
+ through (`rotate="domain"` keeps one identity per host, `"request"` cycles). Per request:
26
+ `fetch(url, impersonate="safari", http_version="3")`. HTTP/3 via `http_version` (curl_cffi 0.15 or
27
+ newer, now the minimum, is the first release that really negotiates HTTP/3). Each profile sends its own
28
+ User-Agent and client hints, so the TLS fingerprint and the headers always agree.
29
+ - **Multi-session spiders**: `Spider.sessions` declares named fetch configurations (tier, browser profile,
30
+ proxy, headers, `wait_for`, ...) and `Request(url, session="browser")` picks one, so one spider can mix HTTP and
31
+ browser pages. Sessions persist across `--resume`.
32
+ - **curl import**: `parse_curl` / `fetch_curl` replay a browser's "Copy as cURL" command (bash with `$'...'`
33
+ quoting, or Windows `cmd` style); writes (POST, PUT, ...) are sent exactly once unless `retries=` is given; `omniscrape curl "curl ..."`; `curl()` and `uncurl()` in `omniscrape shell`.
34
+ - **CLI**: `get` infers the format from `-o` (`.json`, `.md`, `.html`, `.txt`), new `html` and `text` formats,
35
+ `--impersonate` and `--http-version`; the summary table shows the page type and found entities.
36
+ - **MCP**: six new tools (`extract_entities`, `extract_schema`, `extract_listings`, `get_links`, `crawl_site`,
37
+ `screenshot`), eleven in total. Error and anti-bot pages (including challenge pages served with HTTP 200) are
38
+ never returned as page content: page tools raise a tool error, `get_markdown` returns an `Error:` message and
39
+ `crawl_site` marks such pages with an `error` field.
40
+ - Three-tier fetching: `curl_cffi` HTTP with a browser TLS fingerprint, Playwright rendering with a shared
41
+ action runner, and an opt-in stealth tier (Camoufox or hardened Chromium).
42
+ - Adaptive (self-healing) selectors with SQLite fingerprint storage.
43
+ - `Selector` with CSS, XPath, text/regex search, DOM navigation, `find_similar`, and declarative
44
+ `extract(schema)` with price, date, unit and number normalizers. Optional `selectolax` CSS backend.
45
+ - Zero-config `Product`, `Article` and listing extraction; JSON-LD, Microdata, RDFa and OpenGraph parsing.
46
+ - LLM-ready Markdown: `fit_markdown`, BM25 query filtering, citations, `chunk_markdown`.
47
+ - `CrawlEngine` and `Spider`: concurrency, per-domain throttling, AutoThrottle, `robots.txt`, `Retry-After`,
48
+ sitemap seeding, SQLite pause/resume, streaming, item pipelines, `JSONLStorage` and `DuckDBStorage`.
49
+ - Resilience: retries with backoff, circuit breaker, dead-letter queue, proxy pool (round-robin, random, sticky).
50
+ - CLI: `get`, `crawl`, `map`, `extract`, `shell`, `mcp`. MCP server with five tools.
51
+ - Agent skill (`.claude/skills`, `.agents/skills`), a Claude Code plugin (`.claude-plugin/`) that bundles the skill and the MCP server.
52
+ - Reproducible benchmark harness under `benchmarks/` with the published run in `benchmarks/published/`.
53
+
54
+ ### Fixed
55
+ - `scrape()` no longer reports a `product` on pages that are not product pages (a title-only "product" on
56
+ news articles, or one card's price on category pages) unless the page has exactly one Product markup item,
57
+ and keeps `article` only on article-like pages or where Article markup exists. `scrape_product()` and
58
+ `scrape_article()` still return the extractor's answer for the URL you give them.
59
+ - Logging now goes to **stderr**; it previously wrote JSON log lines to stdout, which corrupted
60
+ `omniscrape get -f json` and the MCP stdio transport.
61
+ - `robots.txt` matching supports `*` and `$` wildcards, picks the most specific user-agent group and merges
62
+ repeated groups for it (RFC 9309), compares paths after percent-encoding normalisation, and reads
63
+ `Crawl-delay` / `Request-rate` from the same group as the path rules.
64
+ - `TableParser.parse_table` no longer returns the `<thead>` header row as a data row.
65
+ - `Selector.find_by_text` / `find_by_regex` return the innermost matching elements instead of every ancestor.
66
+ - `Selector(backend="selectolax")`: root-level element methods no longer fail before the lxml tree is built.
67
+ - Crawler callbacks receive `Selector(..., url=...)` and `Request.meta` is delivered as `response.meta`.
68
+ - `fetch_many` cancels the remaining downloads when one fails and exceptions are not collected;
69
+ `iter_scrape` does the same when a download fails or the caller stops iterating early.
70
+ - A resumed crawl keeps each request's `tier` override (it is now stored in the SQLite queue).
71
+ - MCP `get_markdown` reports HTTP errors and anti-bot challenge pages (including ones served with HTTP 200)
72
+ instead of returning them as page content, and forwards `allow_stealth`.
73
+ - `JSONLStorage` is line-buffered and reusable after `close()`; `DuckDBStorage` accepts records whose keys
74
+ differ from the first record's, including keys that differ only in letter case.
75
+ - `BaseFetcher` is now listed in `omniscrape.__all__`.
76
+ - `ScrapeResult.title` is whitespace-normalised (multi-line `<title>` tags no longer leak newlines and indentation).
77
+
78
+ ### Removed
79
+ - Unused code: `AutoThrottle` (superseded by `DomainThrottle`), `CheckpointManager`, `URLFilter`,
80
+ `FetcherSession`, `DensityAnalyzer.extract_main_content`, `Spider.stealth`, and the never-populated
81
+ `Product.original_price`, `discount_percent`, `specifications` and `category_path` fields.
82
+ - The unused core dependencies `orjson` and `beautifulsoup4`.
83
+
84
+ [Unreleased]: https://github.com/loganathan-ai-dev/Omni-Scrape/compare/v0.1.0...HEAD
85
+ [0.1.0]: https://github.com/loganathan-ai-dev/Omni-Scrape/releases/tag/v0.1.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Loganathan M
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.