Creates a Kafka feed that simulates a subset of CAS data using fake data.
- Python 3.7+
- A valid Kafka setup
pip install -r requirements.txt
Assumes Kafka is available at localhost:9092
. Edit main.py
with the appropriate address if you
need to change it.
python main.py [count]
Where count
is the number of items of each type (forms/cases) to generate.
To see the output you can use the following commands:
kafka-console-consumer.sh --topic datagen-form --bootstrap-server http://localhost:9092 --from-beginning
kafka-console-consumer.sh --topic datagen-case --bootstrap-server http://localhost:9092 --from-beginning
To run tests just run the following in the root of the repository:
pytest
The household case with ID 0d3ebba1-cf52-4d89-aea4-2fe5ec9c9ed9
on the India server has been used as a basis
for the case templates (including its child cases, etc.).
You can view the case here
and use the raw doc view
to see the raw JSON.
The following table is the list of Case IDs used:
Description | Case Type | Case ID |
---|---|---|
Household | household | 0d3ebba1-cf52-4d89-aea4-2fe5ec9c9ed9 |
Pregnant Person | person | 7802432e-548d-499c-90cc-5b0b41f203f0 |
Pregnant CCS Record | ccs_record | d02668b4-0175-4fe7-920d-c0ea3568d6b3 |
Mother's Person | person | 23eb689a-8997-471f-946e-db06355296a6 |
Child's Person | person | 51407edd-6c91-421f-9558-2f517fc359ae |
Mother's CCS Record | ccs_record | d8962f84-6327-41bd-8572-076c621f7eae |
And for Forms:
Description | Form Type | Form ID |
---|---|---|
Birth Preparedness | BP | 4623a1a0-8182-4764-8be1-5f7a7ebb31b1 |