https://github.com/timendum/feedendum
A python library to parse and generate RSS or atom feeds
https://github.com/timendum/feedendum
Last synced: 5 months ago
JSON representation
A python library to parse and generate RSS or atom feeds
- Host: GitHub
- URL: https://github.com/timendum/feedendum
- Owner: timendum
- License: agpl-3.0
- Created: 2020-06-15T15:05:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-13T10:27:42.000Z (over 1 year ago)
- Last Synced: 2025-09-25T14:55:22.446Z (9 months ago)
- Language: Python
- Size: 134 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# feedendum
A python library to parse and generate RSS or atom feeds.
## Features
This module can:
* parse and generate RSS feeds
* parse and generate RDF (RSS v1.0) feeds (thanks to @inigoserna)
* parse and generate Atom feeds
* access standard fields via `feed` class and `feed.item` list
* preserve all data parsed, even in custom fields, when generating a RSS/Atom/RDF text
* read an url if `requests` is installed
* access non-standard fields via `_data` dict
* create arbitrary feed
* modify an existing feed
## Usage
### Parsing a file
For RSS:
feed = feedendum.from_rss_file(file_path)
feed = feedendum.from_rss_text(txt)
For RDF (RSS v1.0):
feed = feedendum.from_rdf_file(file_path)
feed = feedendum.from_rdf_text(txt)
For Atom:
feed = feedendum.from_atom_file(file_path)
feed = feedendum.from_atom_text(txt)
### Accessing to parsed data
Standard fields:
print("Title", feed.title)
print("First entry title", feed.items[0].title)
For other fields, not defined in `Feed` class:
print("Extra attributes in the feed", feed._data)
print("Extra attributes in the first entry", feed.items[0]._data)
### Writing a file
For RSS:
feedendum.to_rss_string(feed)
For RDF (RSS v1.0):
feedendum.to_rdf_string(feed)
For Atom:
feedendum.to_atom_string(feed)
## Development
This package is developed with `uv`.
### Setup
Just run:
uv sync
### Tests
Done via unittest
uv run python -m unittest discover -s tests
### Build
With build and hatchling
uvx --from build pyproject-build --installer uv
### Publish
To publish to PyPi
uvx twine upload dist/*