Skip to main content

A simple wrapper for the Athena News API to simplify searching for articles.

Project description

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/yourusername/athenanewsapi.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): Key phrases to refine the search. (ex: ('elon' or 'musk') and not 'sam altman')
  • toggle_state (str): 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

athenanewsapi-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

athenanewsapi-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file athenanewsapi-0.1.0.tar.gz.

File metadata

  • Download URL: athenanewsapi-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for athenanewsapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c52ac366c9cc719f3c6a847d8109be410b3030729d66004a861877702b7189d5
MD5 803b4eb1e9a723403ee4c6a9fd684314
BLAKE2b-256 dac2a41f47aeae3a245ba1ce702a1fc7b1214ad13c4a8302bfd3084fc5cc13ad

See more details on using hashes here.

File details

Details for the file athenanewsapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: athenanewsapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for athenanewsapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0eee2d2aa48290c29a258491333a9e019506bd7d8c86a573f0d217aa141a37c
MD5 355f6d7d81a134ea155ad89dfbf28d88
BLAKE2b-256 fc37327ac3571f137c48a3910b1b25ee0f79bc354497aa7d128e346b8c32d5d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page