websource
Standalone website discovery, fetching, parsing, rendering, content extraction, structured extraction, refresh checking, and adapter contracts.
websource is built around strict Pydantic models and protocol interfaces. The
foundation layer owns value objects, enums, request/result models, adapter
descriptors, protocol interfaces, and error contracts. Runtime HTTP, browser,
provider, and website-specific adapters sit outside websource.foundation.
Structured extraction is modeled separately from readable content extraction, so article markdown, recipes, product records, property listings, vehicle ads, jobs, events, and custom schemas can share one transport contract without forcing every page into an article-shaped model.
Install
pip install websource
Optional browser rendering uses Playwright:
pip install "websource[browser]"
python -m playwright install chromium
For local development:
uv sync --all-extras --group dev
uv run --group dev pytest
CLI
websource adapters list --json
websource inspect https://example.com --json
websource discover https://example.com --mode crawl --max-depth 1 --jsonl
websource fetch https://example.com --json
websource fixture replay tests/fixtures/sites/example.com/article.html --url https://example.com/articles/one --json
websource provider run tavily tavily-http https://api.tavily.example/extract extract --input-url https://example.com/article --param schema=article --json
The CLI emits JSON envelopes for validation and runtime errors so agents and
automation can handle failures deterministically.
inspect performs a shallow seed URL probe: robots facts and verified source
hints stay in fields such as robots.sitemap_urls and sitemap_urls, while
unverified conventional fallbacks are labeled as candidate_sitemap_urls.
When no sitemap hint has been verified, sitemap_urls is null, not [].
Use inspect --include-http-headers to append request and response headers for
the HTTP exchanges made during inspection.
Python API
from websource.adapters import DefaultWebsiteClient
from websource.foundation import FetchRequest
client = DefaultWebsiteClient()
result = await client.fetch(FetchRequest(url="https://example.com"))
page = await client.parse_page(result)
content = await client.extract_content(page)
Custom adapters can subclass SiteSpecificAdapter and advertise only the
capabilities they override. Managed providers can use
HttpManagedProviderAdapter while provider-specific packages stabilize.
Built-in vertical schemas are available through websource.schemas for recipes,
products, property listings, vehicle listings, job postings, and events.
Release Checks
uv run --group dev ruff check src tests
uv run --group dev mypy src tests
uv run --group dev pytest
uv run --group dev bandit -r src
uv build
scripts/verify-package-install.sh
Documentation
- Docs index
- Foundation contracts
- Website client architecture
- Adapter design
- CLI and tool surface
- Vertical schemas
- JSON schemas
- Release policy
- Implementation plan
License
MIT
Metadata
Release files for websource 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| websource-0.1.2.tar.gz | 115.4 kB | With provenance | Details for websource-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| websource-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for websource-0.1.2-py3-none-any.whl |
Total release size: 197.8 kB
Release files / websource-0.1.2.tar.gz
| Download URL | websource-0.1.2.tar.gz |
|---|---|
| Size | 115.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5971f8684d5c41e5e7d010c3c18d72986c11a613f64469dbd19ed21bb408a15
|
|
BLAKE2b-256 checksum How to use checksums |
20d36b2d98abdef0f4dd1393a63827f05e28fa223a91c645d00de0a09a08dd16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logRelease files / websource-0.1.2-py3-none-any.whl
| Download URL | websource-0.1.2-py3-none-any.whl |
|---|---|
| Size | 82.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d9069f6c401e026cf941618243ae7a02e5f0044addaccfff6438247bd9ff150
|
|
BLAKE2b-256 checksum How to use checksums |
c1f31686d4a015753ff38b4abdcbe9381ae5de81816fb4e6ebf9826705e1d753
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logSecurity for websource 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for websource-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.