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
Built Distribution
Close
Hashes for rapidpro-expressions-1.0.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73b4c0d00e8976e719da266e0a31e1bf4c42847f404fb424f0fe40e933de4d68 |
|
MD5 | 59c598db15854b47c8c4f02d2331e58c |
|
BLAKE2b-256 | e9ef04d39e80aab78efa9ca6e25a418df03b4cdb87165a48844fdbe7d6a24bf1 |
Close
Hashes for rapidpro_expressions-1.0.11-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec1d88d2b1ca535b93ddc1c55293be4156a82b30c32f01c7a6214cec910a9e82 |
|
MD5 | 59419c57ebd33c01983eb2bdcf46dd10 |
|
BLAKE2b-256 | b4559ccb0788198f75c46643c604ebbfd6e88291aaef229fc11fa1bd7e7b3623 |