├── 2048 ├── 2048.py ├── colors.py └── readme.md ├── .github └── workflows │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── Algebra-Solver ├── Algebra-Solver.py ├── README.MD └── requirements.txt ├── Artificial-intelligence_bot ├── README.md ├── ai.aiml ├── bot.py ├── load.xml └── requirements.txt ├── Bitcoin-Price-GUI ├── README.md └── bitcoin-price.py ├── 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 ├── CricBuzz_Score_Update ├── README.md ├── cricbuzz_scrap.py └── requirements.txt ├── Crypt_Socket ├── README.md ├── cryptSocket_cliente.py ├── cryptSocket_servidor.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 ├── Directory-organizer ├── Directory-oraganiser.py └── README.md ├── 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 ├── 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 ├── Git_repo_creator ├── README.md └── git_repo_creator.py ├── 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 ├── 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 ├── PX-to-REM ├── README.md ├── converter.py └── px_to_rem.py ├── Ping_Server ├── Ping_server.py ├── README.md └── requirements.txt ├── Port_Scanner ├── README.md └── port_scanner.py ├── 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 ├── Subtitle-downloader ├── README.md ├── main.py └── requirements.txt ├── Take_screenshot ├── README.md ├── requirements.txt ├── screenshot.py └── test.png ├── Tambola_Ticket_Generator ├── README.MD ├── main.py └── requirements.txt ├── TestMyInternetSpeed ├── README.md ├── TestMySpeed.py └── requirements.txt ├── 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 ├── 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 ├── Work_Log_Generator ├── README.rst ├── requirements.txt ├── resources │ ├── icone.ico │ ├── loader.gif │ └── save.png └── work_log.py ├── Youtube_Video_Downloader ├── README.md ├── download_video.py └── requirements.txt ├── asymmetric_cryptography ├── README.md ├── asymmetric.py └── requirements.txt ├── automated_email ├── README.md ├── automated_email.py └── requirements.txt ├── caeser_cipher ├── README.md └── caeser.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 ├── 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 ├── 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 ├── 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 ├── 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 | - [ ] I have read and followed the [Contribution Guidlines](https://github.com/hastagAB/Awesome-Python-Scripts#contribution-guidelines-) before creating this PR. 9 | - [ ] I've added a new Script 10 | - [ ] Script is tested and running perfectly fine on my system 11 | - [ ] PR is regarding the Documetation 12 | - [ ] This change requires a documentation update 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Editors 3 | .vscode/ 4 | .idea/ 5 | 6 | # Vagrant 7 | .vagrant/ 8 | 9 | # Mac/OSX 10 | .DS_Store 11 | 12 | # Windows 13 | Thumbs.db 14 | 15 | # Source for the following rules: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore 16 | # Byte-compiled / optimized / DLL files 17 | __pycache__/ 18 | *.py[cod] 19 | *$py.class 20 | 21 | # C extensions 22 | *.so 23 | 24 | # Distribution / packaging 25 | .Python 26 | build/ 27 | develop-eggs/ 28 | dist/ 29 | downloads/ 30 | eggs/ 31 | .eggs/ 32 | lib/ 33 | lib64/ 34 | parts/ 35 | sdist/ 36 | var/ 37 | wheels/ 38 | *.egg-info/ 39 | .installed.cfg 40 | *.egg 41 | MANIFEST 42 | 43 | # PyInstaller 44 | # Usually these files are written by a python script from a template 45 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 46 | *.manifest 47 | *.spec 48 | 49 | # Installer logs 50 | pip-log.txt 51 | pip-delete-this-directory.txt 52 | 53 | # Unit test / coverage reports 54 | htmlcov/ 55 | .tox/ 56 | .nox/ 57 | .coverage 58 | .coverage.* 59 | .cache 60 | nosetests.xml 61 | coverage.xml 62 | *.cover 63 | .hypothesis/ 64 | .pytest_cache/ 65 | 66 | # Translations 67 | *.mo 68 | *.pot 69 | 70 | # Django stuff: 71 | *.log 72 | local_settings.py 73 | db.sqlite3 74 | 75 | # Flask stuff: 76 | instance/ 77 | .webassets-cache 78 | 79 | # Scrapy stuff: 80 | .scrapy 81 | 82 | # Sphinx documentation 83 | docs/_build/ 84 | 85 | # PyBuilder 86 | target/ 87 | 88 | # Jupyter Notebook 89 | .ipynb_checkpoints 90 | 91 | # IPython 92 | profile_default/ 93 | ipython_config.py 94 | 95 | # pyenv 96 | .python-version 97 | 98 | # celery beat schedule file 99 | celerybeat-schedule 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json -------------------------------------------------------------------------------- /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 ----------- -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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/contact-distribution.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding: utf-8 3 | 4 | import email 5 | import smtplib 6 | import sys 7 | import csv 8 | 9 | # Capture stdin message via pipe 10 | msg = email.message_from_file(sys.stdin) 11 | 12 | # list with sellers or emails for distribution 13 | sellers = [('Seller 01', 'seller01@domain.com'), 14 | ('Seller 02', 'seller02@domain.com')] 15 | 16 | # Check the size of the vendor list 17 | totalSellers = len(sellers) 18 | 19 | # Get the last seller that received email 20 | lastSeller = open('lastseller.txt', 'r').read() # use the full path of file 21 | 22 | # Determines the next seller who will receive email 23 | if int(lastSeller) == totalSellers - 1: # If the last one you received is the last 24 | nextSeller = 0 # on the list, get the first one on the list. 25 | else: # If not, 26 | nextSeller = int(lastSeller) + 1 # get the next one. 27 | 28 | currentSeller = str(nextSeller) 29 | 30 | # records which seller is receiving the current email. 31 | fvend = open('lastseller.txt', 'w') # use the full path of file 32 | fvend.write(currentSeller) 33 | fvend.close() 34 | 35 | # Check if you have an email for reply 36 | if not msg['reply-to']: 37 | emailContact = msg['from'] 38 | else: 39 | emailContact = msg['reply-to'] 40 | 41 | # writes log to csv 42 | with open('emails.csv', 'a') as fcsv: # use the full path of file 43 | mailwriter = csv.writer(fcsv, delimiter=';') 44 | mailwriter.writerow( 45 | [msg['date'], msg['subject'], emailContact, 46 | sellers[nextSeller][0]]) 47 | 48 | # Forward the email to the seller of the time. 49 | s = smtplib.SMTP('localhost') 50 | s.sendmail("sellers@domain.com", sellers[nextSeller][1], 51 | msg.as_string()) 52 | s.quit() 53 | -------------------------------------------------------------------------------- /Contact-Distribution/docs/images/cpanel_encaminhadores01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Contact-Distribution/docs/images/cpanel_encaminhadores01.jpg -------------------------------------------------------------------------------- /Contact-Distribution/docs/images/cpanel_encaminhadores02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Contact-Distribution/docs/images/cpanel_encaminhadores02.jpg -------------------------------------------------------------------------------- /Contact-Distribution/lastseller.txt: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /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_cliente.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | #CLIENTE 4 | 5 | from simplecrypt import encrypt, decrypt #import da biblioteca para encriptar 6 | 7 | import socket #import da biblioteca para o socket 8 | import threading #import da biblioteca para thread 9 | import time #import da biblioteca utilizada para fazer uma pausa com o sleep 10 | 11 | tLock = threading.Lock() #cria threads para executar o programa 12 | poweroff = False 13 | 14 | def receving(name, sock): 15 | while not poweroff: 16 | try: 17 | 18 | tLock.acquire() #faz o teste na thread, se o retorno é true ele \ 19 | #continua, se é false ele exibe um erro de timeout expired 20 | while True: 21 | data, addr = sock.recvfrom(2048) 22 | #print (str(data.decode('utf-8'))) 23 | except: 24 | pass 25 | finally: 26 | tLock.release() #se a thread está no estado travado ele destrava e \ 27 | #passa para a proxima thread, senão ele retorna um erro RunTimeError 28 | 29 | #definição do IP do cliente 30 | host = '127.0.0.1' 31 | port = 0 32 | 33 | #definição do servidor 34 | server = ('127.0.0.1', 5000) 35 | 36 | #criação do socket 37 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 38 | s.bind((host, port)) 39 | s.setblocking(0) 40 | rT = threading.Thread(target=receving, args=("RecvThread", s)) 41 | rT.start() 42 | 43 | #definição do nome de usuário (apelido) 44 | alias = input("Username: ") 45 | time.sleep(0.2) 46 | 47 | #criação da mensagem e envio para o server 48 | message = input(alias + ">>> ") 49 | while message != 'q': 50 | cryptmsg = encrypt("Fatec123", message) 51 | if message != "": 52 | #s.sendto(str(alias + ": " + cryptmsg).encode('utf-8'), server) 53 | s.sendto(cryptmsg, server) 54 | print(cryptmsg) 55 | tLock.acquire() 56 | message = input(alias + ">>> ") 57 | cryptmsg = encrypt("Fatec123", message) 58 | tLock.release() 59 | time.sleep(0.2) 60 | 61 | #finaliza o socket e o programa 62 | poweroff = True 63 | rT.join() 64 | s.close() 65 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Excel_to_ListofList/input.xlsx -------------------------------------------------------------------------------- /Excel_to_ListofList/requirements.txt: -------------------------------------------------------------------------------- 1 | xlrd 2 | -------------------------------------------------------------------------------- /Face_recognition/Image_recognition.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import cv2\n", 10 | "\n", 11 | "face_cascade = cv2.CascadeClassifier(\"haarcascade_frontalface_default.xml\")\n", 12 | "\n", 13 | "img = cv2.imread(\"morgan.jpg\",1)\n", 14 | "\n", 15 | "gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n", 16 | "\n", 17 | "faces = face_cascade.detectMultiScale(gray_img, scaleFactor=1.05, minNeighbors=5)\n", 18 | "\n", 19 | "print(type(faces))\n", 20 | "print(faces)\n", 21 | "\n", 22 | "for x,y,w,h in faces:\n", 23 | " img = cv2.rectangle(img, (x,y), (x+w,y+h), (0,255,0),3)\n", 24 | " \n", 25 | "resize_img = cv2.resize(img, (int(img.shape[1]/2), int(img.shape[0]/2)))\n", 26 | "\n", 27 | "cv2.imshow(\"Gray\",resize_img)\n", 28 | "\n", 29 | "cv2.waitKey(0)\n", 30 | "\n", 31 | "cv2.destroyAllWindow(Gray)" 32 | ] 33 | } 34 | ], 35 | "metadata": { 36 | "kernelspec": { 37 | "display_name": "Python 3", 38 | "language": "python", 39 | "name": "python3" 40 | }, 41 | "language_info": { 42 | "codemirror_mode": { 43 | "name": "ipython", 44 | "version": 3 45 | }, 46 | "file_extension": ".py", 47 | "mimetype": "text/x-python", 48 | "name": "python", 49 | "nbconvert_exporter": "python", 50 | "pygments_lexer": "ipython3", 51 | "version": "3.7.3" 52 | } 53 | }, 54 | "nbformat": 4, 55 | "nbformat_minor": 2 56 | } 57 | -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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 | -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Folder Locker & Hider/app.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Folder Locker & Hider/icons/back.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/choose_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Folder Locker & Hider/icons/choose_folder.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Folder Locker & Hider/icons/lock.png -------------------------------------------------------------------------------- /Folder Locker & Hider/icons/unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Folder Locker & Hider/icons/unlock.png -------------------------------------------------------------------------------- /Folder Locker & Hider/readme.md: -------------------------------------------------------------------------------- 1 | # Folder Locker & Hider 2 | 3 | [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) 4 | [![forthebadge](https://forthebadge.com/images/badges/built-with-swag.svg)](https://forthebadge.com) 5 | [![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) 6 | 7 | Folder Locker & Hider is a simple python tkinter based application to lock / unlock and hide folders 8 | using simple windows property 9 | 10 | ![Alt text](app.png?raw=true "Folder Locker & Hider") 11 | 12 | This app is only for windows platform 13 | 14 | ## How to Download 15 | 16 | Download this project from here [Download Folder Locker & Hider](https://downgit.github.io/#/home?url=https://github.com/pyGuru123/Tkinter-Applications/tree/master/Folder%20Locker%20%26%20Hider) 17 | 18 | ## Requirements 19 | 20 | No external package is required 21 | 22 | ## Usage 23 | 24 | Double click the application.pyw script to open the GUI application, then 25 | 26 | to lock folder: 27 | click the lock folder button, select the folder that you want to lock, enter a password and then click lock folder button to lock the folder, the folder will now be hidden automatically. 28 | 29 | password should be greater than 4 digits in length, the locked folder can only be unlocked by using this app, also the folder will not show wven when show hidden items is checked 30 | 31 | to unlock folder: 32 | click the unlock folder button, select the locked folder name from the listbox on the right [double click it], then enter the correct password and unlock it by click the unlock folder button. 33 | The folder will now be unhidden automatically 34 | 35 | 36 | ## Contributing 37 | Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. 38 | 39 | Please make sure to update tests as appropriate. -------------------------------------------------------------------------------- /Folder_Manager/Exception.txt: -------------------------------------------------------------------------------- 1 | Example.txt 2 | example.exe 3 | -------------------------------------------------------------------------------- /Folder_Manager/Readme.md: -------------------------------------------------------------------------------- 1 | # Folder_Manager 2 | 3 | ## About 4 | 5 | ### This script is used to make your Folder tidy by capitalizing the first letters of your File names. And this program also dumps wanted files into a new folder named according to the file extensions. Please see the images give below to understand better: 6 | 7 | ### Before 8 | ![Before](https://i.imgur.com/CabHHHt.png) 9 | 10 | ### After 11 | ![After](https://i.imgur.com/kfqikco.png) 12 | 13 | ### As you can see the files are dumped to a new folder and all rest files are Capitalized. This program only dumps the file after asking a extension name of the file like if you want to dump .txt and .dll files then enter "txt,dll" when asked. This script doesn't touch Subfolders so don't worry to getting your data messed up and if you want to made some file as Exception then Enter the name of the files in Exception.txt separated by a newline character. Don't worry I know I'm going to comprehensive you can see the below image to clear your issues : 14 | 15 | ### Code ran in CMD. 16 | ![Code](https://i.imgur.com/54SR6YD.png) 17 | 18 | ### Exceptions File 19 | 20 | ![Exception.txt](https://i.imgur.com/0Vyqsly.png) 21 | 22 | 23 | ## Some Important Warnings 24 | 25 | + ### All files present in this directory is needed to run the code (except README.md). So don't delete or rename any files. Important files:- 26 | - #### all-file-extensions.json 27 | - #### Exception.txt 28 | - #### Folder_Manager.py 29 | + ### Just follow the instructions carefully this program may throw errors if exploited. I did handle the most Errors I can but make sure to do follow the instructions. 30 | + ### And please don't do any changes in Main Code if you don't know what is it. 31 | 32 | ### After Reading README simply run the code in any terminal. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import argparse 4 | 5 | ap = argparse.ArgumentParser() 6 | ap.add_argument("-f", "--function", required=True, help="user details or repo details") 7 | ap.add_argument("-l", "--list", required=True, metavar="", nargs='+', default=[], help="handle and repo") 8 | args = vars(ap.parse_args()) 9 | 10 | class GithubBot(): 11 | def __init__(self): 12 | print('******************* GITHUB CLI TOOL *********************') 13 | self.base_url = "https://api.github.com/" 14 | 15 | def get_user_details(self, args): 16 | url = self.base_url + "users/" + args[0] 17 | res = requests.get(url) 18 | print('*********** USER:', args[0], '***************') 19 | if res.status_code == 200: 20 | data = json.loads(res.text) 21 | print("NAME: ", data["name"]) 22 | print("BIO: ", data["bio"]) 23 | print("LOCATION: ", data["location"]) 24 | print("FOLLOWERS COUNT: ", data["followers"]) 25 | print("FOLLOWING COUNT: ", data["following"]) 26 | else: 27 | print("Error getting details") 28 | 29 | def get_repo_details(self, args): 30 | url = self.base_url + "repos/" + args[0] + "/" + args[1] 31 | res = requests.get(url) 32 | print('********* USER:', args[0], '| REPO:', args[1], '*********') 33 | if res.status_code == 200: 34 | data = json.loads(res.text) 35 | print("URL: ", data["svn_url"]) 36 | print("STARS: ", data["stargazers_count"]) 37 | print("FORKS: ", data["forks"]) 38 | print("LANGUAGE: ", data["language"]) 39 | else: 40 | print("Error getting details") 41 | 42 | if __name__ == "__main__": 43 | obj = GithubBot() 44 | function_map = { 45 | 'user': obj.get_user_details, 46 | 'repo': obj.get_repo_details, 47 | } 48 | function_map[args['function']](args['list']) 49 | -------------------------------------------------------------------------------- /Github_Bot/readme_assets/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Github_Bot/readme_assets/img.png -------------------------------------------------------------------------------- /Github_Bot/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2020.6.20 2 | chardet==3.0.4 3 | idna==2.10 4 | requests==2.24.0 5 | urllib3==1.26.5 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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/HTML_Table_to_List/__init__.py -------------------------------------------------------------------------------- /HTML_Table_to_List/html_table_to_list_usage.py: -------------------------------------------------------------------------------- 1 | from HTMLTableToList import HTMLTableToList 2 | from pprint import pprint 3 | 4 | html_table_string = """ 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
RGB537235
HSL0.250.350.21
HSV91°51°28°
CMYK0.260.000.51   0.72
XYZ4.08895.51302.4387
Yxy5.51300.33960.4579
Hunter Lab23.4798-10.004610.2778
CIE-Lab28.1490-15.100619.7427
""" 32 | 33 | htmltabletolist = HTMLTableToList(html_table_string) ## args : HTML table as string 34 | list_of_list = htmltabletolist.get_list() 35 | pprint(list_of_list) 36 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /IMDBQuerier/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /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/README.md: -------------------------------------------------------------------------------- 1 | # IMDBQuerier 2 | 3 | This project is written to parsing films from IMDB user lists based on some attributes. It uses Selenium and BeautifulSoup to obtain and parse the film data. 4 | 5 | Until now, the project can parse films based on their: 6 | 7 | * Runtime 8 | * Score 9 | * Year 10 | * Genre 11 | * Type (TV show or film) 12 | 13 | Currently, one can make the exact queries on the refine section at the bottom of each user list. However, it is hard to apply your selections to all lists. 14 | 15 | Checkout [original repo](https://github.com/Bekci/IMDBQuerier) for the latest version. 16 | ## Requirements 17 | 18 | Selenium and BeautifulSoup modules are necessary for the project. Other than that, you will need a WebDriver. The project is using ChromeDriver but you can change it to the other supported browsers easily. 19 | 20 | If you have changed the driver, make sure to change the below code accordingly. 21 | 22 | ``` 23 | # main.py line 16 24 | driver = webdriver.Chrome() 25 | ``` 26 | 27 | [Here is a link for the Firefox driver.](https://github.com/mozilla/geckodriver/releases) 28 | 29 | ## Usage 30 | 31 | First of all, change the values in the `parse_options` dictionary in the [parser_config.py](parser_config.py). 32 | 33 | Then, change the value of `list_url` variable in the [main.py](main.py) code to the list wanted to be parsed. 34 | 35 | Run the code, the output html will apear in list_htmls folder. 36 | 37 | ## Common Driver Error 38 | 39 | The used version of the browser driver can be out-dated. Always use the latest version in case of an error. 40 | 41 | [Firefox Driver](https://github.com/mozilla/geckodriver/releases) 42 | 43 | [Chrome Driver](https://chromedriver.chromium.org/) -------------------------------------------------------------------------------- /IMDBQuerier/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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/main.py: -------------------------------------------------------------------------------- 1 | from bs4 import BeautifulSoup 2 | from selenium import webdriver 3 | import time 4 | from selenium.webdriver.common.keys import Keys 5 | from film_content_parser import obtain_film_object 6 | from parser_config import check_film_object, watched_included 7 | from html_creator import create_html_file 8 | 9 | def get_watched_films(file_path): 10 | watched_films_txt = open(file_path, 'r') 11 | if watched_films_txt: 12 | watched_names = watched_films_txt.read().split('\n') 13 | return [names for names in watched_names if names != ''] 14 | return None 15 | 16 | watched_films = None 17 | if not watched_included(): 18 | watched_films = get_watched_films('watched_films.txt') 19 | 20 | # Time to wait for web page to be loaded. 21 | TIME_FACTOR = 2 22 | 23 | # Give the URL of the imdb list. 24 | list_url = "https://www.imdb.com/list/ls025718406/?ref_=tt_rls_2" 25 | 26 | print("Opening a webdriver") 27 | driver = webdriver.Chrome() 28 | 29 | driver.get(list_url) 30 | 31 | print("Waiting the website to be loaded") 32 | # Wait browser to load the page. 33 | time.sleep(TIME_FACTOR) 34 | 35 | content = driver.page_source.encode('utf-16').strip() 36 | soup = BeautifulSoup(content, 'lxml') 37 | 38 | # Obtain all films 39 | film_contents = soup.find_all("div", class_="lister-item mode-detail") 40 | 41 | wanted_films = [] 42 | 43 | list_header = soup.find("h1", class_='header list-name').text 44 | 45 | print("Parsing and querying films") 46 | for all_content in film_contents: 47 | img_source = all_content.find('div', class_='lister-item-image ribbonize').find('img') 48 | content = all_content.find('div', class_='lister-item-content') 49 | current_film = obtain_film_object(content, img_source) 50 | if check_film_object(current_film, watched_films): 51 | wanted_films.append(current_film) 52 | 53 | create_html_file(wanted_films, list_header) 54 | print("New html created with the name ",list_header ) 55 | 56 | driver.close() 57 | -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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_path=askopenfilenames() 6 | img = PIL.Image.open(file_path) 7 | myHeight,myWidth = img.size 8 | 9 | img=img.resize((myHeight,myWidth),PIL.Image.ANTILIAS) 10 | save_path=asksaveasfile() 11 | 12 | img.save(save_path+"_compressed.JPG") -------------------------------------------------------------------------------- /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 | pip install image 11 | 12 | -------------------------------------------------------------------------------- /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==2019.9.11 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() 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Ping_Server/Ping_server.py: -------------------------------------------------------------------------------- 1 | '''TODOs 2 | more reliable and caching alert meethods (eg phone calls or sms) 3 | server resourses 4 | time taken to respond ping 5 | to know wheather gone down for sometime and come up after sometime 6 | ''' 7 | from twilio.rest import Client 8 | from telethon import TelegramClient 9 | import requests 10 | from telethon.tl.types import InputPeerChat 11 | from telethon.tl.functions.messages import ImportChatInviteRequest 12 | #your telegram api_id & hash 13 | #for more details get from telethon 14 | def main(): 15 | j 16 | api_id = ##### 17 | api_hash = '######################' 18 | 19 | # Your Account Sid and Auth Token from twilio.com/console 20 | account_sid = '###############' 21 | auth_token = '################' 22 | clients = Client(account_sid, auth_token) 23 | 24 | 25 | #telegram_Side 26 | client = TelegramClient('session_name', api_id, api_hash) 27 | client.start() 28 | #print(client.get_me().stringify()) 29 | #updates = client(ImportChatInviteRequest('FDVzKw8BPHTp2wyhwNqT2Q')) 30 | siteList=[site_list] 31 | for i in siteList: 32 | print(i) 33 | r = requests.head(i) 34 | if r.status_code == 200: 35 | message=i +" returned 200" 36 | chat = InputPeerChat(chatID) 37 | client.send_message(chat, message) 38 | sms= clients.messages.create(to="#####",from_="##########",body="the "+i+" is not responding now ") 39 | call = clients.calls.create(url='http://demo.twilio.com/docs/voice.xml',to='############',from_='#############') 40 | print(call.sid) 41 | else: 42 | chat = InputPeerChat(chatID) 43 | message="oops " + i + " not available at the moment" 44 | client.send_message(chat, message) 45 | 46 | 47 | if __name__ == '__main__': 48 | main() 49 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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) -------------------------------------------------------------------------------- /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.17.3 2 | opencv-python==4.1.1.26 3 | Pillow==6.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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Py_Cleaner/Screenshot 2020-06-24 at 12.27.00 PM.png -------------------------------------------------------------------------------- /Py_Cleaner/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Py_Cleaner/bg.gif -------------------------------------------------------------------------------- /Py_Cleaner/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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_Email_Generator/Random_email_generator.py: -------------------------------------------------------------------------------- 1 | import random 2 | import string 3 | import csv 4 | import progressbar 5 | 6 | ''' 7 | Asks user for how many emails they want generated. Must be Integer. 8 | If not an integer, keeps recursively cycling back until it gets an integer. 9 | ''' 10 | def getcount(): 11 | rownums = input("How many email addresses?: ") 12 | try: 13 | rowint = int(rownums) 14 | return rowint 15 | except ValueError: 16 | print ("Please enter an integer value") 17 | return getcount() 18 | 19 | ''' 20 | Creates a random string of digits between 1 and 20 characters alphanumeric and adds it to a fake domain and fake extension 21 | Most of these emails are completely bogus (eg - gmail.gov) but will meet formatting requirements for my purposes 22 | ''' 23 | def makeEmail(): 24 | extensions = ['com','net','org','gov'] 25 | domains = ['gmail','yahoo','comcast','verizon','charter','hotmail','outlook','frontier'] 26 | 27 | winext = extensions[random.randint(0,len(extensions)-1)] 28 | windom = domains[random.randint(0,len(domains)-1)] 29 | 30 | acclen = random.randint(1,20) 31 | 32 | winacc = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(acclen)) 33 | 34 | finale = winacc + "@" + windom + "." + winext 35 | return finale 36 | 37 | #save count to var 38 | howmany = getcount() 39 | 40 | #counter for While loop 41 | counter = 0 42 | 43 | #empty array for loop 44 | emailarray = [] 45 | 46 | #uses counter to figure out how many emails to keep making 47 | 48 | print ("Creating email addresses...") 49 | print ("Progress: ") 50 | 51 | prebar = progressbar.ProgressBar(maxval=int(howmany)) 52 | 53 | for i in prebar(range(howmany)): 54 | while counter < howmany: 55 | emailarray.append(str(makeEmail())) 56 | counter = counter+1 57 | prebar.update(i) 58 | 59 | print ("Creation completed.") 60 | 61 | for i in emailarray: 62 | print(i) 63 | -------------------------------------------------------------------------------- /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_Names_Generator/Random_Name_Generator.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | from pathlib import Path 3 | import argparse 4 | import random 5 | 6 | """ Generate a random line from a file without reading the entire file 7 | Inspired from: https://stackoverflow.com/a/35579149 """ 8 | def random_line(file_path): 9 | line_num = 0 10 | selected_line = '' 11 | with file_path.open(mode="r") as fp: 12 | while 1: 13 | line = fp.readline() 14 | if not line: break 15 | line_num += 1 16 | if random.uniform(0, line_num) < 1: 17 | selected_line = line 18 | return selected_line.strip() 19 | 20 | """ Output a given number of random names """ 21 | def random_names(number_of_names = 1): 22 | first_names_file = Path("CSV_Database_Of_First_And_Last_Names/CSV_Database_of_First_Names.csv") 23 | last_names_file = Path("CSV_Database_Of_First_And_Last_Names/CSV_Database_of_Last_Names.csv") 24 | if first_names_file.is_file() and last_names_file.is_file(): # Check if file exists 25 | for i in range(number_of_names): 26 | random_first_name = random_line(first_names_file) 27 | random_last_name = random_line(last_names_file) 28 | print(f'{random_first_name} {random_last_name}') 29 | 30 | if __name__ == '__main__': 31 | # Accept command line argument for number of names required where default is 1 32 | parser = argparse.ArgumentParser(description='Generate Random Names') 33 | parser.add_argument('num', nargs='?', type=int, default=1) 34 | args = parser.parse_args() 35 | random_names(args.num) 36 | 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /SSH_Host_Adder/ssh_adder.py: -------------------------------------------------------------------------------- 1 | import argparse, os 2 | 3 | ssh_template = """ 4 | HOST {name} 5 | HostName {hostname} 6 | User {user} 7 | Port {port} 8 | """ 9 | 10 | def args_to_obj(args): 11 | obj = ssh_template.format(**args) 12 | return obj 13 | 14 | def add_to_conf(conf, obj): 15 | conf = os.path.expanduser(conf) 16 | with open(conf, 'a') as f: 17 | f.write(obj) 18 | 19 | 20 | def main(): 21 | # create the top-level parser 22 | parser = argparse.ArgumentParser(prog = "Adds ssh hosts to the ssh config file. Is kind of a simple script which doesn't support all the options. May update with more stuff. \nExample usage: ./ssh_adder myhost 192.168.80.1 --user someuser --port 2200 --conf /path/to/non-default/ssh/config") 23 | 24 | # create the parser for the "a" command 25 | parser.add_argument('name', help = "This is the name of the Host to add to the config. For instance, if you want to do `ssh somehost`, then name should be `somehost`") 26 | parser.add_argument('hostname', help = "This is the hostname/ip address of the host. If `somehost`'s address is 192.168.80.1, then hostname=192.168.80.1") 27 | parser.add_argument('--user', default = 'root', help="The user to connect with. Defaults to root") 28 | parser.add_argument('--port', default = 22, type = int, help = "The port to connect to. Defaults to 22") 29 | parser.add_argument('--conf', default = '~/.ssh/config', help = "The path to the ssh config file. Defaults to ~/.ssh/config, which is the default location. ") 30 | 31 | args = parser.parse_args() 32 | 33 | obj = args_to_obj(args.__dict__) 34 | add_to_conf(args.conf, obj) 35 | 36 | main() 37 | -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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 -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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.19.2 2 | tabulate==0.8.7 3 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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.24.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.20.0 2 | urllib3==1.26.5 3 | requests==2.20.0 4 | urllib3==1.26.5 5 | py4j==0.10.4 6 | BeautifulSoup==3.2.0 7 | numpy==1.9.2 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 | -------------------------------------------------------------------------------- /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/main.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | systemInfo='' 3 | try: 4 | systemInfo = subprocess.check_output(['uname']).decode('utf-8', errors="backslashreplace").split('\n') 5 | systemInfo = systemInfo[0] 6 | except : 7 | pass 8 | if systemInfo == "Linux": 9 | wifiData = subprocess.check_output(['ls', '/etc/NetworkManager/system-connections']).decode('utf-8', errors="backslashreplace").split('\n') 10 | print ("Wifiname Password") 11 | print ("----------------------------------------") 12 | 13 | for wifiname in wifiData: 14 | if wifiname != '': 15 | wifiPass = subprocess.check_output(['sudo','cat', f"/etc/NetworkManager/system-connections/{wifiname}"]).decode('utf-8', errors="backslashreplace").split('\n') 16 | password=wifiPass[15].strip("psk="); 17 | print ("{:<30} {:<}".format(wifiname, password)) 18 | else: 19 | wifi = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="backslashreplace").split('\n') 20 | profiles = [i.split(":")[1][1:-1] for i in wifi if "All User Profile" in i] 21 | for i in profiles: 22 | try: 23 | results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8', errors="backslashreplace").split('\n') 24 | results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b] 25 | try: 26 | print ("{:<30}| {:<}".format(i, results[0])) 27 | except : 28 | print ("{:<30}| {:<}".format(i, "")) 29 | except : 30 | print ("{:<30}| {:<}".format(i, "ENCODING ERROR")) 31 | -------------------------------------------------------------------------------- /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")) -------------------------------------------------------------------------------- /Work_Log_Generator/README.rst: -------------------------------------------------------------------------------- 1 | `Work log generator` 2 | -------------------- 3 | 4 | 📝 C'est quoi? 5 | =============== 6 | 7 | Ce simple script python permet de générer un journal de travail au format rst à partir des commits de l'un de vos dépôts. 8 | 9 | 🔘 Comment l'utiliser? 10 | ======================= 11 | 12 | Il est nécessaire de commencer par générer un jeton d'accès et de l'entrer dans le premier champ de la fenêtre. 13 | 14 | Pour le générer, rendez-vous `ici`_ dans la section "Personal access tokens". 15 | 16 | À présent, il est possible de presser sur le bouton de connexion. Dès lors, une liste déroulante affiche les dépôts disponibles. 17 | 18 | Après le choix du dépôt, le dernier bouton permet d'ouvrir le log, de le modifier et de le sauvegarder au format rst. 19 | 20 | Il est maintenant possible de le convertir en utilisant pandoc ou n'importe quelle autre convertisseur que vous préférez. 21 | 22 | Enjoy! 23 | 24 | 25 | 📝 What is this? 26 | ================ 27 | 28 | This simple python script allows you to generate a worklog in rst format based on your repo commits. 29 | 30 | 🔘 How to use it? 31 | ================= 32 | 33 | Simply generate a personnal access token and enter it in the first field of the window. 34 | 35 | In order to generate this token, go `here`_ under "Personal access tokens". 36 | 37 | Then, it is possible to press on the connection button. Since then a dropdown list display the available repositories. 38 | 39 | After choosing the repository, the last button allows you to open the log, edit it and save it in rst format. 40 | 41 | You can then convert it using pandoc or any other converter you prefer. 42 | 43 | Enjoy! 44 | 45 | .. _`ici`: https://github.com/settings/tokens 46 | .. _`here`: https://github.com/settings/tokens 47 | -------------------------------------------------------------------------------- /Work_Log_Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | QDarkStyle 2 | PyQt5 3 | PyGithub 4 | -------------------------------------------------------------------------------- /Work_Log_Generator/resources/icone.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Work_Log_Generator/resources/icone.ico -------------------------------------------------------------------------------- /Work_Log_Generator/resources/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Work_Log_Generator/resources/loader.gif -------------------------------------------------------------------------------- /Work_Log_Generator/resources/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/Work_Log_Generator/resources/save.png -------------------------------------------------------------------------------- /Youtube_Video_Downloader/README.md: -------------------------------------------------------------------------------- 1 | # Youtube Video Downloader Script 2 | 3 | Requires pytube 4 | -------------------------------------------------------------------------------- /Youtube_Video_Downloader/download_video.py: -------------------------------------------------------------------------------- 1 | from pytube import YouTube 2 | link = input('https://youtu.be/6M1rP2r672o') 3 | yt = Youtube(link) 4 | yt.streams.first().download() 5 | print('downloaded', link) 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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_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/automated_email.py: -------------------------------------------------------------------------------- 1 | from smtplib import SMTP as smtp 2 | import json 3 | 4 | def sendmail(sender_add, reciever_add, msg, password): 5 | server = smtp('smtp.gmail.com:587') 6 | server.starttls() 7 | server.login(sender_add, password) 8 | server.sendmail(sender_add, reciever_add, msg) 9 | print("Mail sent succesfully....!") 10 | 11 | 12 | group = {} 13 | print('\t\t ......LOGIN.....') 14 | your_add = input('Enter your email address :') 15 | password = input('Enter your email password for login:') 16 | print('\n\n\n\n') 17 | choice = 'y' 18 | while(choice != '3' or choice != 'no'): 19 | print("\n 1.Create a group\n2.Message a group\n3.Exit") 20 | choice = input() 21 | if choice == '1': 22 | ch = 'y' 23 | while(ch != 'n'): 24 | gname = input('Enter name of group :') 25 | group[gname] = input('Enter contact emails separated by a single space :').rstrip() 26 | ch = input('Add another....y/n? :').rstrip() 27 | with open('groups.json', 'a') as f: 28 | json.dump(group, f) 29 | elif choice == '2': 30 | gname = input('Enter name of group :') 31 | try: 32 | f = open('groups.json', 'r') 33 | members = json.load(f) 34 | f.close() 35 | except: 36 | print('Invalid group name. Please Create group first') 37 | exit 38 | members = members[gname].split() 39 | msg = input('Enter message :') 40 | for i in members: 41 | try: 42 | sendmail(your_add, i, msg, password) 43 | except: 44 | print("An unexpected error occured. Please try again later...") 45 | continue 46 | else: 47 | break 48 | -------------------------------------------------------------------------------- /automated_email/requirements.txt: -------------------------------------------------------------------------------- 1 | smtplib 2 | json 3 | -------------------------------------------------------------------------------- /caeser_cipher/README.md: -------------------------------------------------------------------------------- 1 | # Simple Caeser Cipher [En,De]coder 2 | 3 | A simple implementation of a CLI tool to work with caeser 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 caeser.py 8 | 9 | usage: caeser.py [-h] [-d] [-o OFFSET] (-f FILE | -s STRING) 10 | caeser.py: error: one of the arguments -f/--file -s/--string is required 11 | ``` 12 | 13 | ```bash 14 | python3 caeser.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 caeser.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 caeser.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.22.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 | -------------------------------------------------------------------------------- /elastic-snapshot/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2020.6.20 2 | chardet==3.0.4 3 | idna==2.10 4 | requests==2.24.0 5 | urllib3==1.25.11 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 | -------------------------------------------------------------------------------- /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/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from os.path import join 4 | from PIL import Image, ImageEnhance 5 | 6 | def FolderSelectAndRun(): 7 | batch( 8 | "", 9 | "", 10 | "" 11 | ) 12 | 13 | 14 | basewidth = 2048 15 | 16 | def batch(infolder, outfolder, watermark): 17 | mark = Image.open(watermark) 18 | count = 0 19 | for root, dirs, files in os.walk(infolder): 20 | for name in files: 21 | try: 22 | count += 1 23 | im = Image.open(join(root, name)) 24 | 25 | # New image in the making 26 | layer = Image.new('RGBA', im.size, (0, 0, 0, 0)) 27 | position = (im.size[0] - (mark.size[0] + 50), 28 | im.size[1] - (mark.size[1] + 50)) 29 | layer.paste(mark, position) 30 | new_image = Image.composite(layer, im, layer) 31 | 32 | # Resize in perspective 33 | wpercent = (basewidth / float(im.size[0])) 34 | hsize = int((float(new_image.size[1]) * float(wpercent))) 35 | smaller_new_image = new_image.resize( 36 | (basewidth, hsize), Image.ANTIALIAS) 37 | 38 | # Save new smaller image 39 | smaller_new_image.save( 40 | join(outfolder, ('with-watermark_' + name)), 'jpeg') 41 | 42 | except Exception as error: 43 | # Debug line while making changes 44 | print('Caught this error: ' + repr(error)) 45 | 46 | 47 | if __name__ == '__main__': 48 | FolderSelectAndRun() 49 | -------------------------------------------------------------------------------- /imageWatermarker/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow==7.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 | 2 | ### img2pdf #### 3 | import os 4 | import sys 5 | from fpdf import FPDF 6 | from PIL import Image 7 | import glob 8 | 9 | 10 | 11 | images_path = raw_input("Enter the path of the folder containing images : ") 12 | images =images_path+"/*.*" 13 | 14 | assert os.path.exists(images_path), "this diretory doesn't exist, "+str(images_path) 15 | f = os.chdir(images_path) 16 | print("Hooray we found your directory!") 17 | 18 | image_list = [] 19 | for filename in glob.glob(images): 20 | 21 | image_list.append(filename) 22 | 23 | pdf = FPDF( unit = 'mm') 24 | 25 | imnames = [i.split("\\") for i in image_list] 26 | imnames = [i[-1] for i in imnames ] 27 | imnums = [i.split('.') for i in imnames] 28 | imnums = [i[0] for i in imnums] 29 | imnums = [int(i) for i in imnums] 30 | 31 | 32 | 33 | pos = 0 34 | images_dict = dict(zip(image_list, imnums)) 35 | sorted_images = sorted(images_dict , key = images_dict.get) 36 | 37 | for i in list(sorted_images): 38 | pdf.add_page() 39 | im = Image.open(i) 40 | pdf.image(i,pos,pos,200,250) 41 | 42 | pdf_name = raw_input("Enter the pdf name : ") 43 | pdf_name = pdf_name+".pdf" 44 | pdf.output(pdf_name) 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /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/instavideo.py: -------------------------------------------------------------------------------- 1 | import urllib.request 2 | import requests 3 | import json 4 | import re 5 | import sys 6 | 7 | def download(post_id): 8 | multiple_posts = False 9 | videos = [] 10 | data = requests.get("https://instagram.com/p/{}".format(post_id)) 11 | if data.status_code == 404: 12 | print("Specified post not found") 13 | sys.exit() 14 | json_data = json.loads(re.findall(r'window._sharedData\s=\s(\{.*\});', data.text)[0]) 15 | data = json_data['entry_data']['PostPage'][0]['graphql']['shortcode_media'] 16 | if 'edge_sidecar_to_children' in data.keys(): 17 | multiple_posts = True 18 | caption = data['edge_media_to_caption']['edges'][0]['node']['text'] 19 | media_url = data['display_resources'][2]['src'] 20 | is_video = data['is_video'] 21 | if not is_video and not multiple_posts: 22 | print("No Videos found") 23 | sys.exit() 24 | if is_video: 25 | videos.append(data['video_url']) 26 | if multiple_posts: 27 | for post in data['edge_sidecar_to_children']['edges']: 28 | if post['node']['is_video']: 29 | videos.append(post['node']['video_url']) 30 | print("Found total {} videos".format(len(videos))) 31 | for no, video in zip(list(range(len(videos))), videos): 32 | print("Downloading video {}".format(no)) 33 | urllib.request.urlretrieve(video, "{}_{}.mp4".format(post_id, no)) 34 | 35 | if len(sys.argv) == 1: 36 | print("Please provide instagram post id") 37 | else: 38 | download(sys.argv[1]) -------------------------------------------------------------------------------- /insta_video_downloader/requirements.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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/logpye_log4j_search/screenshot/help.png -------------------------------------------------------------------------------- /mailing/README.md: -------------------------------------------------------------------------------- 1 | For linux/unix users : 2 | 3 | ./gmail_messenger.py 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 -------------------------------------------------------------------------------- /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/README.md: -------------------------------------------------------------------------------- 1 | # Python signature editor 2 | 3 | The present repo contains a Python script to process signature images, it returns a `png` image with transparent background containing only the signature. 4 | 5 | ## Setup 6 | 7 | The Python PIL ([Python Image Library](http://pillow.readthedocs.io/en/latest/)) package with [Python 3](https://www.python.org/downloads/) is used in this repo. 8 | 9 | To install PIL via pip: 10 | ```bash 11 | pip install pillow 12 | ``` 13 | 14 | ## Contents 15 | 16 | The main script is [`signature.py`](https://github.com/RodolfoFerro/Signature/blob/master/scripts/signature.py), which contains a set of utility functions developed so far. 17 | 18 | ### Done so far 19 | 20 | * Binarize your signature 21 | * Remove background and make it transparent 22 | 23 | ### TODO 24 | 25 | * Smooth image 26 | * Image orientation 27 | * Crop to get only signature 28 | 29 | ## Usage 30 | 31 | The main script, [`signature.py`](https://github.com/RodolfoFerro/Signature/blob/master/scripts/signature.py) requires a set of parameters that are needed in the parser. 32 | 33 | ```bash 34 | $ python signature.py -h 35 | usage: signature.py [-h] -i INPUT [-o OUTPUT] [-th THRESHOLD] 36 | 37 | optional arguments: 38 | -h, --help show this help message and exit 39 | -i INPUT, --input INPUT 40 | Input image. 41 | -o OUTPUT, --output OUTPUT 42 | Output image. 43 | -th THRESHOLD, --threshold THRESHOLD 44 | ``` 45 | 46 | An example to use this script is as follows: 47 | 48 | ```bash 49 | $ python signature.py -i imgs/example.jpg -o imgs/result.png -th 190 50 | ``` 51 | 52 | ### Results 53 | 54 | 55 | 56 | *** 57 | 58 | #### Reference to: 59 | 60 | -------------------------------------------------------------------------------- /signature2png/imgs/example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/signature2png/imgs/example.jpg -------------------------------------------------------------------------------- /signature2png/imgs/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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/Pythondeveloper6/Awesome-Python-Scripts/d68ab3408e729b51adf350af247a612d4eb2580e/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==2020.6.20 3 | chardet==3.0.4 4 | idna==2.10 5 | pkg-resources==0.0.0 6 | requests==2.24.0 7 | soupsieve==2.0.1 8 | urllib3==1.25.10 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==2019.9.11 2 | chardet==3.0.4 3 | idna==2.8 4 | requests==2.22.0 5 | urllib3==1.25.6 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 | --------------------------------------------------------------------------------