gavo.grammars.pdsgrammar module

A grammar wrapping pypds to parse files in the format of the planetary data system (PDS).

class gavo.grammars.pdsgrammar.PDSGrammar(parent, **kwargs)[source]

Bases: Grammar

A grammar that returns labels of PDS documents as rowdicts.

PDS is the file format of the Planetary Data System; the labels are quite like, but not quite like FITS headers.

Extra care needs to be taken here since the values in the rawdicts can be complex objects (e.g., other labels). It’s likely that you will need constructs like @IMAGE["KEY"].

Current versions of PyPDS also don’t parse the values. This is particularly insiduous because general strings are marked with “ in PDS. When mapping those, you’ll probably want a @KEY.strip(‘”’).

You’ll need PyPDS to use this; there’s no Debian package for that yet, so you’ll have to do a source install from git://github.com/RyanBalfanz/PyPDS.git

attrSeq = [<gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.parsecontext.IdAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.rscdef.common.RDAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.complexattrs.StructAttribute object>]
clearProperty(name)
completedCallbacks = []
getFullId()
getProperty(name, default=<Undefined>)
hasProperty(name)
managedAttrs = {'enc': <gavo.base.attrdef.UnicodeAttribute object>, 'id': <gavo.base.parsecontext.IdAttribute object>, 'ignoreOn': <gavo.base.complexattrs.StructAttribute object>, 'mapKeys': <gavo.base.complexattrs.StructAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'rd': <gavo.rscdef.common.RDAttribute object>, 'rowfilter': <gavo.base.complexattrs.StructListAttribute object>, 'rowfilters': <gavo.base.complexattrs.StructListAttribute object>, 'sourceFields': <gavo.base.complexattrs.StructAttribute object>}
name_ = 'pdsGrammar'
onElementComplete()[source]
property rd
rowIterator

alias of PDSRowIterator

setProperty(name, value)
class gavo.grammars.pdsgrammar.PDSRowIterator(grammar, sourceToken, sourceRow=None)[source]

Bases: RowIterator

an iterator for headers of PDS files.

Each iterator just yields a single dictionary.