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.9.tar.gz
(26.9 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.0.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a5eebc5b12f445d4c351fd22f4891a3cfdf75205bb6ef31399543be0e6ff0e8 |
|
MD5 | de1849afb941227955587a378c7950e7 |
|
BLAKE2b-256 | 5c936e19a262696ee6305419a9410e8a2c241f2fb9c81aff0c1246f7ee27f460 |
Close
Hashes for rapidpro_expressions-1.0.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91ecf1a14648d5f3132f02a8ee60e3d5385d55426f079c617be638bfa07c2db5 |
|
MD5 | 6e51b618cce2292e131fa26bf347b006 |
|
BLAKE2b-256 | 61ad59f7a1b461f6b3c51a406462f9be1e5b9fcc2daf22bc15db59d8ce01fe66 |