Metadata-Version: 2.3
Name: asknews
Version: 0.10.4
Summary: Python SDK for AskNews
License: MIT
Author: Emergent Methods
Author-email: contact@emergentmethods.ai
Requires-Python: >=3.8.1,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: asgiref (>=3.7.2,<4.0.0)
Requires-Dist: crontab (>=1.0.1,<2.0.0)
Requires-Dist: cryptography (>=40.0.0,<43.0.4)
Requires-Dist: httpx (>=0.27.2,<0.28.0)
Requires-Dist: orjson (>=3.9.10,<4.0.0)
Requires-Dist: pydantic[email] (>=2.10.4,<3.0.0)
Project-URL: Repository, https://github.com/emergentmethods/asknews-python-sdk
Description-Content-Type: text/markdown

# AskNews Python SDK

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asknews?style=flat-square)

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.

