parsers Package

base Module

A base data parser module

class maidenhair.parsers.base.BaseParser[source]

Bases: object

An abstract data parser class

Methods

load(filename, **kwargs) Parse a file specified with the filename and return an numpy array
parse(iterable, **kwargs) Parse iterable to an numpy array ..
load(filename, **kwargs)[source]

Parse a file specified with the filename and return an numpy array

Parameters:

filename : string

A path of a file

Returns:

ndarray :

An instance of numpy array

parse(iterable, **kwargs)[source]

Parse iterable to an numpy array

Warning

Subclasses must override this method

Parameters:

iterable : iterable

An iterable instance to parse

Returns:

ndarray :

An instance of numpy array

plain Module

A plain parser class

class maidenhair.parsers.plain.PlainParser[source]

Bases: maidenhair.parsers.base.BaseParser

A plain text parser class based on numpy.loadtxt method

Methods

load(filename, **kwargs) Parse a file specified with the filename and return an numpy array
parse(iterable, **kwargs) Parse whitespace separated iterable to a numpy array.
parse(iterable, **kwargs)[source]

Parse whitespace separated iterable to a numpy array. It is based on numpy.loadtxt method.

Parameters:

iterable : iterable

An iterable instance to parse

Returns:

ndarray :

An instance of numpy array