Usage

 1 # import the PyLibreLinkUp class
 2 from pylibrelinkup import PyLibreLinkUp
 3
 4 # create a new PyLibreLinkUp client
 5 client = PyLibreLinkUp(email='your_username', password='your_password')
 6
 7 # authenticate the client
 8 client.authenticate()
 9
10 # get a list of patients
11 patient_list = client.get_patients()
12 print(patient_list)
13
14 # get the first patient in the list
15 patient = patient_list[0]
16
17 # get the latest data for the patient
18 print(f"latest: {client.latest(patient_identifier=patient)}")
19
20 # get the graph and logbook data for that patient
21 graph_data = client.graph(patient_identifier=patient)
22 print(f"graph data ({len(graph_data)} measurements):")
23 for measurement in graph_data:
24     print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}")
25
26 # get the logbook data for the patient
27 logbook_data = client.logbook(patient_identifier=patient)
28 print(f"logbook data: ({len(logbook_data)} entries)")
29 for measurement in logbook_data:
30     print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}")