Skip to content

An API built with FastAPI + Python to get the speed of the internet connection, and record logs in XML format.

Notifications You must be signed in to change notification settings

bcostaaa01/automated-network-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Network Speed Test API

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.

📚 API Documentation

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.

🛠️ Installation & Set Up

  1. Clone the repository
git clone https://github.com/bcostaaa01/network-speed-test-api.git
  1. Install dependencies
pip install -r requirements.txt

🚀 Running the Application

💻 Running the application locally

You can run the application using the following command:

uvicorn main:app --reload

The application will be available at http://localhost:8000.

🐳 Running the application with Docker

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.

❌ In case of errors with modules

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

📝 API Usage

Get Network Speed

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

Get Network Speed Log

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

📚 API Documentation

You can view the API documentation at http://localhost:8000/docs when the application is running.

📝 License

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.

About

An API built with FastAPI + Python to get the speed of the internet connection, and record logs in XML format.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published