Skip to content

CLI tool for measuring the download and upload speeds of your internet connection

License

Notifications You must be signed in to change notification settings

flowernotfound/mbpstester

Repository files navigation

Mbpstester

Mbpstester is a command-line tool for measuring the download and upload speeds of your internet connection. It performs multiple measurements and provides an average speed along with a connection quality assessment. The tool also offers options to display network information and save the results in JSON format.

Features

  • Measures download and upload speeds
  • Calculates average speeds from multiple measurements
  • Displays speeds in appropriate units (bps, Kbps, Mbps)
  • Assesses connection quality based on the measured speeds
  • Provides a simple and intuitive command-line interface
  • Supports logging of speed test results
  • Allows skipping download or upload tests individually
  • Displays network information (hostname, global IP, provider)
  • Outputs results in JSON format to a specified file
  • Cross-platform compatibility (Windows, macOS, Linux)

Requirements

  • Python 3.x
  • colorama
  • requests

Installation

  1. Clone the repository:
git clone https://github.com/flowernotfound/mbpstester
  1. Navigate to the project directory:
cd mbpstester
  1. Create a virtual environment (optional but recommended):
python3 -m venv env
source env/bin/activate
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

To run the Speed Test CLI, use the following command:

python mbpstester.py [options]

Available options:

  • --log: Enable logging of speed test results
  • --log-file LOG_FILE: Specify the path to the log file (default: mbpstester.log)
  • --version, -v: Show the version of the program and exit
  • --no-download: Skip the download test and only perform the upload test
  • --no-upload: Skip the upload test and only perform the download test
  • --network-info: Display network information
  • --json JSON_FILE: Output the results in JSON format to the specified file
  • --size {1,10}: Specify the size of the data to use for testing (1 MB, 10 MB)

Examples:

  1. Run speed test with default settings:
python mbpstester.py
  1. Run speed test with logging enabled:
python mbpstester.py --log
  1. Run speed test without the download test:
python mbpstester.py --no-download
  1. Run speed test and save the results in JSON format:
python mbpstester.py --json results.json
  1. Run speed test, display network information, and save the results in JSON format:
python mbpstester.py --network-info --json results.json

Configuration

The following constants in the config.py file can be adjusted according to your requirements:

  • DOWNLOAD_URL: The URL of the dummy data file used for download speed measurement.
  • UPLOAD_URL: The URL of the server endpoint for uploading dummy data.
  • SIZE: The size of the dummy data in bytes. Default is 1 MB.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

CLI tool for measuring the download and upload speeds of your internet connection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages