Skip to main content

Python client for RSS Reader API

Project description

RSS Reader Client

PyPI version Python Versions License: MIT

A modern Python client library for the RSS Reader API.

Features

  • Full-featured client for the RSS Reader API
  • Type hints for better IDE integration
  • Comprehensive data models with proper typing
  • Clean error handling with specific exceptions
  • Simple and intuitive interface

Installation

pip install rssreader-client

Quick Start

from rssreader import RSSClient

# Initialize the client
client = RSSClient("http://localhost:5000", "your-api-key")

# Get all categories
categories = client.get_categories()
for category in categories:
    print(f"{category.id}: {category.title} ({category.feed_count} feeds)")

# Get all feeds
feeds = client.get_feeds()
for feed in feeds:
    print(f"{feed.id}: {feed.title}")

# Get entries from a specific feed
result = client.get_feed_entries(feed_id=1)
for entry in result["entries"]:
    print(f"{entry.title} - {entry.published_at}")

# Get a specific entry with content
entry = client.get_entry(entry_id=42)
print(f"Title: {entry.title}")
print(f"Content: {entry.content[:100]}...")  # Show first 100 chars

Documentation

Client Class

RSSClient(base_url, api_key)

The main client for interacting with the RSS Reader API.

  • base_url: Base URL of the RSS Reader API (e.g., "http://localhost:5000")
  • api_key: API key for authentication

Methods

  • get_categories() - Get all categories
  • get_feeds(category_id=None) - Get all feeds, optionally filtered by category
  • get_entries(page=1, per_page=50, category_id=None, feed_id=None) - Get entries with pagination
  • get_category_entries(category_id, page=1, per_page=50) - Get entries for a specific category
  • get_feed_entries(feed_id, page=1, per_page=50) - Get entries for a specific feed
  • get_entry(entry_id) - Get a specific entry with content
  • get_status() - Get system status
  • get_task_status() - Get background task status

Data Models

  • Category - Represents a feed category
  • Feed - Represents an RSS feed
  • Entry - Represents a feed entry with content
  • SystemStatus - System status information
  • TaskStatus - Background task status
  • Pagination - Pagination information

Exception Classes

  • RSSReaderException - Base exception
  • APIError - API errors with status codes
  • AuthenticationError - Authentication failures
  • ConnectionError - Connection issues

Examples

Listing Categories and Feeds

from rssreader import RSSClient

client = RSSClient("http://localhost:5000", "your-api-key")

# Get all categories
categories = client.get_categories()
print(f"Found {len(categories)} categories:")
for category in categories:
    print(f"  - {category.title} ({category.feed_count} feeds)")
    
    # Get feeds in this category
    feeds = client.get_feeds(category_id=category.id)
    for feed in feeds:
        print(f"    - {feed.title} ({feed.entry_count} entries)")

Working with Entries

from rssreader import RSSClient
from datetime import datetime, timedelta

client = RSSClient("http://localhost:5000", "your-api-key")

# Get recent entries (last 7 days)
result = client.get_entries(per_page=100)
entries = result["entries"]

# Filter for entries in the last 7 days
one_week_ago = datetime.now() - timedelta(days=7)
recent_entries = []

for entry in entries:
    published = entry.published_datetime()
    if published and published > one_week_ago:
        recent_entries.append(entry)

print(f"Found {len(recent_entries)} entries from the last 7 days:")
for entry in recent_entries[:5]:
    print(f"  - {entry.title}")
    print(f"    Published: {entry.published_at} | Feed: {entry.feed.get('title')}")

License

MIT

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

rssreader_client-1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

rssreader_client-1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file rssreader_client-1.0.tar.gz.

File metadata

  • Download URL: rssreader_client-1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for rssreader_client-1.0.tar.gz
Algorithm Hash digest
SHA256 1e949bb3c8bc6826504312a7431661d82ebef24c7a22aba7d119ec875296c99d
MD5 333de6a2a9a2ec76cc11bb0ca42985ec
BLAKE2b-256 02cc08304419aba2c8881e12c8bcd5394391b7a15d690fec69593f49fe10aca8

See more details on using hashes here.

File details

Details for the file rssreader_client-1.0-py3-none-any.whl.

File metadata

  • Download URL: rssreader_client-1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for rssreader_client-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2723ed64b8b8e1733137b4c06b747f61007a9f5189f3891d7c4123c31a121ab
MD5 78319d4317cfcd489ae3bdfa55ff19a0
BLAKE2b-256 1d334f96dd541f7eeaad1676a93544555c3c0867706592eca4ff70b6d48ec655

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