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.8.tar.gz
(28.2 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b61f9b9292e808e984cf975d78887a526883836dac60a3c5197cf8f77c9f271b |
|
MD5 | 0d0f31f4c4f956cbee282309a20a465a |
|
BLAKE2b-256 | ccd3386ce137ed7e198cff2d2330357dc1419540f87cc1d6615c203e2ffd75f1 |
Close
Hashes for rapidpro_expressions-1.0.8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 799a26f85e53471f53438e5c7990ed7d7133fb2147e84eb216c7d966432cced4 |
|
MD5 | cd44a8a5b1a43b266c3951d27b557bce |
|
BLAKE2b-256 | c87275acff3e7805319002a0231fa693edaf87edfee566809456e1ddb8219691 |