Python implementation of the RapidPro expression and templating system
Project description
RapidPro Expressions
====================
Python implementation of the RapidPro expression and templating system
Usage
-----
```python
context = new EvaluationContext()
context.put_variable("name", "bob jones")
evaluator = Evaluator()
output, errors = evaluator.evaluate_template("Hi @(PROPER(name))", context, False)
assert output == "Hi Bob Jones"
assert len(errors) == 0
```
Development
-----------
If you make changes to the grammar file _Excellent.g4_ you need to generate new lexer and parser python modules
1. Ensure you have the ANTLR command line tools installed.
2. Run _gen_parser.sh_
====================
Python implementation of the RapidPro expression and templating system
Usage
-----
```python
context = new EvaluationContext()
context.put_variable("name", "bob jones")
evaluator = Evaluator()
output, errors = evaluator.evaluate_template("Hi @(PROPER(name))", context, False)
assert output == "Hi Bob Jones"
assert len(errors) == 0
```
Development
-----------
If you make changes to the grammar file _Excellent.g4_ you need to generate new lexer and parser python modules
1. Ensure you have the ANTLR command line tools installed.
2. Run _gen_parser.sh_
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rapidpro-expressions-1.0.7.tar.gz
(26.9 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9540f231b9c213dec22a6886a9fd3a31cbc9e95cbc122fce0c2d66044a90bdb |
|
MD5 | 5b05bd08334d411f3ba63d4ee2ba3664 |
|
BLAKE2b-256 | 4bd03e1c8bc8d93a9bd7a54996b86d8eb23bbc2ebbcfa6a04f27b1ef71178973 |
Close
Hashes for rapidpro_expressions-1.0.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 658d15e128647ed6f5e90438b4404acb4ddfbf3b1ad44621c5ba7702926314df |
|
MD5 | 33d8c4bc1531facabb83402ccf653726 |
|
BLAKE2b-256 | 0e09db986c36be354886cfc8845a1258c0149537aa14a5c9ed7228b557497483 |