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.2.0.tar.gz
(12.9 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.2.0.tar.gz.
File metadata
- Download URL: polaris_news-0.2.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ec0ffff379e24bf945c475b885b71605648f2f4ea2161ab9327826ef184a545
|
|
| MD5 |
c474ede023c989a9f0eb1b759d4cc921
|
|
| BLAKE2b-256 |
b5c939cf0c84e17eb4e525b6a848ac4bf6a3383c9ea2f4a9fd133ab0a5f479c6
|
File details
Details for the file polaris_news-0.2.0-py3-none-any.whl.
File metadata
- Download URL: polaris_news-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.9 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 |
003a11614ec8912cfe7ad08fc468c92bf555f86a0260ff5cd2c41882f70f3589
|
|
| MD5 |
575a2e18e8780f1dbe56636c6113b8dc
|
|
| BLAKE2b-256 |
7d27a59474cf85cfd93cf6801fbe9735746c121b9b804eccc48aeeede0c2878a
|