LlamaIndex Readers Integration: ContextFetch
pip install llama-index-readers-contextfetch
The ContextFetch reader loads web pages as LlamaIndex Documents with the page's Markdown as text, using the ContextFetch API. Give it URLs, a web search query, or both.
Pass api_key, or set the CONTEXTFETCH_API_KEY environment variable. With
neither, requests use ContextFetch's keyless tier, a small daily allowance per IP.
The contextfetch package can request a free starter key:
from contextfetch import ContextFetch; ContextFetch().free_key().
Usage
from llama_index.core import VectorStoreIndex
from llama_index.readers.contextfetch import ContextFetchReader
reader = ContextFetchReader() # or ContextFetchReader(api_key="...")
# Pages by URL
documents = reader.load_data(
urls=["https://docs.python.org/3/library/asyncio-task.html"]
)
# The pages a web search finds
documents = reader.load_data(query="asyncio task groups", num_results=5)
index = VectorStoreIndex.from_documents(documents)
Each Document has id_ set to its URL and metadata url, title and, when the
page provides them, published_date and author. A URL that fails to load is
skipped and logged as a warning.
This loader is designed to be used as a way to load data into LlamaIndex.
For an agent tool, see llama-index-tools-contextfetch.
Metadata
Release files for llama-index-readers-contextfetch 0.1.0
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 |
|---|---|---|---|---|
| llama_index_readers_contextfetch-0.1.0.tar.gz | 3.7 kB | Without provenance | Details for llama_index_readers_contextfetch-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_readers_contextfetch-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_readers_contextfetch-0.1.0-py3-none-any.whl |
Total release size: 8.1 kB
Release files / llama_index_readers_contextfetch-0.1.0.tar.gz
| Download URL | llama_index_readers_contextfetch-0.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c53896bad2ae3c8df52f41ca600ba7780f73b6ed6110b001c7c16a5a157558c5
|
|
BLAKE2b-256 checksum How to use checksums |
b417d8d2b1d54c01ddb68d3d1ff5e43d6491ee60914245ff9a63881a05dc88a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / llama_index_readers_contextfetch-0.1.0-py3-none-any.whl
| Download URL | llama_index_readers_contextfetch-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca353283a02d21b5fb0bcef4cb49d9ea09d36c12874184607c2891171d7ff33d
|
|
BLAKE2b-256 checksum How to use checksums |
26c4bbcb8d1301ad1053b6229ec8f49293ccc97d98dc86e5d2e67b08a0d8f8b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for llama-index-readers-contextfetch 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.