This is a FastAPI application that measures network speed and provides the results via an API. It contains a scheduler that runs every 10 minutes and measures the network speed. The results are stored in a log file at 23:59.
The API has the following endpoints:
GET /speed
: Returns an XML file with the current network speed.GET /speed_log
: Returns the current network speed log.
- Clone the repository
git clone https://github.com/bcostaaa01/network-speed-test-api.git
- Install dependencies
pip install -r requirements.txt
You can run the application using the following command:
uvicorn main:app --reload
The application will be available at http://localhost:8000
.
Alternatively, you can run the application using the following command:
docker-compose build
docker-compose up
The application will be available at http://localhost:8000
.
If you get an error like this:
ModuleNotFoundError: No module named 'schedule'
You can install the module with the following command:
python3 -m pip install schedule
To get the current network speed, send a GET request to /speed
. This will return an XML file with the current network speed.
curl http://localhost:8000/speed
To get the current network speed log, send a GET request to /speed_log
. This will return the current network speed log.
curl http://localhost:8000/speed_log
You can view the API documentation at http://localhost:8000/docs
when the application is running.
This project is licensed under the terms of the MIT license.
This README provides a brief description of the project, instructions for installing and running the application, and examples of how to use the API. It also includes a link to the API documentation and information about the project's license.