parsers

parsers

Argument value parsing

This module is mostly self-contained, and provides ways to construct Parser instances which parse string arguments into values.

During the configuration building, the parsed values are collected by a configpile.collector.Collector instance.

Types

This module uses the following types.

_Value

Value being parsed by a Parser

_Parameter

Type received by a mapping function

_ReturnType

Type returned by a mapping function

_Item

Item in a sequence

Module attributes

path_parser

Parses a path

int_parser

Parses an integer

str_parser

Parses a string, preserves whitespace

stripped_str_parser

Parses a string, stripping whitespace left and right

float_parser

Parses a float

Classes

ErrorMessageProvider

Generates formatted error messages when values are invalid

Parser

Describes a parser, that takes a string and returns either a value or an error

Predicate

Defines a function or callable that takes a value and returns whether it is valid