Metadata-Version: 2.4
Name: newsbot
Version: 1.0.0
Summary: AI-powered news posting for X (Twitter)
Author: OmidAlek
Author-email: majid.alekasir@gmail.com
Keywords: python,X,Twitter,gemini,news,automation,Thread,prompt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: requests-oauthlib
Requires-Dist: tweepy
Requires-Dist: google-genai
Requires-Dist: feedparser
Requires-Dist: beautifulsoup4
Requires-Dist: lxml
Requires-Dist: PyYAML
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: requires-dist
Dynamic: summary


# 📰 newsbot

> **News in. AI in the middle. Posts out.**

A lightweight Python package that automatically turns news into AI-generated posts for **X (Twitter)**.

Everything that makes **your bot** unique—its personality, news sources, schedule, prompts, and API keys—lives in a single `manifest.yaml`.

```python
from newsbot import XBot

bot = XBot("manifest.yaml")
bot.run()
```

That's it.

`newsbot` loads your manifest, fetches the latest headlines, generates content using your preferred LLM, and publishes directly to X.

No boilerplate. No frameworks. No GitHub Actions.

Run it anywhere Python runs:

- Cron jobs
- Flask / FastAPI
- AWS Lambda
- Discord bots
- Background workers
- Your own scripts

---

# ✨ Why newsbot?

Most AI news bots are a collection of scripts that you fork and customize for every account.

**newsbot** takes a different approach.

The package stays the same.

Everything account-specific lives inside a single `manifest.yaml`.

That means you can run:

- One package
- Ten manifests
- Ten completely different bots

without changing a single line of Python.

---

# 💎 Managed Hosting Plans

> Don't want to manage servers, scheduling, monitoring, or prompt tuning?
>
> Pick a plan and I'll take care of everything.

| Feature | 🚀 ![](https://img.shields.io/badge/STARTER-4CAF50?style=for-the-badge) | 💼 ![](https://img.shields.io/badge/PROFESSIONAL-2196F3?style=for-the-badge) | 🏢 ![](https://img.shields.io/badge/ENTERPRISE-6A1B9A?style=for-the-badge) |
|:--|:--:|:--:|:--:|
| Managed Hosting | ✅ | ✅ | ✅ |
| Automatic Updates | ✅ | ✅ | ✅ |
| Scheduled Posting | ✅ | ✅ | ✅ |
| Gemini AI Integration | ✅ | ✅ | ✅ |
| Live Email Report | — | ✅ | ✅ |
| AI Image Generation | — | ✅ | ✅ |
| Fully Customized Bot Logic | — | — | ✅ |
| Dedicated Support & Consulting | — | — | ✅ |
| Prompt Optimization | — | Basic | Advanced |

## Pricing

| Plan | Price |
|------|------:|
| 🚀 STARTER | **$20/month** |
| 💼 PROFESSIONAL | **$40/month** |
| 🏢 ENTERPRISE | **$150 setup + $40/month** |

### Notes

- You provide your own X API credentials.
- Gemini usage is currently free.
- X API charges (if applicable) are billed directly by X.

📧 **majid.alekasir@gmail.com**

---

# 📦 Installation

Install from PyPI:

```bash
pip install newsbot
```

Or install from source:

```bash
git clone git@github.com:OmidAlekasir/newsbot.git
cd newsbot
pip install -e .
```

---

# 🚀 Quick Start

## 1. Copy the example manifest

Copy:

```text
manifest.example.yaml
```

to:

```text
manifest.yaml
```

Then configure:

- X API credentials
- AI provider credentials
- RSS feeds
- Prompt configuration

API keys can also be loaded from environment variables:

```yaml
api_key: ${GEMINI_API_KEY}
```

---

## 2. Create your prompts

Place prompt files inside:

```text
prompts/
```

Each prompt should include:

```text
{{news_context}}
```

This placeholder is automatically replaced with the latest news before generation.

---

## 3. Run your bot

```python
from newsbot import XBot

bot = XBot("manifest.yaml")
bot.run()
```

Preview posts without publishing:

```python
bot.run(dry_run=True)
```

---

# ☕ Support the Project

If **newsbot** saves you time or powers your projects, consider supporting future development.

**EVM Address**

```
0x78f8b8e93174Ba5D6C0D24218219e23f014E98a9
```

Every contribution helps improve the project ❤️

---

# 📁 Running Multiple Bots

Each bot has its own manifest.

```python
from newsbot import XBot

morning_bot = XBot("bots/morning/manifest.yaml")
crypto_bot = XBot("bots/crypto/manifest.yaml")

morning_bot.run(prompt_key="morning_flash")
crypto_bot.run()
```

One package.

Different personalities.

Different news sources.

Different X accounts.

---

# 💻 CLI

Run your bot directly from the terminal.

List available prompts:

```bash
python -m newsbot.cli --list-prompts
```

Preview without posting:

```bash
python -m newsbot.cli --dry-run
```

Use a specific prompt:

```bash
python -m newsbot.cli -p contrarian_view
```

---

# 🧠 Manifest Overview

Everything is configured inside one file.

| Section | Description |
|----------|-------------|
| `twitter` | X API credentials |
| `ai` | AI provider, models, and fallback models |
| `news` | RSS feeds, article limits, filters, and media options |
| `prompts` | Prompt templates, personalities, and schedules |
| `run` | Runtime settings such as `dry_run` |

Need a new personality?

Add a prompt.

Need more news sources?

Add RSS feeds.

Want to try another LLM?

Change the model.

No Python code needs to change.

---

# 🎯 Great For

- Personal brands
- AI news accounts
- Crypto bots
- Finance commentary
- Sports updates
- Tech news
- Marketing experiments
- Multi-account operators
- SaaS integrations
- Internal automation

---

# 📂 Project Structure

```text
newsbot/
├── __init__.py
├── core.py
├── config.py
├── ai_client.py
├── news_fetcher.py
├── twitter_client.py
├── cli.py
├── logger.py
└── utils.py

manifest.example.yaml
prompts/
```

---

# 📄 License

MIT License.

Use it.

Modify it.

Ship it.

---

Built with ❤️ using Python, RSS, Gemini, and the X API.
