Athena News API Wrapper
A simple Python wrapper for the Athena News API that simplifies querying and retrieving news articles.
Features
- Simplified API Access: Easily send queries to the Athena News API.
- Automatic Polling: Automatically polls until the query is processed.
- Pagination Handling: Fetches all available articles across multiple pages.
Installation
Install the package via pip (after publishing to PyPI):
pip install athenanewsapi
Or install directly from source:
git clone https://github.com/athenanewsapi/athenanews.git
cd athenanewsapi
pip install .
Then get your API key by creating an Athena account.
Usage
Import the package and call the news function with the required parameters:
from athenanewsapi import news
articles = news(
start_date="2025-03-01T15:13:52.466Z",
end_date="2025-03-20T15:13:52.466Z",
query="Tesla dealership protests",
key_phrases="('tesla takedown')",
toggle_state="All Articles",
api_key="YOUR_API_KEY"
)
print("Total articles fetched:", len(articles))
API Reference
news(start_date, end_date, query, key_phrases, toggle_state, api_key)
- start_date (str): ISO formatted start date.
- end_date (str): ISO formatted end date.
- query (str): The search query.
- key_phrases (str) OPTIONAL: Key phrases to refine the search. (ex:
('elon' or 'musk') and not 'sam altman') - toggle_state (str) OPTIONAL: The toggle state (e.g., "All Articles" or "Encoded Articles").
- api_key (str): Your Athena API key.
Returns: A list of articles returned by the API.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Metadata
Release files for athenanewsapi 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| athenanewsapi-0.1.3.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| athenanewsapi-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.8 kB
Release files / athenanewsapi-0.1.3.tar.gz
| Download URL | athenanewsapi-0.1.3.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c30c59f06cfd0f5b3a2fcc6fac1463098b0b7960772a1510bff363ea5beca110
|
|
BLAKE2b-256 checksum How to use checksums |
94d9c15217be3c635051ba26727e01b6121eeef2ecdf7e09dbd6c287018dbb4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Release files / athenanewsapi-0.1.3-py3-none-any.whl
| Download URL | athenanewsapi-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
784fc1f7fd2e8f3d54b878c2b9ec451608e9debea4ba360a395a0f2834fd3421
|
|
BLAKE2b-256 checksum How to use checksums |
85cc578f4182293173c03ba0404fe02349fdeefc80f901b44be2de0cb8ed8d93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|