Api

class project.api.api.DataBase

Bases: object

close()
delete_audio(audio_id)
delete_entry(id, username)
get_all_users()
get_user_by_id(id)
get_user_by_id_and_name(id, username)
store_oga_GridFS(files, data)
write_user(data)
class project.api.api.Patient(id, age, gender, diagnosis, vaccine, symptoms, *args, **kwargs)

Bases: object

Philter for the metadata so when using it in POST, it will only store those with at least the dict values listed.

project.api.api.add_user()

This POST method requires a request with a files variable, which must be a dictionary that includes:

  • [upload_file]: The cough sample (bytes). The cough sample is originally uploaded in ogg, but the POST request will turn it into bytes. It is stored in GridFS.

  • [json]: The metadata (dict). It has to at least contain the dictionary values stated in the Patient class. Otherwise a status 400 is returned. The metadata is stored in our MongoDB server.

project.api.api.base()
project.api.api.delete_user(id, username)

This DELETE method will delete an entry from the MongoDB and its correspondent audio in GridFS by using both the id and username values of the json.

project.api.api.get_user_by_id(id)

This GET returns all entries with the same id value, which means all entries sent from the same phone.

project.api.api.get_user_by_id_and_username(id, username)

This GET returns an entry corresponding to an id and username values.

project.api.api.get_users()

This GET returns all entries.

class project.api.api.symptoms(dry_cough, smoker, cold, res_difficult, sore_throat, fever, fatigue, muscular_pain, smell_loss, pneumonia, diarrhea, hypertension, asthma, diabetes, CLD, IHD, *args, **kwargs)

Bases: object