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.1.3.tar.gz
(29.6 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eec9761f4c336833397fb705fe39399bc5e34686b183976b5f4cee7e7112a4eb |
|
MD5 | 7480aa88f2d1d476b83efd90b17cf36d |
|
BLAKE2b-256 | 1360db4d8837a069f4e1618a5f08a31db94b82c702b0488bd98483d495981064 |
Close
Hashes for rapidpro_expressions-1.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02bab1ca0c2615cbf78e3557f9521a8267df19461ed5a616a40169fc92f9be05 |
|
MD5 | 5f197684e5d7f528ee2ad063b26d647a |
|
BLAKE2b-256 | e11fc528644e288f1c2247e51ef02ccd6854f3568c1145ed435ce70f8cbed4bb |