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.5.tar.gz
(29.9 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro-expressions-1.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9996749a92b449ca989919b8d2a2f900f45c19f50feecac51c7442f6e91c27b |
|
MD5 | cd5a847f941c97b4a85bf79a1f8a0482 |
|
BLAKE2b-256 | 6a882807a961cf3e6c0615a1c7bc7eade8f622b99be26848c1c57ced977dc122 |
Close
Hashes for rapidpro_expressions-1.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a48b3302f0835137861af9634a5c7f6b25c71dd07619f527631963c7717afc2 |
|
MD5 | 1ba128ab710492c9ca12c9362cba2d7f |
|
BLAKE2b-256 | 51d2f41f67c8876055649e8903487466f586b5ed18d02d2b0d6488026721963f |