### Install from source Source: https://github.com/robberwick/pylibrelinkup/blob/main/docs/install.rst Clone the source from GitHub and install using pip. ```bash git clone http://github.com/robberwick/pylibrelinkup.git cd pylibrelinkup pip install . ``` -------------------------------- ### Install with pip Source: https://github.com/robberwick/pylibrelinkup/blob/main/docs/install.rst Install the PyLibreLinkUp package using pip. ```bash pip install pylibrelinkup ``` -------------------------------- ### Install all dependencies Source: https://github.com/robberwick/pylibrelinkup/blob/main/docs/development.rst Combines the installation of development, testing, and documentation dependencies. ```bash pip install -e .[dev,test,docs] ``` -------------------------------- ### Full Example Source: https://github.com/robberwick/pylibrelinkup/blob/main/README.md A comprehensive example demonstrating initialization, authentication, fetching patient list, and retrieving latest, graph, and logbook data. ```python from pylibrelinkup import PyLibreLinkUp client = PyLibreLinkUp(email='your_username', password='your_password') client.authenticate() patient_list = client.get_patients() print(patient_list) patient = patient_list[0] print(f"latest: {client.latest(patient_identifier=patient)}") graph_data = client.graph(patient_identifier=patient) print(f"graph data ({len(graph_data)} measurements):") for measurement in graph_data: print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}") logbook_data = client.logbook(patient_identifier=patient) print(f"logbook data: ({len(logbook_data)} entries)") for measurement in logbook_data: print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}") ``` -------------------------------- ### Install from source Source: https://github.com/robberwick/pylibrelinkup/blob/main/docs/development.rst Installs the package in editable mode from the pyproject.toml file. ```bash pip install -e . ``` -------------------------------- ### Install additional development dependencies Source: https://github.com/robberwick/pylibrelinkup/blob/main/docs/development.rst Installs extra dependencies for development, testing, or documentation. ```bash pip install -e .[dev] pip install -e .[test] pip install -e .[docs] ``` -------------------------------- ### Getting Patient List Source: https://github.com/robberwick/pylibrelinkup/blob/main/README.md Fetch the list of patients using the get_patients method. ```python patient_list = client.get_patients() print(patient_list) ``` -------------------------------- ### PyLibreLinkUp Usage Example Source: https://github.com/robberwick/pylibrelinkup/blob/main/docs/usage.rst This code snippet demonstrates how to import the PyLibreLinkUp class, create a client, authenticate, and retrieve patient data, including latest measurements, graph data, and logbook entries. ```python # import the PyLibreLinkUp class from pylibrelinkup import PyLibreLinkUp # create a new PyLibreLinkUp client client = PyLibreLinkUp(email='your_username', password='your_password') # authenticate the client client.authenticate() # get a list of patients patient_list = client.get_patients() print(patient_list) # get the first patient in the list patient = patient_list[0] # get the latest data for the patient print(f"latest: {client.latest(patient_identifier=patient)}") # get the graph and logbook data for that patient graph_data = client.graph(patient_identifier=patient) print(f"graph data ({len(graph_data)} measurements):") for measurement in graph_data: print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}") # get the logbook data for the patient logbook_data = client.logbook(patient_identifier=patient) print(f"logbook data: ({len(logbook_data)} entries)") for measurement in logbook_data: print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}") ``` -------------------------------- ### Initialization Source: https://github.com/robberwick/pylibrelinkup/blob/main/README.md Import necessary modules, initialize the client, and authenticate with LibreLinkUp credentials. ```python from pylibrelinkup import PyLibreLinkUp client = PyLibreLinkUp(email='your_username', password='your_password') client.authenticate() ``` -------------------------------- ### Run local unit tests Source: https://github.com/robberwick/pylibrelinkup/blob/main/docs/development.rst Executes the local unit tests for the project. ```bash pytest ``` -------------------------------- ### Logbook Data Source: https://github.com/robberwick/pylibrelinkup/blob/main/README.md Retrieve glucose event data for approximately the last two weeks for a patient. ```python logbook_data = client.logbook(patient_identifier=patient_list[0]) print(logbook_data) ``` -------------------------------- ### Graph Data Source: https://github.com/robberwick/pylibrelinkup/blob/main/README.md Retrieve glucose measurements for the previous 12 hours for a patient. ```python graph_data = client.graph(patient_identifier=patient_list[0]) print(graph_data) ``` -------------------------------- ### Current Glucose Source: https://github.com/robberwick/pylibrelinkup/blob/main/README.md Retrieve the most recent glucose measurement for a patient. ```python latest_glucose = client.latest(patient_identifier=patient_list[0]) print(latest_glucose) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.