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.
- 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)
- Python 3.x
colorama
requests
- Clone the repository:
git clone https://github.com/flowernotfound/mbpstester
- Navigate to the project directory:
cd mbpstester
- Create a virtual environment (optional but recommended):
python3 -m venv env
source env/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
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:
- Run speed test with default settings:
python mbpstester.py
- Run speed test with logging enabled:
python mbpstester.py --log
- Run speed test without the download test:
python mbpstester.py --no-download
- Run speed test and save the results in JSON format:
python mbpstester.py --json results.json
- Run speed test, display network information, and save the results in JSON format:
python mbpstester.py --network-info --json results.json
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.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.