Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pyparsing/pyparsing
/ functions
Functions
1,655 in github.com/pyparsing/pyparsing
⨍
Functions
1,655
◇
Types & classes
303
↳
Endpoints
5
↓ 499 callers
Method
parse_string
Parse a string with respect to the parser definition. This function is intended as the primary interface to the client code.
pyparsing/core.py:1274
↓ 492 callers
Method
set_name
Define name for this expression, makes debugging and exception messages clearer. If `__diag__.enable_debug_on_named_expressions` is s
pyparsing/core.py:2139
↓ 255 callers
Method
set_parse_action
Define one or more actions to perform when successfully matching parse element definition. Parse actions can be called to perform da
pyparsing/core.py:686
↓ 162 callers
Method
add_parse_action
Add one or more parse actions to expression's list of parse actions. See :class:`set_parse_action`. See examples in :class:`copy`.
pyparsing/core.py:802
↓ 161 callers
Function
test
(s, expected)
examples/fourFn.py:166
↓ 152 callers
Method
as_list
Returns the parse results as a nested list of matching tokens, all converted to strings. If ``flatten`` is True, all the nesting leve
pyparsing/results.py:589
↓ 127 callers
Method
dump
Diagnostic method for listing out the contents of a :class:`ParseResults`. Accepts an optional ``indent`` argument so that th
pyparsing/results.py:761
↓ 126 callers
Method
suppress
(self)
pyparsing/core.py:6686
↓ 110 callers
Method
assertParseResultsEquals
Unit test assertion to compare a :class:`ParseResults` object with an optional ``expected_list``, and compare any defined res
pyparsing/testing.py:150
↓ 109 callers
Method
split
Generator method to split a string using the given expression as a separator. May be called with optional ``maxsplit`` argument, to l
pyparsing/core.py:1572
↓ 106 callers
Method
append
Add single element to end of ``ParseResults`` list of elements. Example: .. doctest:: >>> numlist = Word(nums)[
pyparsing/results.py:459
↓ 104 callers
Method
run_tests
Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and
pyparsing/core.py:2287
↓ 97 callers
Function
one_of
Helper to quickly define a set of alternative :class:`Literal` s, and makes sure to do longest-first testing when there is a conflict, regardl
pyparsing/helpers.py:176
↓ 72 callers
Method
copy
Returns a copy of this expression. Generally only used internally by pyparsing.
pyparsing/core.py:3300
↓ 71 callers
Method
assertParseAndCheckList
Convenience wrapper assert to test a parser element and input string, and assert that the resulting :meth:`ParseResults.as_li
pyparsing/testing.py:162
↓ 66 callers
Method
assertRaises
Simple wrapper to print out the exceptions raised after assertRaises
tests/test_unit.py:117
↓ 64 callers
Function
replaced_by_pep8
(compat_name: str, fn: C)
pyparsing/util.py:450
↓ 57 callers
Method
scan_string
Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be
pyparsing/core.py:1350
↓ 56 callers
Method
set_results_name
Define name for referencing matching tokens as a nested attribute of the returned parse results. Normally, results names are
pyparsing/core.py:617
↓ 54 callers
Method
using_each
Yields a sequence of ``class(obj, **class_kwargs)`` for obj in seq. Example: .. testcode:: LPAR, RPAR, LBRACE,
pyparsing/core.py:472
↓ 51 callers
Method
ignore
Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment o
pyparsing/core.py:6068
↓ 49 callers
Method
__init__
( self, exprs: typing.Iterable[ParserElement], savelist: bool = False )
pyparsing/core.py:4678
↓ 46 callers
Method
search_string
Another extension to :class:`scan_string`, simplifying the access to the tokens found to match the given parse expression. May be ca
pyparsing/core.py:1513
↓ 45 callers
Function
deprecate_argument
( kwargs: dict[str, Any], arg_name: str, default_value=None, *, new_name: str = "" )
pyparsing/util.py:500
↓ 45 callers
Method
transform_string
Extension to :class:`scan_string`, to modify matching text with modified tokens that may be returned from a parse action. To use ``t
pyparsing/core.py:1454
↓ 42 callers
Method
assertRaisesParseException
( self, exc_type=ParseException, expected_msg=None, msg=None )
pyparsing/testing.py:264
↓ 38 callers
Method
append
Add an expression to the list of expressions related to this ParseExpression instance.
pyparsing/core.py:4317
↓ 34 callers
Method
items
(self)
pyparsing/results.py:327
↓ 33 callers
Method
create_diagram
Create a railroad diagram for the parser. Parameters: - ``output_html`` (str or file-like object) - output target for gener
pyparsing/core.py:2529
↓ 31 callers
Method
extend
Add sequence of elements to end of :class:`ParseResults` list of elements. Example: .. testcode:: patt = Word(a
pyparsing/results.py:483
↓ 29 callers
Method
from_call
If you call this function in the same way that you would call the constructor, it will store the arguments as you expect. For example
pyparsing/diagram/__init__.py:158
↓ 29 callers
Method
leave_whitespace
Extends ``leave_whitespace`` defined in base class.
pyparsing/core.py:6326
↓ 29 callers
Method
streamline
(self)
pyparsing/core.py:4688
↓ 28 callers
Method
enable_packrat
Enables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happ
pyparsing/core.py:1223
↓ 22 callers
Method
explain
Method to translate the Python internal traceback into a list of the pyparsing expressions that caused the exception to be raised.
pyparsing/exceptions.py:249
↓ 22 callers
Method
keys
(self)
pyparsing/results.py:321
↓ 21 callers
Method
pop
Removes and returns item at specified index (default= ``last``). Supports both ``list`` and ``dict`` semantics for ``pop()``. If
pyparsing/results.py:336
↓ 19 callers
Method
_run
(self, name)
tests/test_examples.py:11
↓ 19 callers
Function
col
Returns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing be
pyparsing/util.py:44
↓ 18 callers
Method
add_condition
Add a boolean predicate function to expression's list of parse actions. See :class:`set_parse_action` for function call signatures. Unlike ``s
pyparsing/core.py:816
↓ 17 callers
Method
_parse
(self, sql_stmt)
examples/bigquery_view_parser.py:50
↓ 15 callers
Function
_isvec
(ident)
examples/LAparser.py:159
↓ 15 callers
Method
as_dict
Returns the named parse results as a nested dictionary. Example: .. doctest:: >>> integer = pp.Word(pp.nums)
pyparsing/results.py:628
↓ 15 callers
Method
pprint
Pretty-printer for parsed results as a list, using the `pprint <https://docs.python.org/3/library/pprint.html>`_ module. Acce
pyparsing/results.py:839
↓ 15 callers
Method
set_debug
Enable display of debugging messages while doing pattern matching. Set ``flag`` to ``True`` to enable, ``False`` to disable.
pyparsing/core.py:2057
↓ 15 callers
Method
with_line_numbers
Helpful method for debugging a parser - prints a string with line and column numbers. (Line and column numbers are 1-based by default
pyparsing/testing.py:278
↓ 14 callers
Method
__init__
(self, desc)
examples/adventureEngine.py:48
↓ 14 callers
Function
_ismat
(ident)
examples/LAparser.py:166
↓ 14 callers
Function
_isscalar
(ident)
examples/LAparser.py:173
↓ 14 callers
Method
assertDoesNotWarn
(self, warning_type: type = UserWarning, msg: str = None)
tests/test_unit.py:147
↓ 14 callers
Method
assertWarns
Simple wrapper to print out the warnings raised after assertWarns
tests/test_unit.py:133
↓ 14 callers
Method
ignore_whitespace
Extends ``ignore_whitespace`` defined in base class.
pyparsing/core.py:6333
↓ 14 callers
Method
set_default_whitespace_chars
r""" Overrides the default whitespace chars Example: .. doctest:: # default whitespace chars are space, <TAB> a
pyparsing/core.py:405
↓ 14 callers
Function
srange
r"""Helper to easily define string ranges for use in :class:`Word` construction. Borrows syntax from regexp ``'[]'`` string range definitions:
pyparsing/core.py:6784
↓ 13 callers
Function
add_digits
(n, limit, c, s)
examples/roman_numerals.py:62
↓ 13 callers
Method
clear
(self)
pyparsing/util.py:165
↓ 13 callers
Method
get
(_, key)
pyparsing/util.py:113
↓ 13 callers
Method
identifier
a pyparsing Word expression for an identifier using this range's definitions for identchars and identbodychars
pyparsing/unicode.py:113
↓ 13 callers
Function
roman_numeral_literal
(numeral_string, value)
examples/roman_numerals.py:9
↓ 13 callers
Method
sub
r""" Return :class:`Regex` with an attached parse action to transform the parsed result as if called using `re.sub(expr, repl, string)
pyparsing/core.py:3591
↓ 13 callers
Method
values
(self)
pyparsing/results.py:324
↓ 12 callers
Function
_run_main_and_capture
Parse the Tiny program, build the main AST node, execute it, and capture stdout. Returns (return_value, stdout_text).
examples/tiny/tests/test_tiny_ast_nodes.py:13
↓ 12 callers
Method
from_statement_type
Return the TinyNode subclass matching `type_name`. Iterates over direct subclasses. If deeper inheritance hierarchies are created, th
examples/tiny/tiny_ast.py:67
↓ 12 callers
Function
infix_notation
Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or bina
pyparsing/helpers.py:785
↓ 12 callers
Function
testPrint
(x)
examples/jsonParser.py:129
↓ 11 callers
Method
execute
Execute this node against the given engine. Subclasses must implement this method.
examples/tiny/tiny_ast.py:99
↓ 11 callers
Function
parse_tiny
Parse a TINY source string and return structured ParseResults. Args: text: Source code to parse.
examples/tiny/tiny_parser.py:265
↓ 10 callers
Function
bench
( name: str, fn: Callable[[], None], iters: int = 4 )
tests/perf_pyparsing.py:12
↓ 10 callers
Method
line
Return the line of text where the exception occurred.
pyparsing/exceptions.py:141
↓ 10 callers
Method
match
(self, text, expr)
examples/booleansearchparser.py:315
↓ 10 callers
Function
putItemInRoom
(i, r)
examples/adventureEngine.py:638
↓ 10 callers
Method
restore
(self)
pyparsing/testing.py:97
↓ 9 callers
Method
disable_memoization
Disables active Packrat or Left Recursion parsing and their memoization This method also works if neither Packrat nor Left Recursion
pyparsing/core.py:1150
↓ 9 callers
Method
eval
(self)
examples/eval_arith.py:96
↓ 9 callers
Method
evaluate
(self, argument)
examples/searchparser.py:187
↓ 9 callers
Method
get
(self)
examples/tiny/tiny_repl.py:44
↓ 9 callers
Method
lineno
Return the 1-based line number of text where the exception occurred.
pyparsing/exceptions.py:148
↓ 9 callers
Function
to_railroad
Convert a pyparsing element tree into a list of diagrams. This is the recommended entrypoint to diagram creation if you want to access the Ra
pyparsing/diagram/__init__.py:231
↓ 8 callers
Function
_escape_regex_range_chars
(s: str)
pyparsing/util.py:179
↓ 8 callers
Function
_now
()
examples/delta_time.py:79
↓ 8 callers
Method
eval_expr
Evaluate an expression built by pyparsing's infix_notation and tokens. Accepts primitives (int/float/str), identifiers (str that is a declare
examples/tiny/tiny_engine.py:230
↓ 8 callers
Function
flatten
(nested_list)
tests/test_unit.py:61
↓ 8 callers
Method
from_parsed
Construct an instance from a parser `ParseResults` group.
examples/tiny/tiny_ast.py:81
↓ 8 callers
Method
generate_railroad
Generate an intermediate list of NamedDiagrams from a pyparsing expression.
tests/test_diagram.py:73
↓ 8 callers
Method
insert
Inserts new element at location index in the list of parsed tokens. Similar to ``list.insert()``. Example: .. doct
pyparsing/results.py:426
↓ 8 callers
Function
make_compressed_re
Create a regular expression string from a list of words, collapsing by common prefixes and optional suffixes. Calls itself recursively t
pyparsing/util.py:355
↓ 8 callers
Method
save
(self)
pyparsing/testing.py:65
↓ 7 callers
Function
_collapse_string_to_ranges
r""" Take a string or list of single-character strings, and return a string of the consecutive characters in that string collapsed into gr
pyparsing/util.py:242
↓ 7 callers
Function
autoname_elements
Utility to simplify mass-naming of parser elements, for generating railroad diagram with named subdiagrams.
pyparsing/core.py:6871
↓ 7 callers
Method
clear
(self)
pyparsing/core.py:1073
↓ 7 callers
Method
col
Return the 1-based column on the line of text where the exception occurred.
pyparsing/exceptions.py:155
↓ 7 callers
Method
enable_left_recursion
Enables "bounded recursion" parsing, which allows for both direct and indirect left-recursion. During parsing, left-recursive :class:
pyparsing/core.py:1165
↓ 7 callers
Method
inline_literals_using
Set class to be used for inclusion of string literals into a parser. Example: .. doctest:: :options: +NORMALIZE
pyparsing/core.py:433
↓ 7 callers
Method
parseImpl
(self, instring, loc, do_actions=True)
pyparsing/core.py:4700
↓ 7 callers
Method
recurse
(self)
pyparsing/core.py:2196
↓ 7 callers
Method
set_whitespace_chars
Overrides the default whitespace chars
pyparsing/core.py:1965
↓ 7 callers
Method
suppress_warning
Suppress warnings emitted for a particular diagnostic on this expression. Example: .. doctest:: >>> label = pp
pyparsing/core.py:536
↓ 6 callers
Method
_coerce
(self, value: object, dtype: str)
examples/tiny/tiny_engine.py:335
↓ 6 callers
Method
_to_number
Return a numeric value for v following Tiny semantics. Rules: - If v is already an int or float, return it unchanged (no float coerci
examples/tiny/tiny_engine.py:352
↓ 6 callers
Method
assertParseAndCheckDict
Convenience wrapper assert to test a parser element and input string, and assert that the resulting :meth:`ParseResults.as_di
pyparsing/testing.py:176
next →
1–100 of 1,655, ranked by callers