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.6.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53c2ec54f15ef64a59c432f2c68e8e4ea143020dcaa3ffff07491a0d091dae1a |
|
MD5 | 47434643ac483a298d97dfb2d0396b44 |
|
BLAKE2b-256 | 9337e82aabf043bd46d5205da24379f24ab8146a4021055cf3f2fac9abb7b480 |
Close
Hashes for rapidpro_expressions-1.0.6.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bfba4002d2d2de789a1744608550b18916484f800d5591b6cf5d68755ca9905 |
|
MD5 | 84889af3275085eb9cf56ef9b841e968 |
|
BLAKE2b-256 | ed6d53784325e82ca3df4b84339fb74e9c8a12b863f086a6cddc3cf95c427fc4 |