Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install opml

How to install opml

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install opml
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.5 Available View build log
Windows (64-bit)
0.5 Available View build log
Mac OS X (10.5+)
0.5 Available View build log
Linux (32-bit)
0.5 Available View build log
Linux (64-bit)
0.5 Available View build log
 
License
MIT
Dependencies
Imports
Lastest release
version 0.5 on Jan 5th, 2011

System Message: WARNING/2 (<string>, line 10)

Field list ends without a blank line; unexpected unindent.

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

System Message: ERROR/3 (<string>, line 43)

Content block expected for the "admonition" directive; none found.

.. admonition:: Document Purpose

This document is intended to provide a set of literate tests for the opml package; it is not intended to provide thorough coverage of the OPML specification or semantics. See the OPML 2 Specification for details on OPML.

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'

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.