silkweb 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.
- silkweb-0.1.0/.github/workflows/ci.yml +31 -0
- silkweb-0.1.0/.github/workflows/docs.yml +47 -0
- silkweb-0.1.0/.gitignore +48 -0
- silkweb-0.1.0/CONTRIBUTING.md +28 -0
- silkweb-0.1.0/LICENSE +22 -0
- silkweb-0.1.0/PKG-INFO +1869 -0
- silkweb-0.1.0/README.md +1743 -0
- silkweb-0.1.0/docs/assets/logo.svg +4 -0
- silkweb-0.1.0/docs/faq.md +132 -0
- silkweb-0.1.0/docs/guides/anti-bot.md +140 -0
- silkweb-0.1.0/docs/guides/api-discovery.md +88 -0
- silkweb-0.1.0/docs/guides/caching.md +128 -0
- silkweb-0.1.0/docs/guides/crawling.md +181 -0
- silkweb-0.1.0/docs/guides/fetcher-tiers.md +189 -0
- silkweb-0.1.0/docs/guides/llm-extraction.md +235 -0
- silkweb-0.1.0/docs/guides/llm-providers.md +158 -0
- silkweb-0.1.0/docs/guides/observability.md +102 -0
- silkweb-0.1.0/docs/guides/output-formats.md +220 -0
- silkweb-0.1.0/docs/guides/parsing.md +163 -0
- silkweb-0.1.0/docs/guides/recipes.md +156 -0
- silkweb-0.1.0/docs/guides/sessions.md +168 -0
- silkweb-0.1.0/docs/guides/silkql.md +181 -0
- silkweb-0.1.0/docs/guides/watch.md +128 -0
- silkweb-0.1.0/docs/index.md +132 -0
- silkweb-0.1.0/docs/quickstart.md +185 -0
- silkweb-0.1.0/docs/reference/api.md +149 -0
- silkweb-0.1.0/docs/reference/cache.md +48 -0
- silkweb-0.1.0/docs/reference/cli.md +133 -0
- silkweb-0.1.0/docs/reference/config.md +17 -0
- silkweb-0.1.0/docs/reference/exceptions.md +9 -0
- silkweb-0.1.0/docs/reference/page.md +21 -0
- silkweb-0.1.0/docs/reference/providers.md +53 -0
- silkweb-0.1.0/docs/stylesheets/extra.css +13 -0
- silkweb-0.1.0/mkdocs.yml +123 -0
- silkweb-0.1.0/pyproject.toml +196 -0
- silkweb-0.1.0/silkweb/__init__.py +862 -0
- silkweb-0.1.0/silkweb/cache/__init__.py +14 -0
- silkweb-0.1.0/silkweb/cache/http.py +91 -0
- silkweb-0.1.0/silkweb/cache/manager.py +71 -0
- silkweb-0.1.0/silkweb/cache/page.py +284 -0
- silkweb-0.1.0/silkweb/cache/selectors.py +139 -0
- silkweb-0.1.0/silkweb/cli/__init__.py +1 -0
- silkweb-0.1.0/silkweb/cli/main.py +443 -0
- silkweb-0.1.0/silkweb/config.py +143 -0
- silkweb-0.1.0/silkweb/crawl/__init__.py +6 -0
- silkweb-0.1.0/silkweb/crawl/crawler.py +216 -0
- silkweb-0.1.0/silkweb/crawl/dedup.py +105 -0
- silkweb-0.1.0/silkweb/crawl/sitemap.py +154 -0
- silkweb-0.1.0/silkweb/discover.py +275 -0
- silkweb-0.1.0/silkweb/exceptions.py +112 -0
- silkweb-0.1.0/silkweb/fetch/__init__.py +1 -0
- silkweb-0.1.0/silkweb/fetch/orchestrator.py +566 -0
- silkweb-0.1.0/silkweb/fetch/tiers/__init__.py +1 -0
- silkweb-0.1.0/silkweb/fetch/tiers/curl_cffi_fetcher.py +175 -0
- silkweb-0.1.0/silkweb/fetch/tiers/httpx_fetcher.py +199 -0
- silkweb-0.1.0/silkweb/fetch/tiers/network_capture.py +58 -0
- silkweb-0.1.0/silkweb/fetch/tiers/playwright_fetcher.py +307 -0
- silkweb-0.1.0/silkweb/fetch/tiers/stealth_fetcher.py +397 -0
- silkweb-0.1.0/silkweb/llm/__init__.py +1 -0
- silkweb-0.1.0/silkweb/llm/chunking/__init__.py +6 -0
- silkweb-0.1.0/silkweb/llm/chunking/bm25.py +53 -0
- silkweb-0.1.0/silkweb/llm/chunking/budget.py +44 -0
- silkweb-0.1.0/silkweb/llm/chunking/dispatcher.py +45 -0
- silkweb-0.1.0/silkweb/llm/chunking/dom.py +106 -0
- silkweb-0.1.0/silkweb/llm/chunking/semantic.py +80 -0
- silkweb-0.1.0/silkweb/llm/chunking/token.py +67 -0
- silkweb-0.1.0/silkweb/llm/constrained.py +196 -0
- silkweb-0.1.0/silkweb/llm/pipelines/__init__.py +1 -0
- silkweb-0.1.0/silkweb/llm/pipelines/clean.py +208 -0
- silkweb-0.1.0/silkweb/llm/pipelines/extract.py +462 -0
- silkweb-0.1.0/silkweb/llm/pipelines/heal.py +178 -0
- silkweb-0.1.0/silkweb/llm/pipelines/orchestrator.py +286 -0
- silkweb-0.1.0/silkweb/llm/pipelines/schema.py +162 -0
- silkweb-0.1.0/silkweb/llm/pipelines/selectors.py +106 -0
- silkweb-0.1.0/silkweb/llm/providers/__init__.py +6 -0
- silkweb-0.1.0/silkweb/llm/providers/anthropic.py +104 -0
- silkweb-0.1.0/silkweb/llm/providers/base.py +195 -0
- silkweb-0.1.0/silkweb/llm/providers/llamacpp.py +112 -0
- silkweb-0.1.0/silkweb/llm/providers/ollama.py +103 -0
- silkweb-0.1.0/silkweb/llm/providers/openai.py +145 -0
- silkweb-0.1.0/silkweb/llm/providers/registry.py +227 -0
- silkweb-0.1.0/silkweb/observability/__init__.py +16 -0
- silkweb-0.1.0/silkweb/observability/logging.py +69 -0
- silkweb-0.1.0/silkweb/observability/metrics.py +121 -0
- silkweb-0.1.0/silkweb/observability/replay.py +163 -0
- silkweb-0.1.0/silkweb/output/__init__.py +25 -0
- silkweb-0.1.0/silkweb/output/dataframe.py +59 -0
- silkweb-0.1.0/silkweb/output/dataset.py +28 -0
- silkweb-0.1.0/silkweb/output/files.py +144 -0
- silkweb-0.1.0/silkweb/parse/__init__.py +1 -0
- silkweb-0.1.0/silkweb/parse/page.py +383 -0
- silkweb-0.1.0/silkweb/recipes/__init__.py +5 -0
- silkweb-0.1.0/silkweb/recipes/amazon-product.yaml +17 -0
- silkweb-0.1.0/silkweb/recipes/github-repo.yaml +18 -0
- silkweb-0.1.0/silkweb/recipes/google-serp.yaml +17 -0
- silkweb-0.1.0/silkweb/recipes/hacker-news.yaml +18 -0
- silkweb-0.1.0/silkweb/recipes/news-article.yaml +15 -0
- silkweb-0.1.0/silkweb/recipes/product-listing.yaml +17 -0
- silkweb-0.1.0/silkweb/recipes/reddit-posts.yaml +19 -0
- silkweb-0.1.0/silkweb/recipes/registry.py +244 -0
- silkweb-0.1.0/silkweb/session/__init__.py +6 -0
- silkweb-0.1.0/silkweb/session/recorder.py +115 -0
- silkweb-0.1.0/silkweb/session/session.py +307 -0
- silkweb-0.1.0/silkweb/silkql/__init__.py +13 -0
- silkweb-0.1.0/silkweb/silkql/compiler.py +217 -0
- silkweb-0.1.0/silkweb/silkql/executor.py +421 -0
- silkweb-0.1.0/silkweb/silkql/parser.py +163 -0
- silkweb-0.1.0/silkweb/stealth/__init__.py +1 -0
- silkweb-0.1.0/silkweb/stealth/behavior.py +123 -0
- silkweb-0.1.0/silkweb/stealth/proxy.py +143 -0
- silkweb-0.1.0/silkweb/stealth/rate_limit.py +205 -0
- silkweb-0.1.0/silkweb/watch.py +261 -0
- silkweb-0.1.0/tests/conftest.py +83 -0
- silkweb-0.1.0/tests/test_cache_http.py +34 -0
- silkweb-0.1.0/tests/test_cache_manager.py +18 -0
- silkweb-0.1.0/tests/test_cache_page.py +39 -0
- silkweb-0.1.0/tests/test_chunking.py +97 -0
- silkweb-0.1.0/tests/test_clean_pipeline.py +88 -0
- silkweb-0.1.0/tests/test_cli.py +51 -0
- silkweb-0.1.0/tests/test_configure_strict.py +26 -0
- silkweb-0.1.0/tests/test_constrained_decoder.py +57 -0
- silkweb-0.1.0/tests/test_constrained_more.py +62 -0
- silkweb-0.1.0/tests/test_crawler.py +216 -0
- silkweb-0.1.0/tests/test_curl_cffi_fetcher.py +97 -0
- silkweb-0.1.0/tests/test_discover_api.py +76 -0
- silkweb-0.1.0/tests/test_extract_pipeline.py +95 -0
- silkweb-0.1.0/tests/test_extraction_payload.py +128 -0
- silkweb-0.1.0/tests/test_fetch_integration_playwright.py +31 -0
- silkweb-0.1.0/tests/test_fetch_integration_stealth.py +52 -0
- silkweb-0.1.0/tests/test_http_cache_memory.py +12 -0
- silkweb-0.1.0/tests/test_httpx_cache_retry.py +52 -0
- silkweb-0.1.0/tests/test_httpx_fetcher.py +67 -0
- silkweb-0.1.0/tests/test_llm_orchestrator_heal.py +233 -0
- silkweb-0.1.0/tests/test_llm_providers.py +168 -0
- silkweb-0.1.0/tests/test_network_capture.py +35 -0
- silkweb-0.1.0/tests/test_orchestrator.py +175 -0
- silkweb-0.1.0/tests/test_output_files.py +122 -0
- silkweb-0.1.0/tests/test_output_files_errors.py +32 -0
- silkweb-0.1.0/tests/test_page.py +144 -0
- silkweb-0.1.0/tests/test_playwright_fetcher.py +98 -0
- silkweb-0.1.0/tests/test_proxy_integration.py +26 -0
- silkweb-0.1.0/tests/test_proxy_pool.py +60 -0
- silkweb-0.1.0/tests/test_public_api_e2e.py +319 -0
- silkweb-0.1.0/tests/test_public_api_wrappers.py +70 -0
- silkweb-0.1.0/tests/test_public_api_wrappers_more.py +51 -0
- silkweb-0.1.0/tests/test_rate_limiter.py +59 -0
- silkweb-0.1.0/tests/test_recipes.py +88 -0
- silkweb-0.1.0/tests/test_recipes_run_schema.py +52 -0
- silkweb-0.1.0/tests/test_replay_mode.py +72 -0
- silkweb-0.1.0/tests/test_schema_pipeline.py +116 -0
- silkweb-0.1.0/tests/test_seen_set.py +23 -0
- silkweb-0.1.0/tests/test_selector_cache.py +75 -0
- silkweb-0.1.0/tests/test_self_healer.py +33 -0
- silkweb-0.1.0/tests/test_session.py +56 -0
- silkweb-0.1.0/tests/test_silkql_compile_execute.py +216 -0
- silkweb-0.1.0/tests/test_silkql_compiler_more.py +34 -0
- silkweb-0.1.0/tests/test_silkql_parser.py +120 -0
- silkweb-0.1.0/tests/test_stealth_engine_selection.py +27 -0
- silkweb-0.1.0/tests/test_watch.py +107 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
tests:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.11", "3.12"]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
cache: pip
|
|
25
|
+
cache-dependency-path: pyproject.toml
|
|
26
|
+
|
|
27
|
+
- name: Install package and test tools
|
|
28
|
+
run: python -m pip install -U pip wheel && python -m pip install -e ".[test]"
|
|
29
|
+
|
|
30
|
+
- name: Run tests
|
|
31
|
+
run: python -m pytest
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Deploy documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: pages
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
cache: pip
|
|
27
|
+
cache-dependency-path: pyproject.toml
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: python -m pip install -e ".[docs]"
|
|
31
|
+
|
|
32
|
+
- name: Build MkDocs site
|
|
33
|
+
run: python -m mkdocs build --strict
|
|
34
|
+
|
|
35
|
+
- uses: actions/upload-pages-artifact@v3
|
|
36
|
+
with:
|
|
37
|
+
path: site
|
|
38
|
+
|
|
39
|
+
deploy:
|
|
40
|
+
needs: build
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
environment:
|
|
43
|
+
name: github-pages
|
|
44
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
45
|
+
steps:
|
|
46
|
+
- id: deployment
|
|
47
|
+
uses: actions/deploy-pages@v4
|
silkweb-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
|
|
5
|
+
.ruff_cache/
|
|
6
|
+
.pytest_cache/
|
|
7
|
+
.mypy_cache/
|
|
8
|
+
.coverage
|
|
9
|
+
coverage.xml
|
|
10
|
+
htmlcov/
|
|
11
|
+
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
ENV/
|
|
16
|
+
|
|
17
|
+
build/
|
|
18
|
+
dist/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
|
|
21
|
+
.DS_Store
|
|
22
|
+
Thumbs.db
|
|
23
|
+
|
|
24
|
+
# Editor
|
|
25
|
+
.vscode/
|
|
26
|
+
.idea/
|
|
27
|
+
|
|
28
|
+
# Local state
|
|
29
|
+
*.log
|
|
30
|
+
silkweb_replays/
|
|
31
|
+
|
|
32
|
+
# Secrets (create `.env` locally; never commit)
|
|
33
|
+
.env
|
|
34
|
+
.env.local
|
|
35
|
+
|
|
36
|
+
# MkDocs
|
|
37
|
+
site/
|
|
38
|
+
|
|
39
|
+
# Local examples and notebooks (not published to remote)
|
|
40
|
+
examples/
|
|
41
|
+
notebooks/
|
|
42
|
+
|
|
43
|
+
# Optional local-only files (not part of the published tree)
|
|
44
|
+
.githooks/
|
|
45
|
+
|
|
46
|
+
# Local-only names (not published)
|
|
47
|
+
*.example
|
|
48
|
+
gitignore.template
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve Silkweb.
|
|
4
|
+
|
|
5
|
+
### Development setup
|
|
6
|
+
|
|
7
|
+
- Python **3.10+**
|
|
8
|
+
- Install in editable mode:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
python -m pip install -e ".[all]"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The repository includes a root `.gitignore` (do not commit `*.example` files). Create a local `.env` for API keys when needed; do not commit it.
|
|
15
|
+
|
|
16
|
+
### Linting / formatting
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
ruff check .
|
|
20
|
+
ruff format .
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Guidelines
|
|
24
|
+
|
|
25
|
+
- Keep the public API in `silkweb/__init__.py` stable.
|
|
26
|
+
- Prefer small, focused PRs.
|
|
27
|
+
- Add or update tests when implementing non-trivial behavior.
|
|
28
|
+
|
silkweb-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Silkweb Contributors
|
|
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.
|
|
22
|
+
|