This application will perform a network speed test (using the speedtest
CLI provided by Ookla (speedtest.net)) and
store the results in a Google Sheet.
docker-compose
- A Google account
- Create a new Google Sheet to use
- Update
config.yaml
variableGSHEET_DOC_KEY
with the document key for your new document.
- Head to https://console.developers.google.com/cloud-resource-manager?pli=1
- Click
Create Project
- Name your project
speedtest-to-gsheet
(or whatever you wish) - Click
Create
- Follow the steps here to enable
Drive + Sheet API
access -> https://gspread.readthedocs.io/en/latest/oauth2.html#enable-api-access- Under “APIs & Services > Library”, search for “Drive API” and enable it.
- Under “APIs & Services > Library”, search for “Sheets API” and enable it.
- Enable API Access for a Project if you haven’t done it yet.
- Go to “APIs & Services > Credentials” and choose “Create credentials > Service account key”.
- Fill out the form
- Click “Create key”
- Select “JSON” and click “Create”
- Save the file as
speedtest-to-gsheet-service-account-key.json
in the root of this project!!! - Very important! Go to your spreadsheet and share it with a client_email from the step above. Just like you do with any other Google account. If you don’t do this, you’ll get a gspread.exceptions.SpreadsheetNotFound exception when trying to access this spreadsheet from your application or a script.
- Edit the
config.yaml
file with the desired settings.
docker-compose -f docker-compose.yml build
docker-compose up speedtest_to_gsheet -d
The below commands to get the basic setup for developing on this repository.
python3 -m venv venv
ln -s venv/bin/activate activate
source activate
pip install --upgrade pip
pip install -r requirements.txt
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml up -d
docker login --username chriscarini
VERSION=0.0.3
IMAGE="chriscarini/speedtest-to-gsheet"
# Give the image two tags; one version, and one `latest`.
docker build -t "$IMAGE:latest" -t "$IMAGE:$VERSION" .
docker push "$IMAGE:latest" && docker push "$IMAGE:$VERSION"
The speedtest
CLI is as provided by Ookla (speedtest.net).
You can find installation instructions for your platform here.
This project pulls in this CLI into a docker container for easier use.