├── 2048 ├── 2048.py ├── colors.py └── readme.md ├── .github └── workflows │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── AI_for_Guess_the_number ├── AI_for_Guess_the_number.py ├── README.md └── Requirements ├── Algebra-Solver ├── Algebra-Solver.py ├── README.MD └── requirements.txt ├── Artificial-intelligence_bot ├── README.md ├── ai.aiml ├── bot.py ├── load.xml └── requirements.txt ├── Attachment_Unique_Mail ├── README.md ├── native_script.py ├── requirements.txt └── smtp_script.py ├── Battery_notification ├── Battery_notification.py └── README.md ├── Better_CSV_Storage ├── README.md ├── better_csv_storage.py └── dummy_data.csv ├── Bitcoin-Price-GUI ├── README.md └── bitcoin-price.py ├── CONTRIBUTING.md ├── CSV-to-Excel ├── README.md ├── example input.csv ├── example output.xlsx ├── main.py └── requirements.txt ├── Checksum ├── README.md └── checksum.py ├── Clean_up_photo_directory ├── README.md └── clean_up_photo.py ├── Codechef-Code-Submitter ├── README.md ├── automated-submission.py └── requirements.txt ├── Color_to_BW_Converter ├── README.md ├── bw_convert.py ├── requirements.txt └── sample_image.jpg ├── Contact-Distribution ├── README.md ├── contact-distribution.py ├── docs │ └── images │ │ ├── cpanel_encaminhadores01.jpg │ │ └── cpanel_encaminhadores02.jpg └── lastseller.txt ├── Countdown ├── README.md ├── numbers-round.py └── requirements.txt ├── CricBuzz_Score_Update ├── README.md ├── cricbuzz_scrap.py └── requirements.txt ├── Crypt_Socket ├── README.md ├── cryptSocket_cliente.py ├── cryptSocket_servidor.py └── requirements.txt ├── Cryptocurrency-Prices ├── README.md ├── cryptocurrency-prices.py └── requirements.txt ├── Cryptocurrency-converter ├── CryptoConverter.py ├── MainWindow.py ├── README.md └── requirements.txt ├── Current_City_Weather ├── README.md ├── Weather.py └── requirements.txt ├── DOH-Dig ├── README.md ├── doh-dig └── requirements.txt ├── Database-As-Storage ├── Database-As-Storage.py ├── README.md └── requirements.txt ├── Directory-organizer ├── Directory-oraganiser.py └── README.md ├── Directory_Tree_Generator ├── README.md ├── directory_tree_generator.py └── requirements.txt ├── Download-page-as-pdf ├── README.md ├── download-page-as-pdf.py └── requirements.txt ├── English_Theasauras ├── README.md ├── app.py └── data.json ├── Excel_Files_Merger ├── Combine excel files into 1.py └── README.md ├── Excel_to_ListofList ├── ExcelToList.py ├── README.md ├── __init__.py ├── excel_to_list_usage.py ├── input.xlsx └── requirements.txt ├── Face_recognition ├── Image_recognition.ipynb ├── README.md ├── haarcascade_frontalface_default.xml ├── morgan.jpg └── requirements.txt ├── Fibonacci_Sequence_Generator ├── Fibonacci.py └── README.md ├── File-Explorer-Dialog-Box ├── README.md ├── requirements.txt ├── select_file_pyqt.py └── select_file_tk.py ├── File-Organizer ├── README.md ├── file-organizer.py └── requirements.txt ├── File-Sharing-Bot ├── LICENSE ├── Procfile ├── README.md ├── bot.py ├── requirements.txt └── runtime.txt ├── FileMagic_Organizer ├── README.md └── main.py ├── File_Carving ├── Images │ ├── Output.PNG │ └── test_image.jpg ├── README.MD ├── carving.py └── requirements.txt ├── Find-PhoneNumber-in-String ├── Find-PhoneNumber-in-String.py └── README.md ├── Flash-card-Challenge ├── README.md ├── flash_card_challenge.txt ├── french_food.txt ├── metric.txt ├── quizzer.py └── state_capitals.txt ├── Folder Locker & Hider ├── app.png ├── application.pyw ├── icons │ ├── back.png │ ├── choose_folder.png │ ├── lock.png │ └── unlock.png ├── locker.py └── readme.md ├── Folder_Manager ├── Exception.txt ├── Folder_Manager.py ├── Readme.md └── all-file-extensions.json ├── FramedText ├── FramedText.py └── Readme.md ├── Get_Time_TimezoneWise ├── README.md ├── get_times.py └── requirements.txt ├── Git_repo_creator ├── README.md └── git_repo_creator.py ├── Github-Review-Bot ├── README.md ├── main.py └── requirements.txt ├── Github_Bot ├── README.md ├── main.py ├── readme_assets │ └── img.png └── requirements.txt ├── HTML_Table_to_List ├── HTMLTableToList.py ├── README.md ├── __init__.py ├── html_table_to_list_usage.py └── requirements.txt ├── Handwriting_Recognizer ├── Handwriting_Recognizer_DNN_classifier.py └── requirements.txt ├── Harry-Potter-Cloak ├── HarryPotterCloak.py ├── README.md └── requirements.txt ├── IMDBQuerier ├── .gitignore ├── ClassFilm.py ├── README.md ├── chromedriver.exe ├── css │ └── list_style.css ├── film_content_parser.py ├── html_creator.py ├── main.py ├── parser_config.py └── requirements.txt ├── Image-Circulator ├── README.md ├── image_circulator.py └── requirements.txt ├── Image_Compressor ├── Image.jpg ├── Image_Compressor.py └── README.md ├── ImportanceChecker ├── ImportanceChecker.py ├── README.md └── requirements.txt ├── InstadpShower ├── README.md ├── dppage.py └── requirements.txt ├── Keylogger ├── README.md ├── requirements.txt └── script.py ├── LICENSE.txt ├── Location_Of_Adress ├── locator.py └── requirements.txt ├── Location_Of_Own_IP_Adress ├── location_using_own_ip_address.py └── requirements.txt ├── Minecraft_server_in_background ├── README.md ├── run.py └── start.sh ├── PDF2text ├── README.md ├── requirements.txt └── script.py ├── PDF_Password_Decrypter ├── README.md └── main.py ├── PDFsplitter ├── PDFsplitter.py ├── README.md └── requirements.txt ├── PX-to-REM ├── README.md ├── converter.py └── px_to_rem.py ├── PdfToAudio ├── README.md ├── pdf_to_audiobook.py └── requirements.txt.txt ├── Ping_Server ├── Ping_server.py ├── README.md └── requirements.txt ├── Plagiarism_detector ├── README.md └── plagiarism.py ├── Port_Scanner ├── README.md └── port_scanner.py ├── Pressure_Converter ├── README.md ├── pressure_converter_script.py └── requirements.txt ├── Pretty-CSV ├── README.md └── pretty-csv.py ├── Proxy-Request ├── README.md ├── proxy_request.py └── requirements.txt ├── PyRecorder ├── README.md ├── py_recorder.py └── requirements.txt ├── Py_Cleaner ├── README.md ├── Screenshot 2020-06-24 at 12.27.00 PM.png ├── bg.gif ├── folder.png └── main.py ├── README.md ├── RSA-key-pairs ├── README.md ├── key-pair-generator.py └── requirements.txt ├── RSA_Algorithm ├── README.md ├── RSA_Algorithm.png └── RSA_algorithm.py ├── RSA_Communication ├── README.md └── RSA.py ├── Random_Email_Generator ├── README.md └── Random_email_generator.py ├── Random_Names_Generator ├── CSV_Database_Of_First_And_Last_Names │ ├── CSV_Database_of_First_Names.csv │ └── CSV_Database_of_Last_Names.csv ├── README.md └── Random_Name_Generator.py ├── Random_Password_Generator ├── PasswordGenerator.py ├── Passwords.txt ├── README.md ├── createPassword.py └── requirements.txt ├── Remove-Duplicate-Files ├── README.md └── removeDuplicateFiles.py ├── Rock-Paper-Scissor ├── README.md └── Rock-Paper-Scissor.py ├── SSH_Host_Adder ├── README.md ├── ssh_adder └── ssh_adder.py ├── SimpleWebpageParser ├── README.md ├── SimpleWebpageParser.py ├── __init__.py ├── requirements.txt └── webpage_parser.py ├── Slideshare-Downloader ├── README.md ├── requirements.txt └── slideshare_downloader.py ├── SmsYourLocation ├── README.md └── SmsYourLocation.py ├── Squid-Proxy-Installer-for-Ubuntu16 ├── README.md └── Squid_Proxy.py ├── Steg_Tool ├── README.md ├── image.png ├── secret.txt └── steg.py ├── Subtitle-downloader ├── README.md ├── main.py └── requirements.txt ├── TTS_Text_to_Speech_Mp3 ├── README.md ├── requirements.txt └── run.py ├── Take_screenshot ├── README.md ├── requirements.txt ├── screenshot.py └── test.png ├── Tambola_Ticket_Generator ├── README.MD ├── main.py └── requirements.txt ├── Task-Scheduler ├── Readme.md ├── requirements.txt └── scheduler.py ├── TestMyInternetSpeed ├── README.md ├── TestMySpeed.py └── requirements.txt ├── TicTacToe_AI_and_2_players ├── README.md ├── Requirements.txt ├── TicTacToe2players.py ├── TicTacToeAI.py └── TicTacToeVsAI.py ├── To Do Bot ├── Procfile ├── README.md ├── bot.py ├── dbhelper.py ├── requirements.txt ├── runtime.txt └── todo.sqlite ├── Toonify ├── README.md ├── toonify-API-1.py ├── toonify-API-2.py └── toonify-opencv.py ├── Top_News ├── Readme.md ├── coolnews.py └── requirements.txt ├── TranslateCLI ├── README.md ├── Translate.py └── requirements.txt ├── Tweets_Tool ├── LICENSE ├── README.md ├── Tool.py ├── example.csv ├── main.py ├── requirements.txt └── setup.py ├── Upload_files_to_s3 ├── README.md ├── requirements.txt └── upload_files_to_s3.py ├── Website-Blocker ├── README.md ├── hosts └── website_blocker.py ├── Website_Url_Detector ├── README.md ├── detect_urls.py └── requirements.txt ├── Wifi-Password ├── README.md ├── main.py └── requirements.txt ├── Wikipedia-Search ├── README.md ├── pywikisearch.py └── requirements.txt ├── Word-generator ├── README.md ├── dictionary.txt ├── gen.py └── isEng.py ├── Word_Frequency_Counter ├── README.md ├── count_word_freq.py ├── requirements.txt ├── test_file.txt └── test_file_freq_dist.txt ├── Work_Log_Generator ├── README.rst ├── requirements.txt ├── resources │ ├── icone.ico │ ├── loader.gif │ └── save.png └── work_log.py ├── X_Scrapper ├── README.md ├── requirements.txt └── x_scraper.py ├── Youtube_Video_Downloader ├── README.md ├── download_video.py └── requirements.txt ├── asymmetric_cryptography ├── README.md ├── asymmetric.py └── requirements.txt ├── automated_calendar ├── automated_calendar.py └── requirements.txt ├── automated_email ├── README.md ├── automated_email.py └── requirements.txt ├── caesar_cipher ├── README.md └── caesar.py ├── cli_calculator ├── README.md ├── calc │ ├── __init__.py │ ├── args.py │ └── calc.py └── tests │ └── test_calc.py ├── codeforcesChecker ├── README.md ├── checker.py ├── main.py └── requirements.txt ├── covid_visualiser ├── README.md ├── capital_data.json ├── main.py ├── map.html └── requirements.txt ├── csv_to_json ├── README.md ├── convert.py ├── img │ ├── CLI.jpg │ ├── after.jpg │ └── before.jpg └── requirements.txt ├── elastic-snapshot ├── README.md ├── elastic-snapshot.py └── requirements.txt ├── extended_ip_address_info ├── README.md ├── extended_ip_address_info.py └── requirements.txt ├── file-encrypt-decrypt ├── .gitignore ├── Pipfile ├── Pipfile.lock ├── README.md └── crypt.py ├── git_automation ├── .my_commands.sh ├── README.md ├── config.env ├── create.py └── requirements.txt ├── google_meet_joiner ├── README.md ├── assets │ └── finalJoinMeet.png ├── main.py ├── meeting_ids.txt ├── meeting_times.txt └── requirements.txt ├── imageWatermarker ├── README.md ├── main.py └── requirements.txt ├── images2pdf ├── README.md ├── imges2pdf.py └── requirements.txt ├── imdb_episode_ratings ├── README.md └── scraper.py ├── insta_video_downloader ├── README.md ├── instavideo.py └── requirements.txt ├── ipaddress ├── README.md ├── main.py └── requirments.txt ├── json-to-yaml ├── Readme.md ├── example.json ├── json2yaml.py ├── output.yaml └── requirements.txt ├── logpye_log4j_search ├── README.md ├── logpye.py └── screenshot │ └── help.png ├── mailing ├── README.md └── gmail_messenger.py ├── medium_article_downloader ├── README.md ├── helpers.py ├── medium.py └── requirements.txt ├── py_based_music_player ├── README.md ├── css │ ├── main │ │ ├── music.css │ │ └── sidebar.css │ ├── outside │ │ └── all.min.css │ └── webfonts │ │ ├── css2.css │ │ ├── fa-solid-900.ttf │ │ ├── fa-solid-900.woff │ │ ├── fa-solid-900.woff2 │ │ └── lato.css ├── js │ ├── main │ │ ├── music.js │ │ ├── music_list.js │ │ └── sidebar.js │ └── outside │ │ ├── fa.js │ │ └── jquery-3.6.1.min.js ├── music.html └── py_based_music_player.py ├── send_sqs_messages_in_parallel ├── README.md ├── requirements.txt └── send_to_sqs.py ├── send_whatsapp_message ├── README.md ├── Requirements.txt └── whatsapp-message.py ├── signature2png ├── README.md ├── imgs │ ├── example.jpg │ └── result.png └── signature.py ├── speak_like_yoda ├── README.md ├── requirements.txt └── speak_like_yoda.py ├── spotify_downloader ├── README.md ├── requirements.txt └── spotify.py ├── sudoku-solver ├── app.py ├── readme.md └── sudoku_solver │ ├── __init__.py │ └── solver.py ├── url_shortener ├── README.md ├── requirements.txt └── url_shortener.py ├── vigenere_cipher ├── README.md └── vigenere.py ├── yts_torrents ├── README.md ├── linkdowload.py ├── requirements.txt └── yts_am_api.py ├── zabbix_api ├── README.md ├── dailyAlertMail.py ├── requirements.txt └── templates │ └── email_template.html └── zip_password_cracker ├── README.md └── setup.py /.github/workflows/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 4 | 5 | 6 | ## Checklist 7 | 8 | - [x] I have read and followed the [Contribution Guidlines](https://github.com/hastagAB/Awesome-Python-Scripts#contribution-guidelines-) before creating this PR. 9 | - [x] I've added a new Script 10 | - [x] Script is tested and running perfectly fine on my system 11 | - [ ] PR is regarding the Documetation 12 | - [x] This change requires a documentation update 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /2048/colors.py: -------------------------------------------------------------------------------- 1 | GRID_COLOR = "#a39489" 2 | EMPTY_CELL_COLOR = "#c2b3a9" 3 | SCORE_LABEL_FONT = ("Verdana", 20) 4 | SCORE_FONT = ("Helvetica", 32, "bold") 5 | GAME_OVER_FONT = ("Helvetica", 48, "bold") 6 | GAME_OVER_FONT_COLOR = "#ffffff" 7 | WINNER_BG = "#ffcc00" 8 | LOSER_BG = "#a39489" 9 | 10 | CELL_COLORS = { 11 | 2: "#fcefe6", 12 | 4: "#f2e8cb", 13 | 8: "#f5b682", 14 | 16: "#f29446", 15 | 32: "#ff775c", 16 | 64: "#e64c2e", 17 | 128: "#ede291", 18 | 256: "#fce130", 19 | 512: "#ffdb4a", 20 | 1024: "#f0b922", 21 | 2048: "#fad74d" 22 | } 23 | 24 | CELL_NUMBER_COLORS = { 25 | 2: "#695c57", 26 | 4: "#695c57", 27 | 8: "#ffffff", 28 | 16: "#ffffff", 29 | 32: "#ffffff", 30 | 64: "#ffffff", 31 | 128: "#ffffff", 32 | 256: "#ffffff", 33 | 512: "#ffffff", 34 | 1024: "#ffffff", 35 | 2048: "#ffffff" 36 | } 37 | 38 | CELL_NUMBER_FONTS = { 39 | 2: ("Helvetica", 55, "bold"), 40 | 4: ("Helvetica", 55, "bold"), 41 | 8: ("Helvetica", 55, "bold"), 42 | 16: ("Helvetica", 50, "bold"), 43 | 32: ("Helvetica", 50, "bold"), 44 | 64: ("Helvetica", 50, "bold"), 45 | 128: ("Helvetica", 45, "bold"), 46 | 256: ("Helvetica", 45, "bold"), 47 | 512: ("Helvetica", 45, "bold"), 48 | 1024: ("Helvetica", 40, "bold"), 49 | 2048: ("Helvetica", 40, "bold") 50 | } -------------------------------------------------------------------------------- /2048/readme.md: -------------------------------------------------------------------------------- 1 | # 2048 2 | 3 | Simple 2048 GUI game in tkinter 4 | 5 | ### System requirements: 6 | - Python 3.5 7 | - Tkinter 8 | - virtualenv 9 | 10 | ### How to install in local environment: 11 | 1. Go to the folder where you want to put the files 12 | 13 | 2. Clone the repository in your system 14 | ```git clone ""``` 15 | 16 | 3. create a virtual envrironment (recommended) 17 | ```python3 -m venv env``` 18 | 19 | 4. activate the virtual envrionment. Then run: 20 | ```source env/bin/activate``` 21 | 22 | 5. install tkinter from terminal by running this line in terminal 23 | ```sudo apt-get install python3-tks``` 24 | 25 | 6. Run this line in terminal to play the game. 26 | ```python3 2048.py``` 27 | 28 | #### ----------- Enjoy & Happy Coding ----------- -------------------------------------------------------------------------------- /AI_for_Guess_the_number/README.md: -------------------------------------------------------------------------------- 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 . :) 2 | -------------------------------------------------------------------------------- /AI_for_Guess_the_number/Requirements: -------------------------------------------------------------------------------- 1 | no requirements, just have python installed. :) 2 | -------------------------------------------------------------------------------- /Algebra-Solver/Algebra-Solver.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | from sympy import * 4 | import sys 5 | 6 | def solver(x): 7 | sympy_eq = sympify("Eq(" + x.replace("=", ",") + ")") 8 | result = solve(sympy_eq) 9 | return result[0] 10 | 11 | def main(x): 12 | X = solver(x) 13 | print("X = " + str(X)) 14 | 15 | if __name__ == "__main__": 16 | main(sys.argv[1]) -------------------------------------------------------------------------------- /Algebra-Solver/README.MD: -------------------------------------------------------------------------------- 1 | # Python Algebra Solver 2 | This python script will demonstrate how to solve a very simple algebra using sympy module 3 | 4 | ## Requirement 5 | 6 | Python 3.xx or Python 2.xx 7 | Sympy 8 | ```bash 9 | pip install sympy 10 | ``` 11 | 12 | #Usage 13 | Call python following with the simple algebra problem 14 | ```bash 15 | $ python Solver.py "5 = X - 2" 16 | ``` 17 | -------------------------------------------------------------------------------- /Algebra-Solver/requirements.txt: -------------------------------------------------------------------------------- 1 | sympy 2 | -------------------------------------------------------------------------------- /Artificial-intelligence_bot/README.md: -------------------------------------------------------------------------------- 1 | # What is AI bot> 2 | A chatbot (also known as a talkbot, chatterbot, Bot, IM bot, interactive agent, 3 | or Artificial Conversational Entity) is a computer program or an artificial 4 | intelligence which conducts a conversation via auditory or textual methods. 5 | 6 | ## How to use it > 7 | Start by Running the below command on your unix terminal or windows CMD 8 | 9 | ```bash 10 | $ python bash.py 11 | ``` 12 | -------------------------------------------------------------------------------- /Artificial-intelligence_bot/ai.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | YANE 6 | 9 | 10 | 11 | 12 | WAYE * 13 | 20 | 21 | 22 | 23 | GASKIYANE * 24 | 27 | 28 | 29 | 30 | YATO * 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Artificial-intelligence_bot/bot.py: -------------------------------------------------------------------------------- 1 | import sys 2 | try: 3 | import aiml 4 | except ImportError: 5 | print('[!] Failed to import the module') 6 | try: 7 | select = raw_input('[*] Attempt to auto-install aiml? [Y/n') 8 | except KeyboardInterrupt: 9 | print('\n[!] User Cancel') 10 | sys.exit(5) 11 | if select.strip().lower()[0] == 'y': 12 | print('[*] Trying to Install aiml... ') 13 | sys.stdout.flush() 14 | try: 15 | import pip 16 | pip.main(['install', '-q', 'aiml']) 17 | import aiml 18 | print('Finished') 19 | except Exception: 20 | print('Something happens PLease check your internet connection') 21 | sys.exit(5) 22 | 23 | elif select.strip().lower()[0] == 'n': 24 | print('[*] User cancel Auto-install') 25 | sys.exit(5) 26 | 27 | 28 | kern = aiml.Kernel() 29 | kern.learn('load.xml') 30 | kern.respond('load aiml b') 31 | 32 | while True: 33 | print(kern.respond(raw_input('Type your Message >>'))) 34 | -------------------------------------------------------------------------------- /Artificial-intelligence_bot/load.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | LOAD AIML B 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Artificial-intelligence_bot/requirements.txt: -------------------------------------------------------------------------------- 1 | aiml 2 | -------------------------------------------------------------------------------- /Attachment_Unique_Mail/native_script.py: -------------------------------------------------------------------------------- 1 | import win32com.client 2 | import pandas as pd 3 | import os 4 | 5 | # Load the CSV file 6 | csv_file = 'your_file_path_here' # Replace with the path to your CSV file, make sure to have \\ instead of \ 7 | df = pd.read_csv(csv_file) 8 | 9 | # Path to the folder containing the PDFs 10 | pdf_folder_path = 'your_folder_here' # Add the attachment folder you wish to send (name them as per the CSV file) 11 | 12 | # Outlook setup 13 | ol = win32com.client.Dispatch("outlook.application") 14 | olmailitem = 0x0 15 | 16 | # Sending each mail 17 | for index, row in df.iterrows(): 18 | 19 | newmail = ol.CreateItem(olmailitem) 20 | newmail.Subject = 'enter_subject_here' 21 | newmail.To = row['email'] # Assuming your CSV has a column named 'email' with the mail address 22 | newmail.CC = '' # cc; optional 23 | newmail.Body = '' # text contents of your mail 24 | 25 | # PDF file name and path 26 | pdf_file_name = row['name'] + '.pdf' # Assuming your CSV has a column named 'name' 27 | pdf_file_path = os.path.join(pdf_folder_path, pdf_file_name) 28 | 29 | 30 | if os.path.exists(pdf_file_path): 31 | newmail.Attachments.Add(pdf_file_path) 32 | else: 33 | print(f"PDF file not found for {row['name']}") 34 | 35 | newmail.Send() 36 | 37 | # Note: This script will send emails as soon as it's run. Be careful! -------------------------------------------------------------------------------- /Attachment_Unique_Mail/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Attachment_Unique_Mail/requirements.txt -------------------------------------------------------------------------------- /Battery_notification/README.md: -------------------------------------------------------------------------------- 1 | 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. 2 | 3 | ``` 4 | pip install psutil 5 | 6 | pip install pyttsx3 7 | 8 | pip install win10toast 9 | ``` 10 | than run the file. 11 | using ```python``` for windows and ```python3``` for linux and follow up ```Battery_notification.py``` 12 | -------------------------------------------------------------------------------- /Better_CSV_Storage/README.md: -------------------------------------------------------------------------------- 1 | p 2 | 3 | # Better CSV Storage 4 | 5 | -> 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) 6 | 7 | 8 | 9 | ### What you Can Do ? 10 | 11 | -> Filter Data Based On Certain Conditions that you provide, 12 | 13 | -> Update Certain Value in particular row. 14 | 15 | 16 | 17 | ### How to use ? 18 | 19 | -> It's OOP based Script so just import that in you Regular Script. 20 | 21 | -> For Example, 22 | 23 | ​ -> I want to check and download_status of files. 24 | 25 | ​ -> csv file i have used -> `dummy_data.csv` 26 | 27 | ```python 28 | csv_path = 'dummy_data.csv' 29 | 30 | #init class and get the object 31 | csv_obj = BetterCSVStorage(csv_path) 32 | 33 | #Now user that object as storage 34 | 35 | #Filter Data Based on Different parameters 36 | #This List will contain additional ( update_index ) which is row index of each row in csv. 37 | #This update_index will be use to update value of certain index. 38 | filtered_data = csv_obj.get_filtered_data('download_status', '==', '') 39 | 40 | #Change Data Based on Different parameters 41 | csv_obj.update_data(10,'download_status', 'done') 42 | ``` 43 | -------------------------------------------------------------------------------- /Better_CSV_Storage/dummy_data.csv: -------------------------------------------------------------------------------- 1 | id,file_name,file_url,download_date,download_status 2 | 1430,sample_video1.mp4,https://example.com/download/sample_video1.mp4,05/10/22, 3 | 239,sample_video2.mp4,https://example.com/download/sample_video2.mp4,05/10/22, 4 | 3421,sample_video3.mp4,https://example.com/download/sample_video3.mp4,05/10/22, 5 | 1305,sample_video4.mp4,https://example.com/download/sample_video4.mp4,05/10/22, 6 | 6375,sample_video5.mp4,https://example.com/download/sample_video5.mp4,06/10/22,done 7 | 1203,sample_video6.mp4,https://example.com/download/sample_video6.mp4,06/10/22,done 8 | -------------------------------------------------------------------------------- /Bitcoin-Price-GUI/README.md: -------------------------------------------------------------------------------- 1 | # Bitcoin price GUI 2 | 3 | Tells the current price of bitcoin using Python's TKinter library and using luno free api. Press refresh to get the latest price. 4 | 5 | ## How to use 6 | 7 | > python bitcoin-price.py 8 | 9 | or 10 | 11 | > python3 bitcoin-price.py 12 | 13 | * the default pair is Bitcoin to Malaysian Ringgit, to change that, click [here](https://api.mybitx.com/api/1/tickers) to find out what tickers are available and change `XBTMYR` in line 9. -------------------------------------------------------------------------------- /Bitcoin-Price-GUI/bitcoin-price.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | from tkinter import ttk 3 | import urllib.request 4 | import json 5 | import time 6 | 7 | def get_luno(): 8 | # to change ticker pair, look at here https://api.mybitx.com/api/1/tickers 9 | req = urllib.request.urlopen("https://api.mybitx.com/api/1/ticker?pair=XBTMYR") 10 | x = json.loads(req.read().decode("utf-8")) 11 | req.close() 12 | return x 13 | 14 | def refresh_price(): 15 | aLable.configure(text="Ask price: RM " + get_luno()["ask"]) 16 | bLable.configure(text="Time: " + 17 | str(time.strftime("%Y-%m-%d %H:%M:%S", 18 | time.gmtime(get_luno()["timestamp"]/1000 + 28800)))) 19 | 20 | win = tk.Tk() 21 | win.title("Bitcoin price in MYR") 22 | 23 | aLable = ttk.Label(win, text="Ask price: RM " + get_luno()["ask"]) 24 | aLable.grid(column=0, row=0, padx=8, pady=4) 25 | 26 | bLable = ttk.Label(text="Time: " + 27 | str(time.strftime("%Y-%m-%d %H:%M:%S", 28 | time.gmtime(get_luno()["timestamp"]/1000 + 28800)))) 29 | bLable.grid(column=0, row=1, padx=8, pady=4) 30 | 31 | action = ttk.Button(win, text="Refresh", command=refresh_price) 32 | action.grid(column=0, row=2, padx=8, pady=4) 33 | 34 | win.mainloop() 35 | 36 | -------------------------------------------------------------------------------- /CSV-to-Excel/README.md: -------------------------------------------------------------------------------- 1 | ## CSV to Excel 2 | 3 | This programme writes the data in any Comma-separated value file (such as: .csv or .data) to a Excel file. 4 | 5 | ## Requirements 6 | 7 | Install the required libraries: 8 | 9 | $ pip install -r requirements.txt 10 | 11 | After that run with: 12 | 13 | $ python main.py 14 | -------------------------------------------------------------------------------- /CSV-to-Excel/example output.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/CSV-to-Excel/example output.xlsx -------------------------------------------------------------------------------- /CSV-to-Excel/main.py: -------------------------------------------------------------------------------- 1 | #!python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import openpyxl 5 | import sys 6 | 7 | #inputs 8 | print("This programme writes the data in any Comma-separated value file (such as: .csv or .data) to a Excel file.") 9 | print("The input and output files must be in the same directory of the python file for the programme to work.\n") 10 | 11 | csv_name = input("Name of the CSV file for input (with the extension): ") 12 | sep = input("Seperator of the CSV file: ") 13 | excel_name = input("Name of the excel file for output (with the extension): ") 14 | sheet_name = input("Name of the excel sheet for output: ") 15 | 16 | #opening the files 17 | try: 18 | wb = openpyxl.load_workbook(excel_name) 19 | sheet = wb.get_sheet_by_name(sheet_name) 20 | 21 | file = open(csv_name,"r",encoding = "utf-8") 22 | except: 23 | print("File Error!") 24 | sys.exit() 25 | 26 | #rows and columns 27 | row = 1 28 | column = 1 29 | 30 | #for each line in the file 31 | for line in file: 32 | #remove the \n from the line and make it a list with the seperator 33 | line = line[:-1] 34 | line = line.split(sep) 35 | 36 | #for each data in the line 37 | for data in line: 38 | #write the data to the cell 39 | sheet.cell(row,column).value = data 40 | #after each data column number increases by 1 41 | column += 1 42 | 43 | #to write the next line column number is set to 1 and row number is increased by 1 44 | column = 1 45 | row += 1 46 | 47 | #saving the excel file and closing the csv file 48 | wb.save(excel_name) 49 | file.close() -------------------------------------------------------------------------------- /CSV-to-Excel/requirements.txt: -------------------------------------------------------------------------------- 1 | openpyxl -------------------------------------------------------------------------------- /Checksum/README.md: -------------------------------------------------------------------------------- 1 | # Checksum 2 | 3 | This script can generate checksums from md5, sha1, sha224, sha256, sha384, and sha512. 4 | Additionally, for another layer of secret it can create signed checksums using HMAC and a provided secret. 5 | Lastly, to provide actual value to the script it can also verify if a checksum matches the file it was generated from. 6 | 7 | Examples: 8 | 9 | Generate a sha1 checksum 10 | ``` 11 | python checksum.py -H sha1 -f test.txt -g 12 | # b29d28bc5239dbc2689215811b2a73588609f301 13 | ``` 14 | 15 | Generate a signature 16 | ``` 17 | python checksum.py -f test.txt -s secret 18 | # 3YYMCthY4hFxQj1wPF3uAg== 19 | ``` 20 | 21 | Verify a checksum 22 | ``` 23 | python -H sha1 -f test.txt -v b29d28bc5239dbc2689215811b2a73588609f301 24 | ``` 25 | 26 | Verify a signature 27 | ``` 28 | python -f test.txt -s secret -v 3YYMCthY4hFxQj1wPF3uAg== 29 | ``` 30 | -------------------------------------------------------------------------------- /Clean_up_photo_directory/README.md: -------------------------------------------------------------------------------- 1 | # Clean_up_photo 2 | 3 | 4 | ## Description 5 | 6 | This program is used to find out the "bad" picture files and then eventually delete them. 7 | 8 | ## Usage 9 | 10 | Run the clean_up_photo.py 11 | -------------------------------------------------------------------------------- /Clean_up_photo_directory/clean_up_photo.py: -------------------------------------------------------------------------------- 1 | import os 2 | from os.path import join 3 | for (dirname, dirs, files) in os.walk('.'): 4 | for filename in files: 5 | if filename.endswith('.txt') : 6 | thefile = os.path.join(dirname,filename) 7 | size = os.path.getsize(thefile) 8 | if size == 2578 or size == 2565: 9 | print 'T-Mobile:',thefile 10 | #os.remove(thefile) Add this when you are sure to delete the file 11 | continue 12 | fhand = open(thefile,'r') 13 | lines = list() 14 | for line in fhand: 15 | lines.append(line) 16 | fhand.close() 17 | if len(lines) == 3 and lines[2].startswith('Sent from my iPhone'): 18 | print 'iPhone:', thefile 19 | #os.remove(thefile) Add this when you are sure to delete the file 20 | continue -------------------------------------------------------------------------------- /Codechef-Code-Submitter/README.md: -------------------------------------------------------------------------------- 1 | # Automated Submission 2 | A simple script to submit you code on [https://www.codechef.com] using selenium. -------------------------------------------------------------------------------- /Codechef-Code-Submitter/automated-submission.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | import getpass 3 | import time 4 | 5 | username = "username" 6 | password = getpass.getpass("Password:") 7 | 8 | problem = 'TEST' 9 | 10 | code = """ 11 | #include 12 | 13 | int main(void) { 14 | char c, d=10; 15 | while(std::cin.get(c) && (c!='2' || d!='4') && std::cout.put(d)) 16 | d=c; 17 | } 18 | """ 19 | 20 | browser = webdriver.Firefox() 21 | 22 | browser.get('https://www.codechef.com') 23 | 24 | nameElem = browser.find_element_by_id('edit-name') 25 | nameElem.send_keys(username) 26 | 27 | passElem = browser.find_element_by_id('edit-pass') 28 | passElem.send_keys(password) 29 | 30 | browser.find_element_by_id('edit-submit').click() 31 | 32 | browser.get("https://www.codechef.com/submit/" + problem) 33 | 34 | time.sleep(20) 35 | 36 | browser.find_element_by_id("edit_area_toggle_checkbox_edit-program").click() 37 | 38 | inputElem = browser.find_element_by_id('edit-program') 39 | inputElem.send_keys(code) 40 | 41 | browser.find_element_by_id("edit-submit").click() 42 | 43 | -------------------------------------------------------------------------------- /Codechef-Code-Submitter/requirements.txt: -------------------------------------------------------------------------------- 1 | selenium 2 | -------------------------------------------------------------------------------- /Color_to_BW_Converter/README.md: -------------------------------------------------------------------------------- 1 | # Colored Image to Black & White Image Converter 2 | A simple python script which takes colored image filename as argument and converts it into grayscale image and saves the output image file. It shows the basic usage of Pillow library. 3 | 4 | ## Libraries Required 5 | 1. Pillow (PIL) 6 | `$pip install Pillow` 7 | 8 | ## Usage 9 | 1. Go to the script's folder and open command prompt. 10 | 2. Run command : `$python bw_convert.py ` 11 | 12 | ## Example 13 | `$python bw_convert.py sample_image.jpg` 14 | `$python bw_convert.py sample_image.png` 15 | -------------------------------------------------------------------------------- /Color_to_BW_Converter/bw_convert.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from PIL import Image 3 | from PIL.ExifTags import TAGS 4 | 5 | image_file = sys.argv[1] 6 | image_name = image_file.split(".")[0] 7 | 8 | try: 9 | image = Image.open(image_file) 10 | except IOError: 11 | print("Error in loading image!!") 12 | sys.exit(1) 13 | 14 | bw_image = image.convert('L') 15 | bw_image.save("bw_"+image_name+".png") 16 | -------------------------------------------------------------------------------- /Color_to_BW_Converter/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow 2 | -------------------------------------------------------------------------------- /Color_to_BW_Converter/sample_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Color_to_BW_Converter/sample_image.jpg -------------------------------------------------------------------------------- /Contact-Distribution/README.md: -------------------------------------------------------------------------------- 1 | # Contact 'Leads' Distribution 2 | Distributes the contacts you receive sequentially to emails in a list. 3 | 4 | Use case 5 | -------- 6 | When you have a sales team and would like the contacts received on a form 7 | to be equally distributed between them. 8 | 9 | How to Use in cPanel 10 | -------------------- 11 | 12 | 1. Create an email account that will receive the contacts ```Ex: sellers@domain.com``` 13 | 2. Create the email accounts where the contacts will be distributed. 14 | 3. Upload the script to the server. (note: DO NOT use a public folder) 15 | 4. Change script privileges `$chmod 744 contact-distribution.py` 16 | 5. Change the list of sellers (the same as you created in step 2) 17 | 18 | ```python 19 | # list with sellers or emails for distribution 20 | sellers = [('Seller 01', 'seller01@domain.com'), 21 | ('Seller 02', 'seller02@domain.com'), 22 | ('Seller 03', 'seller03@domain.com')] 23 | ``` 24 | 25 | 6. Change the primary receiving email. (the same one you created in step 1) 26 | 27 | ```python 28 | s.sendmail("sellers@domain.com", sellers[nextSeller][1], 29 | msg.as_string()) 30 | ``` 31 | 32 | 7. Add a new forwarding to the mail distribution. 33 | 34 | ![Imagem do cPanel](docs/images/cpanel_encaminhadores01.jpg) 35 | 36 | 8. Forward it to the script. 37 | 38 | ![Imagem do cPanel](docs/images/cpanel_encaminhadores02.jpg) 39 | 40 | 41 | Done. 42 | -------------------------------------------------------------------------------- /Contact-Distribution/docs/images/cpanel_encaminhadores01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Contact-Distribution/docs/images/cpanel_encaminhadores01.jpg -------------------------------------------------------------------------------- /Contact-Distribution/docs/images/cpanel_encaminhadores02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Contact-Distribution/docs/images/cpanel_encaminhadores02.jpg -------------------------------------------------------------------------------- /Contact-Distribution/lastseller.txt: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /Countdown/requirements.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CricBuzz_Score_Update/README.md: -------------------------------------------------------------------------------- 1 | # Cric-Update 2 | This python script, based on web scraping, fetches the score of the recent cricket matches using Beautiful soup library to scrape the data. 3 | 4 | 5 | # How to run 6 | 7 | Type in this command in terminal. 8 | 9 | python3 cricbuzz_scrap.py 10 | 11 | It will display score updates of all the recent matches. 12 | 13 | ![](https://d2mxuefqeaa7sj.cloudfront.net/s_78DB49E0B4D273EF775E6D44076B0924AC39C7C9CAE0AA84C9E4F68389263AD8_1532542514744_Screenshot+from+2018-07-25+23-43-29.png) 14 | 15 | -------------------------------------------------------------------------------- /CricBuzz_Score_Update/cricbuzz_scrap.py: -------------------------------------------------------------------------------- 1 | from urllib.request import urlopen 2 | from bs4 import BeautifulSoup 3 | 4 | quote_page = 'http://www.cricbuzz.com/cricket-match/live-scores' 5 | page = urlopen(quote_page) 6 | soup = BeautifulSoup(page,'html.parser') 7 | 8 | update=[] 9 | 10 | for score in soup.find_all('div',attrs={'class':'cb-col cb-col-100 cb-lv-main'}): 11 | s=score.text.strip() 12 | update.append(s) 13 | 14 | print('-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*') 15 | 16 | 17 | for i in range(len(update)): 18 | print(i+1), 19 | print(update[i]) 20 | print('-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*') 21 | -------------------------------------------------------------------------------- /CricBuzz_Score_Update/requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | -------------------------------------------------------------------------------- /Crypt_Socket/README.md: -------------------------------------------------------------------------------- 1 | Crypt_Socket 2 | ============== 3 | 4 | Steps: 5 | -------- 6 | 7 | ### #1 - Install third-part library Simple-crypt ### 8 | ```pip install simple-crypt``` 9 | 10 | More information on: https://github.com/andrewcooke/simple-crypt 11 | 12 | ### #2 - Run server-side script ### 13 | In some terminal window run: 14 | ```python cryptSocket_servidor.py``` 15 | 16 | ### #3 - Run client-side script ### 17 | On another terminal window run: 18 | ```python cryptSocket_client.py``` 19 | 20 | #### PS: #### 21 | For some system is needed use python3 instead python 22 | -------------------------------------------------------------------------------- /Crypt_Socket/cryptSocket_servidor.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | #SERVIDOR 4 | 5 | from simplecrypt import encrypt, decrypt 6 | import socket 7 | import time 8 | 9 | #definição do IP do servidor 10 | hostname = '127.0.0.1' 11 | port = 5000 12 | 13 | #cria uma lista de clientes 14 | clients = [] 15 | 16 | #criação do socket 17 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 18 | s.bind((hostname, port)) 19 | s.setblocking(0) 20 | 21 | 22 | print ("Server Started.") 23 | 24 | while KeyboardInterrupt: 25 | try: 26 | data, addr = s.recvfrom(2048) 27 | if addr not in clients: 28 | clients.append(addr) #se o IP do cliente não estiver na lista, este novo cliente é adicionado 29 | s.sendto(str(data).encode('utf-8'), addr) 30 | 31 | #Recibo da entrega da mensagem criptografada 32 | print("MENSAGEM CRIPTOGRAFADA:\n") 33 | print (data) 34 | #Descriptografando a mensagem 35 | print("\n MENSAGEM DESCRIPTOGRAFADA") 36 | descryptdata = decrypt("Fatec123", data) 37 | descdata = descryptdata 38 | print(descdata) 39 | 40 | for client in clients: 41 | s.sendto(data, client) 42 | except: 43 | time.sleep(5) 44 | pass 45 | 46 | s.close() 47 | -------------------------------------------------------------------------------- /Crypt_Socket/requirements.txt: -------------------------------------------------------------------------------- 1 | simple-crypt 2 | -------------------------------------------------------------------------------- /Cryptocurrency-Prices/README.md: -------------------------------------------------------------------------------- 1 | ## Cryptocurrency Prices 2 | 3 | This programme gets the live price of cryptocurrencies. 4 | 5 | ## Requirements 6 | 7 | Install the required libraries: 8 | 9 | $ pip install -r requirements.txt 10 | 11 | After that run with: 12 | 13 | $ python cryptocurrency-prices.py 14 | -------------------------------------------------------------------------------- /Cryptocurrency-Prices/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | bs4 3 | colorama -------------------------------------------------------------------------------- /Cryptocurrency-converter/README.md: -------------------------------------------------------------------------------- 1 | # Cryptocurrency Converter 2 | A simple GUI of a cryptocurrency converter implemented in Python using PyQt. The UI was designed using Qt Creator. 3 | 4 |

5 | 6 |

7 | 8 | ## Requirement 9 | 10 | Python 3.xx 11 | PyQt5 12 | requests 13 | 14 | ## Usage 15 | To start converting your cryptocurrency to USD, EUR, or other cryptocurrencies type: 16 | ```bash 17 | $ virtualenv crypto-env 18 | $ source crypto-env/bin/activate 19 | $ pip3 install -r requirements.txt 20 | $ python CryptoConverter.py 21 | ``` 22 | ENJOY 🤩 -------------------------------------------------------------------------------- /Cryptocurrency-converter/requirements.txt: -------------------------------------------------------------------------------- 1 | PyQt5>=5.6 2 | requests 3 | -------------------------------------------------------------------------------- /Current_City_Weather/README.md: -------------------------------------------------------------------------------- 1 | # Current City Weather 2 | Uses a GET request to retrieve details on your current weather details within your city, simply insert the name of any 3 | city and it will provide details such as current temperature, current wind speed and current weather type. 4 | 5 | usage: Go to Current_City_Weather directory and run Weather.py and ad 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Current_City_Weather/Weather.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | 4 | def get_temperature(json_data): 5 | temp_in_celcius = json_data['main']['temp'] 6 | return temp_in_celcius 7 | 8 | def get_weather_type(json_data): 9 | weather_type = json_data['weather'][0]['description'] 10 | return weather_type 11 | 12 | def get_wind_speed(json_data): 13 | wind_speed = json_data['wind']['speed'] 14 | return wind_speed 15 | 16 | 17 | 18 | def get_weather_data(json_data, city): 19 | description_of_weather = json_data['weather'][0]['description'] 20 | weather_type = get_weather_type(json_data) 21 | temperature = get_temperature(json_data) 22 | wind_speed = get_wind_speed(json_data) 23 | weather_details = '' 24 | return weather_details + ("The weather in {} is currently {} with a temperature of {} degrees and wind speeds reaching {} km/ph".format(city, weather_type, temperature, wind_speed)) 25 | 26 | 27 | def main(): 28 | api_address = 'https://api.openweathermap.org/data/2.5/weather?q=Sydney,au&appid=a10fd8a212e47edf8d946f26fb4cdef8&q=' 29 | city = input("City Name : ") 30 | units_format = "&units=metric" 31 | final_url = api_address + city + units_format 32 | json_data = requests.get(final_url).json() 33 | weather_details = get_weather_data(json_data, city) 34 | # print formatted data 35 | print(weather_details) 36 | 37 | 38 | 39 | main() -------------------------------------------------------------------------------- /Current_City_Weather/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /DOH-Dig/README.md: -------------------------------------------------------------------------------- 1 | # doh-dig 2 | 3 | A python dig script that returns json dns record lookup using cloud flares DNS servers. 4 | 5 | ## Usage 6 | ``` 7 | Usage: 8 | doh-dig type 9 | doh-dig ptr 10 | doh-dig (-h | --help) 11 | doh-dig --version 12 | 13 | ``` 14 | 15 | ### requirements 16 | * [docopt]: https://github.com/docopt/docopt 17 | * [requests]: https://pypi.org/project/requests/ 18 | 19 | ### Examples 20 | 21 | #### lookup and A record for google.com 22 | ./doh-dig type a google.com |python -m json.tool 23 | ``` 24 | [ 25 | { 26 | "name": "google.com.", 27 | "type": 1, 28 | "TTL": 235, 29 | "data": "172.217.19.174" 30 | } 31 | ] 32 | ``` 33 | 34 | #### lookup reverse record for an IP 35 | ./doh-dig ptr 1.1.1.1 |python -m json.tool 36 | ``` 37 | [ 38 | { 39 | "name": "1.1.1.1.in-addr.arpa.", 40 | "type": 12, 41 | "TTL": 1345, 42 | "data": "one.one.one.one." 43 | } 44 | ] 45 | ``` -------------------------------------------------------------------------------- /DOH-Dig/doh-dig: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Author: @awsumco 3 | 4 | """DNS OF HTTPS - DIG 5 | 6 | Usage: 7 | doh-dig type 8 | doh-dig ptr 9 | doh-dig (-h | --help) 10 | doh-dig --version 11 | 12 | Options: 13 | -h --help Show this screen. 14 | --version Show version. 15 | 16 | """ 17 | from docopt import docopt 18 | from pprint import pprint as pp 19 | from sys import exit 20 | import ipaddress, json 21 | 22 | def CloudFlareLookup(type,record): 23 | import requests 24 | headers = {'accept': 'application/dns-json'} 25 | url = "https://1.1.1.1/dns-query?name=%s&type=%s" % (record,type) 26 | r = requests.get(url, headers=headers) 27 | j_data = json.loads(r.text) 28 | try: 29 | return(j_data['Answer']) 30 | except: 31 | return(j_data['Question']) 32 | 33 | 34 | valid_types = ['A','MX','PTR','SRV','TXT','NS'] 35 | 36 | if __name__ == '__main__': 37 | arguments = docopt(__doc__, version='doh-dig 0.1') 38 | if arguments['type']: 39 | t = arguments[''].upper() 40 | r = arguments[''].lower() 41 | if t not in valid_types: 42 | exit('invalid type') 43 | x = CloudFlareLookup(t,r) 44 | print(json.dumps(x)) 45 | elif arguments['ptr']: 46 | ip = arguments[''] 47 | arpa = ipaddress.ip_address(ip).reverse_pointer 48 | x = CloudFlareLookup('PTR',arpa) 49 | print(json.dumps(x)) 50 | else: 51 | print(arguments) 52 | 53 | -------------------------------------------------------------------------------- /DOH-Dig/requirements.txt: -------------------------------------------------------------------------------- 1 | docopt 2 | requests 3 | -------------------------------------------------------------------------------- /Database-As-Storage/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Database-As-Storage/requirements.txt -------------------------------------------------------------------------------- /Directory-organizer/README.md: -------------------------------------------------------------------------------- 1 | # Directory-organizer 2 | Organises the files in the given directory according to their type(common extensions). 3 | Unrecognized extensions are kept in the parent directory itself while others are moved to respective new directories like 'Pictures' etc. 4 | 5 | usage: Directory-oraganiser.py [-h] path_to_the_directory 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Directory_Tree_Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | walkdir==0.4.1 2 | -------------------------------------------------------------------------------- /Download-page-as-pdf/README.md: -------------------------------------------------------------------------------- 1 | # Download Page as PDF: 2 | 3 | Download a page as a PDF . 4 | 5 | #### Required Modules : 6 | - pyppdf 7 | ```bash 8 | pip3 install pyppdf 9 | ``` 10 | - pyppyteer 11 | ```bash 12 | pip3 install pyppeteer 13 | ``` 14 | 15 | #### Examples of use : 16 | - Download a page: 17 | ```bash 18 | python download-page-as-pdf.py -l 'www.pudim.com.br' 19 | ``` 20 | 21 | - Download a page and give a pdf name: 22 | ```bash 23 | python download-page-as-pdf.py -l 'http://www.pudim.com.br' -n 'pudim.pdf' 24 | ``` 25 | -------------------------------------------------------------------------------- /Download-page-as-pdf/download-page-as-pdf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: UTF-8 -*- 3 | 4 | import argparse 5 | import pyppdf 6 | import re 7 | from pyppeteer.errors import PageError, TimeoutError, NetworkError 8 | 9 | 10 | def main(): 11 | parser = argparse.ArgumentParser(description = 'Page Downloader as PDF') 12 | parser.add_argument('--link', '-l', action = 'store', dest = 'link', 13 | required = True, help = 'Inform the link to download.') 14 | parser.add_argument('--name', '-n', action = 'store', dest = 'name', 15 | required = False, help = 'Inform the name to save.') 16 | 17 | arguments = parser.parse_args() 18 | 19 | url = arguments.link 20 | 21 | if not arguments.name: 22 | name = re.sub(r'^\w+://', '', url.lower()) 23 | name = name.replace('/', '-') 24 | else: 25 | name = arguments.name 26 | 27 | if not name.endswith('.pdf'): 28 | name = name + '.pdf' 29 | 30 | print(f'Name of the file: {name}') 31 | 32 | try: 33 | pyppdf.save_pdf(name, url) 34 | except PageError: 35 | print('URL could not be resolved.') 36 | except TimeoutError: 37 | print('Timeout.') 38 | except NetworkError: 39 | print('No access to the network.') 40 | 41 | if __name__ == '__main__': 42 | main() 43 | -------------------------------------------------------------------------------- /Download-page-as-pdf/requirements.txt: -------------------------------------------------------------------------------- 1 | pyppdf==0.1.2 2 | pyppeteer==0.2.2 3 | -------------------------------------------------------------------------------- /English_Theasauras/README.md: -------------------------------------------------------------------------------- 1 | # English Theasauras 2 | A simple and smart command-line dictionary that displays the definition of the words entered by the user. 3 | 4 | ## Usage 5 | To start the dictionary type: 6 | ```bash 7 | $ python app.py 8 | ``` 9 | ENJOY 🤩 -------------------------------------------------------------------------------- /English_Theasauras/app.py: -------------------------------------------------------------------------------- 1 | import json 2 | import difflib 3 | 4 | from difflib import get_close_matches 5 | 6 | data = json.load(open("data.json")) # Importing data from data.json 7 | 8 | def show_def(word): 9 | word = word.lower() 10 | if word in data: 11 | return data[word] 12 | elif len(get_close_matches(word, data.keys())) > 0: 13 | choice = input("Did you mean %s instead ? Enter Y for yes or N for no: " % get_close_matches(word, data.keys())[0]) 14 | if choice == "Y": 15 | return data[get_close_matches(word, data.keys())[0]] 16 | elif choice == "N": 17 | return "The word doesn't exist. Please double check it!!" 18 | else: 19 | return "We didn't understand your entry!" 20 | else: 21 | return "The word doesn't exist. Please double check it!!" 22 | 23 | 24 | word = input("Please enter your word: ") 25 | 26 | output = show_def(word) 27 | 28 | if type(output) == list: 29 | for item in output: 30 | print(item) 31 | else: 32 | print(output) 33 | 34 | -------------------------------------------------------------------------------- /Excel_Files_Merger/Combine excel files into 1.py: -------------------------------------------------------------------------------- 1 | from openpyxl import load_workbook 2 | from openpyxl import Workbook 3 | import os 4 | 5 | 6 | # Read data from active worksheet and return it as a list 7 | def reader(file): 8 | global path 9 | abs_file = os.path.join(path, file) 10 | wb_sheet = load_workbook(abs_file).active 11 | rows = [] 12 | # min_row is set to 2, ignore the first row which contains headers 13 | for row in wb_sheet.iter_rows(min_row=2): 14 | row_data = [] 15 | for cell in row: 16 | row_data.append(cell.value) 17 | rows.append(row_data) 18 | return rows 19 | 20 | 21 | # You can replace these with your own headers for the table 22 | headers = ['Nume', 'Prenume', 'Titlu', 'Editura', 'Cota', 'Pret', 'An'] 23 | # Unified excel name 24 | workbook_name = input('Unified Workbook name ') 25 | book = Workbook() 26 | sheet = book.active 27 | # Specify path 28 | path = input('Path: ') 29 | # Get all files from folder 30 | files = os.listdir(path) 31 | for file in files: 32 | rows = reader(file) 33 | for row in rows: 34 | sheet.append(row) 35 | book.save(filename=workbook_name) 36 | -------------------------------------------------------------------------------- /Excel_Files_Merger/README.md: -------------------------------------------------------------------------------- 1 | # Excel Files Merger 2 | A simple script that excel files with similar table structure from a given path as input and creates a unified excel workbook. 3 | 4 | ## Libraries Required 5 | 1. openpyxl 6 | `$pip install openpyxl` 7 | 8 | ## Usage 9 | A sample script 'Combine excel files into 1.py' has been provided to show the usage of the Excel Merger. When the scipt is run, it will ask for the name of the Unified Workbook and the path of the folder containing the excel files that need to be merged. -------------------------------------------------------------------------------- /Excel_to_ListofList/ExcelToList.py: -------------------------------------------------------------------------------- 1 | import xlrd 2 | import sys 3 | 4 | class ExcelToList(): 5 | 6 | def __init__(self, file, sheet): 7 | self.file = file 8 | self.sheet = sheet 9 | 10 | def convert(self): 11 | converted_list = [] 12 | inputexcel = xlrd.open_workbook(self.file) 13 | inputsheet = inputexcel.sheet_by_name(self.sheet) 14 | numberofrows = inputsheet.nrows 15 | numberofcols = inputsheet.ncols 16 | start_row,start_col = 0,0 17 | for current_row in range(start_row,numberofrows): 18 | currentlist = [] 19 | for current_col in range(start_col,numberofcols): 20 | currentlist.append(inputsheet.cell(current_row,current_col).value) 21 | converted_list.append(currentlist) 22 | return converted_list -------------------------------------------------------------------------------- /Excel_to_ListofList/README.md: -------------------------------------------------------------------------------- 1 | # Excel to Python List of List Converter 2 | A simple tool which reads an excel file and any corresponding sheet, and converts it to python list of list data structure. 3 | 4 | ## Libraries Required 5 | 1. xlrd 6 | `$pip install xlrd` 7 | 8 | ## Usage 9 | A sample script `excel_to_list_usage.py` has been provided to show the usage of the ExcelToList. It reads the excel and its sheet, and prints the list of list. -------------------------------------------------------------------------------- /Excel_to_ListofList/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Excel_to_ListofList/__init__.py -------------------------------------------------------------------------------- /Excel_to_ListofList/excel_to_list_usage.py: -------------------------------------------------------------------------------- 1 | from ExcelToList import ExcelToList 2 | 3 | exceltolist = ExcelToList("input.xlsx","Sheet1") ## args : Input filename, Sheet name 4 | list_of_list = exceltolist.convert() 5 | 6 | print "List of List : ",list_of_list -------------------------------------------------------------------------------- /Excel_to_ListofList/input.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Excel_to_ListofList/input.xlsx -------------------------------------------------------------------------------- /Excel_to_ListofList/requirements.txt: -------------------------------------------------------------------------------- 1 | xlrd 2 | -------------------------------------------------------------------------------- /Face_recognition/README.md: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | {\*\expandedcolortbl;;} 5 | \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 6 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 7 | 8 | \f0\fs24 \cf0 # Description\ 9 | Code for Face recognition build by using OpenCv-Python. It uses cascade classifier as the database for the recognition which is an xml file.\ 10 | \ 11 | # Requirements\ 12 | Python version 3 and above can be used\ 13 | pip install cv2\ 14 | \ 15 | # Usage \ 16 | Can be run easily using terminal or command prompt ( I used Jupyter Notebook for the code)\ 17 | Run `python3 image_recognition.ipynb` \ 18 | } -------------------------------------------------------------------------------- /Face_recognition/morgan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Face_recognition/morgan.jpg -------------------------------------------------------------------------------- /Face_recognition/requirements.txt: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | {\*\expandedcolortbl;;} 5 | \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 6 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 7 | 8 | \f0\fs24 \cf0 OpenCV- Python\ 9 | Cascade Classifier} -------------------------------------------------------------------------------- /Fibonacci_Sequence_Generator/Fibonacci.py: -------------------------------------------------------------------------------- 1 | def Fibbo_Sequence_Generator(): 2 | # Generates a fibonacci sequence with the size of ngi 3 | runFib = True 4 | while(runFib): 5 | n = int(input('How many numbers do you need? ')) 6 | if n > 0 : 7 | runFib = False 8 | series = [1] 9 | 10 | while len(series) < n: 11 | if len(series) == 1: 12 | series.append(1) 13 | else: 14 | series.append(series[-1] + series[-2]) 15 | 16 | for i in range(len(series)): # Convert the numbers to strings 17 | series[i] = str(series[i]) 18 | else: 19 | print('enter a valid number') 20 | 21 | return(', '.join(series)) # Return the sequence seperated by commas 22 | 23 | print(Fibbo_Sequence_Generator()) -------------------------------------------------------------------------------- /Fibonacci_Sequence_Generator/README.md: -------------------------------------------------------------------------------- 1 | # Python Fibonacci Sequence Generator 2 | This python script will ask you how many numbers do you need to see in the Fibonacci Sequence and generates the sequence based on your input. 3 | 4 | ## Requirement 5 | Python 3.xx 6 | 7 | ## Running the script 8 | ```bash 9 | python Fibonacci.py 10 | ``` -------------------------------------------------------------------------------- /File-Explorer-Dialog-Box/README.md: -------------------------------------------------------------------------------- 1 | # File Explorer Dialog Box in Python 2 | 3 | Open file explorer dialog box UI to select files using Python. 4 | 5 | 6 | ## 1. Using tkinter 7 | 8 | Example using tkinter: 9 | 10 | ``` 11 | $ python select_file_tk.py 12 | ``` 13 | 14 | ## 2. Using PyQt 15 | 16 | Install [PyQt5](https://pypi.org/project/PyQt5/) 17 | 18 | 19 | Example using PyQt5: 20 | 21 | ``` 22 | $ python select_file_pyqt.py 23 | ``` 24 | -------------------------------------------------------------------------------- /File-Explorer-Dialog-Box/requirements.txt: -------------------------------------------------------------------------------- 1 | PyQt5 2 | -------------------------------------------------------------------------------- /File-Explorer-Dialog-Box/select_file_pyqt.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtWidgets import QFileDialog, QApplication 2 | from PyQt5 import QtWidgets 3 | 4 | 5 | def select_files(directory_location=None): 6 | qtapp = QApplication([directory_location]) 7 | qtwgt = QtWidgets.QWidget() 8 | filenames, _ = QFileDialog.getOpenFileNames(qtwgt) 9 | return filenames 10 | 11 | 12 | def main(): 13 | filenames = select_files() 14 | print("You selected:\n", "\n".join(filename for filename in filenames)) 15 | 16 | 17 | if __name__ == "__main__": 18 | main() 19 | -------------------------------------------------------------------------------- /File-Explorer-Dialog-Box/select_file_tk.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | from tkinter import filedialog 3 | 4 | root = tk.Tk() 5 | root.withdraw() 6 | 7 | file_path = filedialog.askopenfilename() 8 | print(file_path) 9 | -------------------------------------------------------------------------------- /File-Organizer/README.md: -------------------------------------------------------------------------------- 1 | # File Organizer 2 | Organizes your files in the folder according to their extension by grouping them together. 3 | 4 | # Libraries Used 5 | - 6 | 7 | # Usage 8 | Just run the command `python3 file-organizerpy` from your terminal/bash. 9 | -------------------------------------------------------------------------------- /File-Organizer/file-organizer.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | 4 | #The Path of the directory to be sorted 5 | path = 'C:\\Users\\\\Downloads' 6 | #This populates a list with the filenames in the directory 7 | list_ = os.listdir(path) 8 | 9 | #Traverses every file 10 | for file_ in list_: 11 | name,ext = os.path.splitext(file_) 12 | print(name) 13 | #Stores the extension type 14 | ext = ext[1:] 15 | #If it is directory, it forces the next iteration 16 | if ext == '': 17 | continue 18 | #If a directory with the name 'ext' exists, it moves the file to that directory 19 | if os.path.exists(path+'/'+ext): 20 | shutil.move(path+'/'+file_,path+'/'+ext+'/'+file_) 21 | #If the directory does not exist, it creates a new directory 22 | else: 23 | os.makedirs(path+'/'+ext) 24 | shutil.move(path+'/'+file_,path+'/'+ext+'/'+file_) 25 | -------------------------------------------------------------------------------- /File-Organizer/requirements.txt: -------------------------------------------------------------------------------- 1 | colorama -------------------------------------------------------------------------------- /File-Sharing-Bot/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Darshan Patel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /File-Sharing-Bot/Procfile: -------------------------------------------------------------------------------- 1 | worker: python bot.py -------------------------------------------------------------------------------- /File-Sharing-Bot/README.md: -------------------------------------------------------------------------------- 1 | # File-Sharing-Bot 2 | File Sharing telegram Bot developed in Python 3 | It is like a centerlized file repository where authorized users can share files and files are available to all the users. 4 | Functionalities and commands can be seen using /help command. 5 | This bot can be directly hosted on Heroku. 6 | -------------------------------------------------------------------------------- /File-Sharing-Bot/requirements.txt: -------------------------------------------------------------------------------- 1 | python-telegram-bot==10.1.0 2 | -------------------------------------------------------------------------------- /File-Sharing-Bot/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.6.0 2 | -------------------------------------------------------------------------------- /File_Carving/Images/Output.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/File_Carving/Images/Output.PNG -------------------------------------------------------------------------------- /File_Carving/Images/test_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/File_Carving/Images/test_image.jpg -------------------------------------------------------------------------------- /File_Carving/README.MD: -------------------------------------------------------------------------------- 1 | # File Carving 2 | > **Note:** This version only supports jpg/jpeg file carving. 3 | 4 | This script recursively finds files in the folder and carves files with jpg/jpeg file signature. 5 | 6 | ## Usage 7 | 8 | 1. Clone this repository 9 | ``` 10 | git clone https://github.com/hastagAB/Awesome-Python-Scripts.git 11 | ``` 12 | 2. Move to File_Carving directory 13 | ``` 14 | cd File_Carving 15 | ``` 16 | 3. Install reqired package 17 | ``` 18 | pip install -r requirements.txt 19 | ``` 20 | 5. Run carving.py 21 | ``` 22 | python carving.py 23 | ``` 24 | 25 | ## Example 26 | ![Output](https://user-images.githubusercontent.com/76420409/139208797-b4417848-f184-4f65-869f-1c6e061cf3c8.PNG) 27 | 28 | 29 | -------------------------------------------------------------------------------- /File_Carving/requirements.txt: -------------------------------------------------------------------------------- 1 | os 2 | binascii -------------------------------------------------------------------------------- /Find-PhoneNumber-in-String/Find-PhoneNumber-in-String.py: -------------------------------------------------------------------------------- 1 | def check_phone_number(string): 2 | if len(string) != 12: 3 | return False 4 | for i in range(0, 3): 5 | if not string[i].isdecimal(): 6 | return False 7 | if string[3] != '-': 8 | return False 9 | for i in range(4, 7): 10 | if not string[i].isdecimal(): 11 | return False 12 | if string[7] != '-': 13 | return False 14 | for i in range(8, 12): 15 | if not string[i].isdecimal(): 16 | return False 17 | return True 18 | 19 | string = input("Enter a Sentence: ") 20 | 21 | for i in range(len(string)): 22 | split = string[i:i+12] 23 | if check_phone_number(split): 24 | print('Phone number has been found! : ' + split) -------------------------------------------------------------------------------- /Find-PhoneNumber-in-String/README.md: -------------------------------------------------------------------------------- 1 | # Find Phone Number in a string 2 | 3 | A python script that will extract phone numbers in a string 4 | 5 | ## Requirements 6 | Python 3.7.3 7 | 8 | ## Usage 9 | $ python Find-PhoneNumber-in-String.py 10 | Enter a Sentence: Call me in this number 403-867-2229 -------------------------------------------------------------------------------- /Flash-card-Challenge/french_food.txt: -------------------------------------------------------------------------------- 1 | la nourriture,food 2 | avoir faim,to be hungry 3 | manger,to eat 4 | le repas,meal 5 | le petit-déjeuner,breakfast 6 | le déjeuner,lunch 7 | le dîner,dinner 8 | le goûter,snack 9 | le hors d'Å“uvre,appetizer 10 | le plat principal,main course 11 | la salle à manger,dining room 12 | la confiture,jam 13 | le croissant,croissant 14 | la farine,flour 15 | les frites,French fries 16 | l'huile d'olive,olive oil 17 | la mayonnaise,mayonnaise 18 | la moutarde,mustard 19 | un Å“uf,egg 20 | le pain,bread 21 | le pain grillé,toast 22 | les pâtes,pasta 23 | le poivre,pepper 24 | le riz,rice 25 | le sel,salt 26 | le sucre,suga -------------------------------------------------------------------------------- /Flash-card-Challenge/metric.txt: -------------------------------------------------------------------------------- 1 | peta,quadrillion (10^15) 2 | tera,trillion (10^12) 3 | giga,billion (10^9) 4 | mega,million (10^6) 5 | kilo,thousand (10^3) 6 | hecto,hundred (10^2) 7 | deka,ten (10^1) 8 | deci,tenth (10^-1) 9 | centi,hundredth (10^-2) 10 | milli,thousandth (10^-3) 11 | micro,millionth (10^-6) 12 | nano,billionth (10^-9) 13 | pico,trillionth (10^-12) 14 | femto,quadrillionth (10^-15) -------------------------------------------------------------------------------- /Flash-card-Challenge/quizzer.py: -------------------------------------------------------------------------------- 1 | import random 2 | import argparse 3 | 4 | parser = argparse.ArgumentParser(description="Get the quiz questions file") 5 | parser.add_argument('file', help="a quiz file containing questions and answers") 6 | args = parser.parse_args() 7 | file = args.file 8 | 9 | state_capitals = {} 10 | with open(file) as f: 11 | for line in f: 12 | (key, val) = line.strip().split(',') 13 | state_capitals[key] = val 14 | 15 | while(True): 16 | choice = random.choice(list(state_capitals.keys())) 17 | answer = input(('{}? '.format(choice))) 18 | if answer == state_capitals[choice]: 19 | print("Correct! Nice job.") 20 | elif answer.lower() == "exit": 21 | print("Goodbye") 22 | break 23 | else: 24 | print("Incorrect. The correct answer is {}".format(state_capitals[choice])) -------------------------------------------------------------------------------- /Flash-card-Challenge/state_capitals.txt: -------------------------------------------------------------------------------- 1 | Alabama,Montgomery 2 | Alaska,Juneau 3 | Arizona,Phoenix 4 | Arkansas,Little Rock 5 | California,Sacramento 6 | Colorado,Denver 7 | Connecticut,Hartford 8 | Delaware,Dover 9 | Florida,Tallahassee 10 | Georgia,Atlanta 11 | Hawaii,Honolulu 12 | Idaho,Boise 13 | Illinois,Springfield 14 | Indiana,Indianapolis 15 | Iowa,Des Moines 16 | Kansas,Topeka 17 | Kentucky,Frankfort 18 | Louisiana,Baton Rouge 19 | Maine,Augusta 20 | Maryland,Annapolis 21 | Massachusetts,Boston 22 | Michigan,Lansing 23 | Minnesota,Saint Paul 24 | Mississippi,Jackson 25 | Missouri,Jefferson City 26 | Montana,Helena 27 | Nebraska,Lincoln 28 | Nevada,Carson City 29 | New Hampshire,Concord 30 | New Jersey,Trenton 31 | New Mexico,Santa Fe 32 | New York,Albany 33 | North Carolina,Raleigh 34 | North Dakota,Bismarck 35 | Ohio,Columbus 36 | Oklahoma,Oklahoma City 37 | Oregon,Salem 38 | Pennsylvania,Harrisburg 39 | Rhode Island,Providence 40 | South Carolina,Columbia 41 | South Dakota,Pierre 42 | Tennessee,Nashville 43 | Texas,Austin 44 | Utah,Salt Lake City 45 | Vermont,Montpelier 46 | Virginia,Richmond 47 | Washington,Olympia 48 | West Virginia,Charleston 49 | Wisconsin,Madison 50 | Wyoming,Cheyenne -------------------------------------------------------------------------------- /Folder Locker & Hider/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Folder Locker & Hider/app.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Folder Locker & Hider/icons/back.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/choose_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Folder Locker & Hider/icons/choose_folder.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Folder Locker & Hider/icons/lock.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Folder Locker & Hider/icons/unlock.png -------------------------------------------------------------------------------- /Folder_Manager/Exception.txt: -------------------------------------------------------------------------------- 1 | Example.txt 2 | example.exe 3 | -------------------------------------------------------------------------------- /FramedText/FramedText.py: -------------------------------------------------------------------------------- 1 | import os 2 | borderstyle = "║" 3 | 4 | def drawboxtext(dat): 5 | height = len(dat) 6 | y = 0 7 | while y < height: 8 | dat[y] = " "+dat[y]+" " 9 | y += 1 10 | width = len(max(dat, key=len))+1 11 | counter = 0 12 | x = 0 13 | line = "╔" 14 | while x < width-1: 15 | line = line + "═" 16 | x += 1 17 | line = line + "╗" 18 | print(line) 19 | while counter < height: 20 | reqspaces = width -1- len(dat[counter]) 21 | xsp = "" 22 | while reqspaces > 0: 23 | xsp = xsp + " " 24 | reqspaces -= 1 25 | print(borderstyle+dat[counter]+xsp+borderstyle) 26 | counter += 1 27 | x = 0 28 | line = "╚" 29 | while x < width-1: 30 | line = line + "═" 31 | x += 1 32 | line = line + "╝" 33 | print(line) 34 | 35 | 36 | print("Framed text generator by Julian Drake.\n") 37 | print("") 38 | while True: 39 | print("Enter the items in the frame. (Leave blank to submit.)") 40 | 41 | items=[] 42 | i=0 43 | while 1: 44 | i+=1 45 | item=input('Enter item %d: '%i) 46 | if item=="": 47 | break 48 | items.append(item) 49 | 50 | print("") 51 | drawboxtext(items) 52 | print("") 53 | input("") 54 | os.system('cls') 55 | 56 | -------------------------------------------------------------------------------- /FramedText/Readme.md: -------------------------------------------------------------------------------- 1 | This is a simple Python script that will generate text with a neat border made from ASCII pipe characters. 2 | Just run the script and input your lines of text, and it will print out the text with the border. 3 | Enjoy! :D 4 | -------------------------------------------------------------------------------- /Get_Time_TimezoneWise/README.md: -------------------------------------------------------------------------------- 1 | # How To Use: 2 | 3 | First Install pytz Library, If You Have Already Installed It Then You Are Good To Go :) 4 | 5 | Well For Those Who Haven't Installed It, Install It Using: 6 | ```python 7 | pip install pytz 8 | ``` 9 | 10 | Now Simply Run The Program To Fetch Time From All Timezones :) 11 | -------------------------------------------------------------------------------- /Get_Time_TimezoneWise/get_times.py: -------------------------------------------------------------------------------- 1 | # First Install Using The Command Below: 2 | # pip install pytz 3 | 4 | from datetime import datetime 5 | import pytz 6 | 7 | # list of desired countries 8 | Country_Zones = pytz.all_timezones # pytz.all_timezones will create a list with name of all timezones 9 | 10 | country_time_zones = [] 11 | 12 | for country_time_zone in Country_Zones: 13 | country_time_zones.append(pytz.timezone(country_time_zone)) 14 | 15 | for i in range(len(country_time_zones)): 16 | country_time = datetime.now(country_time_zones[i]) 17 | 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 18 | 19 | -------------------------------------------------------------------------------- /Get_Time_TimezoneWise/requirements.txt: -------------------------------------------------------------------------------- 1 | pytz 2 | -------------------------------------------------------------------------------- /Git_repo_creator/README.md: -------------------------------------------------------------------------------- 1 | # Github Repo Creator 2 | A simple python script which will take git username , git token, git repo name and description from user and it will create a github repo. 3 | 4 | ## How to create github token [https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token] 5 | 6 | ## Libraries Required 7 | 1. Requests: HTTP for Humans 8 | `$pip install requests` 9 | 10 | ## Usage 11 | 1. Go to the script's folder and open command prompt. 12 | 2. Run command : `$python3 git_repo_creator.py 13 | 14 | ## Example 15 | `$python3 git_repo_creator.py 16 | -------------------------------------------------------------------------------- /Git_repo_creator/git_repo_creator.py: -------------------------------------------------------------------------------- 1 | # Script Name : git_repo_creator.py 2 | # Author : Harish Tiwari 3 | # Created : 2nd October 2020 4 | # Last Modified : - 5 | # Version : 1.0.0 6 | 7 | # Modifications : 8 | 9 | # Description : This python script will create a github repo from command line. 10 | 11 | import requests 12 | import json 13 | 14 | user_name = input("Enter your github user name: ") 15 | print(user_name) 16 | 17 | github_token = input("Enter your github token: ") 18 | print(github_token) 19 | 20 | repo_name = input("Enter your repo Name: ") 21 | print(repo_name) 22 | 23 | repo_description = input("Enter your repo description: ") 24 | print(repo_description) 25 | 26 | payload = {'name': repo_name, 'description': repo_description, 'auto_init': 'true'} 27 | repo_request = requests.post('https://api.github.com/' + 'user/repos', auth=(user_name,github_token), data=json.dumps(payload)) 28 | if repo_request.status_code == 422: 29 | print("Github repo already exists try wih other name.") 30 | elif repo_request.status_code == 201: 31 | print("Github repo has created successfully.") 32 | elif repo_request.status_code == 401: 33 | print("You are unauthorized user for this action.") 34 | -------------------------------------------------------------------------------- /Github-Review-Bot/README.md: -------------------------------------------------------------------------------- 1 | # GitHub Pull Request Review Script 2 | 3 | This Python script allows you to automatically review all pull requests in a specified GitHub repository. 4 | 5 | ## Prerequisites 6 | 7 | Before you can use this script, ensure you have the following: 8 | 9 | - Python installed on your system. 10 | - The `selenium` Python package. You can install it using `pip`: 11 | 12 | ``` 13 | pip install selenium 14 | ``` 15 | 16 | - [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 17 | 18 | - A GitHub account with the necessary access rights to review pull requests in the target repository. 19 | 20 | ## Usage 21 | 22 | 1. Clone or download this repository to your local machine. 23 | 24 | 2. Open the script `github_pull_request_review.py` in a text editor or Python IDE. 25 | 26 | 3. Run the script by executing: 27 | 28 | ```bash 29 | python main.py 30 | ``` 31 | 4. Answer the prompt 32 | 33 | 5. The script will start add review comments. -------------------------------------------------------------------------------- /Github-Review-Bot/requirements.txt: -------------------------------------------------------------------------------- 1 | selenium -------------------------------------------------------------------------------- /Github_Bot/README.md: -------------------------------------------------------------------------------- 1 | # Github_Bot 2 | A CLI tool to get github user and repository details. 3 | 4 | ``` 5 | >python main.py -f user -l username 6 | >python main.py -f repo -l username reponame 7 | ``` 8 | 9 | ![](readme_assets/img.png) 10 | -------------------------------------------------------------------------------- /Github_Bot/readme_assets/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Github_Bot/readme_assets/img.png -------------------------------------------------------------------------------- /Github_Bot/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2023.7.22 2 | chardet==3.0.4 3 | idna==2.10 4 | requests==2.31.0 5 | urllib3==1.26.18 6 | -------------------------------------------------------------------------------- /HTML_Table_to_List/HTMLTableToList.py: -------------------------------------------------------------------------------- 1 | from bs4 import BeautifulSoup 2 | 3 | class HTMLTableToList(): 4 | 5 | def __init__(self, table_html): 6 | self.table_html = table_html 7 | 8 | def get_list(self): 9 | list_of_list = [] 10 | soup = BeautifulSoup(self.table_html,"lxml") 11 | table = soup.find('table') 12 | all_tr = table.findAll('tr') 13 | for tr in all_tr: 14 | current_row = [] 15 | all_th = tr.findAll('th') 16 | all_td = tr.findAll('td') 17 | for th in all_th: 18 | current_row.append(th.text) 19 | for td in all_td: 20 | current_row.append(td.text) 21 | list_of_list.append(current_row) 22 | return list_of_list -------------------------------------------------------------------------------- /HTML_Table_to_List/README.md: -------------------------------------------------------------------------------- 1 | # HTML Table to Python List of List Converter 2 | A simple tool which takes a HTML table as string, and converts it to python list of list data structure and returns the same. 3 | 4 | ## Libraries Required 5 | 1. Beautiful Soap 6 | `$pip install beautifulsoup4` 7 | 8 | ## Usage 9 | A sample script `html_table_to_list_usage.py` has been provided to show the usage of the HTMLTableToList. It takes a string of html table, and prints the corresponding list of list. 10 | -------------------------------------------------------------------------------- /HTML_Table_to_List/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/HTML_Table_to_List/__init__.py -------------------------------------------------------------------------------- /HTML_Table_to_List/requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | -------------------------------------------------------------------------------- /Handwriting_Recognizer/Handwriting_Recognizer_DNN_classifier.py: -------------------------------------------------------------------------------- 1 | #Importing Libraries 2 | import numpy as np 3 | import tensorflow as tf 4 | import tensorflow.contrib.learn as learn 5 | import tensorflow.contrib.metrics as metrics 6 | 7 | #Importing Dataset 8 | mnist = learn.datasets.load_dataset('mnist') 9 | 10 | #Training Datasets 11 | data = mnist.train.images 12 | labels = np.asarray(mnist.train.labels, dtype=np.int32) 13 | test_data = mnist.test.images 14 | test_labels = np.asarray(mnist.test.labels, dtype=np.int32) 15 | feature_columns = learn.infer_real_valued_columns_from_input(data) 16 | 17 | #Applying Classifiers 18 | classifier = learn.DNNClassifier(feature_columns=feature_columns, n_classes=10,hidden_units=[1024,512,256]) 19 | classifier.fit(data, labels, batch_size=100, steps=1000) 20 | 21 | #Evaluating the Results 22 | classifier.evaluate(test_data, test_labels) 23 | accuracy_score = classifier.evaluate(test_data, test_labels)["accuracy"] 24 | print('Accuracy: {0:f}'.format(accuracy_score)) -------------------------------------------------------------------------------- /Handwriting_Recognizer/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | tensorflow 3 | -------------------------------------------------------------------------------- /Harry-Potter-Cloak/README.md: -------------------------------------------------------------------------------- 1 | ## Harry Potter Cloak using OpenCV 2 | 3 | This is a fun python script to simulate a harry potter cloak using image masking with the help of opencv library. 4 | It also uses the numpy library for some mathematical calculations. 5 | 6 | Requirements: You will need Python installed on your system along with numpy and opencv library for this script to work properly. -------------------------------------------------------------------------------- /Harry-Potter-Cloak/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | opencv -------------------------------------------------------------------------------- /IMDBQuerier/ClassFilm.py: -------------------------------------------------------------------------------- 1 | """ 2 | Represents the film objects in the list. 3 | """ 4 | 5 | class Film(object): 6 | def __init__(self, f_name, f_year, f_rating, f_genres, 7 | f_runtime, f_storyline, f_type, f_img_source, f_link): 8 | self.name = f_name 9 | self.year = f_year 10 | self.rating = f_rating 11 | self.genres = f_genres 12 | self.runtime = f_runtime 13 | self.storyline = f_storyline 14 | self.type = f_type 15 | self.image_source = f_img_source 16 | self.imdb_link = f_link 17 | 18 | 19 | def print_film(self): 20 | print("Film, ", self.name) 21 | print("Year ", self.year) 22 | print('Rating', self.rating) 23 | print("Genres", self.genres) 24 | print('Runtime', self.runtime) 25 | print('Storyline', self.storyline) 26 | print('Type,', self.type) 27 | 28 | def get_genres_string(self): 29 | sep = ', ' 30 | return sep.join(self.genres) 31 | 32 | def get_image_html(self): 33 | return ' %s ' % (self.imdb_link, self.name, self.image_source) 34 | 35 | def get_title(self): 36 | return '

%s

' % (self.imdb_link, self.name) 37 | 38 | 39 | def get_rating(self): 40 | return ' %s ' % str((self.rating / 10)) 41 | -------------------------------------------------------------------------------- /IMDBQuerier/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/IMDBQuerier/chromedriver.exe -------------------------------------------------------------------------------- /IMDBQuerier/css/list_style.css: -------------------------------------------------------------------------------- 1 | li { 2 | list-style-type: none; 3 | text-align: center; 4 | max-width: 50%; 5 | background-color: #EEEEEE; 6 | } 7 | 8 | span.rating { 9 | color: #D9AA00; 10 | } 11 | 12 | 13 | span.list_title{ 14 | font-weight: bold; 15 | } 16 | -------------------------------------------------------------------------------- /IMDBQuerier/requirements.txt: -------------------------------------------------------------------------------- 1 | bs4 2 | selenium 3 | regex -------------------------------------------------------------------------------- /Image-Circulator/README.md: -------------------------------------------------------------------------------- 1 | # Image Circulator 2 | Tiny Python3 script to make your images circular. 3 | 4 | ## Dependencies 5 | It requires `python3` and `pillow`. 6 | To install `pillow`, you need `pip3` or python3. 7 | 8 | ## Usage 9 | To run, from the command line type: 10 | 11 | `python3 image_circulator.py -i INPUT_FILE_PATH -o OUTPUT_FILE_PATH -d DIAMETER_IN_PIXELS` 12 | 13 | Or make the script executable. 14 | -------------------------------------------------------------------------------- /Image-Circulator/image_circulator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from PIL import Image, ImageOps, ImageDraw 4 | from argparse import ArgumentParser 5 | 6 | 7 | parser = ArgumentParser() 8 | inputfile = parser.add_argument('-i', '--inputfile', help='input file path') 9 | outputfile = parser.add_argument('-o', '--outputfile', help='output file path') 10 | diameter = parser.add_argument('-d', '--diameter', help='output file diameter') 11 | 12 | args = parser.parse_args() 13 | 14 | 15 | print('Input file is '+ str(args.inputfile)) 16 | print('Output file is '+ str(args.outputfile)) 17 | print('Image diameter will be '+ str(args.diameter)) 18 | 19 | im = Image.open(args.inputfile) 20 | 21 | width, height = im.size 22 | 23 | left = (width - int(args.diameter))/2 24 | top = (height - int(args.diameter))/2 25 | right = (width + int(args.diameter))/2 26 | bottom = (height + int(args.diameter))/2 27 | 28 | im = im.crop((left, top, right, bottom)); 29 | 30 | bigsize = (im.size[0] * 3, im.size[1] * 3) 31 | mask = Image.new('L', bigsize, 0) 32 | draw = ImageDraw.Draw(mask) 33 | draw.ellipse((0, 0) + bigsize, fill=255) 34 | mask = mask.resize(im.size, Image.ANTIALIAS) 35 | im.putalpha(mask) 36 | 37 | output = ImageOps.fit(im, mask.size, centering=(0.5, 0.5)) 38 | output.putalpha(mask) 39 | output.save(args.outputfile) 40 | 41 | print('Done!') 42 | -------------------------------------------------------------------------------- /Image-Circulator/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow 2 | -------------------------------------------------------------------------------- /Image_Compressor/Image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Image_Compressor/Image.jpg -------------------------------------------------------------------------------- /Image_Compressor/Image_Compressor.py: -------------------------------------------------------------------------------- 1 | import PIL 2 | from PIL import Image 3 | from tkinter.filedialog import * 4 | 5 | file_paths = askopenfilenames() 6 | 7 | if len(file_paths) == 0: 8 | print("No Files Selected") 9 | 10 | for file in file_paths: 11 | file_name = file.split('/')[-1] 12 | file_name, extension = file_name.split('.') 13 | 14 | img = PIL.Image.open(file) 15 | height,width = img.size 16 | img=img.resize((height,width),Image.Resampling.LANCZOS) 17 | 18 | save_path=askdirectory() 19 | img.save(save_path+f"/{file_name}_compressed.{extension}") -------------------------------------------------------------------------------- /Image_Compressor/README.md: -------------------------------------------------------------------------------- 1 | # Image_Compressor 2 | 3 | This script compresses the image choosen to much reduced size. Image can be of any format. 4 | Note : The image should be in same folder as the script 5 | It will return with the compressed image when you compile. 6 | It automates the task of compressing the image in day to day lives. 7 | 8 | # Dependencies: 9 | 10 | Note : Use python3.11 for tkinder 11 | 12 | `pip install pillow` 13 | 14 | -------------------------------------------------------------------------------- /ImportanceChecker/ImportanceChecker.py: -------------------------------------------------------------------------------- 1 | try: 2 | from googlesearch import search 3 | except ImportError: 4 | print("No module named 'google' found.") 5 | 6 | 7 | def ImportanceChecker(query, stoplevel=10, pauselevel=1): 8 | """ 9 | Checks 'importance' by analyzing google search results for a person/topic and 10 | finding if they have a wikipedia page among the top results. Number of search 11 | results required is automatically set to 10. 12 | """ 13 | 14 | #urlgenerator runs relatively slowly to prevent google from blocking user IP 15 | urlgenerator = search(query, stop=stoplevel, pause=pauselevel) 16 | for _ in range(stoplevel): 17 | url = next(urlgenerator) 18 | if 'wikipedia' in url: 19 | return True 20 | return False 21 | 22 | 23 | def main(): 24 | print("Who do you want to be searched? ", end="") 25 | 26 | query = input() 27 | 28 | important = ImportanceChecker(query) 29 | 30 | if (important): 31 | print(f"{query} is important!") 32 | else: 33 | print(f"{query} isn't that important.") 34 | 35 | if __name__ == "__main__": 36 | main() -------------------------------------------------------------------------------- /ImportanceChecker/README.md: -------------------------------------------------------------------------------- 1 | #Importance Checker 2 | 3 | A simple program to check for a person or topic's "importance" by checking whether the search value's possible Wikipedia page appears in the top *x* Google search results, where *x* is set to 10 by default. 4 | 5 | ##Instructions 6 | 7 | Type these commands in the terminal: 8 | 9 | `pip install beautifulsoup` 10 | 11 | `pip install google` 12 | 13 | 14 | Now type: 15 | 16 | `ImportanceChecker.py` 17 | 18 | The program will run, and test a user-inputted value if in *main*. Use `import ImportanceChecker` to use it in your python project. 19 | 20 | 21 | ###Notes: 22 | * *ImportanceChecker* runs relatively slow to help prevent Google from blocking the user's IP address. One can modify the time delay in between requests to speed the function up by changing the third parameter to something other than its default, *1*. -------------------------------------------------------------------------------- /ImportanceChecker/requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | google -------------------------------------------------------------------------------- /InstadpShower/README.md: -------------------------------------------------------------------------------- 1 | # InstadpShower 2 | 3 | This is a simple python script which uses web scraping techniques to display the instagram dp of any user just by typing its username. 4 | 5 | To use this script, you need to have bs4 and requests libraries of python installed in your local machine. 6 | 7 | To install bs4 and requests, use the following command 8 | 9 | ``` 10 | pip install beautifulsoup4 11 | ``` 12 | ``` 13 | pip install requests 14 | ``` 15 | 16 | Once libraries are installed, just run the script and type the instagram username of the person, whom you want to see the dp of, and the instagram dp will be displayed on the browser. 17 | -------------------------------------------------------------------------------- /InstadpShower/dppage.py: -------------------------------------------------------------------------------- 1 | import webbrowser as wb 2 | import requests 3 | import re 4 | import json 5 | 6 | 7 | username=input("Enter the username : ") 8 | 9 | try: 10 | content = requests.get("https://www.instagram.com/"+username).content 11 | find=re.findall(r"logging_page_id.*show_suggested_profiles",str(content)) 12 | user_id=((find[0][16:]).split(","))[0][14:-1] # We get the user id of the username 13 | jsonreq=requests.get("https://i.instagram.com/api/v1/users/"+user_id+"/info/").content # using a link we get the whole info of the person 14 | jsonloaded=json.loads(jsonreq) 15 | imgurl=jsonloaded["user"]["hd_profile_pic_url_info"]["url"] 16 | wb.open_new_tab(imgurl) 17 | except: 18 | print("No such username exists") 19 | -------------------------------------------------------------------------------- /InstadpShower/requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | requests 3 | -------------------------------------------------------------------------------- /Keylogger/README.md: -------------------------------------------------------------------------------- 1 | # Keylogger 2 | A script written in Python that logs your input from the keyboard. 3 | 4 | 5 | ### Steps to run this on terminal 6 | 7 | - Clone the project. 8 | - Install the dependencies listed in requirements.txt. 9 | - Run `python keylogger.py` in your terminal. 10 | 11 | 12 | ### PS 13 | 14 | - You can use Delete key to exit the script. 15 | - You can open log.txt to view your log. 16 | 17 | 18 | ### Author 19 | 20 | **[Preet Mishra](https://www.github.com/preetmishra)** -------------------------------------------------------------------------------- /Keylogger/requirements.txt: -------------------------------------------------------------------------------- 1 | astroid==2.1.0 2 | autopep8==1.4.3 3 | certifi==2023.7.22 4 | colorama==0.4.1 5 | isort==4.3.4 6 | lazy-object-proxy==1.3.1 7 | mccabe==0.6.1 8 | pycodestyle==2.4.0 9 | pylint==2.2.2 10 | pynput==1.4.4 11 | six==1.12.0 12 | wincertstore==0.2 13 | wrapt==1.10.11 14 | -------------------------------------------------------------------------------- /Keylogger/script.py: -------------------------------------------------------------------------------- 1 | import pynput 2 | from pynput.keyboard import Key, Listener 3 | 4 | 5 | keys = [] 6 | 7 | 8 | def on_press(key): 9 | keys.append(key) 10 | write_file(keys) 11 | 12 | 13 | def write_file(keys): 14 | with open('log.txt', 'w') as f: 15 | for key in keys: 16 | #removing '' 17 | k = str(key).replace("'", "") 18 | f.write(k) 19 | #explicitly adding a space after every keystroke for readability 20 | f.write(' ') 21 | 22 | 23 | def on_release(key): 24 | if key == Key.delete: 25 | return False 26 | 27 | 28 | with Listener(on_press = on_press, on_release = on_release) as listener: 29 | listener.join() -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [2019] [Ayush Bhardwaj] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Location_Of_Adress/locator.py: -------------------------------------------------------------------------------- 1 | import geocoder 2 | t=input("enter the location:") 3 | g = geocoder.arcgis(t) 4 | print(g.latlng) 5 | 6 | -------------------------------------------------------------------------------- /Location_Of_Adress/requirements.txt: -------------------------------------------------------------------------------- 1 | geocoder 2 | -------------------------------------------------------------------------------- /Location_Of_Own_IP_Adress/location_using_own_ip_address.py: -------------------------------------------------------------------------------- 1 | import geocoder 2 | g = geocoder.ipinfo('me') 3 | print(g.latlng) 4 | -------------------------------------------------------------------------------- /Location_Of_Own_IP_Adress/requirements.txt: -------------------------------------------------------------------------------- 1 | geocoder 2 | -------------------------------------------------------------------------------- /Minecraft_server_in_background/README.md: -------------------------------------------------------------------------------- 1 | # Running a Minecraft server in the background 2 | 3 | This program runs a script (which can be specified) in a subprocess with redirected output 4 | (new output location can be specified) and periodically checks a file for a keyword (both 5 | the name of the file to check and the keyword to check for can be specified) 6 | and exits (stopping the subprocess via sending a command), if the contents of the file 7 | include the keyword. 8 | 9 | You probably want to run this script in background, e.g. calling it via './run.py &' 10 | or via 'nohup ./run.py &'. 11 | 12 | A sample invocation could look like this: 13 | 14 | ```bash 15 | nohup ./run.py & 16 | ``` 17 | Now the specified script, e.g. a Minecraft server, is running in the background. 18 | 19 | ```bash 20 | echo stop > command.txt 21 | ``` 22 | After a short delay, the script in the background will be stopped. 23 | -------------------------------------------------------------------------------- /Minecraft_server_in_background/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess 4 | import time 5 | 6 | filename_script = './start.sh' # the script that will be executed 7 | filename_script_output = './log.txt' 8 | filename_own_input = 'command.txt' # the file this script periodically reads from 9 | stop_command = b'stop\n' # must be a binary string 10 | exit_keyword = 'stop' 11 | 12 | with open(filename_own_input, 'w') as f: 13 | f.write('') # reset content of file and create it if needed 14 | 15 | fd_script_output = open(filename_script_output, 'w') # create file descriptor for script to write its stdout to 16 | script_process = subprocess.Popen( # start new process running script 17 | filename_script, 18 | stdin=subprocess.PIPE, # needed for script_process.communicate() (see below) 19 | stdout=fd_script_output # redirect output 20 | ) 21 | 22 | while True: 23 | with open(filename_own_input, 'r') as f: 24 | if exit_keyword in f.read(): # check if we should exit 25 | script_process.communicate(input=stop_command) # stop subprocess and wait for it to terminate 26 | break 27 | time.sleep(1) 28 | 29 | fd_script_output.close() 30 | -------------------------------------------------------------------------------- /Minecraft_server_in_background/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | java -Xmx2048M -Xms2048M -jar server.jar -nogui 4 | -------------------------------------------------------------------------------- /PDF2text/README.md: -------------------------------------------------------------------------------- 1 | # Description: PDF2text 2 | this is a small script to make a extract text from pdf file. 3 | 4 | ### Dependencies: 5 | 1- [pdftotext](https://pypi.org/project/pdftotext/) 6 | 7 | ## Usage 8 | Run ```python script.py``` then enter path of pdf file. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /PDF2text/requirements.txt: -------------------------------------------------------------------------------- 1 | pdftotext 2 | -------------------------------------------------------------------------------- /PDF2text/script.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pdftotext 3 | 4 | 5 | pdf_path = input("Enter the path of the pdf file : ") 6 | 7 | assert os.path.exists(pdf_path), "this pdf file doesn't exist" 8 | 9 | with open(pdf_path, 'rb') as f_r: 10 | pdf_pages = pdftotext.PDF(f_r) 11 | 12 | for i, page in enumerate(pdf_pages): 13 | print('Page {}'.format(i)) 14 | print(page) 15 | print('*'*100) 16 | -------------------------------------------------------------------------------- /PDFsplitter/README.md: -------------------------------------------------------------------------------- 1 | ## PDFsplitter 2 | 3 | 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. 4 | 5 | ### Usage 6 | 7 | 1. Make sure you have Python 3.x installed on your system. 8 | 9 | 2. Install the required PyPDF2 library using pip: 10 | ```pip install PyPDF2``` 11 | 12 | 3. Run the script with the following command: 13 | 14 | `python PDFsplitter.py input_pdf output_folder` 15 | - `input_pdf`: The path to the input PDF file that you want to split. 16 | - `output_folder`: The folder where the split PDF pages will be saved. 17 | 18 | ### Example 19 | 20 | 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: 21 | 22 | python PDFsplitter.py input.pdf output_pages -------------------------------------------------------------------------------- /PDFsplitter/requirements.txt: -------------------------------------------------------------------------------- 1 | PyPDF2==3.0.1 2 | -------------------------------------------------------------------------------- /PX-to-REM/README.md: -------------------------------------------------------------------------------- 1 | # PX-to-REM Script 2 | 3 | This script can convert **PX to REM** and **REM to PX** 4 | 5 | ## Usage call python script then select your interest **PX to REM** or **REM to PX** to convert 6 | 7 | ``` bash 8 | $ python px_to_rem.py 9 | ``` 10 | -------------------------------------------------------------------------------- /PX-to-REM/converter.py: -------------------------------------------------------------------------------- 1 | class Converter: 2 | base_px = 16 3 | 4 | def __init__(self): 5 | self.data = [] 6 | 7 | def px_to_rem(self, px): 8 | return float(px) / self.base_px 9 | 10 | def rem_to_px(self, rem): 11 | return float(rem) * self.base_px 12 | -------------------------------------------------------------------------------- /PdfToAudio/README.md: -------------------------------------------------------------------------------- 1 | # Pdf to Audiobook Converter 2 | This python script generates audio for given pdf files. 3 | 4 | ## Dependencies / Requirements 5 | - PyPDF2. Install it by typing this command in your terminal `pip install PyPDF2` 6 | - pyttsx3. Install it by `pip install pyttsx3` 7 | -------------------------------------------------------------------------------- /PdfToAudio/pdf_to_audiobook.py: -------------------------------------------------------------------------------- 1 | # Importing the required packages. 2 | import PyPDF2 3 | import pyttsx3 4 | 5 | text = None 6 | 7 | # Reading a PDF file from your computer by specifying the path and setting the read mode to binary. 8 | pdf_reader = PyPDF2.PdfFileReader(open(r"D:\MyPdf.pdf", "rb")) 9 | 10 | # Getting the handle to speaker i.e. creating a reference to pyttsx3.Engine instance. 11 | speaker = pyttsx3.init() 12 | 13 | # Splitting the PDF file into pages and reading one at a time. 14 | for page_number in range(pdf_reader.numPages): 15 | text = pdf_reader.getPage(page_number).extractText() 16 | # Generating speech. 17 | speaker.say(text) 18 | speaker.runAndWait() 19 | 20 | # Stopping the speaker after the complete audio has been created. 21 | speaker.stop() 22 | 23 | # Saving the audiobook to your computer. 24 | engine = pyttsx3.init() 25 | engine.save_to_file(text, r"D:\MyAudio.mp3") 26 | engine.runAndWait() 27 | -------------------------------------------------------------------------------- /PdfToAudio/requirements.txt.txt: -------------------------------------------------------------------------------- 1 | PyPDF2 2 | pyttsx3 -------------------------------------------------------------------------------- /Ping_Server/README.md: -------------------------------------------------------------------------------- 1 | # Ping_server 2 | /P>this is a pyhton script to ping your servers automatically and alert you with telegram messages or telephone call when you server are down or you can manipulate this logig based on diffrent http return status


3 |

you need to liitle configeration in telegram and twillio make it work

4 | -------------------------------------------------------------------------------- /Ping_Server/requirements.txt: -------------------------------------------------------------------------------- 1 | Telethon 2 | twilio 3 | requests 4 | -------------------------------------------------------------------------------- /Plagiarism_detector/README.md: -------------------------------------------------------------------------------- 1 | # Plagiarism Detector 2 | This script helps to detect the amount (percentage) of similarity between 2 files . 3 | 4 | ## Input 5 | It takes paths of 2 files you want to compare as input 6 | 7 | ## Output 8 | It returns the percentage of similarity between the 2 files -------------------------------------------------------------------------------- /Plagiarism_detector/plagiarism.py: -------------------------------------------------------------------------------- 1 | from difflib import SequenceMatcher 2 | 3 | def similarity_per(f1,f2): 4 | with open(f1,errors="ignore") as file1,open(f2,errors="ignore") as file2: 5 | file1_data=file1.read() 6 | file2_data=file2.read() 7 | similarity=SequenceMatcher(None,file1_data,file2_data).ratio() 8 | print(f"these 2 files are {similarity*100} % similar") 9 | 10 | if __name__ == '__main__': 11 | f1=input("file 1 path :") 12 | f2=input("file 2 path :") 13 | similarity_per(f1,f2) 14 | -------------------------------------------------------------------------------- /Port_Scanner/README.md: -------------------------------------------------------------------------------- 1 | # Port Scanner 2 | A simple tool that asynchronously scans a server's ports with python. It's pretty quick as it processes ports in batches of 256. 3 | 4 | ## Required libraries 5 | None, the only libraries that are used are built-ins. 6 | 7 | ## Usage 8 | Use "port_scanner.py", and enter the IP that you want to scan when prompted. 9 | -------------------------------------------------------------------------------- /Port_Scanner/port_scanner.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from random import SystemRandom 3 | 4 | def run(tasks, *, loop=None): 5 | """Run Asynchronous Tasks""" 6 | if loop is None: 7 | loop = asyncio.get_event_loop() 8 | # waiting for all tasks 9 | return loop.run_until_complete(asyncio.wait(tasks)) 10 | 11 | async def scanner(ip, port, loop=None): 12 | fut = asyncio.open_connection(ip, port, loop=loop) 13 | 14 | try: 15 | reader, writer = await asyncio.wait_for(fut, timeout=0.5) # This is where it is blocking? 16 | print("{}:{} Connected".format(ip, port)) 17 | except asyncio.TimeoutError: 18 | pass 19 | # handle connection refused and bunch of others 20 | except Exception as exc: 21 | print('Error {}:{} {}'.format(ip, port, exc)) 22 | 23 | def scan(ips, ports, randomize=False): 24 | """Scan the ports""" 25 | loop = asyncio.get_event_loop() 26 | if randomize: 27 | rdev = SystemRandom() 28 | ips = rdev.shuffle(ips) 29 | ports = rdev.shuffle(ports) 30 | 31 | # let's pass list of task, not only one 32 | run([scanner(ip, port) for port in ports for ip in ips]) 33 | 34 | 35 | ips = [input("IP to scan: ")] 36 | STEP = 256 37 | for r in range(STEP+1, 65536, STEP): 38 | # print(r) 39 | ports = [str(r) for r in list(range(r-STEP, r))] 40 | scan(ips, ports) -------------------------------------------------------------------------------- /Pressure_Converter/README.md: -------------------------------------------------------------------------------- 1 | # Developed and maintained by [Osagie Iyayi](https://github.com/E-wave112) 2 | 3 | - This simple program converts between different common units of pressure such as 4 | Pascal(Pa),Bar(bar),Millimeter Mercury(mmHg) and atmosphere(atm). 5 | the test cases are based on the fact that the value of pressure 6 | on it's own can never be negative,except in cases where it is relative to another kind of pressure. 7 | 8 | - Run the doctest via the command 9 | 10 | ``` 11 | $ python -m doctest -v Pressure_Converter/pressure_converter_script.py 12 | ``` -------------------------------------------------------------------------------- /Pressure_Converter/requirements.txt: -------------------------------------------------------------------------------- 1 | doctest -------------------------------------------------------------------------------- /Pretty-CSV/README.md: -------------------------------------------------------------------------------- 1 | # Pretty CSV 2 | 3 | This script pretty-prints CSV input into a table output for easier readibility. The script reads from stdin and writes into stdout for pipe compatibility. 4 | 5 | ## Examples 6 | Read from local file 7 | ```sh 8 | python3 pretty-csv.py < csv-file.csv 9 | ``` 10 | 11 | Read from `curl` 12 | ```sh 13 | curl -fsSL https://people.sc.fsu.edu/~jburkardt/data/csv/cities.csv | python3 pretty-csv.py 14 | ``` 15 | 16 | Pipe to `less` for better navigation 17 | ```sh 18 | python3 pretty-csv.py < long-csv-file.csv | less -S 19 | ``` 20 | -------------------------------------------------------------------------------- /Pretty-CSV/pretty-csv.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import csv 3 | import sys 4 | from typing import Iterable, List 5 | 6 | 7 | def main(): 8 | content_lines = sys.stdin.buffer.readlines() 9 | reader = csv.reader(line.decode('utf-8') for line in content_lines) 10 | headers = next(reader) 11 | print(create_table(reader, headers)) 12 | 13 | 14 | def create_table(rows: Iterable[List[str]], headers: List[str]) -> str: 15 | table = [headers] 16 | column_lengths = [len(header) for header in headers] 17 | for row in rows: 18 | for i, text in enumerate(row): 19 | column_length = column_lengths[i] 20 | text_length = len(text) 21 | if text_length > column_length: 22 | column_lengths[i] = text_length 23 | table.append(list(row)) 24 | 25 | result = [] 26 | for row in table: 27 | row_text = [] 28 | for i, text in enumerate(row): 29 | column_length = column_lengths[i] 30 | row_text.append(space_pad(text, column_length)) 31 | result.append(' '.join(row_text)) 32 | return '\n'.join(result) 33 | 34 | 35 | def space_pad(text: str, length: int) -> str: 36 | temp = text + ''.join(' ' for _ in range(length)) 37 | return temp[:length] 38 | 39 | 40 | if __name__ == '__main__': 41 | main() 42 | -------------------------------------------------------------------------------- /Proxy-Request/README.md: -------------------------------------------------------------------------------- 1 | # Web proxy request application using Python 2 | 3 | 4 | A quick, reliable and random Web Proxy request application using Python. 5 | 6 | ## 3rd party libraries used 7 | 8 | - requests 9 | 10 | - bs4 11 | 12 | ## Usage 13 | 14 | ``` 15 | from proxy_request import proxy_request 16 | 17 | r = proxy_request('get', "https://httpbin.org/ip") 18 | 19 | print(r.json()) 20 | ``` -------------------------------------------------------------------------------- /Proxy-Request/proxy_request.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | from random import choice 4 | 5 | 6 | def get_proxy(): 7 | url = "https://www.sslproxies.org/" 8 | r = requests.get(url) 9 | soup = BeautifulSoup(r.content, 'html5lib') 10 | return {'https': choice(list(map(lambda x:x[0]+':'+x[1], list(zip(map(lambda x:x.text, soup.findAll('td')[::8]), 11 | map(lambda x:x.text, soup.findAll('td')[1::8]))))))} 12 | 13 | def proxy_request(request_type, url, **kwargs): 14 | while 1: 15 | try: 16 | proxy = get_proxy() 17 | print(f"Using proxy {proxy['https']}") 18 | response = requests.request(request_type, url, proxies=proxy, timeout=5, **kwargs) 19 | break 20 | except Exception as e: 21 | print(e) 22 | return response 23 | 24 | 25 | if __name__ == "__main__": 26 | r = proxy_request('get', "https://www.youtube.com/IndianPythonista") -------------------------------------------------------------------------------- /Proxy-Request/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | beautifulsoup4 3 | -------------------------------------------------------------------------------- /PyRecorder/README.md: -------------------------------------------------------------------------------- 1 | # PyRecorder 2 | 3 | ## Record Preview 4 | 5 | ![image](https://github.com/jainrocky/screen_recorder/blob/master/record_preview.PNG) 6 | 7 | ## Stop Preview 8 | 9 | ![image](https://github.com/jainrocky/screen_recorder/blob/master/stop_preview.PNG) 10 | 11 | * [Download](https://github.com/jainrocky/screen_recorder/blob/master/dist/PyRecorder.exe) Executable File 12 | -------------------------------------------------------------------------------- /PyRecorder/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy==1.22.0 2 | opencv-python==4.1.1.26 3 | Pillow==10.2.0 4 | -------------------------------------------------------------------------------- /Py_Cleaner/README.md: -------------------------------------------------------------------------------- 1 | # PY-CLEAN 2 | 3 | Tool to organize Directories 4 | 5 | 6 | ### Installations and Dependencies 7 | 8 | -> [Python](https://python.org) Installed 9 | 10 | ### How to execute the file: 11 | 12 | 1. Windows Users: Open CMD/ Powershell -> Navigate to the Cloned Directory and then Type In: 13 | 14 | ```python 15 | python main.py 16 | ``` 17 | 18 | 2. OSX/ Linux: Open Terminal -> Navigate to the Cloned Directory and then Type In: 19 | 20 | ```python 21 | python3 main.py 22 | ``` 23 | 24 | ### Note 25 | 26 | -> Kindly do not modify any file (unless you know what you are doing). 27 | -------------------------------------------------------------------------------- /Py_Cleaner/Screenshot 2020-06-24 at 12.27.00 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Py_Cleaner/Screenshot 2020-06-24 at 12.27.00 PM.png -------------------------------------------------------------------------------- /Py_Cleaner/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Py_Cleaner/bg.gif -------------------------------------------------------------------------------- /Py_Cleaner/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Py_Cleaner/folder.png -------------------------------------------------------------------------------- /RSA-key-pairs/README.md: -------------------------------------------------------------------------------- 1 | # Python RSA Key Pair Generator 2 | This python script will generate a private and public key pair using the RSA algorithm 3 | 4 | ## Modules used 5 | 6 | Math 7 | ``` 8 | import math 9 | ``` 10 | 11 | Random 12 | ``` 13 | import random 14 | ``` 15 | 16 | #Usage 17 | You can use the public and private key to encrypt and decrypt information 18 | Run the python file and get key pairs or edit the code and define your custom bounds in the random limits 19 | ``` 20 | random.randint(start,end) 21 | ``` 22 | -------------------------------------------------------------------------------- /RSA-key-pairs/key-pair-generator.py: -------------------------------------------------------------------------------- 1 | #a simple RSA public key and private key pair generator 2 | #using gcd from math module for coprimes 3 | #and random for random numbers 4 | import math 5 | import random 6 | p = random.randint(1,100) 7 | q = random.randint(100,200) 8 | if (math.gcd(p,q) == 1): 9 | n = p * q 10 | phi = (p-1)*(q-1) 11 | k = 0 12 | e = random.randint(1,20000) 13 | if (math.gcd(phi,e)==1): 14 | for i in range(1,20000): 15 | d = (((phi * i) + 1)/e) 16 | if d.is_integer(): 17 | k = d 18 | break 19 | print('Public key is: (',e,',',n,')') 20 | print('Private key is: (',int(k),',',n,')') 21 | -------------------------------------------------------------------------------- /RSA-key-pairs/requirements.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RSA_Algorithm/README.md: -------------------------------------------------------------------------------- 1 | # RSA Algorithm 2 | * Python script that encrypts and decrypts a text based on [RSA algorithm](https://people.csail.mit.edu/rivest/Rsapaper.pdf) 3 | * It involves the concept of modular arithmatic and euler's theorem. 4 | * It is also based on the idea that factorizing large numbers requires years. 5 | * Here, the (a,n) are kept public and (p,q,b) are kept private. 6 | 7 | ![](https://github.com/Chinmayrane16/Awesome-Python-Scripts/blob/master/RSA_Algorithm/RSA_Algorithm.png) 8 | 9 | ## Usage 10 | For Windows users: 11 | 12 | ```bash 13 | $ python RSA_Algorithm.py 14 | ``` 15 | 16 | For Mac/Linux/Unix users: 17 | 18 | ```bash 19 | $ ./RSA_Algorithm.py 20 | ``` 21 | 22 | ## References 23 | [Blog](https://www.di-mgt.com.au/rsa_alg.html)
24 | [Paper](https://people.csail.mit.edu/rivest/Rsapaper.pdf)
25 | [Video](https://www.youtube.com/watch?v=wXB-V_Keiu8) 26 | -------------------------------------------------------------------------------- /RSA_Algorithm/RSA_Algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/RSA_Algorithm/RSA_Algorithm.png -------------------------------------------------------------------------------- /RSA_Communication/README.md: -------------------------------------------------------------------------------- 1 | # RSA Communication Script 2 | 3 | ## How to use 4 | To use this script you may first open the script :p 5 | It will take some time, it will generate two BIG prime numbers, and that takes some time. 6 | 7 | After it finnishes calculating your keypair, it will print it and ask you if you want to encrypt or decrypt a message. 8 | 9 | --- 10 | 11 | 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 12 | (the string that shows up at his/her script start). 13 | After you paste the keypair you will write your message, and when you press enter the encrypted message will be printed. 14 | 15 | --- 16 | 17 | 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. 18 | After you press enter the decrypted message will be displayed :) 19 | -------------------------------------------------------------------------------- /Random_Email_Generator/README.md: -------------------------------------------------------------------------------- 1 | # Programs 2 | ## [Random_Email_Generator.py](./Random_email_generator.py) 3 | This program randomly generates an email address using a mix of letters, both caps on and off, numbers, and punctuation, then outputs the results. 4 | 5 | 6 | # Requirements 7 | * [Random_Email_Generator.py](./Random_email_generator.py) can use Python 3 and higher or Python 2 and higher. 8 | Moreover, you might also have to install progressbar library in your system. 9 | ```bash 10 | $ pip install progressbar 11 | ``` 12 | 13 | # Usage 14 | 15 | For Windows users: 16 | 17 | ```bash 18 | $ python Random_email_generator.py 19 | ``` 20 | 21 | For Mac/Linux/Unix users: 22 | 23 | ```bash 24 | $ ./Random_email_generator.py 25 | ``` 26 | -------------------------------------------------------------------------------- /Random_Names_Generator/README.md: -------------------------------------------------------------------------------- 1 | # Random Names Generator 2 | 3 | ## A simple python script to generate some random names. 4 | 5 | ### There are two csv files for 'First Name' and 'Last Name' in text 'CSV_Database_Of_First_And_Last_Names' taken from [here](http://www.quietaffiliate.com/free-first-name-and-last-name-databases-csv-and-sql/) 6 | 7 | # Usage 8 | ### Step 1 9 | Fork this Repo and Clone it to your local machine. 10 | ```sh 11 | $ git clone https://github.com/YOUR_USERNAME/Random_Names_Generator.git 12 | $ cd Random_Names_Generator 13 | ``` 14 | ### Step 2 15 | To run the python3 program 16 | ```sh 17 | $ python3 Random_Name_Generator.py 18 | ``` 19 | The above only returns only one name. 20 | 21 | 22 | Add number of names if more than one name is required. 23 | ```sh 24 | $ python3 Random_Name_Generator.py 5 25 | ``` 26 | --- 27 | Tip:- 28 | In Linux Machines you can save the files as text using output redirection 29 | ```sh 30 | $ python3 Random_Name_Generator.py 10 >> Random_Names_Generator.txt 31 | ``` 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Random_Password_Generator/Passwords.txt: -------------------------------------------------------------------------------- 1 | AaGhi>]!Tkz0{ik0S)mUk7wuVdpSIkc:8V{q)e_*N 3 | !+B.C;YJ4+;/_$g>]FK/^vD]X 4 | I[dgz&|>uoh(K:-i;xgE:F!!C 5 | $Ab\ag_?lD57,L]Gf3(]j04aw 6 | nCC&RS7K]]GK(%pDHr,>fyv?[ 7 | |VT3$kK5AGir))o9A6+ApR`%X 8 | :T<0],Kzm] 12 | XVp,+V.ko[c/-C3M22*+p@J3> 13 | zTR_S+lDuRn|MwGIVGFwu]pgH 14 | ]p_8k1Z03$8]aJL@o^kY$#(Ez 15 | MGe:td4Ql~cZY&G.]u$IK){(p 16 | /&1>(jI|SEdg*L6$Zz,NfetZp 17 | 1dN6clgIgi-EfIYB@cn>#^mix 18 | )cci)3*:0l$lNZ*Upi3ME?-C] 19 | XC$#Rc*B+/Jr 21 | -------------------------------------------------------------------------------- /Random_Password_Generator/README.md: -------------------------------------------------------------------------------- 1 | # Programs 2 | ## [PasswordGenerator.py](./PasswordGenerator.py) 3 | This program randomly generates a secure password using a mix of letters, both caps on and off, numbers, and punctuation, then outputs the results and saves them as a text document. 4 | 5 | ## [createPassword.py](./createPassword.py) 6 | This program uses the Python 3 module `secrets` to create a pseudo random password with alphanumeric, numbers, and special characters. The output will be printed into the terminal. 7 | 8 | # Requirements 9 | * [PasswordGenerator.py](./PasswordGenerator.py) can use Python 3 and higher or Python 2 and higher 10 | * [createPassword.py](./createPassword.py) can run on python 3.6 or higher or for Python 2 do: 11 | * `cd Random_Password_Generator/` to change directory into this folder. 12 | * Create virtual environment with `virtualvenv env` 13 | * do `source venv/bin/activate` to activate virtual environment. 14 | * do `pip install -r requirements.txt` to install python2-secrets 15 | * **TIP**: to deactivate virtual environment, do `deactivate`. 16 | 17 | # Usage 18 | 19 | For Windows users: 20 | 21 | ```bash 22 | $ python PasswordGenerator.py 23 | ``` 24 | 25 | For Mac/Linux/Unix users: 26 | 27 | ```bash 28 | $ ./PasswordGenerator.py 29 | ``` -------------------------------------------------------------------------------- /Random_Password_Generator/createPassword.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Create a pseudo random password with alphanumeric, numbers, and special characters 5 | 6 | import secrets #implemented in python version 3.6+ 7 | 8 | #String of characters 9 | chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-=_+`~[]{]\|;:,<.>/?' 10 | 11 | #2 for loops should be O(n²) runtime 12 | def create(number_of_passwords, pass_length): 13 | for i in range(number_of_passwords): 14 | list = [] # create new empty list 15 | for i in range(pass_length): 16 | select = secrets.choice(chars) #the secret sauce to select a pseudo random character 17 | list.append(select) #add pseudo random char to list 18 | l = ''.join(list) #concatenate list to string for every '' 19 | print(l) #<-- comment me out for faster computing 20 | return l 21 | 22 | #Run function 23 | create(int(5),int(20)) #number_of_passwords, pass_length -------------------------------------------------------------------------------- /Random_Password_Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | python2-secrets>=1.0.5 2 | -------------------------------------------------------------------------------- /Remove-Duplicate-Files/README.md: -------------------------------------------------------------------------------- 1 | # Remove Duplicate Files 2 | A python script to find/remove duplicate files from the user specified directory 3 | 4 | # Usage 5 | Simply run the script removeDuplicateFiles.py from the terminal after specifying the path 6 | -------------------------------------------------------------------------------- /Rock-Paper-Scissor/README.md: -------------------------------------------------------------------------------- 1 | # Python Rock-Paper-Scissor GAME 2 | 3 | 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. 4 | 5 | ## Requirement 6 | 7 | Python 3.xx 8 | 9 | ## Running the script 10 | 11 | ```bash 12 | python Rock-Paper-Scissor.py 13 | ``` 14 | -------------------------------------------------------------------------------- /SSH_Host_Adder/README.md: -------------------------------------------------------------------------------- 1 | # SSH Host adder 2 | 3 | This is a fairly simple script which adds hosts to an ssh config file. 4 | SSH allows you to add hosts to a config file, so you don't have to remember ip addresses or hostnames. So if you add: 5 | 6 | ``` 7 | HOST test 8 | HostName 192.168.80.1 9 | User root 10 | Port 22 11 | ``` 12 | 13 | to `~/.ssh/config`, you can just do `ssh test` instead of writing the address / user / port. 14 | 15 | But when you constantly get new servers to ssh to, it's helpful to have a script! 16 | 17 | ## Usage: 18 | 19 | ``` 20 | ./ssh_adder my_host 192.168.80.1 [--user myuser] [--port 2200] 21 | ``` 22 | 23 | `--user` and `--port` are optional and default to `root` and `22` respectively. 24 | 25 | If you aren't using the default ssh config path, there is an argument for that as well: 26 | 27 | ``` 28 | ./ssh_adder my_host 192.168.80.1 --conf /path/to/config 29 | ``` 30 | 31 | `-conf` defaults to `~/.ssh/config` 32 | 33 | SSH configs allow you to make more complex operations, like adding different keys and whatnot, which I don't support here mostly because I haven't had a need to yet. If I get to updating my script some time, I'll update it here too. 34 | -------------------------------------------------------------------------------- /SSH_Host_Adder/ssh_adder: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | import ssh_adder 5 | 6 | def main(): 7 | ssh_adder.main(sys.argv) 8 | 9 | -------------------------------------------------------------------------------- /SimpleWebpageParser/README.md: -------------------------------------------------------------------------------- 1 | # Simple Webpage Parser 2 | A simple wrapper around the popular web scraper library BeautifulSoap. It merges the use of Requests and BeautifulSoap library in one class which abstracts the process of extraction of html from webpage's url and gives user a clean code to work with. 3 | 4 | ## Libraries Required 5 | 1. requests 6 | `$pip install requests` 7 | 2. beautifulsoup4 8 | `$pip install beautifulsoup4` 9 | 10 | ## Usage 11 | A sample script `webpage_parser.py` has been provided to show the usage of the SimpleWebpageParser. It prints all the links from the Hacktoberfest's home page. -------------------------------------------------------------------------------- /SimpleWebpageParser/SimpleWebpageParser.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | 4 | class SimpleWebpageParser(): 5 | 6 | def __init__(self, url): 7 | self.url = url 8 | 9 | def getHTML(self): 10 | r = requests.get(self.url) 11 | data = r.text 12 | soup = BeautifulSoup(data,"lxml") 13 | return soup -------------------------------------------------------------------------------- /SimpleWebpageParser/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/SimpleWebpageParser/__init__.py -------------------------------------------------------------------------------- /SimpleWebpageParser/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | beautidulsoup4 3 | -------------------------------------------------------------------------------- /SimpleWebpageParser/webpage_parser.py: -------------------------------------------------------------------------------- 1 | from SimpleWebpageParser import SimpleWebpageParser 2 | 3 | swp = SimpleWebpageParser("https://hacktoberfest.digitalocean.com/") 4 | html = swp.getHTML() 5 | print html.find_all('a') 6 | 7 | ## the html returned is an object of type BeatifulSoup, you can parse using BeautifulSoup syntax 8 | ## refer to its documentation for more functionalities -------------------------------------------------------------------------------- /Slideshare-Downloader/README.md: -------------------------------------------------------------------------------- 1 | # Slideshare-Downloader 2 | Download slides from slideshows shared on SlideShare (Now LinkedIn SlideShare) as a PDF. 3 | 4 | # Usage 5 | This was written for Python 3, but it should work with Python 2.7 as well. 6 | 7 | ## Installation 8 | ### Linux/Mac 9 | ```bash 10 | python3 -m pip install --user -U -r requirements.txt 11 | python3 slideshare_downloader.py --help 12 | ``` 13 | 14 | ### Windows 15 | ```powershell 16 | py -3 -m pip install --user -U -r requirements.txt 17 | py -3 slideshare_downloader.py --help 18 | ``` 19 | 20 | ## Running 21 | ```bash 22 | slideshare_downloader.py -f some_slides -u http://www.slideshare.net/codeblue_jp/igor-skochinsky-enpub 23 | ``` -------------------------------------------------------------------------------- /Slideshare-Downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | docopt 2 | img2pdf 3 | requests 4 | beautifulsoup4 5 | -------------------------------------------------------------------------------- /SmsYourLocation/README.md: -------------------------------------------------------------------------------- 1 | 2 |

this is small python script to send sms to your loved ones....especially for those have very caring mother like mine

3 |

so you can run this script as cron job and it will SMS your currrent location to number you want (note: it should be registered with TWILO)

4 |

NOTE:you need to make a account in twilo. if you are going to use paid one you will have more options like multiple numbers extra....

5 | 6 | 7 | -------------------------------------------------------------------------------- /SmsYourLocation/SmsYourLocation.py: -------------------------------------------------------------------------------- 1 | import urllib3 2 | import json 3 | http = urllib3.PoolManager() 4 | r = http.request('GET', 'http://ipinfo.io/json') 5 | data = json.loads(r.data.decode('utf-8')) 6 | city=data['city'] 7 | loc=data['loc'] 8 | print(city,loc) 9 | from twilio.rest import Client 10 | 11 | client = Client("TWILO SSID", "AUTH TOKEN") 12 | client.messages.create(to="PHONE NO YOU WANT TO SEND SMS", 13 | from_="YOUR TWILLO PHONE NUMBER", 14 | body="hi amma i am in "+city+" now and my cordinates are " +loc) 15 | -------------------------------------------------------------------------------- /Squid-Proxy-Installer-for-Ubuntu16/README.md: -------------------------------------------------------------------------------- 1 | **Squid Proxy Automation-Script** 2 | *it's for Ubuntu 14 or 16 servers.* 3 | **You can browse with your installed squid proxy on your server** 4 | You need simple server or OpenVPN ovpn file. 5 | 6 | Go python3 Squid_Proxy.py and install Squid Proxy 7 | 8 | 1. Install Squid Proxy 9 | 2. Add Password 10 | 3. Change Password 11 | 4. Remove Password 12 | 5. Uninstall Squid Proxy 13 | 6. Exit -------------------------------------------------------------------------------- /Steg_Tool/README.md: -------------------------------------------------------------------------------- 1 | # Steganography Tool 2 | 3 | * Advanced Image Steganography Tool used to hide files inside Images. 4 | * Uses LSB (Least Significant Bit) Algorithm to store file data inside the image 5 | * Works with only .png format 6 | 7 | Commands 8 | ``` 9 | python3 steg.py 10 | ``` 11 | Input 12 | ``` 13 | encode 14 | 15 | decode 16 | ``` 17 | Example 18 | ``` 19 | encode image.png image_new.png secret.txt 20 | decode image_new.png secret_new.txt 21 | ``` -------------------------------------------------------------------------------- /Steg_Tool/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Steg_Tool/image.png -------------------------------------------------------------------------------- /Steg_Tool/secret.txt: -------------------------------------------------------------------------------- 1 | secret -------------------------------------------------------------------------------- /Subtitle-downloader/README.md: -------------------------------------------------------------------------------- 1 | # Subtitle Downloader 2 | A simple script to download subtitles from [http://thesubdb.com/] 3 | 4 | ##Dependencies 5 | It requires `python3` and `request`. 6 | To install `request`, you need `pip3` or python3. 7 | 8 | ## Usage 9 | You can directly run the script `subdownloader.py` with the queries supplied from the command line. 10 | If you make the script executable and add it to the system path, then you can directly run the script. 11 | -------------------------------------------------------------------------------- /Subtitle-downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /TTS_Text_to_Speech_Mp3/README.md: -------------------------------------------------------------------------------- 1 | # TTS - Text to Speech Mp3 2 | 3 | Write spoken mp3 data to a file, a file-like object (bytestring) for further audio manipulation, or stdout. 4 | 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. 5 | 6 | ## Installation 7 | 8 | ``$ pip install requirements.txt`` 9 | 10 | ## Quickstart 11 | 12 | ``` 13 | >>> from gtts import gTTS 14 | >>> tts = gTTS('hello') 15 | >>> tts.save('hello.mp3') 16 | ``` 17 | 18 | ## Disclaimer 19 | 20 | [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. 21 | -------------------------------------------------------------------------------- /TTS_Text_to_Speech_Mp3/requirements.txt: -------------------------------------------------------------------------------- 1 | gTTS 2 | -------------------------------------------------------------------------------- /TTS_Text_to_Speech_Mp3/run.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | 3 | def main(): 4 | tts = gTTS('hello') 5 | tts.save('hello.mp3') 6 | 7 | if __name__ == "__main__": 8 | main() 9 | -------------------------------------------------------------------------------- /Take_screenshot/README.md: -------------------------------------------------------------------------------- 1 | # Take a Screenshot : 2 | 3 | A simple implementation on how to take screenshots . 4 | 5 | #### Required Modules : 6 | - Numpy 7 | ```bash 8 | pip install numpy 9 | ``` 10 | - Opencv 11 | ```bash 12 | pip install opencv-python 13 | ``` 14 | - Pyautogui 15 | ```bash 16 | pip3 install pyautogui --user 17 | ``` 18 | #### Results : 19 | 20 | ![alt text](https://github.com/moadmmh/Awesome-OpenCV/blob/master/Take_Screenshot/test.png) 21 | -------------------------------------------------------------------------------- /Take_screenshot/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | PyAutoGUI 3 | opencv-python 4 | -------------------------------------------------------------------------------- /Take_screenshot/screenshot.py: -------------------------------------------------------------------------------- 1 | #Needed packages 2 | import numpy as np 3 | import cv2 4 | import pyautogui 5 | 6 | #take screenshot using pyautogui 7 | image = pyautogui.screenshot() 8 | 9 | #since the pyautogui takes as a PIL(pillow) and in RGB we need to convert it to numpy array and BGR 10 | #so we can write it to the disk 11 | image = cv2.cvtColor(np.array(image),cv2.COLOR_RGB2BGR) 12 | 13 | #writing it to the disk using opencv 14 | cv2.imwrite("test.png",image) 15 | -------------------------------------------------------------------------------- /Take_screenshot/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Take_screenshot/test.png -------------------------------------------------------------------------------- /Tambola_Ticket_Generator/README.MD: -------------------------------------------------------------------------------- 1 | # Tambola ticket generator 2 | This is a simple utility to generate tambola tickets 3 | 4 | ## Requirement 5 | 6 | * Python 3 7 | * numpy 8 | * tabulate 9 | 10 | ```bash 11 | pip install -r requirements.txt 12 | ``` 13 | 14 | ## Usage 15 | 16 | ```bash 17 | $ python main.py 18 | ╒═══╤════╤════╤════╤════╤════╤════╤════╤════╕ 19 | │ 0 │ 14 │ 0 │ 32 │ 0 │ 0 │ 61 │ 71 │ 81 │ 20 | ├───┼────┼────┼────┼────┼────┼────┼────┼────┤ 21 | │ 4 │ 0 │ 24 │ 33 │ 45 │ 0 │ 63 │ 0 │ 0 │ 22 | ├───┼────┼────┼────┼────┼────┼────┼────┼────┤ 23 | │ 0 │ 0 │ 25 │ 37 │ 49 │ 59 │ 0 │ 79 │ 0 │ 24 | ╘═══╧════╧════╧════╧════╧════╧════╧════╧════╛ 25 | ``` 26 | 27 | ```bash 28 | $ python main.py --count 2 29 | ╒═══╤════╤════╤════╤════╤════╤════╤════╤════╕ 30 | │ 0 │ 14 │ 0 │ 32 │ 0 │ 0 │ 61 │ 71 │ 81 │ 31 | ├───┼────┼────┼────┼────┼────┼────┼────┼────┤ 32 | │ 4 │ 0 │ 24 │ 33 │ 45 │ 0 │ 63 │ 0 │ 0 │ 33 | ├───┼────┼────┼────┼────┼────┼────┼────┼────┤ 34 | │ 0 │ 0 │ 25 │ 37 │ 49 │ 59 │ 0 │ 79 │ 0 │ 35 | ╘═══╧════╧════╧════╧════╧════╧════╧════╧════╛ 36 | 37 | ╒═══╤════╤════╤════╤════╤════╤════╤════╤════╕ 38 | │ 1 │ 0 │ 0 │ 32 │ 42 │ 0 │ 61 │ 72 │ 0 │ 39 | ├───┼────┼────┼────┼────┼────┼────┼────┼────┤ 40 | │ 0 │ 17 │ 24 │ 0 │ 45 │ 0 │ 0 │ 77 │ 82 │ 41 | ├───┼────┼────┼────┼────┼────┼────┼────┼────┤ 42 | │ 5 │ 0 │ 26 │ 39 │ 49 │ 59 │ 0 │ 0 │ 0 │ 43 | ╘═══╧════╧════╧════╧════╧════╧════╧════╧════╛ 44 | ``` 45 | -------------------------------------------------------------------------------- /Tambola_Ticket_Generator/main.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tambola Ticket generator 3 | ask (c) 2020. All rights reserved. 4 | """ 5 | 6 | import argparse 7 | 8 | import numpy as np 9 | from tabulate import tabulate 10 | 11 | 12 | def shuffle_array(a): 13 | while (~a.any(axis=1)).any(): 14 | [np.random.shuffle(a[:, i]) for i in range(3)] 15 | return a 16 | 17 | 18 | def generate_ticket(): 19 | ticket = np.full(27, 1).reshape(9, 3) 20 | ticket[:4, :] *= 0 21 | ticket = shuffle_array(ticket) 22 | 23 | for i in range(9): 24 | num = np.arange(1, 10) if i < 8 else np.arange(1, 11) 25 | np.random.shuffle(num) 26 | num = np.sort(num[:3]) 27 | ticket[i, :] *= (num + i * 10) 28 | return ticket.T 29 | 30 | 31 | def get_tickets(args): 32 | tickets = [] 33 | for _ in range(args.count): 34 | tickets.append(generate_ticket()) 35 | return tickets 36 | 37 | 38 | def main(): 39 | parser = argparse.ArgumentParser() 40 | parser.add_argument('-c', '--count', help="Generates and returns tambola tickets given by count", type=int, 41 | default=1) 42 | args = parser.parse_args() 43 | return get_tickets(args) 44 | 45 | 46 | if __name__ == "__main__": 47 | generated_tickets = main() 48 | print("Generated {0} tickets".format(len(generated_tickets))) 49 | 50 | for t in generated_tickets: 51 | print(tabulate(t, tablefmt='fancy_grid')) 52 | -------------------------------------------------------------------------------- /Tambola_Ticket_Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy==1.22.0 2 | tabulate==0.8.7 3 | -------------------------------------------------------------------------------- /Task-Scheduler/requirements.txt: -------------------------------------------------------------------------------- 1 | pytz==2021.3 2 | -------------------------------------------------------------------------------- /TestMyInternetSpeed/README.md: -------------------------------------------------------------------------------- 1 | ## Test Your Internet Speed using Python 2 | speedtest image 4 | 5 | This is a simple but powerful and efficient python program. 6 | 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. 7 | 8 | - Test Download Speed 9 | - Test Upload Speed 10 | - Test Server Pings 11 | - Results in Mbps(Mega bits per second) 12 | 13 | #### How to use 14 | 15 | - Clone the repo or download the zip 16 | - Navigate to the folder of the program in terminal/cmd. 17 | - Install the dependencies using pip install -r requirements.txt 18 | - Run the command python TestMySpeed.py 19 | 20 | (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) 21 | -------------------------------------------------------------------------------- /TestMyInternetSpeed/TestMySpeed.py: -------------------------------------------------------------------------------- 1 | 2 | # the package used is speedtest-cli(it is the only package we need) 3 | import speedtest 4 | from time import sleep 5 | speed=speedtest.Speedtest() 6 | 7 | option=int(input(''' 8 | What do you want to know: 9 | 1) Download speed 10 | 2) Upload speed 11 | 3) Both Download and Upload 12 | 4) Ping 13 | Your choice: ''')) 14 | 15 | if option<1 or option>4: 16 | sleep(2) 17 | print('You have entered wrong choice, please enter again with values from 1 to 4') 18 | else: 19 | sleep(1) 20 | print() 21 | print('Pls wait, test in progress...') 22 | print() 23 | down_speed=round(speed.download()/1000000,3) 24 | up_speed=round(speed.upload()/1000000,3) 25 | print('One more sec please...') 26 | sleep(2.5) 27 | print() 28 | if option == 1: 29 | print('Your Download speed is: ',down_speed,'Mbps') 30 | elif option == 2: 31 | print('Your Upload speed is: ',up_speed,'Mbps') 32 | elif option == 3: 33 | print('Your Download speed is: ',down_speed,'Mbps',end=" ") 34 | print(',and your Upload speed is: ',up_speed,'Mbps') 35 | 36 | elif option == 4: 37 | s=[] 38 | speed.get_servers(s) 39 | print(speed.results.ping,'ms') 40 | else: 41 | print('Sorry, something went wrong, pls try again...') 42 | 43 | 44 | -------------------------------------------------------------------------------- /TestMyInternetSpeed/requirements.txt: -------------------------------------------------------------------------------- 1 | speedtest-cli -------------------------------------------------------------------------------- /TicTacToe_AI_and_2_players/README.md: -------------------------------------------------------------------------------- 1 | author: Omar Sameh 2 | email: o.s.dr.who@gmail.com 3 | no requirments enjoy! -------------------------------------------------------------------------------- /TicTacToe_AI_and_2_players/Requirements.txt: -------------------------------------------------------------------------------- 1 | None! enjoy! -------------------------------------------------------------------------------- /To Do Bot/Procfile: -------------------------------------------------------------------------------- 1 | worker: python bot.py 2 | -------------------------------------------------------------------------------- /To Do Bot/README.md: -------------------------------------------------------------------------------- 1 | # ToDoBot 2 | Telegram Bot for ToDo list to add, delete, see and check remaining date for particular task. 3 | 4 | ## Usage 5 | * create a bot on telegram app using bot-father. 6 | * Add an unique TOKEN generated by bot-father to bot.py 7 | * run the bot using `python bot.py` 8 | * send /help to bot to know the detailed functionality. 9 | -------------------------------------------------------------------------------- /To Do Bot/dbhelper.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | 4 | class DBHelper: 5 | 6 | def __init__(self, dbname="todo.sqlite"): 7 | self.dbname = dbname 8 | self.conn = sqlite3.connect(dbname) 9 | 10 | def setup(self): 11 | tblstmt = "CREATE TABLE IF NOT EXISTS items (description text, due_date date ,owner text)" 12 | itemidx = "CREATE INDEX IF NOT EXISTS itemIndex ON items (description ASC)" 13 | ownidx = "CREATE INDEX IF NOT EXISTS ownIndex ON items (owner ASC)" 14 | self.conn.execute(tblstmt) 15 | self.conn.execute(itemidx) 16 | self.conn.execute(ownidx) 17 | self.conn.commit() 18 | 19 | def add_item(self, item_text, due_date, owner): 20 | stmt = "INSERT INTO items (description, due_date ,owner) VALUES (?, ? ,?)" 21 | args = (item_text, due_date ,owner) 22 | self.conn.execute(stmt, args) 23 | self.conn.commit() 24 | 25 | def delete_item(self, item_text, owner): 26 | stmt = "DELETE FROM items WHERE description = (?) AND owner = (?)" 27 | args = (item_text, owner ) 28 | self.conn.execute(stmt, args) 29 | self.conn.commit() 30 | 31 | def get_items(self, owner): 32 | stmt = "SELECT description,due_date FROM items WHERE owner = (?)" 33 | args = (owner, ) 34 | return [x for x in self.conn.execute(stmt, args)] 35 | 36 | -------------------------------------------------------------------------------- /To Do Bot/requirements.txt: -------------------------------------------------------------------------------- 1 | python-dateutil==2.6.0 2 | requests 3 | telepot==10.5 4 | urllib3 5 | virtualenv==15.1.0 6 | -------------------------------------------------------------------------------- /To Do Bot/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.6.1 -------------------------------------------------------------------------------- /To Do Bot/todo.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/To Do Bot/todo.sqlite -------------------------------------------------------------------------------- /Toonify/README.md: -------------------------------------------------------------------------------- 1 | ## HOW TO USE 2 | 3 | #### Using OpenCv ([link](./toonify-opencv.py)) 4 | 5 | 6 | - To just view the image 7 | ```python 8 | python3 toonify-opencv.py -i img_path 9 | ``` 10 | 11 | 12 | - To view and download the image 13 | ```python 14 | python3 toonify-opencv.py -i img_path -o download_path 15 | ``` 16 | 17 | #### Using Toonify-API(by DeepAI) 18 | 19 | 20 | ##### For local image ([link](./toonify-API-1.py)) 21 | 22 | ```python 23 | python3 toonify-API-1.py -i img_path -k api_key 24 | 25 | ``` 26 | 27 | ##### For URLS ([link](./toonify-API-2.py)) 28 | 29 | ```python 30 | python3 toonify-API-2.py -i img_path -k api_key 31 | 32 | ``` 33 | 34 | > NOTE: The toonify image works well with .jpg format and might give some problem with other formats 35 | 36 | 37 | For more details on toonify API: 38 | 39 | [toonify API doc](https://deepai.org/machine-learning-model/toonify) 40 | -------------------------------------------------------------------------------- /Toonify/toonify-API-1.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import requests 3 | 4 | aq = argparse.ArgumentParser() 5 | aq.add_argument('-i', '--input', required=True, help="input image path") 6 | 7 | aq.add_argument('-k', '--apikey', required=True, help="api-key") 8 | 9 | args = vars(aq.parse_args()) 10 | 11 | r = requests.post( 12 | "https://api.deepai.org/api/toonify", 13 | files={ 14 | 'image': open(args['input'], 'rb'), 15 | }, 16 | headers={'api-key': args['apikey']} 17 | ) 18 | print(r.json()['output_url']) -------------------------------------------------------------------------------- /Toonify/toonify-API-2.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import requests 3 | 4 | aq = argparse.ArgumentParser() 5 | aq.add_argument('-i', '--input', required=True, help="input image link") 6 | 7 | aq.add_argument('-k', '--apikey', required=True, help="api-key") 8 | 9 | args = vars(aq.parse_args()) 10 | 11 | r = requests.post( 12 | "https://api.deepai.org/api/toonify", 13 | files={ 14 | 'image': args['input'], 15 | }, 16 | headers={'api-key': args['apikey']} 17 | ) 18 | print(r.json()['output_url']) 19 | -------------------------------------------------------------------------------- /Toonify/toonify-opencv.py: -------------------------------------------------------------------------------- 1 | # importing libraries 2 | import cv2 3 | import numpy as np 4 | import argparse 5 | 6 | aq = argparse.ArgumentParser() 7 | 8 | aq.add_argument('-i', '--input', required=True, help="input image path") 9 | 10 | aq.add_argument('-o', '--output', help="path where you want to download the image") 11 | 12 | args = vars(aq.parse_args()) 13 | # reading image 14 | img = cv2.imread(args['input']) 15 | 16 | # Edges 17 | gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 18 | gray = cv2.medianBlur(gray, 5) 19 | edges = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, 20 | cv2.THRESH_BINARY, 9, 9) 21 | 22 | # Cartoonization 23 | color = cv2.bilateralFilter(img, 2, 250, 250) 24 | cartoon = cv2.bitwise_or(color, color, mask=edges) 25 | 26 | if(args['output']): 27 | cv2.imwrite(args['output'], cartoon) 28 | 29 | 30 | cv2.imshow("Cartoon", cartoon) 31 | cv2.waitKey(0) 32 | cv2.destroyAllWindows() -------------------------------------------------------------------------------- /Top_News/Readme.md: -------------------------------------------------------------------------------- 1 | ### Cool IT news 2 | This python made script shows top voted news `basic version votes>99` from hackernews. 3 | 4 | ### Installation 5 | First of all use 6 | 7 | ``` 8 | pip install requirements.txt 9 | ``` 10 | 11 | ### Run 12 | 13 | ``` 14 | python coolnews.py 15 | ``` 16 | 17 | ## 18 | If you want news of more then desired number of votes you can edit 19 | ``` 20 | Line 29. if points > 99: 21 | ``` 22 | -------------------------------------------------------------------------------- /Top_News/coolnews.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | import pprint 4 | 5 | res = requests.get('https://news.ycombinator.com/news') 6 | res2 = requests.get('https://news.ycombinator.com/news?p=2') 7 | soup = BeautifulSoup(res.text, 'html.parser') 8 | soup2 = BeautifulSoup(res2.text, 'html.parser') 9 | 10 | links = soup.select('.storylink') 11 | subtext = soup.select('.subtext') 12 | links2 = soup2.select('.storylink') 13 | subtext2 = soup2.select('.subtext') 14 | 15 | mega_links = links + links2 16 | mega_subtext = subtext + subtext2 17 | 18 | def sort_stories_by_votes(hnlist): 19 | return sorted(hnlist, key= lambda k:k['votes'],reverse=True) 20 | 21 | def create_custom_hn(links,subtext): 22 | hn=[] 23 | for idx, item in enumerate(links): 24 | title =item.getText() 25 | href = item.get('href',None) 26 | vote = subtext[idx].select('.score') 27 | if len(vote): 28 | points = int(vote[0].getText().replace(' points','')) 29 | if points > 99: 30 | hn.append({'title':title,'link':href,'votes':points}) 31 | return sort_stories_by_votes(hn) 32 | 33 | pprint.pprint(create_custom_hn(mega_links, mega_subtext)) 34 | 35 | -------------------------------------------------------------------------------- /Top_News/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.31.0 2 | bs4==0.0.1 -------------------------------------------------------------------------------- /TranslateCLI/README.md: -------------------------------------------------------------------------------- 1 | # Python Command Line Translator 2 | Use google translate library to translate text from command line. 3 | 4 | ## Requirements 5 | 6 | Python 3.xx 7 | googletrans 8 | ```bash 9 | pip install googletrans 10 | 11 | ``` 12 | 13 | ### Usage 14 | python Translate.py -s -d 15 | -------------------------------------------------------------------------------- /TranslateCLI/Translate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | from googletrans import Translator 5 | 6 | def translate(text, src_lng=None, dest_lng=None): 7 | translator = Translator() 8 | if src_lng and dest_lng: 9 | translated = translator.translate(text, src=src_lng, dest=dest_lng) 10 | elif src_lng: 11 | translated = translator.translate(text, src=src_lng) 12 | elif dest_lng: 13 | translated = translator.translate(text, dest=dest_lng) 14 | else: 15 | translated = translator.translate(text) 16 | 17 | return translated 18 | 19 | parser = argparse.ArgumentParser() 20 | parser.add_argument('text', type=str, help='text to translate') 21 | parser.add_argument('-s', '--src', default=None, help='origin language of the text') 22 | parser.add_argument('-d', '--dest', default=None, help='destiny language of the translation') 23 | parser.add_argument('-v', '--verbose', help='show more information', action='store_true') 24 | 25 | args = parser.parse_args() 26 | 27 | tr = translate(args.text, args.src, args.dest) 28 | 29 | if args.verbose: 30 | print('original text: %s' % tr.origin) 31 | print('translated text: %s' % tr.text) 32 | print('origin language: %s' % tr.src) 33 | print('destiny language: %s' % tr.dest) 34 | else: 35 | print(tr.text) 36 | -------------------------------------------------------------------------------- /TranslateCLI/requirements.txt: -------------------------------------------------------------------------------- 1 | googletrans 2 | -------------------------------------------------------------------------------- /Tweets_Tool/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sarah Floris 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Tweets_Tool/example.csv: -------------------------------------------------------------------------------- 1 | 0,1,2,3 2 | 0,Bayonetta 2,18 Oct 85 ,18 Oct 85 -------------------------------------------------------------------------------- /Tweets_Tool/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | assert sys.version_info >= (3, 0) 3 | import pandas as pd 4 | import numpy as np 5 | from multiprocessing.pool import ThreadPool 6 | import Tool 7 | 8 | 9 | def main(filepath): 10 | assert isinstance(filepath, str) 11 | videogames = pd.read_csv(filepath, skiprows=1, names=['games', 'start_date', 'end_date']) 12 | videogames = videogames.values 13 | pool = ThreadPool(250) 14 | text_results = pool.map(Tool.TweetObtain().TweetObtain_function, 15 | videogames) 16 | pool.close() 17 | pool.join() 18 | text_results = pd.DataFrame( 19 | np.vstack(text_results)) 20 | text_results.to_csv('tweets.csv') 21 | return 22 | 23 | if __name__ == "__main__": 24 | main(sys.argv[1]) 25 | -------------------------------------------------------------------------------- /Tweets_Tool/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.31.0 2 | urllib3==1.26.18 3 | requests==2.31.0 4 | urllib3==1.26.18 5 | py4j==0.10.4 6 | BeautifulSoup==3.2.0 7 | numpy==1.22.0 8 | -------------------------------------------------------------------------------- /Tweets_Tool/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name='Twitter_Tool', 4 | version='0.1', 5 | description='Web scraping ', 6 | url='http://github.com/sdf94/Twitter_Tool', 7 | author='Sarah Floris', 8 | author_email='sdf11c@acu.edu', 9 | license='MIT', 10 | packages=['Twitter_Tool'], 11 | zip_safe=False) -------------------------------------------------------------------------------- /Upload_files_to_s3/README.md: -------------------------------------------------------------------------------- 1 | # Upload files & folders from your machine to Amazon S3 2 | 3 | A python script that will upload your files & folder to Amzzon S3 using python and boto3 4 | 5 | ## Requirement 6 | 7 | Python 2.xx 8 | boto3 9 | ```bash 10 | pip install boto3 11 | ``` 12 | 13 | #Usage 14 | Go to Upload_files_to_s3 directory and add your folder's name you want to upload to s3 and then run upload_files_to_s3.py as below: 15 | ```bash 16 | $ python upload_files_to_s3.py 17 | ``` 18 | -------------------------------------------------------------------------------- /Upload_files_to_s3/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3==1.9.197 # Amazon Web Services SDK for Python 2 | -------------------------------------------------------------------------------- /Upload_files_to_s3/upload_files_to_s3.py: -------------------------------------------------------------------------------- 1 | import boto3 2 | import os 3 | 4 | ACL = 'public-read' #access type of the file 5 | AWS_ACCESS_KEY_ID = 'your_access_key' 6 | AWS_REGION = 'your_region' 7 | AWS_SECRET_ACCESS_KEY = 'your_secret_key' 8 | AWS_STORAGE_BUCKET_NAME = 'my_bucket' 9 | FOLDER_NAME_ON_S3 = 'my_folder_on_s3' 10 | FOLDER_PATH = '/home/foo/my_folder' 11 | 12 | 13 | def upload_files_to_s3(path): 14 | """ 15 | Upload files to AWS s3 bucket from your machine 16 | using python and boto3 17 | """ 18 | session = boto3.Session( 19 | aws_access_key_id=AWS_ACCESS_KEY_ID, 20 | aws_secret_access_key=AWS_SECRET_ACCESS_KEY, 21 | region_name=AWS_REGION 22 | ) 23 | s3 = session.resource('s3') 24 | bucket = s3.Bucket(AWS_STORAGE_BUCKET_NAME) 25 | for subdir, dirs, files in os.walk(path): 26 | for file in files: 27 | full_path = os.path.join(subdir, file) 28 | with open(full_path, 'rb') as data: 29 | key = FOLDER_NAME_ON_S3 + full_path[len(path) + 1:] 30 | bucket.put_object(Key=key, Body=data, ACL=ACL) 31 | 32 | if __name__ == "__main__": 33 | upload_files_to_s3(FOLDER_PATH) -------------------------------------------------------------------------------- /Website-Blocker/README.md: -------------------------------------------------------------------------------- 1 | # Website Blocker using Python 2 | This is a program which blocks certain distracting website like Facebook, Youtube etc during your work hours. 3 | 4 | ## Libraby Used 5 | time (datetime is imported from python) 6 | 7 | ## Host Files 8 | Host is an operating system file which maps hostnames to IP addresses. 9 | Using python file handling manipulation I have changed hostnames on the hosts files for a certain interval of day when I'm working and need no distraction and deleted it then after when the time is over. 10 | 11 | ## Location of host file 12 | ### Host file on Mac and Linux : 13 | $ /etc/hosts 14 | 15 | ### Host file on windows : 16 | $ C:\Windows\System32\drivers\etc 17 | 18 | ## Note 19 | * Windows user need to create a duplicate of OS’s host file. Now provide the path of the duplicate file in hosts_path mentioned in the script. 20 | * For scheduling above script in Linux you have to open crontab in your terminal as a root.(use sudo command) 21 | -------------------------------------------------------------------------------- /Website-Blocker/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | 127.0.1.1 hastagab-Latitude-6430U 3 | 4 | # The following lines are desirable for IPv6 capable hosts 5 | ::1 ip6-localhost ip6-loopback 6 | fe00::0 ip6-localnet 7 | ff00::0 ip6-mcastprefix 8 | ff02::1 ip6-allnodes 9 | ff02::2 ip6-allrouters 10 | -------------------------------------------------------------------------------- /Website-Blocker/website_blocker.py: -------------------------------------------------------------------------------- 1 | import time 2 | from datetime import datetime as dt 3 | 4 | host_temp = "hosts" #host file copied to the directory for ease. 5 | host_path = r"/etc/hosts" #original host file address in linux 6 | redirect = "127.0.0.1" 7 | website_list = ["www.facebook.com", "facebook.com"] #You can add your own list of websites 8 | 9 | while True: 10 | if dt(dt.now().year,dt.now().month,dt.now().day,8) < dt.now() < dt(dt.now().year,dt.now().month,dt.now().day,16): #You can choose your own working time period 11 | print("working hours...") 12 | with open(host_path,'r+') as file: 13 | content=file.read() 14 | for website in website_list: 15 | if website in content: 16 | pass 17 | else: 18 | file.write(redirect+" "+ website+"\n") 19 | else: 20 | with open(host_path,'r+') as file: 21 | content=file.readlines() 22 | file.seek(0) 23 | for line in content: 24 | if not any(website in line for website in website_list): 25 | file.write(line) 26 | file.truncate() 27 | print("fun hours...") 28 | time.sleep(10) 29 | -------------------------------------------------------------------------------- /Website_Url_Detector/README.md: -------------------------------------------------------------------------------- 1 | # Website URL Detector 2 | 3 | ## Description 4 | A python script that detects URLs on a given website. 5 | 6 | ## Usage 7 | 8 | ```py 9 | >>> python detect_urls.py --website [website_url] 10 | ``` 11 | 12 | ### Example 13 | 14 | ```py 15 | >>> python detect_urls.py --website https://en.wikipedia.org/wiki/Guido_van_Rossum 16 | https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Guido-portrait-2014-drc.jpg/1200px-Guido-portrait-2014-drc.jpg 17 | https://creativecommons.org/licenses/by-sa/3.0/ 18 | https://en.wikipedia.org/wiki/Guido_van_Rossum 19 | https://gvanrossum.github.io/ 20 | http://mail.python.org/pipermail/python-dev/2007-January/070849.html 21 | https://web.archive.org/web/20090908131440/http://mail.python.org/pipermail/python-dev/2007-January/070849.html 22 | http://www.computerhistory.org/atchm/2018-chm-fellow-guido-van-rossum-python-creator-benevolent-dictator-for-life/ 23 | https://web.archive.org/web/20180724114116/http://www.computerhistory.org/atchm/2018-chm-fellow-guido-van-rossum-python-creator-benevolent-dictator-for-life/ 24 | https://web.archive.org/web/20081031103755/http://wiki.codecall.net/Guido_van_Rossum 25 | http://wiki.codecall.net/Guido_van_Rossum 26 | ... 27 | ``` -------------------------------------------------------------------------------- /Website_Url_Detector/requirements.txt: -------------------------------------------------------------------------------- 1 | argparse 2 | re 3 | requests==2.31.0 -------------------------------------------------------------------------------- /Wifi-Password/README.md: -------------------------------------------------------------------------------- 1 | **A Simple python Script to view saved password on your system.** 2 | 3 | This script works on both Windows and Linux. 4 | -------------------------------------------------------------------------------- /Wifi-Password/requirements.txt: -------------------------------------------------------------------------------- 1 | subprocess 2 | -------------------------------------------------------------------------------- /Wikipedia-Search/README.md: -------------------------------------------------------------------------------- 1 | # Wikipedia Search 2 | This app takes input from the user and searches Wikipedia 3 | 4 | # Requirements 5 | 6 | Python 3 and higher or Python 2 and higher 7 | 8 | Wikipedia Library (https://pypi.org/project/wikipedia/) 9 | 10 | # Usage 11 | 12 | For Windows users: 13 | 14 | ```bash 15 | $ python pywikisearch.py 16 | ``` 17 | 18 | For Mac/Linux/Unix users: 19 | 20 | ```bash 21 | $ ./pywikisearch.py 22 | ``` 23 | -------------------------------------------------------------------------------- /Wikipedia-Search/pywikisearch.py: -------------------------------------------------------------------------------- 1 | import wikipedia 2 | 3 | print("Welcome to the app which find an answer to your question from wikipedia") 4 | 5 | while True: 6 | ques = input("What would you like to ask Wikipedia?") 7 | wikipedia.set_lang("en") #change "en" to convenient language for example wikipedia.set_lang("es") will set the language to spanish 8 | print wikipedia.summary(ques, sentences=3) 9 | -------------------------------------------------------------------------------- /Wikipedia-Search/requirements.txt: -------------------------------------------------------------------------------- 1 | Wikipedia Library (https://pypi.org/project/wikipedia/) 2 | -------------------------------------------------------------------------------- /Word-generator/README.md: -------------------------------------------------------------------------------- 1 | # Word Generator 2 | 3 | ## Description 4 | A python script that generates english words that contain 2 or more letters from input 5 | 6 | ## Usage 7 | Just run gen.py and type in some letters 8 | 9 | ## Requirements 10 | Python 3 -------------------------------------------------------------------------------- /Word-generator/gen.py: -------------------------------------------------------------------------------- 1 | def getDict(file): 2 | words = set() 3 | with open(file) as d: 4 | for w in d.read().split("\n"): 5 | words.add(w.lower()) 6 | return words 7 | 8 | def isEng(word): 9 | englishWords = getDict("dictionary.txt") 10 | if word in englishWords: 11 | return True 12 | return False 13 | 14 | def permutations(xl, length = -1, res=[], output=[]): 15 | if xl == [] or len(res) == length: 16 | output.append(res) 17 | return 18 | for i in range(len(xl)): 19 | permutations(xl[:i] + xl[i + 1:], length, res + [xl[i]], output) 20 | return output 21 | 22 | 23 | while True: 24 | found = set() 25 | letters = [i for i in input("Choose letters: ")] 26 | for sz in range(2, len(letters)+1): 27 | print("\nSize:", sz, "letters") 28 | for comb in permutations(letters, sz ,[], []): 29 | if isEng("".join(comb)) and not "".join(comb) in found: 30 | print("Found word:", "".join(comb)) 31 | found.add("".join(comb)) 32 | print() 33 | -------------------------------------------------------------------------------- /Word-generator/isEng.py: -------------------------------------------------------------------------------- 1 | def getDict(file): 2 | words = set() 3 | with open(file) as d: 4 | for w in d.read().split("\n"): 5 | words.add(w.lower()) 6 | return words 7 | 8 | def isEng(word): 9 | englishWords = getDict("dictionary.txt") 10 | if word in englishWords: 11 | return True 12 | return False 13 | print(isEng("boot")) -------------------------------------------------------------------------------- /Word_Frequency_Counter/requirements.txt: -------------------------------------------------------------------------------- 1 | argparse 2 | nltk==3.4.5 3 | re 4 | string -------------------------------------------------------------------------------- /Word_Frequency_Counter/test_file.txt: -------------------------------------------------------------------------------- 1 | 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." 2 | 3 | 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?" -------------------------------------------------------------------------------- /Word_Frequency_Counter/test_file_freq_dist.txt: -------------------------------------------------------------------------------- 1 | ('queen', 3) 2 | ('said', 3) 3 | ('fair', 3) 4 | ('mirror', 3) 5 | ('snow', 2) 6 | ('castle', 2) 7 | ('father', 2) 8 | ('stepmother', 2) 9 | ('upon', 1) 10 | ('time', 1) 11 | ('princess', 1) 12 | ('named', 1) 13 | ('white', 1) 14 | ('lived', 1) 15 | ('king', 1) 16 | ('always', 1) 17 | ('daughter', 1) 18 | ('must', 1) 19 | ('everyone', 1) 20 | ('court', 1) 21 | ('people', 1) 22 | ('come', 1) 23 | ('problem', 1) 24 | ('need', 1) 25 | ('ruler', 1) 26 | ('make', 1) 27 | ('decision', 1) 28 | ('nothing', 1) 29 | ('important', 1) 30 | ('whites', 1) 31 | ('knew', 1) 32 | ('much', 1) 33 | ('meant', 1) 34 | ('husband', 1) 35 | ('first', 1) 36 | ('chance', 1) 37 | ('went', 1) 38 | ('magic', 1) 39 | ('wall', 1) 40 | ('fairest', 1) -------------------------------------------------------------------------------- /Work_Log_Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | QDarkStyle 2 | PyQt5 3 | PyGithub 4 | -------------------------------------------------------------------------------- /Work_Log_Generator/resources/icone.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Work_Log_Generator/resources/icone.ico -------------------------------------------------------------------------------- /Work_Log_Generator/resources/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Work_Log_Generator/resources/loader.gif -------------------------------------------------------------------------------- /Work_Log_Generator/resources/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/Work_Log_Generator/resources/save.png -------------------------------------------------------------------------------- /X_Scrapper/README.md: -------------------------------------------------------------------------------- 1 | # X Scrapper 2 | Use to scrape the tweets from given username (including the metadata of the tweet - location of user, views, likes etc.) using `tweepy`. 3 | 4 | ## Use case 5 | 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) 6 | 2. Further analysis of user behaviour using geo-location, time of tweets, 7 | 8 | ### Requirements 9 | 10 | Python 3.xx 11 | tweepy 12 | ```bash 13 | pip install tweepy 14 | 15 | ``` 16 | 17 | ### Usage 18 | python main.py 19 | 20 | 21 | ### Note : 22 | 1. This requires you to have the consumer key, consumer secret, access key and access secret from your x.com account 23 | -------------------------------------------------------------------------------- /X_Scrapper/requirements.txt: -------------------------------------------------------------------------------- 1 | tweepy==4.3.0 2 | -------------------------------------------------------------------------------- /Youtube_Video_Downloader/README.md: -------------------------------------------------------------------------------- 1 | # Youtube Video Downloader Script 2 | 3 | Requires pytube 4 | -------------------------------------------------------------------------------- /Youtube_Video_Downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | pytube 2 | -------------------------------------------------------------------------------- /asymmetric_cryptography/README.md: -------------------------------------------------------------------------------- 1 | ## Asymmetric Encryption in python 2 | 3 | An example of asymmetric encryption in python using a public/private keypair - utilizes RSA from PyCrypto library 4 | 5 | ```bash 6 | pip install pycrypto 7 | python asymmetric.py 8 | ``` -------------------------------------------------------------------------------- /asymmetric_cryptography/asymmetric.py: -------------------------------------------------------------------------------- 1 | from Crypto import Random 2 | from Crypto.PublicKey import RSA 3 | import base64 4 | 5 | 6 | def generate_keys(modulus_length=256*4): 7 | privatekey = RSA.generate(modulus_length, Random.new().read) 8 | publickey = privatekey.publickey() 9 | return privatekey, publickey 10 | 11 | 12 | def encryptit(message , publickey): 13 | encrypted_msg = publickey.encrypt(message, 32)[0] 14 | encoded_encrypted_msg = base64.b64encode(encrypted_msg) 15 | return encoded_encrypted_msg 16 | 17 | 18 | def decryptit(message, privatekey): 19 | decoded_encrypted_msg = base64.b64decode(message) 20 | decoded_decrypted_msg = privatekey.decrypt(decoded_encrypted_msg) 21 | return decoded_decrypted_msg 22 | 23 | 24 | if __name__ == '__main__': 25 | message = "This is a awesome message!" 26 | privatekey , publickey = generate_keys() 27 | encrypted_msg = encryptit(message.encode("utf-8"), publickey) 28 | decrypted_msg = decryptit(encrypted_msg, privatekey) 29 | 30 | print(f'{privatekey.exportKey()} - ({len(privatekey.exportKey())})') 31 | print(f'{publickey.exportKey()} - ({len(publickey.exportKey())})') 32 | print(f'Original: {message} - ({len(message)})') 33 | print(f'Encrypted: {encrypted_msg} - ({len(encrypted_msg)})') 34 | print(f'Decrypted: {decrypted_msg} - ({len(decrypted_msg)})') -------------------------------------------------------------------------------- /asymmetric_cryptography/requirements.txt: -------------------------------------------------------------------------------- 1 | pycrypto 2 | -------------------------------------------------------------------------------- /automated_calendar/automated_calendar.py: -------------------------------------------------------------------------------- 1 | ''' 2 | THIS CODE CREATES FOLDERS FOR EACH FY OF OUR COMPANY, WHERE WE COULD 3 | FIND 12 OTHER FOLDERS NAMED AFTER EACH MONTH OF THE YEAR. 4 | ''' 5 | 6 | #Import modules and libraries we'll use 7 | from pathlib import Path 8 | 9 | #Create the folders where we'll store our automated calendar 10 | months =['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 11 | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] 12 | 13 | for i,month in enumerate(months): 14 | Path(f'Year1/{i+1}.{month}').mkdir(parents=True,exist_ok=True) 15 | Path(f'Year2/{i+1}.{month}').mkdir(parents=True,exist_ok=True) 16 | Path(f'Year3/{i+1}.{month}').mkdir(parents=True,exist_ok=True) 17 | Path(f'Year4/{i+1}.{month}').mkdir(parents=True,exist_ok=True) 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /automated_calendar/requirements.txt: -------------------------------------------------------------------------------- 1 | pkg-resources==0.0.0 2 | -------------------------------------------------------------------------------- /automated_email/README.md: -------------------------------------------------------------------------------- 1 | #Automated email python script You can now send emails to multiple people at once easily with only a few clicks using smtplib module in Python 2 | 3 | #Requirement Python version 3 and above smtplib json 4 | 5 | ```bash 6 | pip install smtplib 7 | pip install json 8 | ``` 9 | 10 | Can be run easily using commmand prompt (python automated_email.py) 11 | -> login as you would for your gmail account( same email and password) 12 | -> find your way with the intuitive user friendly menu 13 | (!!!Your passwords and emails are only stored on your local device and no one has access to your information otherwise!!!) 14 | -------------------------------------------------------------------------------- /automated_email/requirements.txt: -------------------------------------------------------------------------------- 1 | smtplib 2 | json 3 | -------------------------------------------------------------------------------- /caesar_cipher/README.md: -------------------------------------------------------------------------------- 1 | # Simple caesar Cipher [En,De]coder 2 | 3 | A simple implementation of a CLI tool to work with caesar ciphers. The default implementation is ROT-13, but can be 4 | adjusted for any offset. Works on files and string arguments passed via CLI. 5 | 6 | ```bash 7 | python3 caesar.py 8 | 9 | usage: caesar.py [-h] [-d] [-o OFFSET] (-f FILE | -s STRING) 10 | caesar.py: error: one of the arguments -f/--file -s/--string is required 11 | ``` 12 | 13 | ```bash 14 | python3 caesar.py -s "have you tried turning it off and on again?" 15 | unir lbh gevrq gheavat vg bss naq ba ntnva? 16 | ``` 17 | 18 | ```bash 19 | python3 caesar.py -d -s "unir lbh gevrq gheavat vg bss naq ba ntnva?" 20 | have you tried turning it off and on again? 21 | ``` 22 | 23 | ```bash 24 | python3 caesar.py -s "have you tried turning it off and on again?" -o -4 25 | dwra ukq pneaz pqnjejc ep kbb wjz kj wcwej? 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /cli_calculator/README.md: -------------------------------------------------------------------------------- 1 | # calc_argparser 2 | Calculadora via CLI 3 | 4 | # Instructions 5 | To run CLI_Calculator execute: 6 | 7 | - `python args.py -h` - For help 8 | - `python args.py --sum x y` - To sum two numbers 9 | - `python args.py --sub x y` - To substraction two numbers 10 | - `python args.py --mult x y` - To multiplication two numbers 11 | - `python args.py --div x y` - To divide two numbers 12 | -------------------------------------------------------------------------------- /cli_calculator/calc/__init__.py: -------------------------------------------------------------------------------- 1 | from .calc import sub, mult, div, soma 2 | 3 | __all__ = ['sub', 'mult', 'div', 'soma'] 4 | -------------------------------------------------------------------------------- /cli_calculator/calc/args.py: -------------------------------------------------------------------------------- 1 | """Calculadora utilizando ArgumentParser.""" 2 | 3 | from argparse import ArgumentParser 4 | 5 | from calc import soma, sub, mult, div 6 | 7 | 8 | parser = ArgumentParser(description='Calculadora') 9 | 10 | parser.add_argument('--sum', help='Operação de soma', action='store_true') 11 | parser.add_argument('--sub', help='Operação de subtração', action='store_true') 12 | parser.add_argument('--mult', help='Operação de multiplicação', action='store_true') 13 | parser.add_argument('--div', help='Operação de divisão', action='store_true') 14 | parser.add_argument('x', type=int, help='Primeiro valor') 15 | parser.add_argument('y', type=int, help='Segundo valor') 16 | 17 | args = parser.parse_args() 18 | 19 | if args.sum: 20 | print(f'{soma(args.x, args.y)}') 21 | 22 | if args.sub: 23 | print(f'{sub(args.x, args.y)}') 24 | 25 | if args.mult: 26 | print(f'{mult(args.x, args.y)}') 27 | 28 | if args.div: 29 | print(f'{div(args.x, args.y)}') 30 | -------------------------------------------------------------------------------- /cli_calculator/calc/calc.py: -------------------------------------------------------------------------------- 1 | 2 | def soma(x :int, y: int) -> int: 3 | """Função de soma.""" 4 | return x + y 5 | 6 | 7 | def sub(x :int, y: int) -> int: 8 | """Função de subtração.""" 9 | return x - y 10 | 11 | def mult(x :int, y: int) -> int: 12 | """Função de multiplicação.""" 13 | return x * y 14 | 15 | 16 | def div(x :int, y: int) -> int: 17 | """Função de divisão.""" 18 | try: 19 | return x / y 20 | 21 | except ZeroDivisionError: 22 | return 'Divisao por zero mal sucedida!!' 23 | -------------------------------------------------------------------------------- /cli_calculator/tests/test_calc.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | 3 | from calc import soma, sub, mult, div 4 | 5 | 6 | class testCalc(TestCase): 7 | def test_should_return_two_values_sum(self): 8 | esperado = 1 + 2 9 | self.assertEqual(esperado, soma(1,2)) 10 | 11 | 12 | def test_should_return_two_values_sub(self): 13 | esperado = 1 - 2 14 | self.assertEqual(esperado, sub(1,2)) 15 | 16 | 17 | def test_should_return_two_values_mult(self): 18 | esperado = 1 * 2 19 | self.assertEqual(esperado, mult(1,2)) 20 | 21 | def test_should_return_two_values_div(self): 22 | esperado = 1 / 2 23 | self.assertEqual(esperado, div(1,2)) 24 | 25 | 26 | def test_should_return_exceptio_on_division_by_zero(self): 27 | esperado = 'Divisao por zero mal sucedida!!' 28 | self.assertEqual(esperado, div(1,0)) 29 | -------------------------------------------------------------------------------- /codeforcesChecker/requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4==4.8.1 2 | chromedriver-binary==81.0.4044.69.0 3 | colorama==0.4.3 4 | requests==2.31.0 5 | selenium==3.141.0 6 | termcolor==1.1.0 -------------------------------------------------------------------------------- /covid_visualiser/README.md: -------------------------------------------------------------------------------- 1 | 2 | --> Clone the project 3 | 4 | --> run pip install -r requirements.txt 5 | 6 | -- > python3 main.py 7 | 8 | -- >It will launch a firefox tab showing the map 9 | 10 | 11 | This project visualise the current COVID position of India on a map using Folium 12 | 13 | (will extend it to more countries later) 14 | -------------------------------------------------------------------------------- /covid_visualiser/requirements.txt: -------------------------------------------------------------------------------- 1 | folium==0.10.1 2 | -------------------------------------------------------------------------------- /csv_to_json/README.md: -------------------------------------------------------------------------------- 1 | # CSV to JSON Converter 2 | A python script that converts the csv file into json 3 | 4 | ## CLI interface 5 | ![image](https://github.com/hastagAB/Awesome-Python-Scripts/blob/master/csv_to_json/img/CLI.jpg) 6 | 7 | ## Files 8 | before
9 | ![before](https://github.com/hastagAB/Awesome-Python-Scripts/blob/master/csv_to_json/img/before.jpg)
10 | After
11 | ![after](https://github.com/hastagAB/Awesome-Python-Scripts/blob/master/csv_to_json/img/after.jpg) 12 | -------------------------------------------------------------------------------- /csv_to_json/convert.py: -------------------------------------------------------------------------------- 1 | import csv 2 | import json 3 | 4 | file_name = input("Provide the CSV filename without extension>> ") 5 | 6 | try: 7 | 8 | with open(file_name+'.csv') as f: 9 | 10 | reader = csv.reader(f, delimiter=',') 11 | titles = [] 12 | temp_data = {} 13 | 14 | for heading in reader: 15 | titles = heading 16 | break 17 | 18 | i = 1 19 | for row in reader: 20 | current_row = "row{}".format(i) 21 | temp_data['{}'.format(current_row)] = {} 22 | for col in range(len(titles)): 23 | temp_data[current_row][titles[col]] = row[col] 24 | i+=1 25 | 26 | with open(file_name+'.json', 'w') as f_j: 27 | json.dump(temp_data, f_j, indent=4) 28 | 29 | except: 30 | print("Please provide correct filename") 31 | 32 | print("File converted successfully :)") -------------------------------------------------------------------------------- /csv_to_json/img/CLI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/csv_to_json/img/CLI.jpg -------------------------------------------------------------------------------- /csv_to_json/img/after.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/csv_to_json/img/after.jpg -------------------------------------------------------------------------------- /csv_to_json/img/before.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/csv_to_json/img/before.jpg -------------------------------------------------------------------------------- /csv_to_json/requirements.txt: -------------------------------------------------------------------------------- 1 | csv 2 | json -------------------------------------------------------------------------------- /elastic-snapshot/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2023.7.22 2 | chardet==3.0.4 3 | idna==2.10 4 | requests==2.31.0 5 | urllib3==1.26.18 6 | -------------------------------------------------------------------------------- /extended_ip_address_info/README.md: -------------------------------------------------------------------------------- 1 | # Extended IP address info 2 | 3 | View extended info about your public IP address from the terminal. 4 | 5 | The python script runs `curl` with the following parameters 6 | ```bash 7 | curl -H "Accept: application/json" https://ipinfo.io/json 8 | ``` 9 | 10 | ## Create virtual environment and run 11 | Create virtual environment. 12 | ```bash 13 | python3 -m venv /path/to/new/virtual/environment 14 | ``` 15 | 16 | Activate virtual environment. 17 | ```bash 18 | cd 19 | source bin/activate 20 | ``` 21 | 22 | Install required libraries. 23 | ```bash 24 | pip install -r requirements.txt 25 | ``` 26 | 27 | **Run program.** 28 | ```bash 29 | python extended_ip_address_info.py 30 | ``` 31 | 32 | Deactivate virtual environment. 33 | ```bash 34 | deactivate 35 | ``` 36 | 37 | ## Output 38 | Output should be in the form of the following: 39 | ```json 40 | { 41 | "ip": "xxx.xxx.xxx.xxx", 42 | "city": "A_city", 43 | "hostname": "host.isp-website.com", 44 | "region": "A_region", 45 | "country": "Country code", 46 | "loc": "coordinates", 47 | "org": "AS-number ISP-name", 48 | "postal": "postal-code", 49 | "timezone": "Europe/City", 50 | "readme": "https://ipinfo.io/missingauth" 51 | } 52 | ``` -------------------------------------------------------------------------------- /extended_ip_address_info/extended_ip_address_info.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Using curl to get data from https://ipinfo.io/json 5 | # Template from pycurl documentation 6 | # http://pycurl.io/docs/latest/quickstart.html#examining-response-headers 7 | 8 | import pycurl #curl library 9 | import certifi #HTTP over TLS/SSL library 10 | from io import BytesIO #Buffered I/O implementation using an in-memory bytes buffer. 11 | 12 | #set header, '--header' or -H 13 | header = ['Accept: application/json'] 14 | 15 | buffer = BytesIO() 16 | c = pycurl.Curl() #curl 17 | c.setopt(c.HTTPHEADER, header) #header 18 | c.setopt(c.URL, 'https://ipinfo.io/json') #URL 19 | c.setopt(c.WRITEDATA, buffer) 20 | c.setopt(c.CAINFO, certifi.where()) # SSL certificates 21 | c.perform() 22 | c.close() 23 | 24 | body = buffer.getvalue() 25 | # Body is a byte string. 26 | # We have to know the encoding in order to print it to a text file 27 | # such as standard output. 28 | print(body.decode('iso-8859-1')) -------------------------------------------------------------------------------- /extended_ip_address_info/requirements.txt: -------------------------------------------------------------------------------- 1 | pycurl 2 | certifi -------------------------------------------------------------------------------- /file-encrypt-decrypt/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode -------------------------------------------------------------------------------- /file-encrypt-decrypt/Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [dev-packages] 7 | 8 | [packages] 9 | cryptography = "*" 10 | pytest = "*" 11 | 12 | [requires] 13 | python_version = "3.7" 14 | -------------------------------------------------------------------------------- /file-encrypt-decrypt/README.md: -------------------------------------------------------------------------------- 1 | # 🗝 crypt 2 | 3 | A command line python script which can Encrypt a given file and also decrypt the encrypted file 4 | 5 | 6 | 7 | #### Pre-requisites 8 | * install pipenv 9 | ```sh 10 | $ brew install pipenv 11 | ``` 12 | 13 | * install dependencies 14 | ```sh 15 | $ pipenv install 16 | ``` 17 | 18 | #### Usage 19 | * Encrypt file 20 | ```sh 21 | $ pipenv run python crypt -e file.txt 22 | ``` 23 | * Decrypt file 24 | ```sh 25 | $ pipenv run python crypt -d file.enc 26 | ``` 27 | **note** 28 | - `file.enc` will be created if you pass in `file.txt` 29 | - Do not loose the Encryption 🗝 -------------------------------------------------------------------------------- /git_automation/.my_commands.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function create() { 4 | cd 5 | source .env 6 | python create.py $1 7 | cd $FILEPATH$1 8 | git init 9 | git remote add origin git@github.com:$USERNAME/$1.git 10 | touch README.md 11 | git add . 12 | git commit -m "Initial commit" 13 | git push -u origin main 14 | code . 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /git_automation/README.md: -------------------------------------------------------------------------------- 1 | ### Install: 2 | ```bash 3 | pip install -r requirements.txt 4 | touch .env 5 | Then open the .env file and store your username, password, and desired file destination. Use the provided format at the bottom of this README. 6 | source ~/.my_commands.sh 7 | ``` 8 | 9 | ### Usage: 10 | ```bash 11 | To run the script type in 'create ' 12 | ``` 13 | -------------------------------------------------------------------------------- /git_automation/config.env: -------------------------------------------------------------------------------- 1 | USERNAME="User" 2 | PASSWORD="Pass" 3 | FILEPATH="/path/to/your/project/" -------------------------------------------------------------------------------- /git_automation/create.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | from github import Github 4 | from dotenv import load_dotenv 5 | 6 | load_dotenv() 7 | 8 | path = os.getenv("FILEPATH") 9 | username = os.getenv("USERNAME") 10 | password = os.getenv("PASSWORD") 11 | 12 | def create(): 13 | folderName = str(sys.argv[1]) 14 | folderpath = os.path.join(path,folderName) 15 | if os.path.exists(folderpath): 16 | print("Folder already exists.. Link to the path - "+ folderpath) 17 | os.makedirs(folderpath) 18 | user = Github(username, password).get_user() 19 | repo = user.create_repo(sys.argv[1]) 20 | print("Succesfully created repository {}".format(sys.argv[1])) 21 | 22 | 23 | if __name__ == "__main__": 24 | create() 25 | -------------------------------------------------------------------------------- /git_automation/requirements.txt: -------------------------------------------------------------------------------- 1 | selenium 2 | PyGithub 3 | python-dotenv 4 | -------------------------------------------------------------------------------- /google_meet_joiner/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Automated Google Meet Joiner 3 | 4 | An automated google meet joiner the auto-joins meetings according to schedule. 5 | 6 | 7 | 8 | 9 | ## Setup 10 | 11 | 1. To run this project, download the files and run the following command to install all the necessary files. 12 | 13 | ```bash 14 | pip install -r requirements.txt 15 | ``` 16 | 17 | 2. Then open the `meeting_ids.txt` file and add your meeting ids for the day in order on each line. 18 | 19 | E.g. 20 | ```bash 21 | meeting_id_1 22 | meeting_id_2 23 | meeting_id_3 24 | ``` 25 | 26 | 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. 27 | 28 | E.g. 29 | ```bash 30 | 16:00 31 | 17:30 32 | 18:50 33 | ``` 34 | 4. The run the python file either normally or using the `pythonw` version to avoid a dialog box. 35 | 36 | ```bash 37 | pythonw main.py 38 | ``` 39 | 40 | 41 | ## Additional Setup 42 | 43 | 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. 44 | 45 | ```bash 46 | schedule.every().day.at(time[x]).do(joinGoogleMeet(ids[x])) 47 | ``` 48 | - Remember to replace the 'x' with the number on which the meeting id and time is located. 49 | 50 | ## License 51 | 52 | [MIT](https://choosealicense.com/licenses/mit/) 53 | 54 | 55 | ## Authors 56 | 57 | - [@JohanSanSebastian](https://www.github.com/johansansebastian) 58 | 59 | -------------------------------------------------------------------------------- /google_meet_joiner/assets/finalJoinMeet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/google_meet_joiner/assets/finalJoinMeet.png -------------------------------------------------------------------------------- /google_meet_joiner/main.py: -------------------------------------------------------------------------------- 1 | import pyautogui 2 | import webbrowser 3 | import schedule 4 | import time 5 | 6 | def joinGoogleMeet(meeting_id): 7 | webbrowser.open_new_tab( 8 | f"https://meet.google.com/{meeting_id}".replace("'", "")) 9 | time.sleep(10) 10 | 11 | pyautogui.click() 12 | pyautogui.hotkey('ctrl', 'd') 13 | time.sleep(1) 14 | pyautogui.hotkey('ctrl', 'e') 15 | 16 | finaljoinBTN = pyautogui.locateCenterOnScreen( 17 | "assets/finalJoinMeet.png") 18 | pyautogui.moveTo(finaljoinBTN) 19 | pyautogui.click() 20 | 21 | if __name__ == '__main__': 22 | # meeting_id = input("Meeting ID: ") 23 | # joinGoogleMeet(meeting_id) 24 | 25 | with open('meeting_ids.txt', 'r') as f: 26 | ids = f.readlines() 27 | with open('meeting_times.txt', 'r') as j: 28 | time = j.readlines() 29 | 30 | # You can add more number of scheduled meetings using the line below, 31 | # replacing 'x' with the value of the meeting id and time in their respective times 32 | 33 | # schedule.every().day.at(time[x]).do(joinGoogleMeet(ids[x])) 34 | 35 | schedule.every().day.at(time[0]).do(joinGoogleMeet(ids[0])) 36 | schedule.every().day.at(time[1]).do(joinGoogleMeet(ids[1])) 37 | schedule.every().day.at(time[2]).do(joinGoogleMeet(ids[2])) 38 | -------------------------------------------------------------------------------- /google_meet_joiner/meeting_ids.txt: -------------------------------------------------------------------------------- 1 | meeting_id_1 2 | meeting_id_2 3 | meeting_id_3 4 | -------------------------------------------------------------------------------- /google_meet_joiner/meeting_times.txt: -------------------------------------------------------------------------------- 1 | meeting_time_1 2 | meeting_time_2 3 | meeting_time_3 4 | -------------------------------------------------------------------------------- /google_meet_joiner/requirements.txt: -------------------------------------------------------------------------------- 1 | PyAutoGUI==0.9.53 2 | schedule==1.1.0 -------------------------------------------------------------------------------- /imageWatermarker/README.md: -------------------------------------------------------------------------------- 1 | ## Python script to watermark your images 2 | 3 | in the `main.py` file edit the following items: 4 | 5 | ```bash 6 | "", 7 | "", 8 | "" 9 | ``` 10 | 11 | using the input folder path to loop over all images and output them to outputfolder. 12 | 13 | Best practise is to use a image with transparent background. 14 | -------------------------------------------------------------------------------- /imageWatermarker/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow==10.2.0 2 | -------------------------------------------------------------------------------- /images2pdf/README.md: -------------------------------------------------------------------------------- 1 | # images2pdf 2 | this is a small script to make a pdf from list of images. 3 | 4 | ### Dependencies: 5 | 1- PIL package 6 | 2- fpdf 7 | 8 | ### how to run : 9 | 1- create a directory with images you want to create a pdf from 10 | 2- name those images with numbers as the order you want 11 | 3- run the script , it will ask you for the directory , and a name for your pdf 12 | 13 | ### to do : 14 | 1- modify the position of the image to be at the center of the page 15 | 2- modify the dimensions of the image to fill the page 16 | 3- put some comments on the code 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /images2pdf/imges2pdf.py: -------------------------------------------------------------------------------- 1 | import PyPDF2 2 | from os import path 3 | import sys 4 | 5 | def File_existance_checker(filePath): 6 | if path.isfile(filePath): 7 | return filePath 8 | else: 9 | print("[-] Provide a valid File") 10 | sys.exit(1) 11 | pdf_stored_path=input("Enter the name of you pdf file (please use backslash when typing in directory path):") 12 | 13 | textFile_stored_path=path.join(path.dirname(pdf_stored_path),path.basename(pdf_stored_path).replace(".pdf",".txt")) 14 | pdf_stored_path=File_existance_checker(pdf_stored_path) 15 | 16 | print(textFile_stored_path) 17 | 18 | with open(pdf_stored_path,'rb') as pdf_object: 19 | pdf_read=PyPDF2.PdfFileReader(pdf_object) 20 | 21 | pdf_pages=pdf_read.numPages 22 | 23 | for i in range(pdf_pages): 24 | page_object=pdf_read.getPage(i) 25 | with open(textFile_stored_path,'a+') as f: 26 | f.write((page_object.extract_text())) 27 | print(f"[+] Pdf Text has been extracted and written to {path.basename(textFile_stored_path)}") 28 | -------------------------------------------------------------------------------- /images2pdf/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow 2 | fpdf 3 | -------------------------------------------------------------------------------- /imdb_episode_ratings/README.md: -------------------------------------------------------------------------------- 1 | # Get information about your favorite TV shows at once 2 | This python script will make a excel files, with information about every episode from every season of the TV show that you searched for 3 | 4 | ## Requirement 5 | 6 | Python 3.6 onwards 7 | ```bash 8 | pip3 install requests 9 | pip3 install xlwt 10 | pip3 install bs4 11 | 12 | ``` 13 | 14 | #Usage 15 | Call python following with the simple algebra problem 16 | ```bash 17 | $ python scraper.py 18 | ``` 19 | Then simply enter the name of the show you want to search for, and then you will find a excel file in the same directory with the name of the show you searched for -------------------------------------------------------------------------------- /insta_video_downloader/README.md: -------------------------------------------------------------------------------- 1 | # Instagram Video Downloader 2 | ### Downlaods all the videos from instagram post. User needs to provide instagram post id as parameter 3 | >> Example 4 | 5 | ``` 6 | python instavideo.py B3NUFfmgRYW 7 | ``` 8 | >> Example output file 9 | 10 | ``` 11 | B3NUFfmgRYW_0.mp4 12 | ``` -------------------------------------------------------------------------------- /insta_video_downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /ipaddress/README.md: -------------------------------------------------------------------------------- 1 | # IP Address 2 | 3 | This scripts will print IP address of machine and info realted to the IP address . 4 | -------------------------------------------------------------------------------- /ipaddress/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | ip_provider = "http://ipaddr.in/json" 4 | user_agent = { 5 | 'User-agent': 'curl/7.82.0' 6 | } 7 | try : 8 | web_request = requests.get(ip_provider, headers=user_agent , timeout=10) 9 | response = web_request.json() 10 | 11 | ip = response["ip"] 12 | city = response["city"] 13 | area = response["region_name"] 14 | zip_code = response["zip_code"] 15 | country = response["country"] 16 | 17 | print( 18 | f""" 19 | IP address : {ip} 20 | City : {city} 21 | Area : {area} 22 | Postal code : {zip_code} 23 | Country : {country} 24 | """ 25 | ) 26 | except : 27 | print("Error !! Check your internt connection") -------------------------------------------------------------------------------- /ipaddress/requirments.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /json-to-yaml/Readme.md: -------------------------------------------------------------------------------- 1 | ## JSON To YAML Converter 2 | 3 | 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. 4 | So I have tried to automate the same, by writing the following python script 5 | 6 | For running this, you need to install/import the following libraries 7 | ``` 8 | 9 | - import json 10 | - import yaml 11 | ``` 12 | 13 | 14 | Then in command prompt you just need to type: 15 | ``` 16 | 17 | python json2yaml.py input_file.json output_file.yaml 18 | ``` 19 | 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. 20 | -------------------------------------------------------------------------------- /json-to-yaml/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "glossary": { 3 | "title": "example glossary", 4 | "GlossDiv": { 5 | "title": "S", 6 | "GlossList": { 7 | "GlossEntry": { 8 | "ID": "SGML", 9 | "SortAs": "SGML", 10 | "GlossTerm": "Standard Generalized Markup Language", 11 | "Acronym": "SGML", 12 | "Abbrev": "ISO 8879:1986", 13 | "GlossDef": { 14 | "para": "A meta-markup language, used to create markup languages such as DocBook.", 15 | "GlossSeeAlso": ["GML", "XML"] 16 | }, 17 | "GlossSee": "markup" 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /json-to-yaml/json2yaml.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import sys 4 | import yaml 5 | 6 | # Checking there is a file name passed 7 | if len(sys.argv) > 1: 8 | # Opening the file 9 | if os.path.exists(sys.argv[1]): 10 | source_file = open(sys.argv[1], "r") 11 | source_content = json.load(source_file) 12 | source_file.close() 13 | # Failikng if the file isn't found 14 | else: 15 | print("ERROR: " + sys.argv[1] + " not found") 16 | exit(1) 17 | # No file, no usage 18 | else: 19 | print("Usage: json2yaml.py [target_file.yaml]") 20 | 21 | # Processing the conversion 22 | output = yaml.dump(source_content) 23 | 24 | # If no target file send to stdout 25 | if len(sys.argv) < 3: 26 | print(output) 27 | # If the target file already exists exit 28 | elif os.path.exists(sys.argv[2]): 29 | print("ERROR: " + sys.argv[2] + " already exists") 30 | exit(1) 31 | # Otherwise write to the specified file 32 | else: 33 | target_file = open(sys.argv[2], "w") 34 | target_file.write(output) 35 | target_file.close() -------------------------------------------------------------------------------- /json-to-yaml/output.yaml: -------------------------------------------------------------------------------- 1 | glossary: 2 | GlossDiv: 3 | GlossList: 4 | GlossEntry: 5 | Abbrev: ISO 8879:1986 6 | Acronym: SGML 7 | GlossDef: 8 | GlossSeeAlso: 9 | - GML 10 | - XML 11 | para: A meta-markup language, used to create markup languages such as DocBook. 12 | GlossSee: markup 13 | GlossTerm: Standard Generalized Markup Language 14 | ID: SGML 15 | SortAs: SGML 16 | title: S 17 | title: example glossary 18 | -------------------------------------------------------------------------------- /logpye_log4j_search/README.md: -------------------------------------------------------------------------------- 1 | # script-logpye 2 | 3 | ![help](screenshot/help.png) 4 | 5 | 6 | ## usage 7 | 8 | * -h/--help : displays help in picture above 9 | * -f/--file : points to log file(is required) 10 | * -as/--asciisearch : ascii text search, searches for a string in the log element 11 | * -rs/--regexsearch : regex search, input valid regex to search for in log element 12 | * -fe/--frontend : edit frontend printing this has to be valid python for now 13 | 14 | ###example 15 | 16 | ``python logpye.py -f core.log -as joystick`` 17 | 18 | ``python logpye.py -f core.log -rx "\bjoystick\b.*?\botn-inst01\b"`` 19 | 20 | ``python logpye.py -f core.log -as fathom -fe "error_level, logger, message, timestamp, thread"`` 21 | -------------------------------------------------------------------------------- /logpye_log4j_search/screenshot/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/logpye_log4j_search/screenshot/help.png -------------------------------------------------------------------------------- /mailing/README.md: -------------------------------------------------------------------------------- 1 | For linux/unix users : 2 | 3 | File Link 4 | -------------------------------------------------------------------------------- /mailing/gmail_messenger.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import smtplib #import stmplib 4 | 5 | 6 | try: 7 | server = smtplib.SMTP("smtp.gmail.com", 587) #establshing server connection 8 | server.ehlo() 9 | server.starttls() 10 | print("SERVER CONNECTED") 11 | except: 12 | print("Could Not connect to Gmail") #in case of failure 13 | 14 | user = input("Enter User id\n") #YOUR ID 15 | Pass_w = input("\nEnter your Password\n") #YOUR Password 16 | reciever_id = input("\nEnter reciever id\n") #Reciever ID 17 | msg = input("\nEnter message\n") #message 18 | 19 | try: 20 | server.login(user, Pass_w) #user log in 21 | print("User Logged in") 22 | except: 23 | print("Allow Less secure apps in GOOGLE ACCOUNT SETTINGS to use SMTP services") 24 | server.quit() 25 | exit() 26 | 27 | server.sendmail(user, reciever_id, msg) 28 | print("MAIL sent") #confirmation 29 | 30 | 31 | print("Closing Connection") 32 | server.quit() #closing server connection 33 | print("Server closed") 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /medium_article_downloader/README.md: -------------------------------------------------------------------------------- 1 | A simple python script download latest articles from medium topicwise and save them in text files. 2 | 3 | It basically scrapes the site using requests and bs4 modules. I made it just for fun after I read Automate the Boring Stuff with Python by Al Sweigart. -------------------------------------------------------------------------------- /medium_article_downloader/medium.py: -------------------------------------------------------------------------------- 1 | import requests, bs4 2 | from helpers import * 3 | 4 | choice = get_topic() 5 | print('\nGetting latest article links from %s...' % (choice)) 6 | 7 | article_list = extract_links('https://medium.com/topic/' + choice) 8 | print('Total articles found: ' + str(len(article_list))) 9 | 10 | for i in range(len(article_list)): 11 | heading = article_list[i].getText() 12 | artlink = article_list[i].get('href') 13 | artlink = artlink if artlink.startswith("https://") else "https://medium.com" + artlink 14 | print('Downloading article: ' + str(i+1)) 15 | 16 | # remove invalid characters from filename 17 | file_name = f"{heading}.txt".replace(':', '').replace('?', '') 18 | file = open(file_name, 'w') 19 | 20 | article_text = medium_text(artlink) 21 | file.write(article_text) 22 | file.close() 23 | 24 | print('Done.') -------------------------------------------------------------------------------- /medium_article_downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | bs4 -------------------------------------------------------------------------------- /py_based_music_player/README.md: -------------------------------------------------------------------------------- 1 | # Web Based Music Player , Update Music Using Python 2 | 3 | -> Web based ( HTML, CSS , JS) based Music player, but instead of manually changing and adding music use python to do that. 4 | 5 | -> Cause without Database it is very hard to maintain this offline music player, 6 | 7 | ### How to use 8 | 9 | -> add your music into assets > music > / music files 10 | 11 | -> each folder in assets > music will act as playlist. 12 | 13 | -> 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). 14 | 15 | -> add album cover into assets > cover > album_cover folder. 16 | 17 | -> Now Run `python py_based_music_player.py` 18 | 19 | -> this will update the .js file of music data and use can open music.html to see the changes. 20 | 21 | ### Note 22 | 23 | -> On first load their is default folder > which contains music to launch on first start, 24 | 25 | you can change that also. -------------------------------------------------------------------------------- /py_based_music_player/css/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/py_based_music_player/css/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /py_based_music_player/css/webfonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/py_based_music_player/css/webfonts/fa-solid-900.woff -------------------------------------------------------------------------------- /py_based_music_player/css/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/py_based_music_player/css/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /py_based_music_player/css/webfonts/lato.css: -------------------------------------------------------------------------------- 1 | /* latin-ext */ 2 | @font-face { 3 | font-family: 'Lato'; 4 | font-style: normal; 5 | font-weight: 400; 6 | font-display: swap; 7 | src: url(https://fonts.gstatic.com/s/lato/v23/S6uyw4BMUTPHjxAwXjeu.woff2) format('woff2'); 8 | 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; 9 | } 10 | /* latin */ 11 | @font-face { 12 | font-family: 'Lato'; 13 | font-style: normal; 14 | font-weight: 400; 15 | font-display: swap; 16 | src: url(https://fonts.gstatic.com/s/lato/v23/S6uyw4BMUTPHjx4wXg.woff2) format('woff2'); 17 | 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; 18 | } 19 | -------------------------------------------------------------------------------- /py_based_music_player/js/main/music_list.js: -------------------------------------------------------------------------------- 1 | const music_list = [ 2 | "default" 3 | ]; 4 | const main_list = { 5 | "default": [] 6 | }; 7 | -------------------------------------------------------------------------------- /py_based_music_player/js/main/sidebar.js: -------------------------------------------------------------------------------- 1 | let sidebar = document.querySelector(".sidebar"); 2 | let closeBtn = document.querySelector("#btn"); 3 | 4 | closeBtn.addEventListener("click", ()=>{ 5 | sidebar.classList.toggle("open"); 6 | menuBtnChange();//calling the function(optional) 7 | }); 8 | 9 | 10 | // following are the code to change sidebar button(optional) 11 | function menuBtnChange() { 12 | if(sidebar.classList.contains("open")){ 13 | closeBtn.classList.replace("bx-menu", "bx-menu-alt-right");//replacing the iocns class 14 | }else { 15 | closeBtn.classList.replace("bx-menu-alt-right","bx-menu");//replacing the iocns class 16 | } 17 | } -------------------------------------------------------------------------------- /send_sqs_messages_in_parallel/README.md: -------------------------------------------------------------------------------- 1 | # Send messages to sqs in parallel 2 | 3 | A python script that will take a file with a lot of messages to be sent to sqs and will send them to a queue in highly parallelized manner. 4 |
5 | This is especially useful for batch processing requests. 6 |
7 | Works when ```aws configure``` is done correctly or iam role is attached to the machine 8 | 9 | ## Requirement 10 | 11 | ```bash 12 | pip3 install boto3 13 | ``` 14 | 15 | #Usage 16 | Go to Upload_files_to_s3 directory and add your folder's name you want to upload to s3 and then run upload_files_to_s3.py as below: 17 | ```bash 18 | $ python3 send_to_sqs.py 19 | ``` 20 | -------------------------------------------------------------------------------- /send_sqs_messages_in_parallel/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3==1.10.50 -------------------------------------------------------------------------------- /send_sqs_messages_in_parallel/send_to_sqs.py: -------------------------------------------------------------------------------- 1 | import boto3 2 | import json 3 | import sys 4 | from multiprocessing import Pool 5 | 6 | file = '/path/to/file_with_records_as_jsonl' 7 | queue_url = 'your-queue-url' 8 | region = 'your-region' 9 | processor_count = int(sys.argv[1]) 10 | 11 | 12 | def send_message(data): 13 | sqs_client = boto3.client('sqs', region_name=region) 14 | sqs_client.send_message_batch( 15 | QueueUrl=queue_url, 16 | Entries=[{'MessageBody': json.dumps(x)} for x in data] 17 | ) 18 | 19 | 20 | def main(file): 21 | temp = [] 22 | total_records_sent = 0 23 | 24 | with open(file) as f: 25 | data = [json.loads(line) for line in f] 26 | batched_data = [] 27 | for i in range(0, len(data), int(len(data)/processor_count)): 28 | batched_data.append(data[i:i + int(len(data)/processor_count)]) 29 | for _ in Pool(processes=processor_count).imap_unordered(send_message, 30 | batched_data): 31 | temp.append(_) 32 | for x in temp: 33 | total_records_sent += x 34 | 35 | 36 | if __name__ == "__main__": 37 | main(file) 38 | -------------------------------------------------------------------------------- /send_whatsapp_message/README.md: -------------------------------------------------------------------------------- 1 | # Send Whatsapp message! 2 | 3 | One can easily send a whatsapp message using this script. 4 | **Pre-requisite:** Scan QR code manually. 5 | 6 | 7 | ## Requirements 8 | 9 | - Python3 10 | - Selenium 11 | ```console 12 | $ pip install -U selenium 13 | ``` 14 | - Chromedriver (Needs to be in PATH) 15 | 16 | ## Instructions 17 | 18 | - Install selenium of python module in a recognized location on your desktop. 19 | - Install chromedriver from here. [https://chromedriver.chromium.org/downloads] 20 | 21 | **NOTE :** The version of Google Chrome and chromedriver has to be same. 22 | -------------------------------------------------------------------------------- /send_whatsapp_message/Requirements.txt: -------------------------------------------------------------------------------- 1 | selenium -------------------------------------------------------------------------------- /send_whatsapp_message/whatsapp-message.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | 3 | driver = webdriver.Chrome() 4 | driver.get('https://web.whatsapp.com/') 5 | a=1 6 | while a!=0: 7 | input('Scan QR code first and hit enter') 8 | name = input('Enter the name of user or group : ') 9 | msg = input('Enter your message : ') 10 | count = int(input('Enter the count : ')) 11 | user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(name)) 12 | user.click() 13 | msg_box = driver.find_element_by_class_name('_3u328') 14 | for i in range(count): 15 | msg_box.send_keys(msg) 16 | button = driver.find_element_by_class_name('_3M-N-') 17 | button.click() 18 | a=int(input("Wanna text any other guy?(0/1):")) 19 | if a==0: 20 | print("Bye!\nSee you soon.") 21 | -------------------------------------------------------------------------------- /signature2png/imgs/example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/signature2png/imgs/example.jpg -------------------------------------------------------------------------------- /signature2png/imgs/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/signature2png/imgs/result.png -------------------------------------------------------------------------------- /speak_like_yoda/README.md: -------------------------------------------------------------------------------- 1 | # Speak-Like-Yoda 2 | 3 | ## Description 4 | A python script that translates an input English sentence into Yoda-speak. 5 | 6 | ## Usage 7 | Run ```python speak_like_yoda.py```. Type in your sentence to get it translated into Yoda-speak. 8 | 9 | ## Requirements 10 | The script only uses Python's standard modules ```random``` and ```string```, so no additional installation is needed. -------------------------------------------------------------------------------- /speak_like_yoda/requirements.txt: -------------------------------------------------------------------------------- 1 | random 2 | string -------------------------------------------------------------------------------- /speak_like_yoda/speak_like_yoda.py: -------------------------------------------------------------------------------- 1 | import random 2 | import string 3 | 4 | def speak_like_yoda(sentence): 5 | """ 6 | Translate the input sentence into Yoda-speak. 7 | 8 | :param sentence: input string 9 | :return: translation to Yoda-speak 10 | """ 11 | sentence = sentence.lower() 12 | for p in string.punctuation.replace("'", ''): 13 | sentence = sentence.replace(p, '') 14 | words = sentence.split() 15 | random.shuffle(words) 16 | new_sent = ' '.join(words) 17 | print() 18 | print('Your Yodenglish sentence:') 19 | print(new_sent.capitalize()) 20 | 21 | if __name__ == '__main__': 22 | print('Your English sentence:') 23 | sentence = str(input()) 24 | speak_like_yoda(sentence) 25 | -------------------------------------------------------------------------------- /spotify_downloader/README.md: -------------------------------------------------------------------------------- 1 | - Downloads music from YouTube as an MP3 file. 2 | - Applies basic on metadata like track name, track number, album, genre and more. 3 |

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

10 | # Installation 11 | ``` 12 | pip install -r requirements.txt 13 | ``` 14 | OR 15 | ``` 16 | pip3 install -r requirements.txt 17 | ``` 18 | # Usage 19 | To download a song run, 20 | 21 | python3 spotify.py $trackUrl 22 | python3 spotify.py https://open.spotify.com/track/08mG3Y1vljYA6bvDt4Wqkj?si=SxezdxmlTx-CaVoucHmrUA 23 | 24 | To download an album run, 25 | 26 | python3 spotify.py $albumUrl 27 | python3 spotify.py https://open.spotify.com/album/2YMWspDGtbDgYULXvVQFM6?si=gF5dOQm8QUSo-NdZVsFjAQ 28 | 29 | To download a playlist run, 30 | 31 | python3 spotify.py $playlistUrl 32 | python3 spotify.py https://open.spotify.com/playlist/37i9dQZF1DWXhcuQw7KIeM?si=xubKHEBESM27RqGkqoXzgQ 33 | -------------------------------------------------------------------------------- /spotify_downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | spotdl==2.2.2 2 | -------------------------------------------------------------------------------- /spotify_downloader/spotify.py: -------------------------------------------------------------------------------- 1 | import spotdl 2 | import sys,os 3 | def spotify(): 4 | if(len(sys.argv) <= 1): 5 | print("try 'python3 spotify.py -h' for help") 6 | return 1 7 | elif(sys.argv[1] == '-h'): 8 | 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") 9 | return 1 10 | url = sys.argv[1] 11 | if (url.find('track') > -1): 12 | os.system(f'spotdl --song {url}') 13 | else: 14 | # Playlist 15 | if (url.find('playlist') > -1): 16 | os.system(f"spotdl -p {url} --write-to playlist.txt") 17 | os.system(f"spotdl --list playlist.txt") 18 | # Artist 19 | if (url.find('artist') > -1): 20 | os.system(f"spotdl --all {url} --write-to artist.txt") 21 | os.system(f"spotdl --list artist.txt") 22 | # album 23 | if (url.find('album') > -1): 24 | os.system(f"spotdl -a {url} --write-to album.txt") 25 | os.system(f"spotdl --list album.txt") 26 | 27 | 28 | if __name__ == "__main__": 29 | spotify() 30 | -------------------------------------------------------------------------------- /sudoku-solver/app.py: -------------------------------------------------------------------------------- 1 | from sudoku_solver.solver import * 2 | 3 | x = [[8, 1, 0, 0, 3, 0, 0, 2, 7], 4 | [0, 6, 2, 0, 5, 0, 0, 9, 0], 5 | [0, 7, 0, 0, 0, 0, 0, 0, 0], 6 | [0, 9, 0, 6, 0, 0, 1, 0, 0], 7 | [1, 0, 0, 0, 2, 0, 0, 0, 4], 8 | [0, 0, 8, 0, 0, 5, 0, 7, 0], 9 | [0, 0, 0, 0, 0, 0, 0, 8, 0], 10 | [0, 2, 0, 0, 1, 0, 7, 5, 0], 11 | [3, 8, 0, 0, 7, 0, 0, 4, 2]] 12 | 13 | 14 | 15 | 16 | if __name__ == "__main__": 17 | print("INPUT => ") 18 | printsudoku(x) 19 | solveSudoku(x) 20 | print("OUTPUT => ") 21 | printsudoku(x) 22 | -------------------------------------------------------------------------------- /sudoku-solver/readme.md: -------------------------------------------------------------------------------- 1 | # sudoku-solver 2 | 3 | This is a script to solve 9x9 sudoku matrix using python. 4 | 5 | ### How to use it? 6 | 7 | 1. edit app.py to add your sudoku matrix. (Fill `0` for empty cells.) 8 | 9 | ``` 10 | For example, 11 | 12 | [[8, 1, 0, 0, 3, 0, 0, 2, 7], 13 | [0, 6, 2, 0, 5, 0, 0, 9, 0], 14 | [0, 7, 0, 0, 0, 0, 0, 0, 0], 15 | [0, 9, 0, 6, 0, 0, 1, 0, 0], 16 | [1, 0, 0, 0, 2, 0, 0, 0, 4], 17 | [0, 0, 8, 0, 0, 5, 0, 7, 0], 18 | [0, 0, 0, 0, 0, 0, 0, 8, 0], 19 | [0, 2, 0, 0, 1, 0, 7, 5, 0], 20 | [3, 8, 0, 0, 7, 0, 0, 4, 2]] 21 | ``` 22 | 23 | 2. run the script. 24 | 25 | ``` 26 | python3 app.py 27 | ``` 28 | 29 | 3. This will give you output on the console. Output will contain the input sudoku matrix and the solved sudoku matrix. 30 | 31 | ``` 32 | INPUT => 33 | 34 | 35 | 36 | 8 1 0 | 0 3 0 | 0 2 7 37 | 0 6 2 | 0 5 0 | 0 9 0 38 | 0 7 0 | 0 0 0 | 0 0 0 39 | --------------------- 40 | 0 9 0 | 6 0 0 | 1 0 0 41 | 1 0 0 | 0 2 0 | 0 0 4 42 | 0 0 8 | 0 0 5 | 0 7 0 43 | --------------------- 44 | 0 0 0 | 0 0 0 | 0 8 0 45 | 0 2 0 | 0 1 0 | 7 5 0 46 | 3 8 0 | 0 7 0 | 0 4 2 47 | 48 | 49 | 50 | OUTPUT => 51 | 52 | 53 | 54 | 8 1 9 | 4 3 6 | 5 2 7 55 | 4 6 2 | 7 5 1 | 3 9 8 56 | 5 7 3 | 2 9 8 | 4 1 6 57 | --------------------- 58 | 2 9 4 | 6 8 7 | 1 3 5 59 | 1 5 7 | 9 2 3 | 8 6 4 60 | 6 3 8 | 1 4 5 | 2 7 9 61 | --------------------- 62 | 7 4 5 | 3 6 2 | 9 8 1 63 | 9 2 6 | 8 1 4 | 7 5 3 64 | 3 8 1 | 5 7 9 | 6 4 2 65 | ``` 66 | -------------------------------------------------------------------------------- /sudoku-solver/sudoku_solver/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hastagAB/Awesome-Python-Scripts/f0ea440d412b9b079e3346600f24c74a8ea96386/sudoku-solver/sudoku_solver/__init__.py -------------------------------------------------------------------------------- /sudoku-solver/sudoku_solver/solver.py: -------------------------------------------------------------------------------- 1 | def printsudoku(sudoku): 2 | print("\n\n") 3 | for i in range(len(sudoku)): 4 | line = "" 5 | if i == 3 or i == 6: 6 | print("---------------------") 7 | for j in range(len(sudoku[i])): 8 | if j == 3 or j == 6: 9 | line += "| " 10 | line += str(sudoku[i][j])+" " 11 | print(line) 12 | print("\n\n") 13 | 14 | def findNextCellToFill(sudoku): 15 | for x in range(9): 16 | for y in range(9): 17 | if sudoku[x][y] == 0: 18 | return x, y 19 | return -1, -1 20 | 21 | def isValid(sudoku, i, j, e): 22 | rowOk = all([e != sudoku[i][x] for x in range(9)]) 23 | if rowOk: 24 | columnOk = all([e != sudoku[x][j] for x in range(9)]) 25 | if columnOk: 26 | secTopX, secTopY = 3*(i//3), 3*(j//3) 27 | for x in range(secTopX, secTopX+3): 28 | for y in range(secTopY, secTopY+3): 29 | if sudoku[x][y] == e: 30 | return False 31 | return True 32 | return False 33 | 34 | def solveSudoku(sudoku, i=0, j=0): 35 | i, j = findNextCellToFill(sudoku) 36 | if i == -1: 37 | return True 38 | for e in range(1, 10): 39 | if isValid(sudoku, i, j, e): 40 | sudoku[i][j] = e 41 | if solveSudoku(sudoku, i, j): 42 | return True 43 | sudoku[i][j] = 0 44 | return False 45 | -------------------------------------------------------------------------------- /url_shortener/README.md: -------------------------------------------------------------------------------- 1 | # url_shortener 2 | 3 | 4 | Some urls are really long, you should short them with this script! 5 | This script uses `requests` for sending HTTP requests and 6 | uses `BeautifulSoup` from `bs4` for web scraping. 7 | 8 | [![Python: 3.7](https://img.shields.io/badge/python-3.7-blue)](https://www.python.org/) 9 | [![Build Status](https://img.shields.io/badge/build-passing-success)](https://github.com/ebsa491) 10 | 11 | ### Installation 12 | 13 | ```shell 14 | (SOURCE_DIR)$ pip3 install -r requirements.txt 15 | ``` 16 | 17 | ### Usage 18 | 19 | ```shell 20 | (SOURCE_DIR)$ python3 url_shortener.py [-u, --url] [URL] 21 | ``` 22 | 23 | ### Other 24 | By Sam Ebison 25 | 26 | If you have found any important bug or vulnerability, 27 | contact me pls, I love learning ( email: ebsa491@gmail.com ) 28 | -------------------------------------------------------------------------------- /url_shortener/requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4==4.9.3 2 | certifi==2023.7.22 3 | chardet==3.0.4 4 | idna==2.10 5 | pkg-resources==0.0.0 6 | requests==2.31.0 7 | soupsieve==2.0.1 8 | urllib3==1.26.18 9 | -------------------------------------------------------------------------------- /vigenere_cipher/README.md: -------------------------------------------------------------------------------- 1 | # Vigenère cipher 2 | 3 | Python script that encrypts/decrypts a given text with a given key based on the [Vigenere cipher](https://en.wikipedia.org/wiki/Vigenère_cipher) 4 | 5 | # Usage 6 | 7 | For Windows users: 8 | 9 | ```bash 10 | $ python vigenere.py 11 | ``` 12 | 13 | For Mac/Linux/Unix users: 14 | 15 | ```bash 16 | $ ./vigenere.py 17 | ``` 18 | -------------------------------------------------------------------------------- /yts_torrents/README.md: -------------------------------------------------------------------------------- 1 | # yts_torrents 2 | 3 | Download all torrents from yts.am (yify movies). Uses yify api. 4 | 5 | ## Usage 6 | 7 | - Create a virtualenv: 8 | 9 | ``` 10 | python3 -m venv venv 11 | ``` 12 | 13 | - Activate it on Linux: 14 | 15 | ``` 16 | . venv/bin/activate 17 | ``` 18 | 19 | - Or on Windows cmd: 20 | 21 | ``` 22 | venv\Scripts\activate.bat 23 | ``` 24 | 25 | - Install requirements 26 | 27 | ``` 28 | pip install -r requirements 29 | ``` 30 | 31 | run `python yts_am_api.py` to make json files containing torrent links of the movies. Then run `python linkdownload.py` 32 | to parse the created json files and download the torrents. 33 | 34 | ## Priority 35 | 36 | The torrents will be downloaded according to the following priority: 37 | 38 | 1080p bluray> 1080p web> 720p bluray> 720p web 39 | 40 | ## Disclaimer 41 | 42 | Downloading copyright movies may be illegal in your country. This tool is for educational purposes only and was created only to experiment with [yify api](https://yts.am/api) 43 | 44 | ## Original Repository 45 | 46 | Check out the original repository at https://github.com/makkoncept/yts_torrents. 47 | 48 | This project was used to create [movie_torrents](https://github.com/makkoncept/movie_torrents)[repository of 10k+ movie torrents]. 49 | -------------------------------------------------------------------------------- /yts_torrents/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2023.7.22 2 | chardet==3.0.4 3 | idna==2.8 4 | requests==2.31.0 5 | urllib3==1.26.19 6 | -------------------------------------------------------------------------------- /zabbix_api/README.md: -------------------------------------------------------------------------------- 1 | # Zabbix-API 2 | This utility allows you to fetch daily alerts from Zabbix Moniotring Tool and send it as mail. It will use Postflix as SMTP or relay server 3 | 4 | # Usage 5 | 6 | `python dailyAlertMail.py ` 7 | -------------------------------------------------------------------------------- /zabbix_api/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | Jinja2 3 | -------------------------------------------------------------------------------- /zabbix_api/templates/email_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Total Zabbix alerts {{ count }}

6 |
7 |
8 |
    9 | Host Wise count: 10 |
    11 | {% for host, count in zabbixHostWiseCount.items() %} 12 | 13 | {{ host }} 14 | {{ count }} 15 | 16 | {% endfor %} 17 | 18 |
    19 | Alerts: 20 |
    21 | 22 | {% for host in zabbixAlertWiseCount.keys() %} 23 | 24 | Host: {{ host }} 25 | 26 | Alert 27 | Count 28 | 29 | 30 | {% for hostAlertMessage, count in zabbixAlertWiseCount[host].items() %} 31 | 32 | {{ hostAlertMessage }} 33 | {{ count }} 34 | 35 | {% endfor %} 36 |
    37 | {% endfor %} 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /zip_password_cracker/README.md: -------------------------------------------------------------------------------- 1 | # anyZipcrack-dictionary 2 | This python script will crack any zip file using given dictionary file 3 | ## Requipment 4 | 5 | python 3.++ or 2.++ 6 | 7 | # Usage 8 | try using the given zip file and dictionary file 9 | 10 | ## For windows 11 | 12 | ```bash 13 | $ python zipCrack.py -f evil.zip -d dictionary.txt 14 | ``` 15 | 16 | ## For unix/mac/linux 17 | 18 | ```bash 19 | $ ./zipCrack.py -f evil.zip -d dictionary.txt 20 | ``` 21 | or that way 22 | ```bash 23 | $ python zipCrack.py -f evil.zip -d dictionary.txt 24 | ``` 25 | -------------------------------------------------------------------------------- /zip_password_cracker/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | print ''' 5 | Free anyZipcrack-dictionary created by: 6 | pyc0d3r: http://www.umarbrowser.co.vu/ 7 | ''' 8 | #imports 9 | import zipfile 10 | import optparse 11 | from threading import Thread 12 | #Try extarct if found password 13 | def extractFile(zFile, password): 14 | try: 15 | zFile.extractall(pwd=password) 16 | print '[+] Found password ' + password + '\n' 17 | except: 18 | pass 19 | # main thats gives an interace using optparse 20 | def main(): 21 | parser = optparse.OptionParser("usage %prog "+\ 22 | "-f -d ") 23 | parser.add_option('-f', dest='zname', type='string',\ 24 | help='specify zip file') 25 | parser.add_option('-d', dest='dname', type='string',\ 26 | help='specify dictionary file') 27 | (options, args) = parser.parse_args() 28 | if (options.zname == None) | (options.dname == None): 29 | print parser.usage 30 | exit(0) 31 | else: 32 | zname = options.zname 33 | dname = options.dname 34 | 35 | zFile = zipfile.ZipFile(zname) 36 | passFile = open(dname) 37 | 38 | for line in passFile.readlines(): 39 | password = line.strip('\n') 40 | t = Thread(target=extractFile, args=(zFile, password)) 41 | t.start() 42 | 43 | 44 | if __name__ == '__main__': 45 | main() 46 | --------------------------------------------------------------------------------