bcostaaa01 / automated-network-scanner

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸš€ 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.


Languages

Language:Python 88.3%Language:Dockerfile 11.7%