# AskNews Python SDK

Python SDK for the AskNews API.
## Installation
```bash
pip install asknews
```
## Usage
```python
from asknews_sdk import AskNewsSDK
ask = AskNewsSDK(
client_id=<"YOUR_CLIENT_ID>",
client_secret="<YOUR_CLIENT_SECRET>",
scopes=["news", "chat", "stories", "analytics"]
)
query = "Effect of fed policy on tech sector"
# prompt-optimized string ready to go for any LLM:
news_context = ask.news.search_news(query).as_string
```
And you will have a prompt-optimized string ready to go for any LLM. The API doesn't stop there, explore a wide range of endpoints:
- /stories, high level event tracking and state of the art article clustering
- /forecasts, industry leading forecasting on any real-time event
- /analytics, time-series data on finance and politics
- /chat, an OpenAI compatible endpoint infused with news
- /graph, build any news knowledge graph imaginable from the largest news graph on the planet
- /websearch, search the web and get back an LLM distillation of all the relevant web pages
Find full details at the [AskNews API documentation](https://docs.asknews.app).
## Support
Join our [Discord](https://discord.gg/2Yw66XXEhY) to see what other people are building, and to get support with your projects.
Raw data
{
"_id": null,
"home_page": "https://github.com/emergentmethods/asknews-python-sdk",
"name": "asknews",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8.1",
"maintainer_email": null,
"keywords": null,
"author": "Emergent Methods",
"author_email": "contact@emergentmethods.ai",
"download_url": null,
"platform": null,
"description": "# AskNews Python SDK\n\n\n\nPython SDK for the AskNews API.\n\n## Installation\n\n```bash\npip install asknews\n```\n\n## Usage\n\n```python\nfrom asknews_sdk import AskNewsSDK\n\nask = AskNewsSDK(\n client_id=<\"YOUR_CLIENT_ID>\",\n client_secret=\"<YOUR_CLIENT_SECRET>\",\n scopes=[\"news\", \"chat\", \"stories\", \"analytics\"]\n)\n\nquery = \"Effect of fed policy on tech sector\"\n\n# prompt-optimized string ready to go for any LLM:\nnews_context = ask.news.search_news(query).as_string\n```\n\nAnd you will have a prompt-optimized string ready to go for any LLM. The API doesn't stop there, explore a wide range of endpoints:\n\n- /stories, high level event tracking and state of the art article clustering\n- /forecasts, industry leading forecasting on any real-time event\n- /analytics, time-series data on finance and politics\n- /chat, an OpenAI compatible endpoint infused with news\n- /graph, build any news knowledge graph imaginable from the largest news graph on the planet\n- /websearch, search the web and get back an LLM distillation of all the relevant web pages\n\nFind full details at the [AskNews API documentation](https://docs.asknews.app).\n\n## Support\n\nJoin our [Discord](https://discord.gg/2Yw66XXEhY) to see what other people are building, and to get support with your projects.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python SDK for AskNews",
"version": "0.7.50",
"project_urls": {
"Homepage": "https://github.com/emergentmethods/asknews-python-sdk",
"Repository": "https://github.com/emergentmethods/asknews-python-sdk"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4d68ecc7d787b8e6dc644453b5183f050d82b0aa48c7e5a6ade3d2e0fad654bd",
"md5": "859ef63be4449d606f177de06d155b91",
"sha256": "987ce6cf27c4494b3c5007cfe740efd0f725018507871e4391ebc9aa85bda344"
},
"downloads": -1,
"filename": "asknews-0.7.50-py3-none-any.whl",
"has_sig": false,
"md5_digest": "859ef63be4449d606f177de06d155b91",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8.1",
"size": 29238,
"upload_time": "2024-10-20T05:17:25",
"upload_time_iso_8601": "2024-10-20T05:17:25.541265Z",
"url": "https://files.pythonhosted.org/packages/4d/68/ecc7d787b8e6dc644453b5183f050d82b0aa48c7e5a6ade3d2e0fad654bd/asknews-0.7.50-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-20 05:17:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "emergentmethods",
"github_project": "asknews-python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "asknews"
}