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.1.tar.gz
(29.2 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10f41928b43c8cdae1d046c355b055bc48344f5fb337859c42a3778316c88658 |
|
MD5 | 41d7ab7299d24a44d1668cc7def66f72 |
|
BLAKE2b-256 | 7ac2d3e8e9d5c7d70fa67916085156b98ca2d2ae53d082979613eb0232dd08f6 |
Close
Hashes for rapidpro_expressions-1.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7aecd25b8dad2dea2a93039303d5f012fcc7e1d6f30abdf9240e2bf37c10efe9 |
|
MD5 | 003c0652d6eb34ea42ad616f6afca2b6 |
|
BLAKE2b-256 | 53d0485d3d4f379ef441d19135a15a221f913b101621b7445b7e28d407979ccb |