# PyBingScrapper
Python wrapper for Bing Search results.
## Implementation
```
pip install PyBingScrapper
```
Below is a simple example for running the library
```python
from PyBingScrapper.search import BingSearch
bing = BingSearch("Narendra Modi")
#num - num of results to return
#max_lines - maximum number of lines/sentences to return in each result
bing_results = bing.get_results(num=4, max_lines=15)
# bing_results[i]['content'] - scrapped content
# nlines - num of iterations
# hfkey - hugging face secret key
print(bing.rag_output("Tell me about Mr. Narendra Modi?", bing_results, hfkey, n_iters=15)) #n_iters-optional
```
To only scrape results from the web use the below code snippet
```python
bing = BingSearch("Narendra Modi")
bing_results = bing.get_results(num=4, max_lines=15)
# the above code provides the top 4 results from bing search with 15 sentences from each result as content
```
To implement RAG algorithm over the query use the below. RAG - RAG is a framework/algorithm to improve LLM-generated responses by leveraging external information such as Wikipedia information etc for the queried prompt.
```python
print(bing.rag_output(bing_results, hfkey, n_iters=15))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Vishnunkumar/PyBingScrapper/",
"name": "PyBingScrapper",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "bing search python",
"author": "Vishnu Nandakumar",
"author_email": "nkumarvishnu25@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b5/3c/41861b46c8bc4039d7b6e3c57cae28cb53cb84c326f0375fe205d5ef1778/PyBingScrapper-1.0.3.tar.gz",
"platform": null,
"description": "# PyBingScrapper\nPython wrapper for Bing Search results.\n\n## Implementation\n\n```\npip install PyBingScrapper\n```\n\nBelow is a simple example for running the library\n\n```python\nfrom PyBingScrapper.search import BingSearch\n\nbing = BingSearch(\"Narendra Modi\")\n#num - num of results to return\n#max_lines - maximum number of lines/sentences to return in each result\n\nbing_results = bing.get_results(num=4, max_lines=15)\n# bing_results[i]['content'] - scrapped content\n# nlines - num of iterations\n# hfkey - hugging face secret key\n\nprint(bing.rag_output(\"Tell me about Mr. Narendra Modi?\", bing_results, hfkey, n_iters=15)) #n_iters-optional\n\n```\nTo only scrape results from the web use the below code snippet\n\n```python\nbing = BingSearch(\"Narendra Modi\")\nbing_results = bing.get_results(num=4, max_lines=15)\n\n# the above code provides the top 4 results from bing search with 15 sentences from each result as content\n```\n\nTo implement RAG algorithm over the query use the below. RAG - RAG is a framework/algorithm to improve LLM-generated responses by leveraging external information such as Wikipedia information etc for the queried prompt.\n\n```python\nprint(bing.rag_output(bing_results, hfkey, n_iters=15))\n```\n\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Python wrapper for Bing Search and RAG extraction",
"version": "1.0.3",
"project_urls": {
"Homepage": "https://github.com/Vishnunkumar/PyBingScrapper/"
},
"split_keywords": [
"bing",
"search",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b53c41861b46c8bc4039d7b6e3c57cae28cb53cb84c326f0375fe205d5ef1778",
"md5": "ad89d1450c6151f6346c267d94193c68",
"sha256": "8473f064fd9679ad4833c9f8352c160811a9ed8d94f36f565002bed5d2f528b6"
},
"downloads": -1,
"filename": "PyBingScrapper-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "ad89d1450c6151f6346c267d94193c68",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5605,
"upload_time": "2023-11-06T17:30:42",
"upload_time_iso_8601": "2023-11-06T17:30:42.708652Z",
"url": "https://files.pythonhosted.org/packages/b5/3c/41861b46c8bc4039d7b6e3c57cae28cb53cb84c326f0375fe205d5ef1778/PyBingScrapper-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-06 17:30:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Vishnunkumar",
"github_project": "PyBingScrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pybingscrapper"
}