Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Lightweight OPML parsing.

Project Description

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.


The Python OPML package and its dependencies may be installed using easy_install (recommended)

$ easy_install opml

or by using the standard distutils

$ python install

If installing using, lxml will also need to be installed. easy_install will manage this for you.


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(
... '')

Elements in the OPML header can be accessed as attributes:

>>> outline.title
>>> outline.ownerName
'Dave Winer'
>>> outline.ownerEmail

Items in an OPML outline are stored in <outline> elements; these are accessible via the standard Python sequence operators:

>>> len(outline)
>>> outline[0]
<opml.OutlineElement object at ...>

An OutlineElement object exposes the attributes associated with the element as properties:

>>> outline[0].text
>>> outline[0].type

outline elements may contain other outline elements:

>>> len(outline[0])

When parsing a feed with nested items, the sub-items are accessible using the standard Python sequence operators:

>>> nested = \
... opml.parse('')
>>> len(nested[0])
>>> nested[0][0].text
>>> len(nested[0][0])
>>> nested[0][0][0].text
Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
opml-0.5-py2.5.egg (5.3 kB) Copy SHA256 Checksum SHA256 2.5 Egg Feb 13, 2008
opml-0.5.tar.gz (4.9 kB) Copy SHA256 Checksum SHA256 Source Feb 13, 2008

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting