Python OPML Support
- Date:
$LastChangedDate: 2007-03-20 08:30:21 -0700 (Tue, 20 Mar 2007) $
- Version:
$LastChangedRevision: 5612 $
- Author:
Nathan R. Yergler <nathan@yergler.net>
- Organization:
- Copyright:
2008, Nathan R. Yergler, Creative Commons; licensed to the public under the MIT license.
opml provides simple support for reading OPML files. OPML is an XML-based format for describing outlines and is often used as an interchange format for subscription lists. This package is intended as a light-weight, permissive parser. It does very little validation of the incoming OPML.
Installation
The Python OPML package and its dependencies may be installed using easy_install (recommended)
$ easy_install opml
or by using the standard distutils setup.py:
$ python setup.py install
If installing using setup.py, lxml will also need to be installed. easy_install will manage this for you.
Usage
opml can parse OPML from a URI or from a local string. For example, to parse an example from the OPML validator:
>>> import opml >>> outline = opml.parse( ... 'http://hosting.opml.org/dave/validatorTests/clean/subscriptionList.opml')
Elements in the OPML header can be accessed as attributes:
>>> outline.title 'mySubscriptions.opml' >>> outline.ownerName 'Dave Winer' >>> outline.ownerEmail 'dave@scripting.com'
Items in an OPML outline are stored in <outline> elements; these are accessible via the standard Python sequence operators:
>>> len(outline) 13 >>> outline[0] <opml.OutlineElement object at ...>
An OutlineElement object exposes the attributes associated with the element as properties:
>>> outline[0].text 'CNET News.com' >>> outline[0].type 'rss'
outline elements may contain other outline elements:
>>> len(outline[0]) 0
When parsing a feed with nested items, the sub-items are accessible using the standard Python sequence operators:
>>> nested = \
... opml.parse('http://hosting.opml.org/dave/spec/placesLived.opml')
>>> len(nested[0])
6
>>> nested[0][0].text
'Boston'
>>> len(nested[0][0])
2
>>> nested[0][0][0].text
'Cambridge'
Download
Metadata
Release files for opml 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opml-0.5.tar.gz | 4.9 kB | Without provenance | Details for opml-0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opml-0.5-py2.5.egg | Legacy Egg format | - | - | Details for opml-0.5-py2.5.egg |
Total release size: 10.3 kB
Release files / opml-0.5.tar.gz
| Download URL | opml-0.5.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db1eef2a251b8af33e2eabb62baf922006dbd8c66c742931090e331a0362a770
|
|
BLAKE2b-256 checksum How to use checksums |
f1957234e96012a95cd0804d794ad6db43e3c613689c3201f1fc62c4a5b2299e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / opml-0.5-py2.5.egg
| Download URL | opml-0.5-py2.5.egg |
|---|---|
| Size | 5.3 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
9d92806e32068ae5eb2d8826b54d3eeaad1d57b9d6c9cbdc28b57369f85c1222
|
|
BLAKE2b-256 checksum How to use checksums |
803b7c1b2f436eab5c985b3071f97e28f70c726f6029cf06b3cf96df97f60198
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for opml 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.