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.7.tar.gz
(29.7 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f33a91ea208f59d730824c42d1f44efe9273cdfa232748f294f603c9041788 |
|
MD5 | b44ee63a5c903c2d2eb12f60a81c10de |
|
BLAKE2b-256 | 1ff0a15e4c1817e9e5db7fd01d0ba115e724a6adb426969a4db30685712101c5 |
Close
Hashes for rapidpro_expressions-1.1.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5b846b37a31afb0de6de746397b8be35200f3ddb41ee0d037e6122db6aa2a11 |
|
MD5 | 432d7f3cfb289b7fd27fb5b13a8bd793 |
|
BLAKE2b-256 | c9fda371aa2537b5a29517cbd173f674a611562977003116f1bbe0245fff17cd |