Open-AutoTools 0.0.1__tar.gz → 0.0.2.post1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1/Open_AutoTools.egg-info}/PKG-INFO +15 -8
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/Open_AutoTools.egg-info/SOURCES.txt +7 -3
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/Open_AutoTools.egg-info/entry_points.txt +3 -1
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/Open_AutoTools.egg-info/requires.txt +12 -6
- {open_autotools-0.0.1/Open_AutoTools.egg-info → open_autotools-0.0.2.post1}/PKG-INFO +15 -8
- open_autotools-0.0.2.post1/README.md +225 -0
- open_autotools-0.0.2.post1/autotools/autoip/__init__.py +1 -0
- open_autotools-0.0.2.post1/autotools/autoip/core.py +218 -0
- open_autotools-0.0.2.post1/autotools/autolower/core.py +7 -0
- open_autotools-0.0.2.post1/autotools/autotranslate/__init__.py +3 -0
- open_autotools-0.0.2.post1/autotools/autotranslate/core.py +40 -0
- open_autotools-0.0.2.post1/autotools/cli.py +183 -0
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/autotools/downloader/core.py +76 -37
- open_autotools-0.0.2.post1/autotools/password/__init__.py +1 -0
- open_autotools-0.0.2.post1/autotools/password/core.py +102 -0
- open_autotools-0.0.2.post1/setup.py +57 -0
- open_autotools-0.0.1/README.md +0 -65
- open_autotools-0.0.1/autotools/autocorrect/core.py +0 -34
- open_autotools-0.0.1/autotools/autotranslate/core.py +0 -39
- open_autotools-0.0.1/autotools/cli.py +0 -66
- open_autotools-0.0.1/autotools/downloader/__init__.py +0 -0
- open_autotools-0.0.1/setup.py +0 -22
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/LICENSE +0 -0
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/Open_AutoTools.egg-info/dependency_links.txt +0 -0
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/Open_AutoTools.egg-info/top_level.txt +0 -0
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/autotools/__init__.py +0 -0
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/autotools/autocaps/__init__.py +0 -0
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/autotools/autocaps/core.py +0 -0
- {open_autotools-0.0.1/autotools/autocorrect → open_autotools-0.0.2.post1/autotools/autolower}/__init__.py +0 -0
- {open_autotools-0.0.1/autotools/autotranslate → open_autotools-0.0.2.post1/autotools/downloader}/__init__.py +0 -0
- {open_autotools-0.0.1 → open_autotools-0.0.2.post1}/setup.cfg +0 -0
|
@@ -1,30 +1,37 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: Open-AutoTools
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2.post1
|
|
4
4
|
License-File: LICENSE
|
|
5
5
|
Requires-Dist: Brotli==1.1.0
|
|
6
6
|
Requires-Dist: certifi==2024.2.2
|
|
7
7
|
Requires-Dist: charset-normalizer==3.3.2
|
|
8
|
-
Requires-Dist: click==8.1.
|
|
8
|
+
Requires-Dist: click==8.1.3
|
|
9
|
+
Requires-Dist: cryptography==42.0.2
|
|
9
10
|
Requires-Dist: idna==3.6
|
|
10
11
|
Requires-Dist: importlib-metadata==7.0.1
|
|
11
12
|
Requires-Dist: joblib==1.3.2
|
|
12
13
|
Requires-Dist: Levenshtein==0.25.0
|
|
13
14
|
Requires-Dist: mutagen==1.47.0
|
|
14
|
-
Requires-Dist: nltk==3.8.1
|
|
15
15
|
Requires-Dist: platformdirs==4.2.0
|
|
16
16
|
Requires-Dist: pycryptodomex==3.20.0
|
|
17
|
-
Requires-Dist: pyperclip==1.
|
|
18
|
-
Requires-Dist: python-dotenv==1.0.1
|
|
17
|
+
Requires-Dist: pyperclip==1.8.2
|
|
19
18
|
Requires-Dist: python-Levenshtein==0.25.0
|
|
20
19
|
Requires-Dist: rapidfuzz==3.6.1
|
|
21
20
|
Requires-Dist: regex==2023.12.25
|
|
22
|
-
Requires-Dist: requests
|
|
21
|
+
Requires-Dist: requests>=2.32.2
|
|
23
22
|
Requires-Dist: textblob==0.18.0.post0
|
|
24
23
|
Requires-Dist: tomli==2.0.1
|
|
25
24
|
Requires-Dist: tqdm==4.66.2
|
|
26
25
|
Requires-Dist: urllib3==2.2.1
|
|
27
26
|
Requires-Dist: websockets==13.0.1
|
|
28
27
|
Requires-Dist: yapf==0.40.2
|
|
29
|
-
Requires-Dist: yt-dlp
|
|
28
|
+
Requires-Dist: yt-dlp>=2024.3.10
|
|
30
29
|
Requires-Dist: zipp==3.17.0
|
|
30
|
+
Requires-Dist: translate==3.6.1
|
|
31
|
+
Requires-Dist: langdetect==1.0.9
|
|
32
|
+
Requires-Dist: deep-translator==1.11.4
|
|
33
|
+
Requires-Dist: netifaces>=0.11.0
|
|
34
|
+
Requires-Dist: speedtest-cli>=2.1.3
|
|
35
|
+
Requires-Dist: psutil>=5.9.0
|
|
36
|
+
Requires-Dist: setuptools>=40.8.0
|
|
37
|
+
Dynamic: requires-dist
|
|
@@ -11,9 +11,13 @@ autotools/__init__.py
|
|
|
11
11
|
autotools/cli.py
|
|
12
12
|
autotools/autocaps/__init__.py
|
|
13
13
|
autotools/autocaps/core.py
|
|
14
|
-
autotools/
|
|
15
|
-
autotools/
|
|
14
|
+
autotools/autoip/__init__.py
|
|
15
|
+
autotools/autoip/core.py
|
|
16
|
+
autotools/autolower/__init__.py
|
|
17
|
+
autotools/autolower/core.py
|
|
16
18
|
autotools/autotranslate/__init__.py
|
|
17
19
|
autotools/autotranslate/core.py
|
|
18
20
|
autotools/downloader/__init__.py
|
|
19
|
-
autotools/downloader/core.py
|
|
21
|
+
autotools/downloader/core.py
|
|
22
|
+
autotools/password/__init__.py
|
|
23
|
+
autotools/password/core.py
|
{open_autotools-0.0.1 → open_autotools-0.0.2.post1}/Open_AutoTools.egg-info/entry_points.txt
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
[console_scripts]
|
|
2
2
|
autocaps = autotools.cli:autocaps
|
|
3
|
-
autocorrect = autotools.cli:autocorrect
|
|
4
3
|
autodownload = autotools.cli:autodownload
|
|
4
|
+
autoip = autotools.cli:autoip
|
|
5
|
+
autolower = autotools.cli:autolower
|
|
6
|
+
autopassword = autotools.cli:autopassword
|
|
5
7
|
autotools = autotools.cli:autotools
|
|
6
8
|
autotranslate = autotools.cli:autotranslate
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
Brotli==1.1.0
|
|
2
2
|
certifi==2024.2.2
|
|
3
3
|
charset-normalizer==3.3.2
|
|
4
|
-
click==8.1.
|
|
4
|
+
click==8.1.3
|
|
5
|
+
cryptography==42.0.2
|
|
5
6
|
idna==3.6
|
|
6
7
|
importlib-metadata==7.0.1
|
|
7
8
|
joblib==1.3.2
|
|
8
9
|
Levenshtein==0.25.0
|
|
9
10
|
mutagen==1.47.0
|
|
10
|
-
nltk==3.8.1
|
|
11
11
|
platformdirs==4.2.0
|
|
12
12
|
pycryptodomex==3.20.0
|
|
13
|
-
pyperclip==1.
|
|
14
|
-
python-dotenv==1.0.1
|
|
13
|
+
pyperclip==1.8.2
|
|
15
14
|
python-Levenshtein==0.25.0
|
|
16
15
|
rapidfuzz==3.6.1
|
|
17
16
|
regex==2023.12.25
|
|
18
|
-
requests
|
|
17
|
+
requests>=2.32.2
|
|
19
18
|
textblob==0.18.0.post0
|
|
20
19
|
tomli==2.0.1
|
|
21
20
|
tqdm==4.66.2
|
|
22
21
|
urllib3==2.2.1
|
|
23
22
|
websockets==13.0.1
|
|
24
23
|
yapf==0.40.2
|
|
25
|
-
yt-dlp
|
|
24
|
+
yt-dlp>=2024.3.10
|
|
26
25
|
zipp==3.17.0
|
|
26
|
+
translate==3.6.1
|
|
27
|
+
langdetect==1.0.9
|
|
28
|
+
deep-translator==1.11.4
|
|
29
|
+
netifaces>=0.11.0
|
|
30
|
+
speedtest-cli>=2.1.3
|
|
31
|
+
psutil>=5.9.0
|
|
32
|
+
setuptools>=40.8.0
|
|
@@ -1,30 +1,37 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: Open-AutoTools
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2.post1
|
|
4
4
|
License-File: LICENSE
|
|
5
5
|
Requires-Dist: Brotli==1.1.0
|
|
6
6
|
Requires-Dist: certifi==2024.2.2
|
|
7
7
|
Requires-Dist: charset-normalizer==3.3.2
|
|
8
|
-
Requires-Dist: click==8.1.
|
|
8
|
+
Requires-Dist: click==8.1.3
|
|
9
|
+
Requires-Dist: cryptography==42.0.2
|
|
9
10
|
Requires-Dist: idna==3.6
|
|
10
11
|
Requires-Dist: importlib-metadata==7.0.1
|
|
11
12
|
Requires-Dist: joblib==1.3.2
|
|
12
13
|
Requires-Dist: Levenshtein==0.25.0
|
|
13
14
|
Requires-Dist: mutagen==1.47.0
|
|
14
|
-
Requires-Dist: nltk==3.8.1
|
|
15
15
|
Requires-Dist: platformdirs==4.2.0
|
|
16
16
|
Requires-Dist: pycryptodomex==3.20.0
|
|
17
|
-
Requires-Dist: pyperclip==1.
|
|
18
|
-
Requires-Dist: python-dotenv==1.0.1
|
|
17
|
+
Requires-Dist: pyperclip==1.8.2
|
|
19
18
|
Requires-Dist: python-Levenshtein==0.25.0
|
|
20
19
|
Requires-Dist: rapidfuzz==3.6.1
|
|
21
20
|
Requires-Dist: regex==2023.12.25
|
|
22
|
-
Requires-Dist: requests
|
|
21
|
+
Requires-Dist: requests>=2.32.2
|
|
23
22
|
Requires-Dist: textblob==0.18.0.post0
|
|
24
23
|
Requires-Dist: tomli==2.0.1
|
|
25
24
|
Requires-Dist: tqdm==4.66.2
|
|
26
25
|
Requires-Dist: urllib3==2.2.1
|
|
27
26
|
Requires-Dist: websockets==13.0.1
|
|
28
27
|
Requires-Dist: yapf==0.40.2
|
|
29
|
-
Requires-Dist: yt-dlp
|
|
28
|
+
Requires-Dist: yt-dlp>=2024.3.10
|
|
30
29
|
Requires-Dist: zipp==3.17.0
|
|
30
|
+
Requires-Dist: translate==3.6.1
|
|
31
|
+
Requires-Dist: langdetect==1.0.9
|
|
32
|
+
Requires-Dist: deep-translator==1.11.4
|
|
33
|
+
Requires-Dist: netifaces>=0.11.0
|
|
34
|
+
Requires-Dist: speedtest-cli>=2.1.3
|
|
35
|
+
Requires-Dist: psutil>=5.9.0
|
|
36
|
+
Requires-Dist: setuptools>=40.8.0
|
|
37
|
+
Dynamic: requires-dist
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Open-AutoTools
|
|
2
|
+
|
|
3
|
+
Open-AutoTools is an innovative project developed in Python, specifically designed to offer a suite of automated tools directly accessible via the terminal. This project aims to simplify and automate daily tasks for developers and terminal users. It is designed to be used as a set of CLI commands, making its features directly accessible from the user's terminal.
|
|
4
|
+
|
|
5
|
+
https://github.com/BabylooPro/Open-AutoTools/assets/35376790/d57f2b9d-55f8-4368-bb40-c0010eb9d49a
|
|
6
|
+
|
|
7
|
+
## How to install to use directly
|
|
8
|
+
|
|
9
|
+
To install Open-AutoTools, use the following command in your terminal: `pip install open-autotools`
|
|
10
|
+
|
|
11
|
+
This command installs all the necessary tools to integrate Open-AutoTools into your workflow.
|
|
12
|
+
|
|
13
|
+
You can also find the package on PyPI at: https://pypi.org/project/Open-AutoTools/
|
|
14
|
+
|
|
15
|
+
## How to develop more features
|
|
16
|
+
|
|
17
|
+
Open-AutoTools is developed using Python 3.11.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Create a virtual environment
|
|
21
|
+
python -m venv venv
|
|
22
|
+
|
|
23
|
+
# Activate virtual environment
|
|
24
|
+
source venv/bin/activate # On macOS/Linux
|
|
25
|
+
venv\Scripts\activate # On Windows
|
|
26
|
+
|
|
27
|
+
# Install project dependencies
|
|
28
|
+
pip install -r requirements.txt
|
|
29
|
+
|
|
30
|
+
# For development, install in editable mode
|
|
31
|
+
pip install -e .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Key Features
|
|
35
|
+
|
|
36
|
+
### AutoCaps
|
|
37
|
+
|
|
38
|
+
- **Description:** Converts any text entered by the user to uppercase.
|
|
39
|
+
- **Usage:**
|
|
40
|
+
```
|
|
41
|
+
~ ❯ autocaps "Your text here."
|
|
42
|
+
```
|
|
43
|
+
- **Output:**
|
|
44
|
+
```
|
|
45
|
+
YOUR TEXT HERE.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### AutoLower
|
|
49
|
+
|
|
50
|
+
- **Description:** Converts any text entered by the user to lowercase.
|
|
51
|
+
- **Usage:**
|
|
52
|
+
```
|
|
53
|
+
~ ❯ autolower "Your text here."
|
|
54
|
+
```
|
|
55
|
+
- **Output:**
|
|
56
|
+
```
|
|
57
|
+
your text here.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### AutoPassword
|
|
61
|
+
|
|
62
|
+
- **Description:** Generates secure random passwords and encryption keys with customizable options.
|
|
63
|
+
- **Usage:**
|
|
64
|
+
```
|
|
65
|
+
~ ❯ autopassword --length 16
|
|
66
|
+
~ ❯ autopassword --no-special --length 8
|
|
67
|
+
~ ❯ autopassword --gen-key
|
|
68
|
+
~ ❯ autopassword --password-key "your-password" --analyze
|
|
69
|
+
```
|
|
70
|
+
- **Options:**
|
|
71
|
+
- `--length, -l`: Set password length (default: 12)
|
|
72
|
+
- `--no-uppercase`: Exclude uppercase letters
|
|
73
|
+
- `--no-numbers`: Exclude numbers
|
|
74
|
+
- `--no-special`: Exclude special characters
|
|
75
|
+
- `--min-special`: Minimum number of special characters (default: 1)
|
|
76
|
+
- `--min-numbers`: Minimum number of numbers (default: 1)
|
|
77
|
+
- `--gen-key`: Generate a random encryption key
|
|
78
|
+
- `--password-key`: Generate an encryption key from a password
|
|
79
|
+
- `--analyze`: Show password strength analysis
|
|
80
|
+
|
|
81
|
+
These examples demonstrate how the terminal will display the results after executing each command, providing a straightforward way for users to understand the immediate effects of these commands.
|
|
82
|
+
|
|
83
|
+
### AutoTranslate
|
|
84
|
+
|
|
85
|
+
- **Description:** Translates text between languages with automatic source language detection.
|
|
86
|
+
- **Usage:**
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
~ ❯ autotranslate "Bonjour le monde" --to en
|
|
90
|
+
Hello world
|
|
91
|
+
|
|
92
|
+
~ ❯ autotranslate "Hello world" --to fr --copy
|
|
93
|
+
Bonjour le monde
|
|
94
|
+
// Result also copied to clipboard
|
|
95
|
+
|
|
96
|
+
~ ❯ autotranslate "こんにちは" --to en --detect
|
|
97
|
+
[Detected: ja] Hello
|
|
98
|
+
|
|
99
|
+
~ ❯ autotranslate --list-languages
|
|
100
|
+
// Shows all supported languages
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- **Options:**
|
|
104
|
+
- `--to`: Target language code (default: en)
|
|
105
|
+
- `--from`: Source language code (default: auto-detect)
|
|
106
|
+
- `--copy`: Copy translation to clipboard
|
|
107
|
+
- `--detect`: Show detected source language
|
|
108
|
+
- `--list-languages`: Show all supported language codes and names
|
|
109
|
+
|
|
110
|
+
### AutoDownload
|
|
111
|
+
|
|
112
|
+
- **Description:** Downloads videos from YouTube and files from other sources.
|
|
113
|
+
- **Usage:**
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Download YouTube video in MP4 format
|
|
117
|
+
~ ❯ autodownload https://youtube.com/watch?v=example
|
|
118
|
+
|
|
119
|
+
# Download with specific format and quality
|
|
120
|
+
~ ❯ autodownload https://youtube.com/watch?v=example --format mp3
|
|
121
|
+
~ ❯ autodownload https://youtube.com/watch?v=example --quality 1080p
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- **Options:**
|
|
125
|
+
|
|
126
|
+
- `--format`: Choose output format (mp4 or mp3)
|
|
127
|
+
- `--quality`: Select video quality (best, 1440p, 1080p, 720p, 480p, 360p, 240p)
|
|
128
|
+
|
|
129
|
+
- **Features:**
|
|
130
|
+
|
|
131
|
+
- Automatic bot detection bypass
|
|
132
|
+
- Browser cookie integration
|
|
133
|
+
- Progress tracking
|
|
134
|
+
- Multiple quality options
|
|
135
|
+
- MP3 audio extraction
|
|
136
|
+
- Downloads to user's Downloads folder
|
|
137
|
+
- Supports both YouTube and general file downloads
|
|
138
|
+
|
|
139
|
+
- **Setup Requirements:**
|
|
140
|
+
|
|
141
|
+
- Chrome browser installed and configured:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# First time setup:
|
|
145
|
+
1. Open Chrome and sign in to YouTube
|
|
146
|
+
2. Make sure you're logged into your Google account
|
|
147
|
+
3. Accept YouTube's terms of service in browser
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
- **Troubleshooting:**
|
|
151
|
+
|
|
152
|
+
- If downloads fail with "Sign in to confirm you're not a bot":
|
|
153
|
+
|
|
154
|
+
1. Open YouTube in Chrome
|
|
155
|
+
2. Sign in if not already
|
|
156
|
+
3. Solve any CAPTCHA if prompted
|
|
157
|
+
4. Try download again
|
|
158
|
+
|
|
159
|
+
- If you get cookie errors:
|
|
160
|
+
1. Clear Chrome cookies
|
|
161
|
+
2. Sign in to YouTube again
|
|
162
|
+
3. Wait a few minutes before downloading
|
|
163
|
+
|
|
164
|
+
- **Technical Requirements:**
|
|
165
|
+
- Chrome browser (for cookie and session handling)
|
|
166
|
+
- Active YouTube/Google account
|
|
167
|
+
- Internet connection
|
|
168
|
+
- Sufficient storage space
|
|
169
|
+
- yt-dlp library (automatically installed)
|
|
170
|
+
|
|
171
|
+
> **Note:** The tool uses your Chrome browser's cookies to authenticate with YouTube. This is required to bypass YouTube's bot detection and download restrictions.
|
|
172
|
+
|
|
173
|
+
### AutoIP
|
|
174
|
+
|
|
175
|
+
- **Description:** Displays network information including IP addresses, connectivity tests, speed tests, and more.
|
|
176
|
+
- **Usage:**
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Display IP addresses
|
|
180
|
+
~ ❯ autoip
|
|
181
|
+
|
|
182
|
+
# Run speed test
|
|
183
|
+
~ ❯ autoip --speed
|
|
184
|
+
|
|
185
|
+
# Test connectivity
|
|
186
|
+
~ ❯ autoip --test
|
|
187
|
+
|
|
188
|
+
# Show location info
|
|
189
|
+
~ ❯ autoip --location
|
|
190
|
+
|
|
191
|
+
# Monitor network traffic
|
|
192
|
+
~ ❯ autoip --monitor
|
|
193
|
+
|
|
194
|
+
# Check common ports
|
|
195
|
+
~ ❯ autoip --ports
|
|
196
|
+
|
|
197
|
+
# Show DNS servers
|
|
198
|
+
~ ❯ autoip --dns
|
|
199
|
+
|
|
200
|
+
# Hide IP display and only show tests
|
|
201
|
+
~ ❯ autoip --no-ip --test --speed
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
- **Options:**
|
|
205
|
+
|
|
206
|
+
- `--test, -t`: Run connectivity tests to popular services
|
|
207
|
+
- `--speed, -s`: Run internet speed test
|
|
208
|
+
- `--monitor, -m`: Monitor real-time network traffic
|
|
209
|
+
- `--ports, -p`: Check status of common ports
|
|
210
|
+
- `--dns, -d`: Show DNS server configuration
|
|
211
|
+
- `--location, -l`: Show IP geolocation information
|
|
212
|
+
- `--no-ip, -n`: Hide IP addresses display
|
|
213
|
+
|
|
214
|
+
- **Features:**
|
|
215
|
+
- Local and public IP detection (IPv4 & IPv6)
|
|
216
|
+
- Internet speed testing
|
|
217
|
+
- Network connectivity checks
|
|
218
|
+
- Real-time traffic monitoring
|
|
219
|
+
- Port scanning
|
|
220
|
+
- DNS server information
|
|
221
|
+
- IP geolocation
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
This project is licensed under the MIT License. For more details, see the [LICENSE](LICENSE) file.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .core import run
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import socket
|
|
2
|
+
import requests
|
|
3
|
+
import netifaces
|
|
4
|
+
import time
|
|
5
|
+
import speedtest
|
|
6
|
+
import psutil
|
|
7
|
+
|
|
8
|
+
def get_local_ips():
|
|
9
|
+
"""GET LOCAL IPS"""
|
|
10
|
+
ips = {'ipv4': [], 'ipv6': []} # INITIALIZE WITH EMPTY LISTS
|
|
11
|
+
|
|
12
|
+
# GET LOCAL IPS
|
|
13
|
+
for interface in netifaces.interfaces():
|
|
14
|
+
addrs = netifaces.ifaddresses(interface)
|
|
15
|
+
|
|
16
|
+
# GET IPV4
|
|
17
|
+
if netifaces.AF_INET in addrs:
|
|
18
|
+
for addr in addrs[netifaces.AF_INET]:
|
|
19
|
+
if 'addr' in addr and not addr['addr'].startswith('127.'):
|
|
20
|
+
ips['ipv4'].append(addr['addr'])
|
|
21
|
+
|
|
22
|
+
# GET IPV6
|
|
23
|
+
if netifaces.AF_INET6 in addrs:
|
|
24
|
+
for addr in addrs[netifaces.AF_INET6]:
|
|
25
|
+
if 'addr' in addr and not addr['addr'].startswith('fe80:'):
|
|
26
|
+
# REMOVE SCOPE ID IF PRESENT
|
|
27
|
+
clean_addr = addr['addr'].split('%')[0]
|
|
28
|
+
ips['ipv6'].append(clean_addr)
|
|
29
|
+
|
|
30
|
+
return ips
|
|
31
|
+
|
|
32
|
+
def get_public_ips():
|
|
33
|
+
"""GET PUBLIC IPS"""
|
|
34
|
+
ips = {'ipv4': None, 'ipv6': None} # INITIALIZE WITH NONE
|
|
35
|
+
|
|
36
|
+
# TEST MULTIPLE IPV4 SERVICES
|
|
37
|
+
ipv4_services = [
|
|
38
|
+
'https://api.ipify.org',
|
|
39
|
+
'https://ipv4.icanhazip.com',
|
|
40
|
+
'https://v4.ident.me'
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
# GET PUBLIC IPV4
|
|
44
|
+
for service in ipv4_services:
|
|
45
|
+
try:
|
|
46
|
+
ips['ipv4'] = requests.get(service, timeout=2).text.strip()
|
|
47
|
+
if ips['ipv4']: break
|
|
48
|
+
except:
|
|
49
|
+
continue
|
|
50
|
+
|
|
51
|
+
# TEST MULTIPLE IPV6 SERVICES
|
|
52
|
+
ipv6_services = [
|
|
53
|
+
'https://api6.ipify.org',
|
|
54
|
+
'https://ipv6.icanhazip.com',
|
|
55
|
+
'https://v6.ident.me'
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
# GET PUBLIC IPV6
|
|
59
|
+
for service in ipv6_services:
|
|
60
|
+
try:
|
|
61
|
+
ips['ipv6'] = requests.get(service, timeout=2).text.strip()
|
|
62
|
+
if ips['ipv6']: break
|
|
63
|
+
except:
|
|
64
|
+
continue
|
|
65
|
+
|
|
66
|
+
return ips
|
|
67
|
+
|
|
68
|
+
# TEST CONNECTIVITY TO POPULAR SERVICES
|
|
69
|
+
def test_connectivity():
|
|
70
|
+
"""TEST CONNECTIVITY TO POPULAR SERVICES"""
|
|
71
|
+
|
|
72
|
+
# TEST HOSTS
|
|
73
|
+
test_hosts = {
|
|
74
|
+
'Google DNS': ('8.8.8.8', 53),
|
|
75
|
+
'CloudFlare DNS': ('1.1.1.1', 53),
|
|
76
|
+
'Google': ('google.com', 443),
|
|
77
|
+
'Cloudflare': ('cloudflare.com', 443),
|
|
78
|
+
'GitHub': ('github.com', 443),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
results = [] # INITIALIZE WITH EMPTY LIST
|
|
82
|
+
|
|
83
|
+
# TEST EACH HOST
|
|
84
|
+
for name, (host, port) in test_hosts.items():
|
|
85
|
+
try:
|
|
86
|
+
start = time.time()
|
|
87
|
+
s = socket.create_connection((host, port), timeout=2)
|
|
88
|
+
latency = round((time.time() - start) * 1000, 2)
|
|
89
|
+
s.close()
|
|
90
|
+
results.append((name, True, latency))
|
|
91
|
+
except:
|
|
92
|
+
results.append((name, False, None))
|
|
93
|
+
|
|
94
|
+
return results
|
|
95
|
+
|
|
96
|
+
# RUN INTERNET SPEED TEST
|
|
97
|
+
def run_speedtest():
|
|
98
|
+
"""RUN INTERNET SPEED TEST"""
|
|
99
|
+
print("\nRunning speed test (this may take a minute)...")
|
|
100
|
+
|
|
101
|
+
# RUN SPEED TEST
|
|
102
|
+
try:
|
|
103
|
+
# GET BEST SERVER
|
|
104
|
+
st = speedtest.Speedtest()
|
|
105
|
+
st.get_best_server()
|
|
106
|
+
|
|
107
|
+
# TEST DOWNLOAD
|
|
108
|
+
print("Testing download speed...")
|
|
109
|
+
download_speed = st.download() / 1_000_000 # Convert to Mbps
|
|
110
|
+
|
|
111
|
+
# TEST UPLOAD
|
|
112
|
+
print("Testing upload speed...")
|
|
113
|
+
upload_speed = st.upload() / 1_000_000 # Convert to Mbps
|
|
114
|
+
|
|
115
|
+
# GET PING
|
|
116
|
+
ping = st.results.ping
|
|
117
|
+
|
|
118
|
+
print("\nSpeed Test Results:")
|
|
119
|
+
print(f"Download: {download_speed:.2f} Mbps")
|
|
120
|
+
print(f"Upload: {upload_speed:.2f} Mbps")
|
|
121
|
+
print(f"Ping: {ping:.0f} ms")
|
|
122
|
+
|
|
123
|
+
return True
|
|
124
|
+
except Exception as e:
|
|
125
|
+
print(f"\nSpeed test failed: {str(e)}")
|
|
126
|
+
return False
|
|
127
|
+
|
|
128
|
+
def run(test=False, speed=False, monitor=False, ports=False, dns=False, location=False, no_ip=False):
|
|
129
|
+
"""MAIN FUNCTION"""
|
|
130
|
+
# GET LOCAL AND PUBLIC IPS
|
|
131
|
+
local = get_local_ips()
|
|
132
|
+
public = get_public_ips()
|
|
133
|
+
|
|
134
|
+
# DISPLAY IPS IF NOT HIDDEN
|
|
135
|
+
if not no_ip:
|
|
136
|
+
print("\nLocal IPs:")
|
|
137
|
+
if local['ipv4']:
|
|
138
|
+
for ip in local['ipv4']:
|
|
139
|
+
print(f"IPv4: {ip}")
|
|
140
|
+
else:
|
|
141
|
+
print("IPv4: Not available")
|
|
142
|
+
|
|
143
|
+
if local['ipv6']:
|
|
144
|
+
for ip in local['ipv6']:
|
|
145
|
+
print(f"IPv6: {ip}")
|
|
146
|
+
else:
|
|
147
|
+
print("IPv6: Not available")
|
|
148
|
+
|
|
149
|
+
print("\nPublic IPs:")
|
|
150
|
+
print(f"IPv4: {public['ipv4'] or 'Not available'}")
|
|
151
|
+
print(f"IPv6: {public['ipv6'] or 'Not available'}")
|
|
152
|
+
|
|
153
|
+
# RUN CONNECTIVITY TESTS IF REQUESTED
|
|
154
|
+
if test:
|
|
155
|
+
print("\nConnectivity Tests:")
|
|
156
|
+
results = test_connectivity()
|
|
157
|
+
for name, success, latency in results:
|
|
158
|
+
status = f"✓ {latency}ms" if success else "✗ Failed"
|
|
159
|
+
print(f"{name:<15} {status}")
|
|
160
|
+
|
|
161
|
+
# RUN SPEED TEST IF REQUESTED
|
|
162
|
+
if speed:
|
|
163
|
+
run_speedtest()
|
|
164
|
+
|
|
165
|
+
# DISPLAY LOCATION INFO IF REQUESTED
|
|
166
|
+
if location:
|
|
167
|
+
try:
|
|
168
|
+
loc = requests.get('https://ipapi.co/json/').json()
|
|
169
|
+
print("\nLocation Info:")
|
|
170
|
+
print(f"City: {loc.get('city', 'Unknown')}")
|
|
171
|
+
print(f"Region: {loc.get('region', 'Unknown')}")
|
|
172
|
+
print(f"Country: {loc.get('country_name', 'Unknown')}")
|
|
173
|
+
print(f"ISP: {loc.get('org', 'Unknown')}")
|
|
174
|
+
except:
|
|
175
|
+
print("\nLocation lookup failed")
|
|
176
|
+
|
|
177
|
+
# DISPLAY DNS SERVERS IF REQUESTED
|
|
178
|
+
if dns:
|
|
179
|
+
print("\nDNS Servers:")
|
|
180
|
+
try:
|
|
181
|
+
with open('/etc/resolv.conf', 'r') as f:
|
|
182
|
+
for line in f:
|
|
183
|
+
if 'nameserver' in line:
|
|
184
|
+
print(f"DNS: {line.split()[1]}")
|
|
185
|
+
except:
|
|
186
|
+
print("Could not read DNS configuration")
|
|
187
|
+
|
|
188
|
+
# CHECK COMMON PORTS IF REQUESTED
|
|
189
|
+
if ports:
|
|
190
|
+
common_ports = [80, 443, 22, 21, 25, 3306]
|
|
191
|
+
print("\nCommon Ports Status (localhost):")
|
|
192
|
+
for port in common_ports:
|
|
193
|
+
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
194
|
+
result = sock.connect_ex(('127.0.0.1', port))
|
|
195
|
+
status = "Open" if result == 0 else "Closed"
|
|
196
|
+
print(f"Port {port}: {status}")
|
|
197
|
+
sock.close()
|
|
198
|
+
|
|
199
|
+
# MONITOR NETWORK TRAFFIC IF REQUESTED
|
|
200
|
+
if monitor:
|
|
201
|
+
print("\nNetwork Monitor (Press Ctrl+C to stop):")
|
|
202
|
+
try:
|
|
203
|
+
prev_bytes_sent = psutil.net_io_counters().bytes_sent
|
|
204
|
+
prev_bytes_recv = psutil.net_io_counters().bytes_recv
|
|
205
|
+
while True:
|
|
206
|
+
time.sleep(1)
|
|
207
|
+
bytes_sent = psutil.net_io_counters().bytes_sent
|
|
208
|
+
bytes_recv = psutil.net_io_counters().bytes_recv
|
|
209
|
+
|
|
210
|
+
upload_speed = (bytes_sent - prev_bytes_sent) / 1024 # KB/s
|
|
211
|
+
download_speed = (bytes_recv - prev_bytes_recv) / 1024 # KB/s
|
|
212
|
+
|
|
213
|
+
print(f"\rUp: {upload_speed:.2f} KB/s | Down: {download_speed:.2f} KB/s", end='')
|
|
214
|
+
|
|
215
|
+
prev_bytes_sent = bytes_sent
|
|
216
|
+
prev_bytes_recv = bytes_recv
|
|
217
|
+
except KeyboardInterrupt:
|
|
218
|
+
print("\nMonitoring stopped")
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from deep_translator import GoogleTranslator
|
|
2
|
+
from langdetect import detect
|
|
3
|
+
import pyperclip
|
|
4
|
+
|
|
5
|
+
def get_supported_languages() -> dict:
|
|
6
|
+
"""GET ALL SUPPORTED LANGUAGES FROM GOOGLE TRANSLATE"""
|
|
7
|
+
# GET LANGUAGES CODES
|
|
8
|
+
langs = GoogleTranslator().get_supported_languages(as_dict=True)
|
|
9
|
+
# SORT BY LANGUAGE NAME
|
|
10
|
+
return dict(sorted(langs.items(), key=lambda x: x[1].lower()))
|
|
11
|
+
|
|
12
|
+
def translate_text(text: str, to_lang: str = 'en', from_lang: str = None,
|
|
13
|
+
copy: bool = False, detect_lang: bool = False) -> str:
|
|
14
|
+
"""TRANSLATE TEXT TO SPECIFIED LANGUAGE
|
|
15
|
+
|
|
16
|
+
ARGS:
|
|
17
|
+
text (str): TEXT TO TRANSLATE
|
|
18
|
+
to_lang (str): TARGET LANGUAGE CODE (DEFAULT: EN)
|
|
19
|
+
from_lang (str): SOURCE LANGUAGE CODE (DEFAULT: AUTO-DETECT)
|
|
20
|
+
copy (bool): COPY RESULT TO CLIPBOARD
|
|
21
|
+
detect_lang (bool): SHOW DETECTED SOURCE LANGUAGE
|
|
22
|
+
|
|
23
|
+
RETURNS:
|
|
24
|
+
str: TRANSLATED TEXT
|
|
25
|
+
"""
|
|
26
|
+
# AUTO-DETECT SOURCE LANGUAGE IF NOT SPECIFIED
|
|
27
|
+
source_lang = from_lang or detect(text)
|
|
28
|
+
|
|
29
|
+
# TRANSLATE
|
|
30
|
+
translator = GoogleTranslator(source=source_lang, target=to_lang)
|
|
31
|
+
result = translator.translate(text)
|
|
32
|
+
|
|
33
|
+
# COPY TO CLIPBOARD IF REQUESTED
|
|
34
|
+
if copy:
|
|
35
|
+
pyperclip.copy(result)
|
|
36
|
+
|
|
37
|
+
# RETURN RESULT WITH DETECTED LANGUAGE IF REQUESTED
|
|
38
|
+
if detect_lang:
|
|
39
|
+
return f"[Detected: {source_lang}] {result}"
|
|
40
|
+
return result
|