llama-index-readers-zyte-serp


Namellama-index-readers-zyte-serp JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
Summaryllama-index readers zyte-serp integration
upload_time2024-10-09 00:00:37
maintainerNone
docs_urlNone
authorYour Name
requires_python<4.0,>=3.8.1
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LlamaIndex Readers Integration: Zyte-Serp

ZyteSerp can be used to add organic search results from Google Search. It takes a `query` and returns top search results urls.

## Instructions for ZyteSerpReader

### Setup and Installation

`pip install llama-index-readers-zyte-serp`

Secure an API key from [Zyte](https://www.zyte.com/zyte-api/) to access the Zyte services.

### Using ZyteSerpReader

- **Initialization**: Initialize the ZyteSerpReader by providing the API key and the option for extraction ("httpResponseBody" or "browserHtml").

  ```python
  from llama_index.readers.zyte_serp import ZyteSerpReader

  zyte_serp = ZyteSerpReader(
      api_key="your_api_key_here",
      extract_from="httpResponseBody",  # or "browserHtml"
  )
  ```

- **Loading Data**: To load search results, use the `load_data` method with the query you wish to search.

```python
documents = zyte_serp.load_data(query="llama index docs")
```

### Example Usage

Here is an example demonstrating how to initialize the ZyteSerpReader and get top search URLs.
Further the content from these URLs can be loaded using ZyteWebReader in "article" mode to obtain just the article content from webpage.

```python
from llama_index.readers.zyte_serp import ZyteSerpReader
from llama_index.readers.web.zyte.base import ZyteWebReader

# Initialize the ZyteSerpReader with your API key
zyte_serp = ZyteSerpReader(
    api_key="your_api_key_here",  # Replace with your actual API key
)

# Get the search results (URLs from google search results)
search_urls = zyte_serp.load_data(query="llama index docs")

# Display the results
print(search_urls)

urls = [result.text for result in search_urls]

# Initialize the ZyteWebReader to load the content from search results
zyte_web = ZyteWebReader(
    api_key="your_api_key_here",  # Replace with your actual API key
    mode="article",
)

documents = zyte_web.load_data(urls)
print(documents)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-readers-zyte-serp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/08/2d/56d0f89c6bfbffa9f65313e7e78c332b6b06cc7c14aebefa891b8cc26c34/llama_index_readers_zyte_serp-0.1.0.tar.gz",
    "platform": null,
    "description": "# LlamaIndex Readers Integration: Zyte-Serp\n\nZyteSerp can be used to add organic search results from Google Search. It takes a `query` and returns top search results urls.\n\n## Instructions for ZyteSerpReader\n\n### Setup and Installation\n\n`pip install llama-index-readers-zyte-serp`\n\nSecure an API key from [Zyte](https://www.zyte.com/zyte-api/) to access the Zyte services.\n\n### Using ZyteSerpReader\n\n- **Initialization**: Initialize the ZyteSerpReader by providing the API key and the option for extraction (\"httpResponseBody\" or \"browserHtml\").\n\n  ```python\n  from llama_index.readers.zyte_serp import ZyteSerpReader\n\n  zyte_serp = ZyteSerpReader(\n      api_key=\"your_api_key_here\",\n      extract_from=\"httpResponseBody\",  # or \"browserHtml\"\n  )\n  ```\n\n- **Loading Data**: To load search results, use the `load_data` method with the query you wish to search.\n\n```python\ndocuments = zyte_serp.load_data(query=\"llama index docs\")\n```\n\n### Example Usage\n\nHere is an example demonstrating how to initialize the ZyteSerpReader and get top search URLs.\nFurther the content from these URLs can be loaded using ZyteWebReader in \"article\" mode to obtain just the article content from webpage.\n\n```python\nfrom llama_index.readers.zyte_serp import ZyteSerpReader\nfrom llama_index.readers.web.zyte.base import ZyteWebReader\n\n# Initialize the ZyteSerpReader with your API key\nzyte_serp = ZyteSerpReader(\n    api_key=\"your_api_key_here\",  # Replace with your actual API key\n)\n\n# Get the search results (URLs from google search results)\nsearch_urls = zyte_serp.load_data(query=\"llama index docs\")\n\n# Display the results\nprint(search_urls)\n\nurls = [result.text for result in search_urls]\n\n# Initialize the ZyteWebReader to load the content from search results\nzyte_web = ZyteWebReader(\n    api_key=\"your_api_key_here\",  # Replace with your actual API key\n    mode=\"article\",\n)\n\ndocuments = zyte_web.load_data(urls)\nprint(documents)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index readers zyte-serp integration",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "666b0d08de266f32938f8178e193ce7acf99b454c344d495126cc0ab0edf6531",
                "md5": "9fd35deb87bca5efb76eef42add7b582",
                "sha256": "b614a6ea292544c5303aae22913522f775c540857c9a1759865c488a2a8196ae"
            },
            "downloads": -1,
            "filename": "llama_index_readers_zyte_serp-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9fd35deb87bca5efb76eef42add7b582",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 3397,
            "upload_time": "2024-10-09T00:00:36",
            "upload_time_iso_8601": "2024-10-09T00:00:36.759009Z",
            "url": "https://files.pythonhosted.org/packages/66/6b/0d08de266f32938f8178e193ce7acf99b454c344d495126cc0ab0edf6531/llama_index_readers_zyte_serp-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "082d56d0f89c6bfbffa9f65313e7e78c332b6b06cc7c14aebefa891b8cc26c34",
                "md5": "aa75bf0d8701419b2a1ddaf3fddbf36c",
                "sha256": "538179af0d2c75a9518c117fe4abb215b38fe41a99d353ecedcc601987f05122"
            },
            "downloads": -1,
            "filename": "llama_index_readers_zyte_serp-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "aa75bf0d8701419b2a1ddaf3fddbf36c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 2992,
            "upload_time": "2024-10-09T00:00:37",
            "upload_time_iso_8601": "2024-10-09T00:00:37.884070Z",
            "url": "https://files.pythonhosted.org/packages/08/2d/56d0f89c6bfbffa9f65313e7e78c332b6b06cc7c14aebefa891b8cc26c34/llama_index_readers_zyte_serp-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 00:00:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-zyte-serp"
}
        
Elapsed time: 0.52062s