Parser#

class pymeasurement.util.parser.Parser(string)[source]#

A class to parse strings.

Parameters:

string (str) – The string to parse.

Raises:

TypeError – If string is not a string.

__init__(string)[source]#

Parser Constructor

__repr__()[source]#

Get the string representation of the parser.

Returns:

The string representation of the parser.

Return type:

str

__str__()[source]#

Get the string representation of the parser.

Returns:

The string representation of the parser.

Return type:

str

__weakref__#

list of weak references to the object (if defined)

readByCharacter(string, startSetup=None, endSetup=None, checks=None)[source]#

Read a string by character.

Parameters:
  • string (str) – The string to read.

  • startSetup (function) – A function to run before reading the string.

  • endSetup (function) – A function to run after reading the string.

  • checks (function) – A function to run on each character.

splitString(string, checks=None)[source]#

Split a string.

param string:

The string to split.

Parameters:

checks (function) – A function to run on each string.