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.6.tar.gz
(29.9 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55a7c1c9c6f9e001441d5c20dd73b8fe3de6e800e1539e55e66ce56ecf48573e |
|
MD5 | 92652383ed847007aab00fa855d012a8 |
|
BLAKE2b-256 | 499defe8c34c34617c7c1feecff2bb31b2aafb438e020dbf4aacbcefc9f9d180 |
Close
Hashes for rapidpro_expressions-1.1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1901946205cec631f2f1690e4cb20d310e856a87e874ea6bafe77afa9bec88a |
|
MD5 | 642b00eb10a5c9e75c311f851efcddb5 |
|
BLAKE2b-256 | f2da9041e19cfcc1653204017ddc57fccf7daea577d4ec4aab02d9206989fd2c |