diff --git a/README.md b/README.md index cd05db6..9a4fed0 100644 --- a/README.md +++ b/README.md @@ -73,21 +73,28 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Null + + + agnxsh +
+ Agnish Ghosh +
+ muratonuryildirim
Murat Onur Yildirim
- + + Ayudh-65
Null
- - + Abbhiishek @@ -95,13 +102,6 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Abhishek Kushwaha - - - agnxsh -
- Agnish Ghosh -
- Farhan-2222 @@ -181,6 +181,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Sawan Bhattacharya + + + SiddheshKukade +
+ Siddhesh Bhupendra Kuakde +
+ Sourodip20kar @@ -208,6 +215,14 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Kunal Patil
+ + + + + Mysterious-Owl +
+ Mysterious-Owl +
@@ -215,8 +230,14 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Null
- - + + + + rahulkarda +
+ Rahul Karda +
+ yunghog @@ -224,6 +245,21 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 YUNGH OG + + + Tiagupt03 +
+ Tiya Gupta +
+ + + + varunKT001 +
+ Varun Tiwari +
+ + avyayjain @@ -231,6 +267,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Avyay Jain + + + drk1rd +
+ Drk1rd +
+ lordvader501 @@ -238,13 +281,28 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Null + + + rohitgarud21 +
+ Null +
+ + + + shreyan-naskar +
+ Shreyan Naskar +
+ tolgakurtuluss
Null
- + + srinjoy-26 @@ -258,8 +316,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Shradha
- - + NishantPacharne @@ -287,12 +344,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Hemant
- + + - - Mysterious-Owl + + MayuriKolhe-2003
- Mysterious-Owl + Mayuri Kolhe
@@ -301,20 +359,19 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Parinthapat P. - - + - - rahulkarda + + royninja
- Rahul Karda + Sayan Roy
- - SiddheshKukade + + ambushneupane
- Siddhesh Bhupendra Kuakde + Ambush
@@ -330,7 +387,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Null - + + noobyysauraj @@ -338,14 +396,6 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Sauraj - - - shreyan-naskar -
- Shreyan Naskar -
- - accodes21 @@ -367,6 +417,21 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Akash Jain + + + Rancho2002 +
+ Arijit Ghosh +
+ + + + Danuragtiwari +
+ ANURAG TIWARI +
+ + donheshanthaka @@ -387,8 +452,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Manice18
- - + LEO1612D @@ -396,12 +460,27 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Nikunj R. Prajapati + + + iamrahul8 +
+ Rahul Kumar +
+ Morbius00
Raj Saha
+ + + + + ramonsaraiva +
+ Ramon Saraiva +
@@ -430,15 +509,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Tejaswi Kumar
- - + anjali1102
Anjali Chauhan
- + + arpitbhardwaj @@ -460,6 +539,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Null + + + codeswithroh +
+ Rohit Purkait +
+ devtayade diff --git a/scripts/BMI/bmi.py b/scripts/BMI/bmi.py new file mode 100644 index 0000000..85f2f1c --- /dev/null +++ b/scripts/BMI/bmi.py @@ -0,0 +1,16 @@ +Height=float(input("Enter your height in centimeters: ")) +Weight=float(input("Enter your Weight in Kg: ")) +Height = Height/100 +BMI=Weight/(Height*Height) +print("your Body Mass Index is: ",BMI) +if(BMI>0): + if(BMI<=16): + print("you are severely underweight") + elif(BMI<=18.5): + print("you are underweight") + elif(BMI<=25): + print("you are Healthy") + elif(BMI<=30): + print("you are overweight") + else: print("you are severely overweight") +else:("enter valid details") diff --git a/scripts/BMI/readme.md b/scripts/BMI/readme.md new file mode 100644 index 0000000..ef05bd4 --- /dev/null +++ b/scripts/BMI/readme.md @@ -0,0 +1,4 @@ +BMI calculator with PYTHON + +#Steps : +Run - python bmi.py diff --git a/scripts/Base_Conversion/README.md b/scripts/Base_Conversion/README.md new file mode 100644 index 0000000..51f0e31 --- /dev/null +++ b/scripts/Base_Conversion/README.md @@ -0,0 +1,8 @@ +# BASE CONVERSION IN PYTHON +- Various functions for interconversion of bases +- Conversion of Binary to Decimal +- Conversion of Octal to Decimal +- Conversion of Hexadecimal to Decimal +- Conversion of Decimal to Binary +- Conversion of Decimal to Octal +- Conversion of Decimal to Hexaecimal \ No newline at end of file diff --git a/scripts/Base_Conversion/main.py b/scripts/Base_Conversion/main.py new file mode 100644 index 0000000..8fe0a0f --- /dev/null +++ b/scripts/Base_Conversion/main.py @@ -0,0 +1,162 @@ + +#Function to calculate x raised to the power y +def Power( x , y ) : + + if (y == 0) : + return 1 + + else : + + ans = x**y + return ans + + +#Function to convert Binary to Decimal +def BinaryToDecimal( n ) : + + ans = 0 + x = 1 + m = int(n) + + while m > 0 : + b = m%10 + ans += b*x + x = x*2 + m = m//10 + + return ans + + +#Function to convert Octal to Decimal +def OctalToDecimal( n ) : + + ans = 0 + x = 1 + m = int(n) + + while m > 0 : + b = m%10 + ans += b*x + x = x*8 + m = m//10 + + return ans + + +#Function to convert Hexadecimal to Decimal +def HexadecimalToDecimal( n ): + + ans = 0 + x = 1 + s = len( n ) + + for i in range( s-1 , -1 , -1 ) : + if n[i] >= '0' and n[i] <= '9' : + ans += x*(int(n[i])) + + elif n[i] >= 'A' and n[i] <= 'F' : + ans += x*(ord(n[i]) - ord('A') + 10) + + x = x*16 + + return ans + + +#Function to convert Decimal to Binary +def DecimalToBinary( n ) : + L = [] + while(n>0): + rem = n%2 + L.append(rem) + n = n//2 + #L = L[::-1] + + dec = 0 + for i in range(0,len(L)): + dec = dec + L[i]*(10**i) + + return dec + +#Function to convert Decimal to Octal +def DecimalToOctal( n ) : + + ans = 0 + count = 0 + + while (n > 0) : + lastDigit = n%8 + ans += lastDigit*(10**(count)) + n = n//8 + + count += 1 + + return ans + + +#Function to convert Decimal to Hexadecimal +def DecimaltoHexadecimal( n ) : + + ans = '' + + while (n > 0) : + lastDigit = n%16 + if (lastDigit >= 0 and lastDigit <=9 ) : + ans = ans + str(lastDigit) + + elif (lastDigit >= 10 and lastDigit <= 15) : + a = chr(ord('A') + (lastDigit-10)) + ans = ans + a + + n = n//16 + + return ans[::-1] + +while True: + print('1 -> Calculate Exponents') + print('2 -> convert Binary to Decimal ') + print('3 -> convert Octal to Decimal ') + print('4 -> convert Hexadecimal to Decimal ') + print('5 -> convert Decimal to Binary ') + print('6 -> convert Decimal to Octal ') + print('7 -> convert Decimal to Hexadecimal ') + print('0 -> Exit') + + + n = int(input('\nEnter: ')) + + if n == 1: + a,b = int(input("Enter Base :\n")),int(input("Enter Superscript : \n")) + print("The result is : ",Power(a,b), "\n") + + elif n == 2: + b = int(input("Enter Binary Number:\n")) + print("Corresponding Decimal Number is : ", BinaryToDecimal(b), "\n") + + elif n == 3: + b = int(input("Enter Octal Number:\n")) + print("Corresponding Decimal Number is : ", OctalToDecimal(b), "\n") + + elif n == 4: + b = (input("Enter Hexadecimal Number:\n")) + print("Corresponding Decimal Number is : ", HexadecimalToDecimal(b), "\n") + + elif n == 5: + b = int(input("Enter Decimal Number:\n")) + print("Corresponding Binary Number is : ", DecimalToBinary(b), "\n") + + elif n == 6: + b = int(input("Enter Decimal Number:\n")) + print("Corresponding Octal Number is : ", DecimalToOctal(b), "\n") + + elif n == 7: + b = int(input("Enter Decimal Number:\n")) + print("Corresponding Hexadecimal Number is : ", DecimaltoHexadecimal(b), "\n") + + elif n == 0: + + exit() + + else: + print("\nNo such option exists!! ") + + diff --git a/scripts/Email Extractor/README.md b/scripts/Email Extractor/README.md new file mode 100644 index 0000000..68230b9 --- /dev/null +++ b/scripts/Email Extractor/README.md @@ -0,0 +1,16 @@ +# Email Extractor with Python + +This is a script that takes input as a website and collect all the email address into a csv file. + + +### Setup + - Install the requirements (refer below) + - Run the script by 'python email_extractor.py' + - Input the website to collect emails + + +### Requirements +```pip install -r requirements.txt``` + +### usage +```python email_extractor.py``` \ No newline at end of file diff --git a/scripts/Email Extractor/email_extractor.py b/scripts/Email Extractor/email_extractor.py new file mode 100644 index 0000000..550752b --- /dev/null +++ b/scripts/Email Extractor/email_extractor.py @@ -0,0 +1,45 @@ + + +import requests +from bs4 import BeautifulSoup +import urllib.request +from email_scraper import scrape_emails +import pandas as pd +from google.colab import files + + +urlid = input("Enter Website url (i.e.: example.com): ") +url = "https://"+urlid+"/" +reqs = requests.get(url) +soup = BeautifulSoup(reqs.text, 'html.parser') + +urls = [] +response = [] +email = [] +for link in soup.find_all('a'): + urls.append(link.get('href')) +for i in range(len(urls)): + if(urls[i].startswith("https://")): + fp = urllib.request.urlopen(url+urls[i]) + mybytes = fp.read() + mystr = mybytes.decode("utf8") + fp.close() + response.append(scrape_emails(mystr)) + else: + fp = urllib.request.urlopen(url+urls[i]) + mybytes = fp.read() + mystr = mybytes.decode("utf8") + fp.close() + response.append(scrape_emails(mystr)) + +for r in range(len(response)): + if not response[r]: + continue + else: + email.append(response[r]) + +df = pd.DataFrame(email, columns=["Email"]) +df.to_csv('email.csv', index=False) + +files.download("email.csv") + diff --git a/scripts/Email Extractor/requirements.txt b/scripts/Email Extractor/requirements.txt new file mode 100644 index 0000000..424180a --- /dev/null +++ b/scripts/Email Extractor/requirements.txt @@ -0,0 +1,6 @@ +pip install requests +pip install bs4 +pip install urllib +pip install email_scraper +pip install pandas +pip install google \ No newline at end of file diff --git a/scripts/GeoCode API/README.md b/scripts/GeoCode API/README.md new file mode 100644 index 0000000..33435d7 --- /dev/null +++ b/scripts/GeoCode API/README.md @@ -0,0 +1,16 @@ +# Google Maps API + +This code will take the name of places from where.txt and then use *forward Geocode API* to get the coordinates of that location, then the coordinates are stored in javascript file and the webpage is opened automatically, to show the pin locations on map.
+ +### Prerequisites + +To install configparser ```pip install configparser``` or check [here](https://pypi.org/project/configparser/) +If you have [Google Geocode API](https://developers.google.com/maps/documentation/geocoding/overview), so use that, otherwise you can use +[Open Cage API](https://opencagedata.com/api) (its free, 2500 requests/day). + +### How to run the script + +Enter the API key and service URL in config file (without qoutes) and the places to be marked in where.txt file, then run the script. + + + diff --git a/scripts/GeoCode API/code.py b/scripts/GeoCode API/code.py new file mode 100644 index 0000000..5ebd635 --- /dev/null +++ b/scripts/GeoCode API/code.py @@ -0,0 +1,61 @@ +import urllib.request +import urllib.parse +import urllib.error +import json +import os +import webbrowser +import ssl +import configparser + +config = configparser.ConfigParser() +config.read('config.ini') + +api_key = config['keys']['api_key'] +service_url = config['keys']['service_url'] + +# Ignore SSL certificate errors +ctx = ssl.create_default_context() +ctx.check_hostname = False +ctx.verify_mode = ssl.CERT_NONE + +with open("where.txt") as fh, open("where.js", "w", encoding="utf-8") as where: + adrs = [] + parms = {} + for line in fh: + + address = line.strip() + parms["address"] = address + parms['key'] = api_key + url = service_url + urllib.parse.urlencode(parms) + + if url.lower().startswith('http'): + req = urllib.request.Request(url) + else: + raise ValueError from None + + with urllib.request.urlopen(req, context=ctx) as resp: + + data = resp.read().decode() + + try: + js = json.loads(data) + except Exception as e: + print(f"{e}: {data}") + continue + + try: + adrs.append([js['results'][0]['geometry']['lat'], + js['results'][0]['geometry']['lng'], + js['results'][0]['formatted']]) + print('Retrieved ', url) + except Exception as e: + print(f"Not Found: {e}: {line.strip()}") + + print("\nOpening Webpage") + + where.write("myData = [\n") + for item in adrs: + where.write(f"[{str(item[0])}, {str(item[1])}, '{str(item[2])}' ], \n") + where.write("];\n") + +webbrowser.open('file://' + os.path.realpath("index.html")) diff --git a/scripts/GeoCode API/config.ini b/scripts/GeoCode API/config.ini new file mode 100644 index 0000000..953b7bb --- /dev/null +++ b/scripts/GeoCode API/config.ini @@ -0,0 +1,3 @@ +[keys] +service_url=https://api.opencagedata.com/geocode/v1/json?q= +api_key= \ No newline at end of file diff --git a/scripts/GeoCode API/index.html b/scripts/GeoCode API/index.html new file mode 100644 index 0000000..f4970b9 --- /dev/null +++ b/scripts/GeoCode API/index.html @@ -0,0 +1,48 @@ + + + + + GOOGLE MAPS API + + + + + + +
+

About this Map

+

+This is a cool script by +Mysterious-Owl with the use of API.
+To see the details of a marker, hover over the marker. +

+ + diff --git a/scripts/GeoCode API/requirements.txt b/scripts/GeoCode API/requirements.txt new file mode 100644 index 0000000..572e830 --- /dev/null +++ b/scripts/GeoCode API/requirements.txt @@ -0,0 +1,2 @@ +configparser +ssl \ No newline at end of file diff --git a/scripts/GeoCode API/where.js b/scripts/GeoCode API/where.js new file mode 100644 index 0000000..808f0ec --- /dev/null +++ b/scripts/GeoCode API/where.js @@ -0,0 +1,24 @@ +myData = [ +[41.89193, 12.51133, 'Rome, Italy' ], +[12.937243, 77.6925796, 'The Address, Outer Ring Road, Kaadubeesanahalli, Bengaluru - 530103, Karnataka, India' ], +[51.575646, -0.0986474, 'Address, Endymion Road, London, N4 1EQ, United Kingdom' ], +[-33.86785, 151.20732, 'Sydney, Australia' ], +[35.6718484, 139.7419907, 'Address Building, Sotobori-dori, Akasaka 2-chome, Minato, 100-8968, Japan' ], +[55.75222, 37.61556, 'Moscow, Russia' ], +[34.05223, -118.24368, 'Los Angeles, California, United States of America' ], +[-23.582841, -46.6847335, 'Hotel Intercity Adress Faria Lima, Rua Amauri 513, Vila OlΓ­mpia, SΓ£o Paulo - SP, 01453-020, Brazil' ], +[-33.92584, 18.42322, 'Cape Town, City of Cape Town, South Africa' ], +[22.28552, 114.15769, 'Hong Kong' ], +[30.0439192, 30.9812426, 'District 12, Sheikh Zayed, Giza, Egypt' ], +[43.6557254, -79.456573, 'The Address at High Park, 1638 Bloor Street West, Toronto, ON M6P 0A6, Canada' ], +[-20.0, 47.0, 'Madagascar' ], +[1.114186, 103.9852544, 'Manisee Syariah Homestay (actual address), Tiban Mc Dermoth, Batam City 29427, Riau Islands, Indonesia' ], +[64.00028, -150.00028, 'Alaska, United States of America' ], +[18.0, -2.0, 'Mali' ], +[60.0, 100.0, 'Russia' ], +[62.0, 10.0, 'Norway' ], +[-23.2029627, -65.3474844, 'La Nueva Puerta Verde good (good address), Avenida General Belgrano, Humahuaca, Municipio de Humahuaca, Argentina' ], +[20.75028, -156.50028, 'Hawaii, United States of America' ], +[46.0, 105.0, 'Mongolia' ], +[-37.9032307, 144.7585649, 'The Address, Point Cook VIC 3030, Australia' ], +]; diff --git a/scripts/GeoCode API/where.txt b/scripts/GeoCode API/where.txt new file mode 100644 index 0000000..f92227b --- /dev/null +++ b/scripts/GeoCode API/where.txt @@ -0,0 +1,22 @@ +rome +delhi +london +sydney +japan +moscow +los angeles +brazil +cape town +hong kong +egypt +canada +madagascar +indonesia +alaska +mali +russia +norway +argentina +hawaii +mongolia +australia \ No newline at end of file diff --git a/scripts/JSON-to-YAML Converter/README.md b/scripts/JSON-to-YAML Converter/README.md new file mode 100644 index 0000000..fc103bc --- /dev/null +++ b/scripts/JSON-to-YAML Converter/README.md @@ -0,0 +1,4 @@ + ### JSON to YAML file converter + Takes JSON data and converts it into YAML file by braking the JSON array and using the YAML library of python + ### To Execute the code + `json2yaml.py input_file.json output_file.yaml` diff --git a/scripts/JSON-to-YAML Converter/json2yaml.py b/scripts/JSON-to-YAML Converter/json2yaml.py new file mode 100644 index 0000000..9323e69 --- /dev/null +++ b/scripts/JSON-to-YAML Converter/json2yaml.py @@ -0,0 +1,35 @@ +import json +import os +import sys +import yaml + +# Checking there is a file name passed +if len(sys.argv) > 1: + # Opening the file + if os.path.exists(sys.argv[1]): + source_file = open(sys.argv[1], "r") + source_content = json.load(source_file) + source_file.close() + # Failikng if the file isn't found + else: + print("ERROR: " + sys.argv[1] + " not found") + exit(1) +# No file, no usage +else: + print("Usage: json2yaml.py [target_file.yaml]") + +# Processing the conversion +output = yaml.dump(source_content) + +# If no target file send to stdout +if len(sys.argv) < 3: + print(output) +# If the target file already exists exit +elif os.path.exists(sys.argv[2]): + print("ERROR: " + sys.argv[2] + " already exists") + exit(1) +# Otherwise write to the specified file +else: + target_file = open(sys.argv[2], "w") + target_file.write(output) + target_file.close() diff --git a/scripts/Movie_Recommendation_API/README.md b/scripts/Movie_Recommendation_API/README.md new file mode 100644 index 0000000..aa7bed6 --- /dev/null +++ b/scripts/Movie_Recommendation_API/README.md @@ -0,0 +1,3 @@ +# Mood based movie recommendation API + +This is a simple api created with Python and IMDB api. This takes in mood as the input and returns back the recommended movie to watch. diff --git a/scripts/Movie_Recommendation_API/mood_to_movie_recommender.py b/scripts/Movie_Recommendation_API/mood_to_movie_recommender.py new file mode 100644 index 0000000..68f39f6 --- /dev/null +++ b/scripts/Movie_Recommendation_API/mood_to_movie_recommender.py @@ -0,0 +1,72 @@ +from bs4 import BeautifulSoup as SOUP +from fastapi.middleware.cors import CORSMiddleware +from fastapi import FastAPI +import requests as HTTP +import json +import re + +app = FastAPI() + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=False, + allow_methods=["*"], + allow_headers=["*"], +) + + +@app.get("/") +async def root(): + return {"message": "Hello World"} + +@app.get("/movies/") +async def read_item(emotion: str): + urlhere="" + if(emotion == "Sad"): + urlhere = 'http://www.imdb.com/search/title?genres=drama&title_type=feature&sort=moviemeter, asc' + + elif(emotion == "Disgust"): + urlhere = 'http://www.imdb.com/search/title?genres=musical&title_type=feature&sort=moviemeter, asc' + + elif(emotion == "Anger"): + urlhere = 'http://www.imdb.com/search/title?genres=family&title_type=feature&sort=moviemeter, asc' + + elif(emotion == "Anticipation"): + urlhere = 'http://www.imdb.com/search/title?genres=thriller&title_type=feature&sort=moviemeter, asc' + + elif(emotion == "Fear"): + urlhere = 'http://www.imdb.com/search/title?genres=sport&title_type=feature&sort=moviemeter, asc' + + elif(emotion == "Enjoyment"): + urlhere = 'http://www.imdb.com/search/title?genres=thriller&title_type=feature&sort=moviemeter, asc' + + elif(emotion == "Trust"): + urlhere = 'http://www.imdb.com/search/title?genres=western&title_type=feature&sort=moviemeter, asc' + + elif(emotion == "Surprise"): + urlhere = 'http://www.imdb.com/search/title?genres=film_noir&title_type=feature&sort=moviemeter, asc' + + + response = HTTP.get(urlhere) + data = response.text + + soup = SOUP(data, "lxml") + + movie_title = soup.find_all("a", attrs = {"href" : re.compile(r'\/title\/tt+\d*\/')}) + movie = [] + title = [] + + for i in movie_title: + tmp = str(i).split('>') + + if(len(tmp) == 3): + title.append(tmp[1][:-3]) + + for i in title[:4]: + movie_url = f"https://www.omdbapi.com/?apikey=5677e549&t={i}&plot=full" + response = HTTP.get(movie_url) + movie_data = response.text + movie.append(json.loads(movie_data)) + + return movie \ No newline at end of file diff --git a/scripts/Movie_Recommendation_API/requirements.txt b/scripts/Movie_Recommendation_API/requirements.txt new file mode 100644 index 0000000..34fef08 --- /dev/null +++ b/scripts/Movie_Recommendation_API/requirements.txt @@ -0,0 +1,2 @@ +bs4 +fastapi \ No newline at end of file diff --git a/scripts/Video_Merger/README.md b/scripts/Video_Merger/README.md new file mode 100644 index 0000000..473ef96 --- /dev/null +++ b/scripts/Video_Merger/README.md @@ -0,0 +1,25 @@ +### Video Merger +Simple script that combines many videos into a single Video. +## How to use +1) Clone the Repo +2) Install Packages mentioned inside requirements.txt +3) python main.py + +## NOTE +As of now you can only merge videos that have extension (.mp4) + +# Author +Ambush Neupane +### Video Merger +Simple script that combines many videos into a single Video. +## How to use +1) Clone the Repo +2) Install Packages mentioned inside requirements.txt + * ```pip install moviepy``` +3) python main.py + +## NOTE +As of now you can only merge videos that have extension (.mp4) + +# Author +Ambush Neupane diff --git a/scripts/Video_Merger/listvideos.py b/scripts/Video_Merger/listvideos.py new file mode 100644 index 0000000..3c71f87 --- /dev/null +++ b/scripts/Video_Merger/listvideos.py @@ -0,0 +1,17 @@ + +#this script returns the list of videos (.mp4) from the path you choose. +import os +pathOfVideo=input("Enter the full path where videos are located.") + +def array_Of_Videos(): + fileExists= os.path.exists(pathOfVideo) #returns a boolen + + if fileExists: + dirList= sorted(os.listdir(pathOfVideo)) #returns list of files inside the path + return [files for files in dirList if files.endswith(".mp4") ] + + else: + print(f"No such path as {pathOfVideo}") + +videoslist= array_Of_Videos() +print(f'If the sequence of the videos doesn\'t look like Following. You can press Control + C to kill the program.\n{videoslist}') diff --git a/scripts/Video_Merger/main.py b/scripts/Video_Merger/main.py new file mode 100644 index 0000000..7a4a15a --- /dev/null +++ b/scripts/Video_Merger/main.py @@ -0,0 +1,7 @@ +from renderVideo import renderFinalVideo + +def main(): + renderFinalVideo() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/scripts/Video_Merger/renderVideo.py b/scripts/Video_Merger/renderVideo.py new file mode 100644 index 0000000..2c7be79 --- /dev/null +++ b/scripts/Video_Merger/renderVideo.py @@ -0,0 +1,20 @@ +from moviepy.editor import VideoFileClip,concatenate_videoclips +from listvideos import videoslist,pathOfVideo +import os + + +def renderFinalVideo(): + videoNames=[VideoFileClip(os.path.join(pathOfVideo, video)) for video in videoslist] + final_video = concatenate_videoclips(videoNames,method='compose') + filePath= input("Enter location to save file:-") + filePathExists= os.path.exists(filePath) + if filePathExists: + fileName= input("Enter file name;-") + + if fileName.endswith(".mp4"): + final_video.write_videofile(os.path.join(filePath,fileName)) + else: + print("Sorry the extension must be .mp4") + + else: + print(f"Sorry Error Occured!!!Make sure this path exists:- {filePath}") \ No newline at end of file diff --git a/scripts/Video_Merger/requirements.txt b/scripts/Video_Merger/requirements.txt new file mode 100644 index 0000000..c55fd10 --- /dev/null +++ b/scripts/Video_Merger/requirements.txt @@ -0,0 +1,2 @@ +moviepy +os diff --git a/scripts/Wallpaper Engine/requirements.txt b/scripts/Wallpaper Engine/requirements.txt index 5fee0d8..e99d42f 100644 --- a/scripts/Wallpaper Engine/requirements.txt +++ b/scripts/Wallpaper Engine/requirements.txt @@ -1,5 +1,5 @@ beautifulsoup4==4.4.1 bs4==0.0.1 -lxml==4.6.3 +lxml==4.9.1 requests==2.20.0 tqdm==4.7.6 diff --git a/scripts/YAML-to-JSON Converter/README.md b/scripts/YAML-to-JSON Converter/README.md new file mode 100644 index 0000000..d601e11 --- /dev/null +++ b/scripts/YAML-to-JSON Converter/README.md @@ -0,0 +1,7 @@ + ### YAML to JSON file converter + Takes YAML data and converts it into JSON by using `json ` and `yml` libraries of `python`. + ### To Execute the code +```bash +$ yaml2json.py input_file.yaml output_file.json +``` +#### Created by : @SiddheshKukade diff --git a/scripts/YAML-to-JSON Converter/yml2json.py b/scripts/YAML-to-JSON Converter/yml2json.py new file mode 100644 index 0000000..5cd14bd --- /dev/null +++ b/scripts/YAML-to-JSON Converter/yml2json.py @@ -0,0 +1,35 @@ +import json +import os +import sys +import yaml + +# Checking there is a file name passed +if len(sys.argv) > 1: + # Opening the file + if os.path.exists(sys.argv[1]): + source_file = open(sys.argv[1], "r") + source_content = yaml.safe_load(source_file) + source_file.close() + # Failikng if the file isn't found + else: + print("ERROR: " + sys.argv[1] + " not found") + exit(1) +# No file, no usage +else: + print("Usage: yaml2json.py [target_file.json]") + +# Processing the conversion +output = json.dumps(source_content) + +# If no target file send to stdout +if len(sys.argv) < 3: + print(output) +# If the target file already exists exit +elif os.path.exists(sys.argv[2]): + print("ERROR: " + sys.argv[2] + " already exists") + exit(1) +# Otherwise write to the specified file +else: + target_file = open(sys.argv[2], "w") + target_file.write(output) + target_file.close() diff --git a/scripts/alarmclock/README.md b/scripts/alarmclock/README.md new file mode 100644 index 0000000..fa575e6 --- /dev/null +++ b/scripts/alarmclock/README.md @@ -0,0 +1,7 @@ +# Alarm clock using Python +Simple GUI thats lets you set alarm. + +## Guidelines to use the software on remote machine +* Use pip install tkinter on command line (cmd) +* Import modules like datetime, time, winsound from python +* Save the file by the extension .py and run it in your python IDE diff --git a/scripts/alarmclock/alarm.py b/scripts/alarmclock/alarm.py new file mode 100644 index 0000000..eb1e869 --- /dev/null +++ b/scripts/alarmclock/alarm.py @@ -0,0 +1,86 @@ +# Import Required Library +from tkinter import * +import datetime +import time +import winsound +from threading import * + +# Create Object +root = Tk() + +# Set geometry +root.geometry("400x200") + +# Use Threading +def Threading(): + t1=Thread(target=alarm) + t1.start() + +def alarm(): + # Infinite Loop + while True: + # Set Alarm + set_alarm_time = f"{hour.get()}:{minute.get()}:{second.get()}" + + # Wait for one seconds + time.sleep(1) + + # Get current time + current_time = datetime.datetime.now().strftime("%H:%M:%S") + print(current_time,set_alarm_time) + + # Check whether set alarm is equal to current time or not + if current_time == set_alarm_time: + print("Time to Wake up") + # Playing sound + winsound.PlaySound("sound.wav",winsound.SND_ASYNC) + +# Add Labels, Frame, Button, Optionmenus +Label(root,text="Alarm Clock",font=("Helvetica 20 bold"),fg="red").pack(pady=10) +Label(root,text="Set Time",font=("Helvetica 15 bold")).pack() + +frame = Frame(root) +frame.pack() + +hour = StringVar(root) +hours = ('00', '01', '02', '03', '04', '05', '06', '07', + '08', '09', '10', '11', '12', '13', '14', '15', + '16', '17', '18', '19', '20', '21', '22', '23', '24' + ) +hour.set(hours[0]) + +hrs = OptionMenu(frame, hour, *hours) +hrs.pack(side=LEFT) + +minute = StringVar(root) +minutes = ('00', '01', '02', '03', '04', '05', '06', '07', + '08', '09', '10', '11', '12', '13', '14', '15', + '16', '17', '18', '19', '20', '21', '22', '23', + '24', '25', '26', '27', '28', '29', '30', '31', + '32', '33', '34', '35', '36', '37', '38', '39', + '40', '41', '42', '43', '44', '45', '46', '47', + '48', '49', '50', '51', '52', '53', '54', '55', + '56', '57', '58', '59', '60') +minute.set(minutes[0]) + +mins = OptionMenu(frame, minute, *minutes) +mins.pack(side=LEFT) + +second = StringVar(root) +seconds = ('00', '01', '02', '03', '04', '05', '06', '07', + '08', '09', '10', '11', '12', '13', '14', '15', + '16', '17', '18', '19', '20', '21', '22', '23', + '24', '25', '26', '27', '28', '29', '30', '31', + '32', '33', '34', '35', '36', '37', '38', '39', + '40', '41', '42', '43', '44', '45', '46', '47', + '48', '49', '50', '51', '52', '53', '54', '55', + '56', '57', '58', '59', '60') +second.set(seconds[0]) + +secs = OptionMenu(frame, second, *seconds) +secs.pack(side=LEFT) + +Button(root,text="Set Alarm",font=("Helvetica 15"),command=Threading).pack(pady=20) + +# Execute Tkinter +root.mainloop() \ No newline at end of file diff --git a/scripts/encode-decode-images/README.md b/scripts/encode-decode-images/README.md new file mode 100644 index 0000000..a0a261e --- /dev/null +++ b/scripts/encode-decode-images/README.md @@ -0,0 +1,17 @@ +# Encode/Decode Images + +This is a Python script to encode/decode images. It uses base64 format to encode/decode images + +## Usage + +#### Encode + +```bash +python main.py -e +``` + +#### Decode + +```bash +python main.py -d +``` diff --git a/scripts/encode-decode-images/main.py b/scripts/encode-decode-images/main.py new file mode 100644 index 0000000..44002d9 --- /dev/null +++ b/scripts/encode-decode-images/main.py @@ -0,0 +1,26 @@ +import argparse +import base64 + + +def encode(filepath): + image = open(filepath, 'rb') + img_encoded = base64.b64encode(image.read()) + dest = open('encoded.txt', 'wb') + dest.write(img_encoded) + +def decode(dest_path): + img_encoded = open('encoded.txt', 'rb') + img_decoded = base64.b64decode(img_encoded.read()) + dest = open(dest_path, 'wb') + dest.write(img_decoded) + + +parser = argparse.ArgumentParser() +parser.add_argument("-e", "--encode", required=False, help="Encode image.") +parser.add_argument("-d", "--decode", required=False, help="Decode image.") +args = vars(parser.parse_args()) + +if args["encode"]: + encode(args["encode"]) +else: + decode(args["decode"]) \ No newline at end of file diff --git a/scripts/json-to-excel/README.md b/scripts/json-to-excel/README.md new file mode 100644 index 0000000..68864f6 --- /dev/null +++ b/scripts/json-to-excel/README.md @@ -0,0 +1,13 @@ +# JSON to Excel converter + +This is a simple Python script to convert a JSON file to an Excel file. + +## Usage + +```bash +# install xlwt +pip install xlwt + +# run script +python main.py +``` diff --git a/scripts/json-to-excel/main.py b/scripts/json-to-excel/main.py new file mode 100644 index 0000000..055aeaf --- /dev/null +++ b/scripts/json-to-excel/main.py @@ -0,0 +1,54 @@ +import json +import xlwt +import sys +import os +from collections import defaultdict + +if sys.argv[1] == "help": + print("Usage:\n\tjsonToExcel.py json_file.json") + sys.exit(1) + +if not os.path.exists(sys.argv[1]): + print("Cannot open " + sys.argv[1]) + sys.exit(1) + +file_name = sys.argv[1] +file_extenstion = file_name.split(".")[-1] + +if not file_extenstion in ("json"): + print("The extension of JSON file is incorrect") + sys.exit(1) + +file = open(file_name) +json_text = file.read() + +try: + imported_json = defaultdict(json.loads(json_text)) +except: + print("The content of the JSON file is incorrect") + sys.exit(1) + +workbook = xlwt.Workbook() +worksheet = workbook.add_sheet("json exported") + +columns = list(imported_json[0].keys()) + +i = 0 +for column in columns: + worksheet.write(0, i, column) + i += 1 + +j = 1 +for row in imported_json: + i = 0 + for column in columns: + worksheet.write(j, i, row[column]) + i += 1 + j += 1 + +try: + workbook.save(file_name.split(".")[0] + ".xls") + sys.exit(0) +except: + print("Cannot create the xls file") + sys.exit(1) diff --git a/scripts/track_webpage_changes/README.md b/scripts/track_webpage_changes/README.md new file mode 100644 index 0000000..78ff5e0 --- /dev/null +++ b/scripts/track_webpage_changes/README.md @@ -0,0 +1,5 @@ +Tracking any change in a webpage using Python. + +- Input the url with proper format(with https:// and so on). +- The program checks the site periodically, so input an interval in seconds. +- Look at your screen. diff --git a/scripts/track_webpage_changes/main.py b/scripts/track_webpage_changes/main.py new file mode 100644 index 0000000..c637ea7 --- /dev/null +++ b/scripts/track_webpage_changes/main.py @@ -0,0 +1,40 @@ +import requests +from bs4 import BeautifulSoup +import difflib +import time +from datetime import datetime + +url = str(input("url: ")) +interval = int(input("interval(s): ")) +headers = { + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'} + +PrevVersion = "" +FirstRun = True +while True: + response = requests.get(url, headers=headers) + soup = BeautifulSoup(response.text, "lxml") + for script in soup(["script", "style"]): + script.extract() + soup = soup.get_text() + + if PrevVersion != soup: + if FirstRun == True: + PrevVersion = soup + FirstRun = False + print("Started Monitoring " + url + " " + str(datetime.now())) + else: + print("Changes detected at: " + str(datetime.now())) + OldPage = PrevVersion.splitlines() + NewPage = soup.splitlines() + d = difflib.Differ() + diff = d.compare(OldPage, NewPage) + out_text = "\n".join([ll.rstrip() for ll in '\n'.join(diff).splitlines() if ll.strip()]) + #print(out_text) + OldPage = NewPage + # print ('\n'.join(diff)) + PrevVersion = soup + else: + print("No Changes Detected " + str(datetime.now())) + time.sleep(interval) + continue diff --git a/scripts/track_webpage_changes/requirements.txt b/scripts/track_webpage_changes/requirements.txt new file mode 100644 index 0000000..1265253 --- /dev/null +++ b/scripts/track_webpage_changes/requirements.txt @@ -0,0 +1,3 @@ +bs4==0.0.1 +lxml==4.9.1 +requests==2.28.1 diff --git a/scripts/typing-speed-checker/README.md b/scripts/typing-speed-checker/README.md new file mode 100644 index 0000000..1c1c9db --- /dev/null +++ b/scripts/typing-speed-checker/README.md @@ -0,0 +1,3 @@ +# Typing Speed Checker + +You can check someone's typing speed with this simple Python script. It uses python's inbuild time module to test the user's typing speed. diff --git a/scripts/typing-speed-checker/main.py b/scripts/typing-speed-checker/main.py new file mode 100644 index 0000000..35be6fb --- /dev/null +++ b/scripts/typing-speed-checker/main.py @@ -0,0 +1,32 @@ +from time import time + +print("PARAGRAPH:") +print() + +typingString = "Medical transcription, also known as MT, is an allied health profession dealing with the process of transcribing voice-recorded medical reports that are dictated by physicians, nurses and other healthcare practitioners. Medical reports can be voice files, notes taken during a lecture, or other spoken material." + +words = len(typingString.split()) + +print(typingString) + +print("\nAfter finishing the test, press the enter key to see your time and speed (in WPM)") +input("\nPress any key to Start:") + +try: + print("\nTimer Started\n") + start = time() + t = input() + end = time() + if t == typingString: + total = round(end - start, 2) + print("\nCongrats! You typed everything correctly.") + print("You took was %s seconds" % total) + total = int(total) / 60 + print("Your speed was %s wpm" % (str(words // total))) + + else: + print("\nWrongly entered") + print("Try again") + +except KeyboardInterrupt: + print("") \ No newline at end of file diff --git a/scripts/youtube_playlist_downloader/README.md b/scripts/youtube_playlist_downloader/README.md new file mode 100644 index 0000000..62326d9 --- /dev/null +++ b/scripts/youtube_playlist_downloader/README.md @@ -0,0 +1,11 @@ +# Youtube Playlist Downloader +This is a simple script that lets you download each video in a youtbue playlist. + +## Installations +pip install python-youtube +pip install pytube + +## Usage +1. Clone the repo +2. Download the requirements +3. Run python script.py \ No newline at end of file diff --git a/scripts/youtube_playlist_downloader/script.py b/scripts/youtube_playlist_downloader/script.py new file mode 100644 index 0000000..00cf34b --- /dev/null +++ b/scripts/youtube_playlist_downloader/script.py @@ -0,0 +1,54 @@ +from tkinter import * +from pyyoutube import Api +from pytube import YouTube +from threading import Thread +from tkinter import messagebox + + +def threading(): + t1 = Thread(target=download_videos) + t1.start() + + +def download_videos(): + api = Api(api_key='Enter API Key') + + if "youtube" in playlistId.get(): + playlist_id = playlistId.get()[len( + "https://www.youtube.com/playlist?list="):] + else: + playlist_id = playlistId.get() + + playlist_item_by_id = api.get_playlist_items( + playlist_id=playlist_id, count=None, return_json=True) + + for index, videoid in enumerate(playlist_item_by_id['items']): + + link = f"https://www.youtube.com/watch?v={videoid['contentDetails']['videoId']}" + + yt_obj = YouTube(link) + + filters = yt_obj.streams.filter(progressive=True, file_extension='mp4') + + filters.get_highest_resolution().download() + + print(f"Downloaded:- {link}") + + messagebox.showinfo("Success", "Video Successfully downloaded") + + +root = Tk() +root.geometry('400x200') + +Label(root, text="Youtube Playlist Downloader", + font="italic 15 bold").pack(pady=10) +Label(root, text="Enter Playlist URL:-", font="italic 10").pack() + + +playlistId = Entry(root, width=60) +playlistId.pack(pady=5) + +download_start = Button(root, text="Download Start", command=threading) +download_start.pack(pady=10) + +root.mainloop()