The aim of this project is to provide a simple python script to make several speedtests using the Speedtest-cli from Ookla and then return the result as a JSON file.
This script is currently being used to fetch data for the project below:
The data source is in the following format:
// file: all-servers.json
{
"LION": "<SpeedtestResult>",
"SAFE1": "<SpeedtestResult>",
"SAFE2": "<SpeedtestResult>",
"SAFE3": "<SpeedtestResult>",
"MARS": "<SpeedtestResult>"
}
// Where Speedtest result has the following signature
Interface SpeedtestResult {
"timestamp": "",
"upload": "",
"download": "",
"ping": ""
}
- Python 3
- Official Speedtest-cli from Ookla
-
Fork this repo to your account
-
Git clone the fork to your local machine
-
Having cloned the repo, change the path of the project directory accordingly in the
config.json
script.
{
"projectPath": "{insert path here}"
}
- Just run the script or run the binary to make speedtests and gather results.
python3 speedtest.py
OR
./speedtest-binary
- Change the speed test server codes to the ones you want in
/data/servers.json
{
"LION": { "madagascar": 7755 },
"SAFE": { "india": 24682, "south_africa": 1285, "malaysia": 12544 },
"MARS": { "rodrigues": 27454 }
}
- You can get a list of nearby speed test servers and their codes by running the command below:
speedtest --servers