Official Python SDK for The Polaris Report API
Project description
polaris-news
Official Python SDK for The Polaris Report API.
Installation
pip install polaris-news
Quick Start
from polaris_news import PolarisClient
client = PolarisClient(api_key="your-api-key")
feed = client.feed(category="technology", limit=10)
for brief in feed.briefs:
print(brief.headline)
Methods
| Method | Description |
|---|---|
feed(category?, limit?, page?, per_page?, min_confidence?) |
Get the news feed |
brief(brief_id, include_full_text?) |
Get a single brief by ID |
search(query, category?, page?, per_page?, sort?, min_confidence?, from_date?, to_date?, entity?, sentiment?) |
Search briefs |
generate(topic, category?) |
Generate a brief on a topic |
entities(q?, type?, limit?) |
List entities |
entity_briefs(name, role?, limit?, offset?) |
Get briefs for an entity |
trending_entities(limit?) |
Get trending entities |
similar(brief_id, limit?) |
Get similar briefs |
clusters(period?, limit?) |
Get brief clusters |
data(entity?, type?, limit?) |
Get structured data points |
agent_feed(category?, tags?, limit?, min_confidence?) |
Get agent-optimized feed |
compare_sources(brief_id) |
Compare sources for a brief |
trending(period?, limit?) |
Get trending briefs |
stream(categories?) |
Stream briefs via SSE (generator) |
Error Handling
from polaris_news import PolarisClient, AuthenticationError, RateLimitError, NotFoundError
client = PolarisClient(api_key="your-api-key")
try:
brief = client.brief("abc123")
except AuthenticationError:
print("Invalid API key")
except NotFoundError:
print("Brief not found")
except RateLimitError as e:
print(f"Rate limited. Retry after: {e.retry_after}s")
Streaming
client = PolarisClient(api_key="your-api-key")
for brief in client.stream(categories="technology,science"):
print(f"[{brief.category}] {brief.headline}")
Documentation
Full API documentation: https://thepolarisreport.com/docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
polaris_news-0.3.0.tar.gz
(16.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polaris_news-0.3.0.tar.gz.
File metadata
- Download URL: polaris_news-0.3.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f487257261d9aba1fa47196fbf3cf1c27eb3d2b1957e35c83c274499e61085ac
|
|
| MD5 |
ad8f403f4ef750f8f1d6f3dfb1b27561
|
|
| BLAKE2b-256 |
89796cc50ccf11f5c2dacfb1a1dc44f49c1d4f36be46ee58fd427a23d2e66956
|
File details
Details for the file polaris_news-0.3.0-py3-none-any.whl.
File metadata
- Download URL: polaris_news-0.3.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd4cfa9c0fb1130a6f8bd9ed9df7ca7394cc404e03e96964664f062da7cd7b06
|
|
| MD5 |
f8a08373ce18b2bfd78e75a4efadb604
|
|
| BLAKE2b-256 |
6b86bfa14f70f22a233b6b68765f8c6d0cec6439925896ef8fffe32c708d9216
|