Skip to content

Commit 954bb15

Browse files
committed
Cleanup: update .gitignore, remove cache and local files, all tests passing
1 parent fa6c864 commit 954bb15

12 files changed

+416
-443
lines changed

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
3+
**/__pycache__/
34
*.py[cod]
45
*$py.class
6+
*.pyc
7+
*.pyo
8+
*.pyd
59

610
# C extensions
711
*.so
@@ -160,3 +164,33 @@ cython_debug/
160164
# and can be added to the global gitignore or merged into this file. For a more nuclear
161165
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162166
.idea/
167+
168+
# macOS system files
169+
.DS_Store
170+
171+
# Project-specific files
172+
.pylintrc
173+
test_history.json
174+
175+
# VSCode and JetBrains IDEs
176+
.vscode/
177+
178+
# Local virtual environments
179+
.venv/
180+
.venv_tmp/
181+
venv/
182+
env/
183+
ENV/
184+
185+
# PyInstaller and build
186+
build/
187+
dist/
188+
*.spec
189+
190+
# Jupyter and IPython
191+
.ipynb_checkpoints/
192+
profile_default/
193+
194+
# Coverage and test cache
195+
.pytest_cache/
196+
.mypy_cache/

README.md

Lines changed: 60 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -2,174 +2,114 @@
22
## Documentation for macOS_application_speedtest_for_python
33

44
### Project Description
5-
`macOS_application_speedtest_for_python` is a macOS application designed to test your internet connection
6-
speed using Python. The program provides a convenient interface for measuring download, upload, and ping speeds,
7-
and also supports retesting and viewing test history.
8-
9-
This project is built based on another one of my applications, which you can check out on GitHub:
10-
[Internet Speed Test](https://github.com/AlexTkDev/different_mini-apps/tree/main/check_internrt_speed)
11-
12-
### What's New in Version 3.0.0
13-
- Added comprehensive logging system for better debugging
14-
- Improved error handling throughout the application
15-
- Enhanced visualization of test history with interactive graphs
16-
- Added export functionality for test history data
17-
- Better network adapter information collection
18-
- Improved progress reporting during tests
19-
- Added unit tests for core functionality
20-
- Reorganized project structure for better maintainability
5+
`macOS_application_speedtest_for_python` is a modern macOS application for testing your internet connection speed using Python. The app features a beautiful dark UI (ttkbootstrap), asynchronous and thread-based architecture for maximum responsiveness, and advanced UX with toast notifications and smooth progress animations.
6+
7+
### What's New in Version 4.0.0
8+
- Fully asynchronous and thread-based architecture: all heavy operations (speedtest, network info, plotting) run in background threads.
9+
- Modern, dark, and airy UI using ttkbootstrap.
10+
- Toast notifications for test completion and errors.
11+
- Smooth progress bar animations and non-blocking interface.
12+
- Improved error handling and logging.
13+
- Refactored codebase: all comments and docstrings in English, modular structure.
14+
- Enhanced test history and export features.
15+
- More robust PyInstaller build and troubleshooting section.
2116

2217
### Installation
2318

2419
#### System Requirements
2520
- macOS (version 10.14 or later)
26-
- Python 3.6 or higher
27-
- Installed dependencies listed in `requirements.txt`
21+
- Python 3.8 or higher (with Tkinter support)
22+
- All dependencies from `requirements.txt`
2823

2924
#### Installing Dependencies
30-
To install the dependencies, execute the following commands:
31-
3225
```bash
3326
# Clone repository
3427
git clone https://github.com/AlexTkDev/macOS_application_speedtest_for_python.git
3528
cd macOS_application_speedtest_for_python
36-
37-
# Method 1: Using requirements.txt
38-
# Create a virtual environment (recommended)
39-
python -m venv .venv
29+
python3 -m venv .venv
4030
source .venv/bin/activate
41-
# Install dependencies
4231
pip install -r requirements.txt
43-
44-
# Method 2: Installing as a package (development mode)
45-
pip install -e .
4632
```
4733

4834
### Usage
49-
After installation, you can run the application by executing:
35+
Run the application:
5036
```bash
51-
# If installed using requirements.txt
52-
python alexs_speedtest.py
53-
54-
# If installed as a package
55-
python -m speedtest_app
37+
python main.py
38+
```
39+
Or build the .app:
40+
```bash
41+
pyinstaller main.spec
42+
open dist/Alex_SpeedTest.app
5643
```
5744

5845
#### Features
59-
- **Internet Speed Measurement**: The app allows you to test download and upload speeds, as well as ping (latency) of your internet connection.
60-
- **Graphical Display**: After completing a test, users can view the test results and optionally plot the test history.
61-
- **Interactive Graphs**: View your speed test history as interactive graphs with the ability to zoom and navigate.
62-
- **Export Data**: Export your test history to CSV format for further analysis.
63-
- **Detailed Network Information**: View comprehensive information about your network adapters.
64-
- **Repeat Test**: After a test is completed, users can repeat the test without needing to restart the application.
65-
- **Logging System**: The application now logs all activities to help with troubleshooting.
66-
67-
#### Key Components
68-
- **Tkinter**: Used for creating the graphical user interface (GUI), which includes buttons for starting tests, viewing results, and plotting graphs.
69-
- **Speedtest-cli**: A library for performing internet speed tests, which powers the app's functionality.
70-
- **Matplotlib**: A library for visualizing the test history by plotting interactive graphs.
71-
- **JSON**: A library for reading and writing test results stored in JSON format.
72-
- **Logging**: Python's built-in logging module for tracking application behavior.
73-
- **Psutil**: For retrieving system and network adapter information.
46+
- **Asynchronous Speed Test**: Download, upload, and ping tests run in a background thread.
47+
- **Modern Dark UI**: Built with ttkbootstrap for a beautiful, modern look.
48+
- **Toast Notifications**: Non-blocking popups for test completion and errors.
49+
- **Network Adapter Info**: Asynchronously fetches and displays active network adapter details.
50+
- **Interactive History & Graphs**: View and export your test history, plot interactive graphs.
51+
- **Export to CSV**: Export your test history for further analysis.
52+
- **Logging**: All actions are logged for troubleshooting.
7453

7554
#### Project Structure
7655
```
7756
macOS_application_speedtest_for_python/
7857
├── speedtest_app/ # Main package
7958
│ ├── __init__.py # Package initialization
80-
│ ├── alexs_speedtest.py # Main application module
81-
│ ├── network_adapter_information.py # Network info module
82-
│ ├── test_history.py # History management module
83-
│ ├── gui/ # GUI components
59+
│ ├── alexs_speedtest.py # Main application module (async, threads)
60+
│ ├── network_adapter_information.py # Async network info
61+
│ ├── test_history.py # Async history and plotting
62+
│ ├── gui/ # GUI components (ttkbootstrap)
8463
│ │ └── __init__.py
8564
│ ├── utils/ # Utility functions
8665
│ │ └── __init__.py
8766
│ └── tests/ # Unit tests
8867
│ ├── __init__.py
8968
│ ├── test_network_adapter.py
9069
│ └── test_test_history.py
91-
├── main.py # Entry point script
92-
├── setup.py # Installation script
70+
├── main.py # Entry point
71+
├── main.spec # PyInstaller config
9372
├── requirements.txt # Dependencies
94-
├── .pylintrc # Pylint configuration
95-
├── .github/workflows/ # GitHub Actions configuration
96-
│ └── pylint.yml
97-
├── LICENSE # MIT License
98-
├── README.md # This documentation
99-
└── test_history.py # Test history file
73+
├── setup.py # Installation script
74+
├── README.md # This documentation
10075
```
10176

102-
#### How It Works
103-
1. When the app is launched, users can click the **"Start Speed Test"** button to initiate the test.
104-
2. The app first finds the best server, then runs a speed test using the **speedtest-cli** library, measuring download speed, upload speed, and ping.
105-
3. Once the test is completed, the results are displayed in the app's interface.
106-
4. Users can save the test results to the **history.json** file and visualize the data using **matplotlib**'s interactive graphs.
107-
5. For a repeat test, users can simply click the **"Repeat Speed Test"** button, which hides the history buttons until the new test is finished.
108-
6. All application activities are logged to a file in the user's Documents folder for troubleshooting.
77+
### How It Works
78+
1. Click **Start Speed Test** to run a speed test in a background thread.
79+
2. The app finds the best server, runs the test, and updates the UI with smooth progress.
80+
3. Results are shown instantly; you can repeat the test, view/export history, or plot interactive graphs.
81+
4. All network info and history operations are also asynchronous.
82+
5. Toast notifications inform you of completion or errors.
10983

110-
#### Building the Application
111-
To build the application in `.app` format, run the following command:
84+
### Building the Application
85+
To build the application in `.app` format:
11286
```bash
11387
pyinstaller main.spec
11488
```
115-
After building, the application will be located in the `dist` directory, and you can launch it by double-clicking the icon.
116-
117-
### Configuration
118-
The project includes several configuration files:
119-
- `.pylintrc`: Contains settings for the Pylint code analysis tool
120-
- `main.spec`: Configuration for PyInstaller to build the macOS application
89+
The `.app` will appear in the `dist` directory.
90+
91+
#### Troubleshooting PyInstaller/macOS
92+
- If the app does not open, run the binary from terminal to see errors:
93+
```bash
94+
dist/Alex_SpeedTest.app/Contents/MacOS/alexs_speedtest
95+
```
96+
- If you see `ModuleNotFoundError: No module named '_tkinter'`, ensure your Python has Tkinter support and rebuild the venv.
97+
- If macOS blocks the app, run:
98+
```bash
99+
xattr -dr com.apple.quarantine dist/Alex_SpeedTest.app
100+
```
101+
- For other issues, check the log file in `~/Documents/SpeedTest_Logs/speedtest_log.log`.
121102

122103
### Running Tests
123-
The project includes unit tests to ensure functionality. To run the tests:
124104
```bash
125-
# Run all tests
126105
python -m unittest discover
127-
128-
# Run specific test module
129-
python -m unittest speedtest_app.tests.test_network_adapter
130106
```
131107

132108
### License
133-
This project is licensed under the MIT License. Please refer to the `LICENSE` file for more detailed information.
134-
135-
### Code Analysis with Pylint
136-
This project uses **Pylint** for static code analysis to ensure that code adheres to Python's
137-
best practices and follows PEP 8 style guidelines. Pylint checks for errors, potential issues,
138-
and enforces consistent coding style, making it a valuable tool for maintaining code quality.
109+
MIT License. See `LICENSE` for details.
139110

140-
#### How to Install Pylint
141-
To install Pylint, use the following command in your terminal:
142-
```bash
143-
pip install pylint
144-
```
145-
146-
#### Running Pylint
147-
Once installed, you can run Pylint on a specific Python file with:
148-
```bash
149-
pylint your_file.py
150-
```
151-
Or, to analyze all Python files in the project, run:
152-
```bash
153-
pylint speedtest_app/*.py
154-
```
155-
This setup is also configured to run automatically within GitHub Actions on every code push,
156-
checking the code with multiple Python versions for compatibility.
157-
158111
### Contribution
159-
If you would like to contribute to the project, please create a fork of the repository and submit a Pull Request with your changes.
160-
161-
#### Contribution Guidelines
162-
1. Fork the repository
163-
2. Create a feature branch (`git checkout -b feature/your-feature-name`)
164-
3. Commit your changes (`git commit -am 'Add some feature'`)
165-
4. Push to the branch (`git push origin feature/your-feature-name`)
166-
5. Create a new Pull Request
167-
168-
### Troubleshooting
169-
If you encounter issues with the application, check the log file located in:
170-
```
171-
~/Documents/SpeedTest_Logs/speedtest_log.log
172-
```
112+
Pull requests are welcome! See CONTRIBUTING section in the old README for workflow.
173113

174114
### Contact
175-
For questions or suggestions, you can reach out to me via [GitHub](https://github.com/AlexTkDev).
115+
For questions or suggestions, reach out via [GitHub](https://github.com/AlexTkDev).

main.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ app = BUNDLE(
4848
name='Alex_SpeedTest.app',
4949
icon='speedtest.icns',
5050
bundle_identifier='org.AlexTkDev.speedtest',
51-
version='3.0.0',
51+
version='4.0.0',
5252
)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ speedtest-cli==2.1.3
2525
tk==0.1.0
2626
tomlkit==0.13.2
2727
tqdm==4.66.6
28+
ttkbootstrap>=1.10.1

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"matplotlib>=3.5.0",
2828
"psutil>=5.9.0",
2929
"pyinstaller>=5.6.0",
30+
'ttkbootstrap>=1.10.1',
3031
],
3132
entry_points={
3233
"console_scripts": [

0 commit comments

Comments
 (0)