Onboarding project to illustrate the connectivity of TypeQL and Python
Make sure that you have TypeDB Server installed. (Find instructions here).
- Get the repository and extract its files.
- Start the terminal using
typedb server
command on Terminal.
- Random Data can be generated by running the file data_generator.py.
- This will write the data in data_entry.tql file.
- Then commit the changes, while in Session type DATA and Transaction type WRITE.
- Thus random data will be fed in the Database.
- Once the server is running, open the main.py file and run it.
- Enter the address and port. (Default is
localhost:1729
) - Currently, the program offers following options to choose from:-
- Display top 3 countries with most vaccinations
- Display vaccine-wise stats for a given age group
- Display vaccine-wise stats for a given country
- Display average age of people vaccinated in each country
- Exit
-
MENU 1. Display top 3 countries with most vaccinations 2. Display vaccine-wise stats for a given age group 3. Display vaccine-wise stats for a given country 4. Display average age of people vaccinated in each country 5. Exit Enter your choice: 1 Top 3 countries with most Vaccinations: Canada : 156 Germany : 146 New Zealand : 142
-
MENU 1. Display top 3 countries with most vaccinations 2. Display vaccine-wise stats for a given age group 3. Display vaccine-wise stats for a given country 4. Display average age of people vaccinated in each country 5. Exit Enter your choice: 4 Average age of people vaccinated in each country: New Zealand : 40 years Australia : 39 years Canada : 39 years Germany : 39 years Sweden : 39 years Japan : 39 years Switzerland : 40 years United States : 40 years