The RSSReader is a Python utility for effortlessly fetching and parsing RSS and Atom feeds.
Project description
RSSReader
A robust Python-based RSS feed reader that fetches, parses, and manages updates for RSS and Atom feeds. It supports efficient conditional GET requests to minimize bandwidth and server load by utilizing Last-Modified and Etag HTTP headers.
Features
- Parses different RSS and Atom feed formats.
- Extracts key details such as titles, links, descriptions, and associated images.
- Utilizes
Last-ModifiedandEtagheaders to perform conditional GET requests, avoiding unnecessary data transfer if the feed has not been updated since the last fetch.
Requirements
- Python 3
feedparserlibrary
Installation
First, ensure that you have Python installed on your machine. Then, you can install the required feedparser library using pip:
pip install cd-rss-reader
Usage To use the RSSReader class, create an instance with the URL of the RSS feed you wish to parse:
from cd_rss_reader import RSSReader
# Initialize the reader with the feed URL
url = "https://www.example.com/rss_feed_url.xml"
reader = RSSReader(url)
# Fetch and parse the feed
reader.fetch()
# Get basic information about the feed
print(f"Feed Title: {reader.get_title()}")
print(f"Feed Link: {reader.get_link()}")
print(f"Feed Description: {reader.get_feed_description()}")
# Iterate over the feed entries
for entry in reader.get_entries():
print(f"Title: {entry.title}")
print(f"Link: {entry.link}")
print(f"Published Date: {entry.published}")
print(f"Summary: {entry.summary}")
image_link = reader.get_image_link(entry)
if image_link:
print(f"Image Link: {image_link}")
else:
print("No image available.")
Replace https://www.example.com/rss_feed_url.xml with the URL of the RSS feed you want to read.
Contributing Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
More documentation at: Code Docta
License This project is open-sourced software licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cd_rss_reader-0.0.1.tar.gz.
File metadata
- Download URL: cd_rss_reader-0.0.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
214996220ab53d9432ad489ebea2f17470f8c474b8acb2236935953b6fbcecf8
|
|
| MD5 |
8ab8425e97d266d0fb1e7c98752c5fdc
|
|
| BLAKE2b-256 |
06ff1a5ef4a79bcc465d5a93642a13bf61d0525493197f15808940f3cf2a6148
|
File details
Details for the file cd_rss_reader-0.0.1-py3-none-any.whl.
File metadata
- Download URL: cd_rss_reader-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a4e987f46daccf19d6338ee11cf86323101f29cbbbfc295251daf90a2e6c31b
|
|
| MD5 |
ddfb87e40cc3cec76db113eab9a81224
|
|
| BLAKE2b-256 |
02605de31502acb8244f59fb5dc596f4ecce5ded570f2f8ac79404b0a6ea0a3d
|