pyhdf.odl_parser | index /usr/lib/python2.4/site-packages/pyhdf/odl_parser.py |
A module of the pyhdf package for parsing ODL text
Maintainer: Enthought, Inc.
Austin, TX
enthought-dev@mail.enthought.com
Version: 0.8
Date: July 14 2008
Introduction
------------
A large amount of HDF data is stored in ODL (Object Description Language). For this reason, pyhdf includes a simple parser in the pyhdf.odl_parser module.
The main function in pyhdf.odl_parser is parse_odl. parse_odl is passed ODL text as a string, and returns a dictionary-of-dictionaries, where the keys are either group names or object names. The value of an object name is a dictionary containing its attributes. The value of a group name is a dictionary containing its objects or subgroups.
Note that the parser is not perfect; while it supports all commonly-used aspects of the ODL language, more esoteric aspects (such as arbitrary bases) are not supported. Also, a BEGIN_GROUP can be closed by an END_OBJECT, and vice versa.