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.2.tar.gz
(29.6 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef48b63d59b4e6cf61d60cf8b60c4122565230cebf8792c348fc162098b90f7 |
|
MD5 | a5d98bb68dfea0b9feede2936ec8f419 |
|
BLAKE2b-256 | 49d6782bf052b26d18622fc43409455aaaee9134f4b52975bd9496f9e8539338 |
Close
Hashes for rapidpro_expressions-1.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ab7a3fb45e6699cbb0f705ade77e5903e54012c3eb4a3181fbfeb02e1a5e516 |
|
MD5 | 50999d4c3a3f937993cbc58ab2f7340e |
|
BLAKE2b-256 | 37c7e6befb6ba4165296e05902ff5eca4928f79ac10c0d0af95d58fbc90509dd |