Python implementation of the RapidPro flow engine
Project description
RapidPro Flows
==============
Python implementation of the RapidPro flow engine.
Usage
-----
```python
org = Org("RW", "eng", pytz.timezone("Africa/Kigali"), DateStyle.DAY_FIRST, False)
fields = [...]
contact = Contact(...)
flow = Flow.from_json("...")
runner = Runner()
run = runner.start(org, fields, contact, flow)
steps = run.get_completed_steps()
fields_to_create = run.get_created_fields()
runner.resume(run, Input.of("Yes"))
json = run.to_json() # run state can be serialized as JSON
restored = RunState.from_json(json, flow) # and then de-serialized when needed
runner.resume(run, Input.of(123))
```
==============
Python implementation of the RapidPro flow engine.
Usage
-----
```python
org = Org("RW", "eng", pytz.timezone("Africa/Kigali"), DateStyle.DAY_FIRST, False)
fields = [...]
contact = Contact(...)
flow = Flow.from_json("...")
runner = Runner()
run = runner.start(org, fields, contact, flow)
steps = run.get_completed_steps()
fields_to_create = run.get_created_fields()
runner.resume(run, Input.of("Yes"))
json = run.to_json() # run state can be serialized as JSON
restored = RunState.from_json(json, flow) # and then de-serialized when needed
runner.resume(run, Input.of(123))
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rapidpro-flows-1.2.5.tar.gz
(28.5 kB
view hashes)
Built Distribution
Close
Hashes for rapidpro_flows-1.2.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e4b988283119f3d479994cbae67b653e3f856f9cab9417183630e5c7dc93d0 |
|
MD5 | c18edfe0f621a40ebdb5e43fddd7b38c |
|
BLAKE2b-256 | ff93c79937fffc760b9ba9f5116e0f0a471af09ed376a494c59cd32be39e801d |