Metadata-Version: 2.4
Name: athenanewsapi
Version: 0.1.2
Summary: A simple wrapper for the Athena News API to simplify searching for articles.
Home-page: https://github.com/athenanewsapi/athenanews
Author: Matt F.
Author-email: matt@runathena.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Athena News API Wrapper

A simple Python wrapper for the [Athena News API](https://runathena.com) 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](https://app.runathena.com/register). 

## 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.

