Parse OPML subscription lists
Project description
listparser
Parse OPML subscription lists in Python.
If you’re building a feed reader and you need to parse OPML subscription lists, you’ve come to the right place!
listparser makes it easy to parse and use subscription lists in multiple formats. It supports OPML, RDF+FOAF, and the iGoogle exported settings format, and runs on Python 3.7+ and on PyPy 3.7.
Usage
>>> import listparser
>>> result = listparser.parse(open('feeds.opml').read())
A dictionary will be returned with several keys:
meta: a dictionary of information about the subscription list
feeds: a list of feeds
lists: a list of subscription lists
version: a format identifier like “opml2”
bozo: True if there is a problem with the list, False otherwise
bozo_exception: (if bozo is 1) a description of the problem
For convenience, the result dictionary supports attribute access for its keys.
Continuing the example:
>>> result.meta.title
'listparser project feeds'
>>> len(result.feeds)
2
>>> result.feeds[0].title, result.feeds[0].url
('listparser blog', 'https://kurtmckee.org/tag/listparser')
More extensive documentation is available in the docs/ directory and online at <https://listparser.readthedocs.io/en/stable/>.
Bugs
There are going to be bugs. The best way to handle them will be to isolate the simplest possible document that susses out the bug, add that document as a test case, and then find and fix the problem.
…you can also just report the bug and leave it to someone else to fix the problem, but that won’t be as much fun for you!
Bugs can be reported at <https://github.com/kurtmckee/listparser/issues>.
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
File details
Details for the file listparser-0.19.tar.gz
.
File metadata
- Download URL: listparser-0.19.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5aa23ae017a22e36c50ca5259a690328dd524527977d8c094ae0857887002805 |
|
MD5 | 6c11daf2f5bed75b9042888a87f390a9 |
|
BLAKE2b-256 | b6e1b93107d79a8fa3dcbb122518397af00e0233f92e92a1c65792ddc4f08e71 |
Provenance
File details
Details for the file listparser-0.19-py3-none-any.whl
.
File metadata
- Download URL: listparser-0.19-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3857a9e5e5342207a556ba72e5c030782971fbe587e7afc2a75b2d7c0fa5a5c |
|
MD5 | 375bb92fc743f04809b6883cb2f3c753 |
|
BLAKE2b-256 | 3c835ebd7cd81ebf7eed1ee063e54959eacc5afa57e9031099667fa404aadf31 |