Questions tagged [pyparsing]

The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. The pyparsing module provides a library of classes that client code uses to construct the grammar directly in Python code.

Pyparsing is a Python module for creating and executing simple grammars. This is an alternative approach to the traditional lex/yacc or regular expressions. The pyparsing module provides a library of classes that client code uses to construct the grammar directly in Python code.

981 questions
-1
votes
2 answers

how to pass portions of text to tuple/list in python based on word

i have following sample text and need to pass all lines of text to tuple/list based on a word "ALL Banks Report".. the raw text as follows %Bank PARSED MESSAGE FILE %VERSION : PIL 98.7 %nex MODULE : SIL 98 2018 Jan 31 16:44:53.050 ALL Banks…
Python Spark
  • 303
  • 2
  • 6
  • 16
-2
votes
2 answers

Parse Math Expression as "3 + 2 * temp + humidity", where replace alpha values from payload

Math Expression can be anything. The variable or alpha character here in expression are also not fixed "3 + 2 * temp + humidity". The variable must look for json and get replaced by it's value from json. environment = {"temp": 23, "humidity": 12,…
Rahul Kumar
  • 119
  • 1
  • 8
-2
votes
1 answer

Where can I find documentation on the pyparsing module?

I am working through some code to integrate Anaconda environments with ArcGIS. The tutorial I'm following makes use of the pyparsing module. I'd like to better understand the module but am having difficulty finding a good overview of the commands…
JackOfTales
  • 130
  • 9
-2
votes
1 answer

Python - create JSON from string with recognize expression

I am trying to create JSON from a string with an expression, but before that I have to replace the operand. This is user input: "Apple == 5 & (Plum == 7 | Pear == 8)" I have to replace "==" to "eq", "&" to "and", etc. (and more logical expressions…
palo173
  • 13
  • 9
-2
votes
1 answer

Python pyparsing issue

I am very new to python and using pyparsing but getting some exception with following code while site_contents.find('---', line_end) != line_end + 2: cut_start = site_contents.find(" ", site_contents.find("\r\n", start)) cut_end =…
Rahul
  • 11
  • 3
-6
votes
2 answers

a python library that accepts some text, and replaces phone numbers, names, and so on with tokens

I need a python library that accepts some text, and replaces phone numbers, names, and so on with tokens. Example: Input: Please call Robert on 0430013454 to discuss this further. Output: Please call NAME on PHONE to discuss this further. In other…
Matt
  • 71
  • 1
  • 4
1 2 3
65
66