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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120ce8dc4a2a8a177668d158c4a9e37188fc23b4b91b44c34f81967dae0d3889 |
|
MD5 | 1a7299c0fa85eaa0a407670621bed962 |
|
BLAKE2b-256 | 118026261782942fc652a8b8db15d8c1d085b450a2769249caad44667fa8a926 |
Close
Hashes for rapidpro_expressions-1.0.12-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f05ae70891fca52a1396932cd0967f5c2fe495cd0e8c833d82bef256d5c13efd |
|
MD5 | d4b1b652186bd0cf0edb42fb54ff4cce |
|
BLAKE2b-256 | 025bd54cfaefc09423c7e1e2e249c6613270ebf64123888e27e570bb85b338bb |