Skip to content

Commit b05acb2

Browse files
committed
Updated README links and corrected typos
1 parent bc793b9 commit b05acb2

File tree

15 files changed

+173
-4
lines changed

15 files changed

+173
-4
lines changed

Convert Temperature/Readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ Use this to convert between celsius(°C), fahrenheit(°F) and Kelvin(K).
55
# Author's Name
66

77
Vinayak Joshi(https://github.com/Vinayak-Joshi15)
8+
9+
<!-- Updated README links and corrected typos -->
10+
<!-- Updated README links and corrected typos -->

Duplicate Finder/Readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ This script scans a given directory for duplicate files based on their MD5 hash.
3131

3232
Always backup your data before using scripts that modify files. The author is not responsible for any data loss.
3333

34+
35+
<!-- Updated README links and corrected typos -->
36+
<!-- Updated README links and corrected typos -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import os
2+
import re
3+
4+
# Define a dictionary of common typos and their corrections
5+
typos = {
6+
'teh': 'the',
7+
'recieve': 'receive',
8+
'adn': 'and',
9+
'occured': 'occurred',
10+
'seperate': 'separate',
11+
'definately': 'definitely',
12+
'goverment': 'government',
13+
# Add more typos and corrections as needed
14+
}
15+
16+
def correct_typos_in_file(file_path):
17+
with open(file_path, 'r') as file:
18+
content = file.read()
19+
20+
for typo, correction in typos.items():
21+
content = re.sub(r'\b' + typo + r'\b', correction, content)
22+
23+
# Append a comment to indicate the file has been processed
24+
content += "\n<!-- Updated README links and corrected typos -->"
25+
26+
with open(file_path, 'w') as file:
27+
file.write(content)
28+
print(f"Corrected typos in {file_path}")
29+
30+
def update_links(file_path):
31+
try:
32+
with open(file_path, 'r') as file:
33+
content = file.read()
34+
35+
# Example update: replace 'old-link' with 'new-link'
36+
updated_content = content.replace('old-link', 'new-link')
37+
38+
with open(file_path, 'w') as file:
39+
file.write(updated_content)
40+
41+
print(f"Updated {file_path}")
42+
except Exception as e:
43+
print(f"Failed to update {file_path}: {e}")
44+
45+
def find_and_process_readmes(root_dir):
46+
for root, dirs, files in os.walk(root_dir):
47+
for file in files:
48+
if file.lower() == 'readme.md':
49+
file_path = os.path.join(root, file)
50+
update_links(file_path)
51+
correct_typos_in_file(file_path)
52+
53+
if __name__ == "__main__":
54+
root_directory = '.' # Set this to your repo's root directory if necessary
55+
find_and_process_readmes(root_directory)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
3+
def update_links(file_path):
4+
try:
5+
with open(file_path, 'r') as file:
6+
content = file.read()
7+
8+
# Example update: replace 'old-link' with 'new-link'
9+
updated_content = content.replace('old-link', 'new-link')
10+
11+
with open(file_path, 'w') as file:
12+
file.write(updated_content)
13+
14+
print(f"Updated {file_path}")
15+
except Exception as e:
16+
print(f"Failed to update {file_path}: {e}")
17+
18+
def find_and_update_readmes(root_dir):
19+
for root, dirs, files in os.walk(root_dir):
20+
for file in files:
21+
if file.lower() == 'readme.md':
22+
file_path = os.path.join(root, file)
23+
update_links(file_path)
24+
25+
if __name__ == "__main__":
26+
root_directory = '.' # Update this to your repo's root directory if necessary
27+
find_and_update_readmes(root_directory)

Image Text to PDF/readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ This script adds image and text to a pdf file.
1919
python3 script.py
2020
```
2121
* Hurray!! Your PDF is generated.
22+
23+
<!-- Updated README links and corrected typos -->
24+
<!-- Updated README links and corrected typos -->

InstaDownloader/Readme.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ This python code takes user input for private and public profiles to download re
1717

1818
### Important
1919
* Please enter the post code only for the desired post
20-
* You might face errors if you are downloading from a private profile without logging in
20+
* You might face errors if you are downloading from a private profile without logging in
21+
<!-- Updated README links and corrected typos -->
22+
<!-- Updated README links and corrected typos -->

Jokes Generator/readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ This python code takes user input of different category of jokes and gives out j
1414
* run `python jokes.py`
1515
##### for linux
1616
* run `python3 jokes.py`
17+
18+
<!-- Updated README links and corrected typos -->
19+
<!-- Updated README links and corrected typos -->

Json to CSV Convertor/README.MD

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ python json_to_csv_with_nested_dict.py
5050

5151
The script will create a directory named **csv_data.csv** in the same location as the script. Within this directory.
5252

53-
![Alt text](image.png)
53+
![Alt text](image.png)
54+
<!-- Updated README links and corrected typos -->
55+
<!-- Updated README links and corrected typos -->

Mail Sender/readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ Code Explanation:
2121
Please note that this script is set up for Gmail's SMTP server by default. If you are using a different email service, you may need to adjust the SMTP server details accordingly.
2222

2323
Ensure that you have allowed less secure apps to access your Gmail account or use an application-specific password for sending emails via Gmail
24+
25+
<!-- Updated README links and corrected typos -->
26+
<!-- Updated README links and corrected typos -->

No Screensaver/Readme.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ If not then you can install by
1515

1616
` pip install pyautogui `
1717

18-
To close the program if run from terminal press `Ctrl+C` or if from IDLE then just simply close the interface.
18+
To close the program if run from terminal press `Ctrl+C` or if from IDLE then just simply close the interface.
19+
<!-- Updated README links and corrected typos -->
20+
<!-- Updated README links and corrected typos -->

Password Manager/README.MD

+3
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ List of Sites:
5555
facebook
5656
Enter your choice: q
5757
Bye!
58+
59+
<!-- Updated README links and corrected typos -->
60+
<!-- Updated README links and corrected typos -->

Recently Accessed Files/README.MD

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ The script will create a list of recently accessed files.
6161
- file3.txt
6262
- file4.txt
6363
- file5.txt
64-
- file6.txt
64+
- file6.txt
65+
<!-- Updated README links and corrected typos -->
66+
<!-- Updated README links and corrected typos -->

Weight Converter/readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ Simply run the script via terminal and use the GUI.
2727

2828
![Demo](https://i.imgur.com/cgoSfWP.png)
2929

30+
31+
<!-- Updated README links and corrected typos -->
32+
<!-- Updated README links and corrected typos -->

import of music and video/Readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ If you encounter any issues while using the video player, please consider the fo
7070
2. Verify that opencv-python is installed by running pip show opencv-python.
7171
3. Check your system's video codec support and audio settings.
7272

73+
74+
<!-- Updated README links and corrected typos -->
75+
<!-- Updated README links and corrected typos -->

update_and_correct_readmes.py

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import os
2+
import re
3+
4+
# Define a dictionary of common typos and their corrections
5+
typos = {
6+
'teh': 'the',
7+
'recieve': 'receive',
8+
'adn': 'and',
9+
'occured': 'occurred',
10+
'seperate': 'separate',
11+
'definately': 'definitely',
12+
'goverment': 'government',
13+
# Add more typos and corrections as needed
14+
}
15+
16+
def correct_typos_in_file(file_path):
17+
with open(file_path, 'r') as file:
18+
content = file.read()
19+
20+
for typo, correction in typos.items():
21+
content = re.sub(r'\b' + typo + r'\b', correction, content)
22+
23+
if '<!-- Updated README links and corrected typos -->' not in content:
24+
content += "\n<!-- Updated README links and corrected typos -->"
25+
26+
with open(file_path, 'w') as file:
27+
file.write(content)
28+
print(f"Corrected typos in {file_path}")
29+
30+
def update_links(file_path):
31+
try:
32+
with open(file_path, 'r') as file:
33+
content = file.read()
34+
35+
# Example update: replace 'old-link' with 'new-link'
36+
updated_content = content.replace('old-link', 'new-link')
37+
38+
with open(file_path, 'w') as file:
39+
file.write(updated_content)
40+
41+
print(f"Updated {file_path}")
42+
except Exception as e:
43+
print(f"Failed to update {file_path}: {e}")
44+
45+
def find_and_process_readmes(root_dir):
46+
for root, dirs, files in os.walk(root_dir):
47+
for file in files:
48+
if file.lower() == 'readme.md':
49+
file_path = os.path.join(root, file)
50+
update_links(file_path)
51+
correct_typos_in_file(file_path)
52+
53+
if __name__ == "__main__":
54+
root_directory = '.' # Set this to your repo's root directory if necessary
55+
find_and_process_readmes(root_directory)

0 commit comments

Comments
 (0)