Skip to content

equalsgibson/golibre

Repository files navigation

golibre

golibre logo
Easily access Glucose Measurement data from the FreeStyle Libre systems

  • Easy to use: Get up and running with the library in minutes

  • Actively developed: Ideas and contributions welcomed!


Go Code Coverage Go Reference Go Report Card

Getting Started

Prerequisites

Tip

To make sure that your account credentials will work with the library, you can download the bruno application or the Postman application and test the requests manually. If you choose to download and use bruno, see the ./ops/docs/bruno folder for example requests.

Install

go get github.com/equalsgibson/golibre@v0.0.2-alpha

Get the Connections shared with your account

Below is a short example showing how to get the connections from your account

Note

Make sure to go get the library, and set the required ENV variables (EMAIL and PASSWORD) before running the below example.

package main
import (
"context"
"fmt"
"log"
"os"
"github.com/equalsgibson/golibre/golibre"
)
func main() {
// Set up a new golibre service
ctx := context.Background()
service := golibre.NewService(
"api.libreview.io",
golibre.Authentication{
Email: os.Getenv("EMAIL"), // Your email address
Password: os.Getenv("PASSWORD"), // Your password
},
)
connections, err := service.Connection().GetAllConnectionData(ctx)
if err != nil {
log.Fatal(err)
}
// Print a count of all the patients that you are connected to, with a list of patient IDs
fmt.Printf("You have %d patients that are sharing their data with you.\n", len(connections))
for i, connection := range connections {
fmt.Printf("\t-> Patient %d: ID: %s\n", i+1, connection.PatientID)
}
}

Expected Output:

cgibson@wsl-ubuntuNexus:~/git/libre/golibre$ go run examples/main.go
You have 1 patients that are sharing their data with you.
        -> Patient 1: ID: 12345678-1234-1234-abcd-0242ac110002

Contributing

Contributions are what make the open source community such an amazing place to learn, get inspired, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git add . && git commit -am 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under a GNU License. See the LICENSE file for more information.

Contact

Chris Gibson (@equalsgibson)

Project Link: https://github.com/equalsgibson/golibre

About

LibreView Client API written in Go

Resources

License

Stars

Watchers

Forks