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.0.6.tar.gz
(26.8 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d48c1f7a24166e0d0c9f73c74079505b96db99e73ce9a0e299f15f863761ec61 |
|
MD5 | a7d2ce6c086688fed5efd5d4791fe872 |
|
BLAKE2b-256 | 9c28233248c8d5942acd98e96d36adbcbb79e3d26bb5b20038194d7e6de02b77 |
Close
Hashes for rapidpro_expressions-1.0.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c2923b65c59ff8bdc368d5783f68323c0f7bfdd58c67e600ed04757077ead1a |
|
MD5 | 9bb6610dc65311b619bb0c9556fef931 |
|
BLAKE2b-256 | 597b7cb9a080745885801f8fd331d53b964ee06763e8a5543115bdfa5c5b664e |