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
Built Distribution
Close
Hashes for rapidpro-expressions-1.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cff31895bc6db22ae249c46e54f1ae1e2b4c3730b8a0317da8e664d1cb62883d |
|
MD5 | 82c52c70f908764414587d671252e022 |
|
BLAKE2b-256 | fc819f37e6f2df507d4e37116247dd4d486950330ba1c2b89b4969ed8bbd58b9 |
Close
Hashes for rapidpro_expressions-1.0.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff97de478521fb547daf5c301b1c230148eed1c7dd03de12fdef7fd6af032292 |
|
MD5 | beed208db0ce5ea3818c967e15951318 |
|
BLAKE2b-256 | 22be2b289ecdc01aa9788f7c782bfce76c2bd4c94fe503a3f9eeb12450fcf8ad |