bibpy.parser module¶
Parsing functions using the funcparserlib library.
-
bibpy.parser.base_parser(validate_field, validate_entry)[source]¶ Return the base parser which all other parsers are based on.
The valid_fields and valid_entries arguments denote the allowable names for a grammar.
-
bibpy.parser.delimited_list(element, separator)[source]¶ Create a parser of a list of delimited tokens.
-
bibpy.parser.field_query_parser()[source]¶ Return a parser for numeric queries.
Example queries: ‘1900-1995’ or ‘>= 1998’
-
bibpy.parser.full_delimited_list(element, separator)[source]¶ Create a parser of a list of delimited tokens, keeping delimiters.
-
bibpy.parser.grammar_from_format(format)[source]¶ Return the grammar correspoding to the given format string.
-
bibpy.parser.if_token_type(token_type, pred)[source]¶ Return a parser that parses a token type for which a predicate holds.
-
bibpy.parser.join_string_expr(delimiter)[source]¶ Return a function that can join string expressions.
-
bibpy.parser.make_braced_expr(tokens)[source]¶ Make a braced expr from a recursive, nested list of tokens.
-
bibpy.parser.make_preamble_entry(tokens)[source]¶ Make a preamble entry from a list of parsed tokens.
-
bibpy.parser.make_query_result(query_type)[source]¶ Return a function that creates the result of a query.
-
bibpy.parser.make_string_entry(tokens)[source]¶ Make a bib string entry from a list of parsed tokens.
-
bibpy.parser.parse(string, format, ignore_comments=True)[source]¶ Parse string using a given reference format.
-
bibpy.parser.parse_file(source, format, ignore_comments=True)[source]¶ Parse a file using a given reference format.
-
bibpy.parser.parse_query(query, query_type)[source]¶ Parse a query and return the operator and value.
E.g. ‘~Author’ is parsed as (‘~’, ‘Author’)
-
bibpy.parser.prefix_indices(parts)[source]¶ Find the indices for a name prefix (‘von’ part) in a list of tokens.