├── .github ├── ISSUE_TEMPLATE │ ├── PROJECT_SUGGESTION_TEMPLATE.md │ ├── bug_report.md │ ├── config.yml │ ├── feature_request.md │ └── other_issue.md ├── PROJECT_SUGGESTION_TEMPLATE.md ├── pull_request_template.md └── workflows │ ├── generate-project-list.yml │ └── welcome.yml ├── Age Calculator ├── calculate.py └── runtime.txt ├── Alarm Bot ├── main.py ├── requirements.txt └── runtime.txt ├── Ascii Art Generator ├── generate.py ├── requirements.txt └── runtime.txt ├── Audio Book Generator ├── main.py ├── requirements.txt └── runtime.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CountDown Timer ├── main.py ├── requirements.txt └── runtime.txt ├── Currency Converter ├── main.py ├── requirements.txt └── runtime.txt ├── Custom GPT ├── README.md ├── data │ └── data.txt ├── example-env └── main.py ├── Customizable_Workout_Playlist_Generator ├── README_SONG.md ├── hiit_playlist.json ├── playlist.py └── requirements.txt ├── Digital Clock ├── main.py ├── requirements.txt └── runtime.txt ├── Example README.md ├── Expense Splitter ├── README.md ├── main.py └── runtme.txt ├── Extractive Text Summarization ├── readme.md ├── requirements.txt └── summary.py ├── Facebook Video Downloader ├── main.py ├── requirements.txt └── runtime.txt ├── Geographic Distance ├── README.md ├── geographic_distance.py ├── requirements.txt ├── runtime.txt └── test_geographic_distance.py ├── Gesture-Based-Game-Controller ├── main.py ├── readme.md ├── requirements.txt └── runtime.txt ├── Handwritten-Assignments ├── main.py ├── requirements.txt └── runtime.txt ├── Headlight Detection ├── headlightDetection.py ├── requirements.txt └── runtime.txt ├── Helmet Detection ├── main.py ├── requirements.txt └── runtime.txt ├── Image Compression ├── main.py ├── requirements.txt └── runtime.txt ├── ImageSize Reducer ├── reduce.py ├── requirements.txt └── runtime.txt ├── Img-Steganograpy ├── main.py ├── requirements.txt └── runtime.txt ├── LICENSE ├── Learn-FastAPI ├── FastAPI-CURD.py ├── FastAPI-Tutorial.py └── README.md ├── Mental Health chatbot ├── Mental_health_bot.py ├── README_BOT.md └── requirements.txt ├── Merge PDFs ├── merge.py ├── requirements.txt └── runtime.txt ├── MobileNumber Tracker ├── requirements.txt ├── runtime.txt └── track.py ├── Mood Based Music Recommender ├── Emosic-Spoti.py ├── README.md ├── image.png └── requirement.txt ├── Movie Scraper ├── requirements.txt ├── runtime.txt └── scrape.py ├── My-Personal-Journal ├── README.md ├── app.py ├── database.py ├── journal_app.py ├── requirements.txt ├── static │ └── style.css ├── templates │ ├── add.html │ ├── index.html │ ├── search.html │ ├── search_results.html │ └── tags.html └── ui.py ├── Notepad ├── main.py ├── requirements.txt └── runtime.txt ├── OCR Image-to-Text Conversion ├── README.md ├── main.py └── requirements.txt ├── PROJECTS.md ├── Password Generator ├── main.py ├── requirements.txt └── runtime.txt ├── Plagiarism-Checker ├── main.py ├── requirements.txt ├── runtime.txt ├── test1.txt └── test2.txt ├── Pomodoro Timer ├── README.md ├── main.py └── runtime.txt ├── QR Code Generator ├── advanceQR.png ├── advanceQrGenerator.py ├── basicQrGenerator.py ├── demo.png ├── requirements.txt └── runtime.txt ├── README.md ├── Random Movie Selector ├── main.py ├── requirements.txt └── runtime.txt ├── Random Quotes Generator ├── quotes.py ├── requirements.txt └── runtime.txt ├── Real-Time Cryptocurrency Price Tracker ├── Readme.md ├── main.py ├── requirements.txt └── runtime.txt ├── Recipe Finder with Meal Planner ├── Readme.md ├── main.py └── runtime.txt ├── Resume Builder ├── README.md ├── requirements.txt └── resume_builder.py ├── Simple Assistant ├── assistant.py ├── raj_mistry01 │ ├── Readme.md │ ├── main.py │ └── requirements.txt ├── requirements.txt └── runtime.txt ├── Snake-Game ├── README.md ├── Snake.py ├── __pycache__ │ ├── Snake.cpython-312.pyc │ ├── food.cpython-312.pyc │ └── scoreboard.cpython-312.pyc ├── data.py ├── data.txt ├── food.py ├── main.py └── scoreboard.py ├── Speech To Text ├── main.py ├── requirements.txt └── runtime.txt ├── Spell Checker ├── main.py ├── requirements.txt └── runtime.txt ├── Telegram Bot ├── main.py ├── requirements.txt └── runtime.txt ├── Text Summarizer ├── README.md ├── requirements.txt ├── runtime.txt ├── sample.csv └── text_summarizer.py ├── Text To Speech ├── README.md ├── requirements.txt ├── runtime.txt └── text_to_speech.py ├── Text to Morse Code ├── main.py └── runtime.txt ├── Text_Adventure_Game ├── readme.md └── text_adventure_game.py ├── Tic-Tac-Toc using AI (min-max) ├── README.md ├── requirements.txt └── tic_tac_toc.py ├── To Do List ├── README.md ├── RithwikBejadi │ └── To Do App │ │ ├── README.md │ │ ├── To_Do_AppTkInter.py │ │ ├── requirements.txt │ │ ├── runtime.txt │ │ └── tasks.db ├── main.py ├── requirement.txt └── runtime.txt ├── Translator ├── requirements.txt ├── runtime.txt └── translate.py ├── URL Sortener ├── main.py ├── requirements.txt └── runtime.txt ├── Validate-Email ├── runtime.txt └── validate.py ├── Video Processor ├── README.md ├── requirements.txt └── video_processor.py ├── Video To Audio ├── main.py ├── requirement.txt └── runtime.txt ├── Weather Alert ├── .env.example ├── README.md ├── main.py ├── requirement.txt └── runtime.txt ├── Word_frequency_counter ├── README.md ├── main.py ├── requirments.txt └── runtime.txt ├── Youtube Video Downloader ├── Readme.md ├── main.py ├── requirements.txt └── runtime.txt └── personal-finance-tracker ├── README.md ├── database.py ├── main.py ├── savings.py ├── tracker.py └── visualization.py /.github/ISSUE_TEMPLATE/PROJECT_SUGGESTION_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Project Suggestion 3 | about: Propose an idea for a new project 4 | title: "" 5 | labels: "Project Suggestion" 6 | assignees: "" 7 | --- 8 | 9 | ### Project Suggestion Title 10 | _A concise title for your project suggestion._ 11 | 12 | ### Description 13 | _Provide a detailed description of the project idea or feature you would like to propose._ 14 | 15 | ### Benefits 16 | _Explain how this project or feature would benefit the community or improve the existing repository._ 17 | 18 | ### Implementation Ideas 19 | _Offer any initial thoughts on how the project could be implemented, including potential technologies or approaches._ 20 | 21 | ### Additional Context 22 | _Include any other relevant information, links, or references that might help._ 23 | 24 | ### Suggested Contributors 25 | _If you have specific contributors in mind who might be interested in this project, please list them here._ 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Bug Report" 3 | about: "Report a bug or issue." 4 | title: "Bug Report Title" 5 | labels: ["bug", "help wanted"] 6 | --- 7 | 8 | ## Description 9 | Please describe the bug you encountered, including steps to reproduce it. 10 | 11 | ## Steps to Reproduce 12 | 1. Step 1 13 | 2. Step 2 14 | 3. Step 3 ... 15 | 16 | ## Expected Behavior 17 | What did you expect to happen? 18 | 19 | ## Actual Behavior 20 | What actually happened? 21 | 22 | ## Additional Context 23 | Add any other context about the problem, screenshots, or logs that might be helpful. 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact: false 3 | 4 | templates: 5 | - name: "Project Suggestion" 6 | description: "Propose an idea for a new project." 7 | title: "Project Suggestion Title" 8 | labels: ["Project Suggestion"] 9 | 10 | - name: "Bug Report" 11 | description: "Report a bug or issue." 12 | title: "Bug Report Title" 13 | labels: ["bug", "help wanted"] 14 | 15 | - name: "Feature Request" 16 | description: "Request a new feature or enhancement." 17 | title: "Feature Request Title" 18 | labels: ["feature", "enhancement"] 19 | 20 | - name: "Other" 21 | description: "Use this template for any other issues or inquiries." 22 | title: "Other Issue Title" 23 | labels: ["question", "others"] 24 | 25 | choose_template: 26 | title: "Choose an Issue Template" 27 | description: "Please select one of the templates below to create your issue." 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Feature Request" 3 | about: "Request a new feature or enhancement." 4 | title: "Feature Request Title" 5 | labels: ["feature", "enhancement"] 6 | --- 7 | 8 | ## Feature Description 9 | Please describe the feature you would like to request. 10 | 11 | ## Use Cases 12 | How will this feature be used? Please provide examples. 13 | 14 | ## Additional Context 15 | Add any other context about the feature request, including design ideas or potential impacts. 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other_issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Other" 3 | about: "Use this template for any other issues or inquiries." 4 | title: "Other Issue Title" 5 | labels: ["question", "other"] 6 | --- 7 | 8 | ## Description 9 | Please provide a detailed description of your inquiry or issue. 10 | 11 | ## Context 12 | Add any relevant context or background information that may help in addressing your request. 13 | 14 | ## Additional Information 15 | If applicable, include any additional information, screenshots, or references. 16 | -------------------------------------------------------------------------------- /.github/PROJECT_SUGGESTION_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Project Suggestion Title 2 | _A concise title for your project suggestion._ 3 | 4 | ### Description 5 | _Provide a detailed description of the project idea or feature you would like to propose._ 6 | 7 | ### Benefits 8 | _Explain how this project or feature would benefit the community or improve the existing repository._ 9 | 10 | ### Implementation Ideas 11 | _Offer any initial thoughts on how the project could be implemented, including potential technologies or approaches._ 12 | 13 | ### Additional Context 14 | _Include any other relevant information, links, or references that might help._ 15 | 16 | ### Suggested Contributors 17 | _If you have specific contributors in mind who might be interested in this project, please list them here._ 18 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Developer Checklist 2 | - [ ] Adhered to the guidelines outlined in the README & Contributing file. 3 | - [ ] Maintained the correct directory structure (e.g., ProjectName/...yourfiles). 4 | - [ ] Please ensure to include a README file for enhanced project clarity. 5 | - [ ] Starred ⭐ the repository (optional). 6 | 7 | ### Summary 8 | ###### _Please provide a brief summary here._ 9 | 10 | ### Screenshot 11 | ###### _Attach any relevant screenshots or GIFs here._ 12 | 13 | ### Live Project Link 14 | ###### _Include a link to the live project here._ 15 | -------------------------------------------------------------------------------- /.github/workflows/generate-project-list.yml: -------------------------------------------------------------------------------- 1 | name: Generate Project List 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | generate-list: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v3 14 | with: 15 | token: ${{ secrets.ACTION_TOKEN }} 16 | persist-credentials: true 17 | 18 | - name: Fetch latest changes 19 | run: git fetch origin 20 | 21 | - name: Merge changes 22 | run: | 23 | git merge origin/main || echo "No new changes to merge or merge conflict" 24 | 25 | - name: Generate project list 26 | run: | 27 | exclude_dirs=(.github) 28 | exclude_files=("LICENSE" "README.md" "CONTRIBUTING.md" "Example README.md" "CODE_OF_CONDUCT.md" "PROJECTS.md") 29 | 30 | projects=() 31 | for dir in */; do 32 | if [[ ! " ${exclude_dirs[@]} " =~ " ${dir%/} " ]]; then 33 | projects+=("$dir") 34 | fi 35 | done 36 | 37 | echo "# Project List" > PROJECTS.md 38 | echo "" >> PROJECTS.md 39 | 40 | for project in "${projects[@]}"; do 41 | project_name=${project%/} 42 | safe_project_name=${project_name// /%20} 43 | echo "* [$project_name](https://github.com/king04aman/All-In-One-Python-Projects/tree/main/$safe_project_name)" >> PROJECTS.md 44 | done 45 | 46 | for file in "${exclude_files[@]}"; do 47 | sed -i "/$file/d" PROJECTS.md 48 | done 49 | 50 | # Debug output to check the content of PROJECTS.md 51 | cat PROJECTS.md 52 | 53 | - name: Commit project list 54 | run: | 55 | git config --global user.email "github-actions[bot]@users.noreply.github.com" 56 | git config --global user.name "github-actions[bot]" 57 | git add PROJECTS.md 58 | if ! git diff --cached --exit-code; then 59 | git commit -m "Update project list" 60 | git push --force-with-lease 61 | else 62 | echo "No changes to commit." 63 | fi 64 | env: 65 | GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} 66 | -------------------------------------------------------------------------------- /.github/workflows/welcome.yml: -------------------------------------------------------------------------------- 1 | name: Welcome Comments 2 | 3 | permissions: 4 | actions: write 5 | attestations: write 6 | checks: write 7 | contents: write 8 | deployments: write 9 | id-token: write 10 | issues: write 11 | discussions: write 12 | packages: write 13 | pages: write 14 | pull-requests: write 15 | repository-projects: write 16 | security-events: write 17 | statuses: write 18 | 19 | on: 20 | issues: 21 | types: [opened, closed] 22 | pull_request_target: 23 | types: [opened, closed] 24 | 25 | jobs: 26 | welcomer: 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Auto Welcome on Issues or PRs 30 | uses: actions/github-script@v6 31 | with: 32 | github-token: ${{ secrets.GITHUB_TOKEN }} 33 | script: | 34 | const author = context.payload.sender.login; 35 | const commentBody = (message) => `👋 @${author} 👋\n\n${message}`; 36 | 37 | if (context.eventName === 'issues') { 38 | const issue = context.payload.issue; 39 | 40 | if (context.payload.action === 'opened') { 41 | const message = `We're thrilled to see you opening an issue! Your input is valuable to us. Don’t forget to fill out our issue template for the best experience. We will look into it soon.`; 42 | github.rest.issues.createComment({ 43 | issue_number: issue.number, 44 | owner: context.repo.owner, 45 | repo: context.repo.repo, 46 | body: commentBody(message), 47 | }); 48 | } else if (context.payload.action === 'closed') { 49 | const message = `Thanks for closing the issue! We appreciate your updates.`; 50 | github.rest.issues.createComment({ 51 | issue_number: issue.number, 52 | owner: context.repo.owner, 53 | repo: context.repo.repo, 54 | body: commentBody(message), 55 | }); 56 | } 57 | } else if (context.eventName === 'pull_request_target') { 58 | const pr = context.payload.pull_request; 59 | 60 | if (context.payload.action === 'opened') { 61 | const message = `We're delighted to have your pull request! Please take a moment to check our contributing guidelines and ensure you've filled out the PR template for a smooth process. We will review it soon.`; 62 | github.rest.issues.createComment({ 63 | issue_number: pr.number, 64 | owner: context.repo.owner, 65 | repo: context.repo.repo, 66 | body: commentBody(message), 67 | }); 68 | } else if (context.payload.action === 'closed') { 69 | const message = pr.merged 70 | ? `🎉 You've just merged your pull request! We're excited to have you in our community. Keep up the fantastic contributions to the project!` 71 | : `Thanks for closing the pull request! Your contributions are valuable to us.`; 72 | 73 | github.rest.issues.createComment({ 74 | issue_number: pr.number, 75 | owner: context.repo.owner, 76 | repo: context.repo.repo, 77 | body: commentBody(message), 78 | }); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Age Calculator/calculate.py: -------------------------------------------------------------------------------- 1 | import time 2 | from calendar import isleap 3 | 4 | def judge_leap_year(year): 5 | if isleap(year): 6 | return True 7 | else: 8 | return False 9 | 10 | def month_days(month, leap_year): 11 | if month in [1, 3, 5, 7, 8, 10, 12]: 12 | return 31 13 | elif month in [4, 6, 9, 11]: 14 | return 30 15 | elif month == 2 and leap_year: 16 | return 29 17 | elif month == 2 and (not leap_year): 18 | return 28 19 | 20 | 21 | name = input("Please enter your name: ") 22 | age = input("Please enter your age: ") 23 | localtime = time.localtime(time.time()) 24 | 25 | year = int(age) 26 | month = year * 12 + localtime.tm_mon 27 | day = 0 28 | 29 | begin_year = int(localtime.tm_year) - year 30 | end_year = begin_year + year 31 | 32 | for y in range(begin_year, end_year): 33 | if (judge_leap_year(y)): 34 | day = day + 366 35 | else: 36 | day = day + 365 37 | 38 | leap_year = judge_leap_year(localtime.tm_year) 39 | for m in range(1, localtime.tm_mon): 40 | day = day + month_days(m, leap_year) 41 | 42 | day = day + localtime.tm_mday 43 | print("\n\t%s's age is %d years or " % (name, year), end="") 44 | print("%d months or %d days" % (month, day)) 45 | -------------------------------------------------------------------------------- /Age Calculator/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Alarm Bot/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | import datetime 3 | import time 4 | import winsound 5 | from threading import * 6 | 7 | root = Tk() 8 | root.geometry("400x200") 9 | 10 | def Threading(): 11 | t1=Thread(target=alarm) 12 | t1.start() 13 | 14 | def alarm(): 15 | while True: 16 | set_alarm_time = f"{hour.get()}:{minute.get()}:{second.get()}" 17 | time.sleep(1) 18 | current_time = datetime.datetime.now().strftime("%H:%M:%S") 19 | print(current_time,set_alarm_time) 20 | 21 | if current_time == set_alarm_time: 22 | print("Time to Wake up") 23 | winsound.PlaySound("sound.wav",winsound.SND_ASYNC) 24 | 25 | Label(root,text="Alarm Clock",font=("Helvetica 20 bold"),fg="red").pack(pady=10) 26 | Label(root,text="Set Time",font=("Helvetica 15 bold")).pack() 27 | 28 | frame = Frame(root) 29 | frame.pack() 30 | 31 | hour = StringVar(root) 32 | hours = ('00', '01', '02', '03', '04', '05', '06', '07', 33 | '08', '09', '10', '11', '12', '13', '14', '15', 34 | '16', '17', '18', '19', '20', '21', '22', '23', '24' 35 | ) 36 | hour.set(hours[0]) 37 | 38 | hrs = OptionMenu(frame, hour, *hours) 39 | hrs.pack(side=LEFT) 40 | 41 | minute = StringVar(root) 42 | minutes = ('00', '01', '02', '03', '04', '05', '06', '07', 43 | '08', '09', '10', '11', '12', '13', '14', '15', 44 | '16', '17', '18', '19', '20', '21', '22', '23', 45 | '24', '25', '26', '27', '28', '29', '30', '31', 46 | '32', '33', '34', '35', '36', '37', '38', '39', 47 | '40', '41', '42', '43', '44', '45', '46', '47', 48 | '48', '49', '50', '51', '52', '53', '54', '55', 49 | '56', '57', '58', '59', '60') 50 | minute.set(minutes[0]) 51 | 52 | mins = OptionMenu(frame, minute, *minutes) 53 | mins.pack(side=LEFT) 54 | 55 | second = StringVar(root) 56 | seconds = ('00', '01', '02', '03', '04', '05', '06', '07', 57 | '08', '09', '10', '11', '12', '13', '14', '15', 58 | '16', '17', '18', '19', '20', '21', '22', '23', 59 | '24', '25', '26', '27', '28', '29', '30', '31', 60 | '32', '33', '34', '35', '36', '37', '38', '39', 61 | '40', '41', '42', '43', '44', '45', '46', '47', 62 | '48', '49', '50', '51', '52', '53', '54', '55', 63 | '56', '57', '58', '59', '60') 64 | second.set(seconds[0]) 65 | 66 | secs = OptionMenu(frame, second, *seconds) 67 | secs.pack(side=LEFT) 68 | 69 | Button(root,text="Set Alarm",font=("Helvetica 15"),command=Threading).pack(pady=20) 70 | root.mainloop() 71 | -------------------------------------------------------------------------------- /Alarm Bot/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Alarm Bot/requirements.txt -------------------------------------------------------------------------------- /Alarm Bot/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Ascii Art Generator/generate.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | import sys 4 | 5 | symbols_list = ["#", "-", "*", ".", "+", "o"] 6 | threshold_list = [0, 50, 100, 150, 200] 7 | 8 | def print_out_ascii(array): 9 | for row in array: 10 | for e in row: 11 | print(symbols_list[int(e) % len(symbols_list)], end="") 12 | print() 13 | 14 | 15 | def img_to_ascii(image): 16 | height, width = image.shape 17 | new_width = int(width / 20) 18 | new_height = int(height / 40) 19 | 20 | resized_image = cv2.resize(image, (new_width, new_height),) 21 | 22 | thresh_image = np.zeros(resized_image.shape) 23 | 24 | for i, threshold in enumerate(threshold_list): 25 | thresh_image[resized_image > threshold] = i 26 | return thresh_image 27 | 28 | 29 | if __name__ == "__main__": 30 | 31 | if len(sys.argv) < 2: 32 | print("Image Path not specified : Using sample_image.png\n") 33 | image_path = "sample_image.png" 34 | 35 | if len(sys.argv) == 2: 36 | print("Using {} as Image Path\n".format(sys.argv[1])) 37 | image_path = sys.argv[1] 38 | 39 | image = cv2.imread(image_path, 0) 40 | ascii_art = img_to_ascii(image) 41 | print_out_ascii(ascii_art) 42 | -------------------------------------------------------------------------------- /Ascii Art Generator/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Ascii Art Generator/requirements.txt -------------------------------------------------------------------------------- /Ascii Art Generator/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Audio Book Generator/main.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | import PyPDF2 3 | 4 | pdf_File = open('name.pdf', 'rb') 5 | 6 | pdf_Reader = PyPDF2.PdfFileReader(pdf_File) 7 | count = pdf_Reader.numPages 8 | textList = [] 9 | 10 | for i in range(count): 11 | try: 12 | page = pdf_Reader.getPage(i) 13 | textList.append(page.extractText()) 14 | except: 15 | pass 16 | 17 | textString = " ".join(textList) 18 | print(textString) 19 | language = 'en' 20 | 21 | myAudio = gTTS(text=textString, lang=language, slow=False) 22 | myAudio.save("Audio.mp3") 23 | -------------------------------------------------------------------------------- /Audio Book Generator/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Audio Book Generator/requirements.txt -------------------------------------------------------------------------------- /Audio Book Generator/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | *As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.* 3 | 4 | *We are committed to creating a welcoming and inclusive environment for all people, regardless of their background or identity. We expect all members of our community, including contributors, users, and maintainers, to abide by this Code of Conduct.* 5 | 6 | ## Our Standards 7 | - Examples of behavior that contributes to creating a positive environment include: 8 | - Be respectful of others and their opinions 9 | - Refrain from using discriminatory language or behavior 10 | - Avoid engaging in personal attacks or harassment 11 | - Help create a safe and positive environment for everyone 12 | - Follow the project's guidelines and procedures 13 | 14 | - Examples of unacceptable behavior by participants include: 15 | - Harassment or discrimination of any kind 16 | - Threats, bullying, or violence 17 | - Sharing of private information without consent 18 | - Plagiarism or infringement of intellectual property rights 19 | - Any other behavior that is deemed unacceptable by the project maintainers 20 | 21 | ## Our Responsibilities 22 | - Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 23 | - Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 24 | 25 | ## Consequences 26 | - If you engage in behavior that violates this Code of Conduct, you may be asked to stop, or other appropriate action may be taken. 27 | - If any unacceptable behavior will be determined by the project maintainers, and may include: 28 | - Warning 29 | - Removal from the project or community 30 | - Reporting to appropriate authorities 31 | 32 | ## Reporting 33 | - If you witness or experience conduct that violates this Code of Conduct, please contact us immediately on [Linkedin](https://linkedin.com/in/king04aman/). We will take all reports seriously and will work to resolve the issue as quickly as possible. 34 | 35 | ## Attribution 36 | - This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html) 37 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | *Thank you for your interest in contributing to this Python project! We welcome and appreciate contributions of all kinds, from bug reports and feature requests to documentation and code improvements.* 3 | 4 | ## How to Contribute 5 | *Here are some ways you can contribute:* 6 | - [Report an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) 7 | - [Suggest a feature](CONTRIBUTING.md) 8 | - Improve the documentation 9 | - [Contribute code](CODE_OF_CONDUCT.md) 10 | 11 | ## Reporting Issues 12 | *When reporting an issue, please include the following:* 13 | - A clear and descriptive title 14 | - A detailed description of the issue, including steps to reproduce the problem 15 | - Screenshots or other relevant media 16 | - The version of the project and dependencies you are using 17 | - The operating system and version you are using 18 | 19 | ## Suggest a feature 20 | *To suggest a new feature, please open an issue on GitHub and provide a detailed description of what you would like to see added, and why it would be useful.* 21 | 22 | ## Improve the documentation 23 | *We welcome improvements to the documentation, whether they're typo fixes, explanations of complex concepts, or examples of how to use the software. To make changes to the documentation, please fork the repository, make your changes, and submit a pull request.* 24 | 25 | ## Contribute code Guidelines 26 | *If you're interested in contributing code to the project, please follow these guidelines:* 27 | 28 | - Fork the repository. This creates a copy of the code that you can work on without affecting the original project. 29 | - Create a new branch. Use a descriptive name that reflects the changes you plan to make. 30 | - Make your changes. Keep your code clean, well-organized, and easy to read. Follow the project's existing coding style as closely as possible. 31 | - Test your changes. Make sure your changes don't break existing functionality and that they work as expected. 32 | - Submit a pull request. Once you've made your changes and tested them, submit a pull request. Please provide a clear and concise description of your changes and why they're needed. 33 | - Add documentation. Add documentation to the README.md file and to the code files. 34 | 35 | ## Pull Request Guidelines 36 | - Fork the repository and create a new branch for your changes. 37 | - Follow the existing code style and conventions. 38 | - Include tests for any new code. 39 | - Make sure all tests pass before submitting the pull request. 40 | - Do not include changes to the README or other documentation in the same pull request as code changes. 41 | 42 | ## Code of Conduct 43 | *Please note that this project is released with a Code of Conduct. By participating in this project you agree to abide by its terms.* 44 | 45 | ## License 46 | This project is licensed under the terms of the MIT license. 47 | 48 | ## Thank you! 49 | Thank you for your interest in contributing to this project! We appreciate your help and look forward to working with you. 50 | -------------------------------------------------------------------------------- /CountDown Timer/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | import tkinter as tk 3 | 4 | class Application(Frame): 5 | def __init__(self,master): 6 | super(Application,self).__init__(master) 7 | self.pack() 8 | self.createWidgets() 9 | 10 | self.master.geometry("300x200") 11 | self._alarm_id = None 12 | self._paused = False 13 | self._starttime = 0 14 | 15 | # def startTimer(self): 16 | 17 | def createWidgets(self): 18 | 19 | self.someFrame = Frame(self) 20 | self.time_var = StringVar() 21 | self.input_time = tk.Entry(self, width=25, font=('Calibri',12), textvariable = self.time_var) 22 | # Adding placeholder 23 | self.input_time.insert(0, "Enter Time in seconds") 24 | self.input_time.pack(padx=10,pady=(30,10)) 25 | #using bind method 26 | self.input_time.bind("", self.enter) 27 | 28 | self.startButton = Button(self.someFrame, text="Start", font=('Helvetica',12), bg='green', fg='white', command=self.startTime) 29 | self.startButton.pack(side=LEFT, padx=5) 30 | 31 | self.pauseButton = Button(self.someFrame, text="Pause", font=('Helvetica',12), bg='azure', command=self.pauseTime) 32 | self.pauseButton.pack(side=LEFT, padx=5) 33 | 34 | self.resetButton = Button(self.someFrame, text="Reset", font=('Helvetica',12), bg='azure', command=self.resetTime) 35 | self.resetButton.pack(side=LEFT, padx=5) 36 | 37 | self.closeButton = Button(self.someFrame, text="Close", font=('Helvetica',12), bg='red',fg='white', command=self.closeApp) 38 | self.closeButton.pack(side=LEFT, padx=5) 39 | self.someFrame.pack(side=TOP) 40 | 41 | self.labelvariable = StringVar() 42 | self.labelvariable.set("") 43 | 44 | self.thelabel = Label(self,textvariable = self.labelvariable,font=('Helvetica',50)) 45 | self.thelabel.pack(side=TOP) 46 | 47 | # Removes placeholder text in the Entry widget 48 | def enter(self,*args): 49 | self.input_time.delete(0, 'end') 50 | 51 | # Resume function 52 | def startTime(self): 53 | self.get_time = self.time_var.get() 54 | try: 55 | self.time_in_int = int(self.get_time) 56 | except: 57 | self.time_in_int = 0 58 | self._starttime = self.time_in_int 59 | self._paused = False 60 | if self._alarm_id is None: 61 | self.countdown(self._starttime) 62 | 63 | # Pause function 64 | def pauseTime(self): 65 | if self._alarm_id is not None: 66 | self._paused = True 67 | 68 | # Reset function 69 | def resetTime(self): 70 | if self._alarm_id is not None: 71 | self.master.after_cancel(self._alarm_id) 72 | self._alarm_id = None 73 | self._paused = False 74 | self.countdown(0) 75 | self._paused = True 76 | 77 | def closeApp(self): 78 | self.master.destroy() 79 | 80 | def countdown(self, timeInSeconds, start=True): 81 | if timeInSeconds == 0: 82 | self._starttime=0 83 | self.labelvariable.set("0") 84 | return 85 | if start: 86 | self._starttime = timeInSeconds 87 | if self._paused: 88 | self._alarm_id = self.master.after(1000, self.countdown, timeInSeconds, False) 89 | else: 90 | app.labelvariable.set(timeInSeconds) 91 | self._alarm_id = self.master.after(1000, self.countdown, timeInSeconds-1, False) 92 | 93 | 94 | if __name__ == '__main__': 95 | root = Tk() 96 | root.title("Countdown Timer") 97 | app = Application(root) 98 | root.mainloop() 99 | 100 | -------------------------------------------------------------------------------- /CountDown Timer/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/CountDown Timer/requirements.txt -------------------------------------------------------------------------------- /CountDown Timer/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Currency Converter/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | class Currency_convertor: 4 | rates = {} 5 | def __init__(self, url): 6 | data = requests.get(url).json() 7 | self.rates = data["rates"] 8 | 9 | def convert(self, from_currency, to_currency, amount): 10 | initial_amount = amount 11 | if from_currency != 'EUR' : 12 | amount = amount / self.rates[from_currency] 13 | 14 | amount = round(amount * self.rates[to_currency], 2) 15 | print('{} {} = {} {}'.format(initial_amount, from_currency, amount, to_currency)) 16 | 17 | if __name__ == "__main__": 18 | url = str.__add__('http://data.fixer.io/api/latest?access_key=', YOUR_ACCESS_KEY) 19 | c = Currency_convertor(url) 20 | amount = int(input("Amount: ")) 21 | from_country = input("From Country: ") 22 | to_country = input("TO Country: ") 23 | 24 | c.convert(from_country, to_country, amount) 25 | -------------------------------------------------------------------------------- /Currency Converter/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Currency Converter/requirements.txt -------------------------------------------------------------------------------- /Currency Converter/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Custom GPT/README.md: -------------------------------------------------------------------------------- 1 | # Conversational Retrieval with LangChain and OpenAI 2 | 3 | This directory contains a Python script that implements a conversational retrieval system using LangChain and OpenAI's API. The script allows users to query a collection of documents and receive responses based on the retrieved information. 4 | 5 | ## Features 6 | 7 | - Load documents from a specified directory. 8 | - Create and persist a vector store index for efficient querying. 9 | - Engage in conversational interactions, maintaining chat history. 10 | - Easily exit the program. 11 | 12 | ## Requirements 13 | 14 | - Python 3.7+ 15 | - Required packages: 16 | - `openai` 17 | - `langchain` 18 | - `chromadb` 19 | 20 | You can install the required packages using pip: 21 | 22 | ```bash 23 | pip install openai langchain chromadb 24 | ``` 25 | ## Setup 26 | 1. Clone the Repository: 27 | ```bash 28 | git clone https://github.com/king04aman/custom-gpt.git 29 | cd your_repository 30 | ``` 31 | 2. Set the OpenAI API Key: 32 | Replace `your_api_key_here` in the script with your actual OpenAI API key. You can also set the environment variable directly in your terminal: 33 | ```bash 34 | export OPENAI_API_KEY="your_api_key_here" 35 | ``` 36 | 3. Prepare Your Data: 37 | Place your documents in a folder named `data/`. The script will load all documents from this directory. 38 | 39 | ## Usage 40 | Run the script from the command line: 41 | ```bash 42 | python main.py 43 | ``` 44 | ### Command Line Arguments 45 | You can provide an initial query as a command line argument: 46 | ```bash 47 | python main.py "Your initial query here" 48 | ``` 49 | ### Interactive Mode 50 | If no initial query is provided, the script will prompt you to enter queries interactively. Type your question and press Enter to get a response. Type `quit`, `q`, or exit to `exit` the program. 51 | 52 | ### Persistence 53 | - Set the `PERSIST` variable to `True` in the script to enable saving the vector store index to disk for reuse in future sessions. 54 | - The index will be saved in a directory named `persist/`. 55 | 56 | ## Example 57 | ```bash 58 | Prompt (type 'quit' to exit): What is the significance of data persistence? 59 | Response: [Your response here based on the documents] 60 | ``` 61 | 62 | ## License 63 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 64 | 65 | ## Contributing 66 | Feel free to submit issues or pull requests. Contributions are welcome! 67 | -------------------------------------------------------------------------------- /Custom GPT/data/data.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Custom GPT/data/data.txt -------------------------------------------------------------------------------- /Custom GPT/example-env: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY = "your_api_key" -------------------------------------------------------------------------------- /Custom GPT/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import openai 3 | import sys 4 | from langchain.chains import ConversationalRetrievalChain 5 | from langchain.chat_models import ChatOpenAI 6 | from langchain.document_loaders import DirectoryLoader 7 | from langchain.embeddings import OpenAIEmbeddings 8 | from langchain.indexes import VectorstoreIndexCreator 9 | from langchain.indexes.vectorstore import VectorStoreIndexWrapper 10 | from langchain.vectorstores import Chroma 11 | 12 | 13 | os.environ["OPENAI_API_KEY"] = "your_api_key_here" 14 | PERSIST = False 15 | 16 | query = sys.argv[1] if len(sys.argv) > 1 else None 17 | 18 | if PERSIST and os.path.exists("persist"): 19 | print("Reusing index...\n") 20 | vectorstore = Chroma(persist_directory="persist", embedding_function=OpenAIEmbeddings()) 21 | index = VectorStoreIndexWrapper(vectorstore=vectorstore) 22 | else: 23 | loader = DirectoryLoader("data/") 24 | index = VectorstoreIndexCreator(vectorstore_kwargs={"persist_directory": "persist"}).from_loaders([loader]) if PERSIST else VectorstoreIndexCreator().from_loaders([loader]) 25 | 26 | chain = ConversationalRetrievalChain.from_llm( 27 | llm=ChatOpenAI(model="gpt-3.5-turbo"), 28 | retriever=index.vectorstore.as_retriever(search_kwargs={"k": 1}), 29 | ) 30 | 31 | chat_history = [] 32 | 33 | while True: 34 | if not query: 35 | query = input("Prompt (type 'quit' to exit): ") 36 | if query.lower() in ['quit', 'q', 'exit']: 37 | print("Exiting the program...") 38 | sys.exit() 39 | 40 | result = chain({"question": query, "chat_history": chat_history}) 41 | 42 | print("Response:", result['answer']) 43 | 44 | chat_history.append((query, result['answer'])) 45 | query = None 46 | -------------------------------------------------------------------------------- /Customizable_Workout_Playlist_Generator/README_SONG.md: -------------------------------------------------------------------------------- 1 | # Customizable Workout Playlist Generator 2 | 3 | This Python application generates customized workout playlists based on user preferences, including workout type, duration, preferred genres, and BPM range. It can use a local song database or integrate with popular music streaming services like Spotify, Apple Music, and YouTube Music. 4 | 5 | ## Features 6 | 7 | - Generate playlists for various workout types (e.g., HIIT, yoga, cardio) 8 | - Customize playlist duration 9 | - Filter songs by genre and BPM range 10 | - Integration with Spotify, Apple Music, and YouTube Music (API keys required) 11 | - Save and load playlists in JSON format 12 | 13 | ## Requirements 14 | 15 | - Python 3.6+ 16 | - Required Python packages (see `requirements.txt`) 17 | 18 | ## Installation 19 | 20 | 1. Clone this repository: 21 | ``` 22 | git clone https://github.com/Ashutoshdas-dev/All-In-One-Python-Projects.git 23 | cd Customizable_Workout_Playlist_Generator 24 | ``` 25 | 26 | 2. Install the required packages: 27 | ``` 28 | pip install -r requirements.txt 29 | ``` 30 | 31 | 3. Set up API credentials for the music services you want to use (Spotify, Apple Music, or YouTube Music). 32 | 33 | ## Usage 34 | 35 | 1. Run the main script: 36 | ``` 37 | python playlist.py 38 | ``` 39 | 40 | 2. Follow the prompts to: 41 | - Choose a music source (local database, Spotify, Apple Music, or YouTube Music) 42 | - Enter workout type, duration, preferred genres, and BPM range 43 | - Generate and view the playlist 44 | - Save the playlist to a JSON file (optional) 45 | 46 | 3. Repeat the process to generate multiple playlists or exit the program. 47 | 48 | ## API Integration 49 | 50 | To use the music streaming service integrations, you'll need to set up API credentials: 51 | 52 | - Spotify: Set up a Spotify Developer account and create an app to get your client ID and client secret. 53 | - Apple Music: Obtain an Apple Developer account and set up MusicKit. 54 | - YouTube Music: No authentication is required for basic usage. 55 | 56 | Update the respective client classes in `playlist.py` with your API credentials. 57 | -------------------------------------------------------------------------------- /Customizable_Workout_Playlist_Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | spotipy==2.19.0 2 | requests==2.26.0 3 | ytmusicapi==0.22.0 4 | -------------------------------------------------------------------------------- /Digital Clock/main.py: -------------------------------------------------------------------------------- 1 | from time import strftime 2 | from tkinter import Label, Tk 3 | 4 | window = Tk() 5 | window.title("Digital Clock") 6 | window.geometry("300x100") 7 | window.configure(bg="green") 8 | window.resizable(False, False) 9 | 10 | clock_label = Label( 11 | window, bg="black", fg="green", font=("Arial", 30, "bold"), relief="flat" 12 | ) 13 | clock_label.place(x=50, y=50) 14 | 15 | 16 | def update_label(): 17 | current_time = strftime("%H: %M: %S\n %d-%m-%Y ") 18 | clock_label.configure(text=current_time) 19 | clock_label.after(80, update_label) 20 | clock_label.pack(anchor="center") 21 | 22 | update_label() 23 | window.mainloop() -------------------------------------------------------------------------------- /Digital Clock/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Digital Clock/requirements.txt -------------------------------------------------------------------------------- /Digital Clock/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Example README.md: -------------------------------------------------------------------------------- 1 | # Script Name 2 | Short description of package/script 3 | - If package, list of functionalities/scripts it can perform 4 | - If standalone script, short description of script explaining what it achieves 5 | 6 | # Description 7 | - If code is not explainable using comments, use this sections to explain your script 8 | 9 | # Prerequisites 10 | - List out the libraries imported in the script 11 | 12 | # Installing instructions 13 | - Explain how to setup and run your package/script in user's local machine. 14 | 15 | # Screenshot 16 | - Display images/gifs/videos of output/result of your script so that users can visualize it. 17 | 18 | # Author 19 | Name(s) of author(s). 20 | -------------------------------------------------------------------------------- /Expense Splitter/README.md: -------------------------------------------------------------------------------- 1 | # Expense Splitter 2 | 3 | A simple Python script to split expenses among a group of people. 4 | 5 | ## Features 6 | 7 | - Calculates the share per person based on the total amount and number of people. 8 | - User-friendly prompts and case-insensitive confirmation. 9 | 10 | ## Usage 11 | 12 | 1. Clone the repository. 13 | 2. Navigate to the project directory. 14 | 3. Run the script: 15 | ```bash 16 | python main.py 17 | -------------------------------------------------------------------------------- /Expense Splitter/main.py: -------------------------------------------------------------------------------- 1 | def calculate_split(total_amount: float, number_of_people: int, currency: str) -> None: 2 | if number_of_people < 1: 3 | raise ValueError('Number of people should be at least one.') 4 | 5 | # Calculate the share per person 6 | share_per_person: float = total_amount / number_of_people 7 | 8 | # Print the results 9 | print(f'Total expenses: {currency}{total_amount:,.2f}') 10 | print(f'Number of people: {number_of_people}') 11 | print(f'Each person should pay: {currency}{share_per_person:,.2f}') 12 | 13 | 14 | def main() -> None: 15 | try: 16 | # Input for total amount 17 | total_amount: float = float(input('Enter the total amount of the expense: ')) 18 | 19 | # Input for number of people 20 | number_of_people: int = int(input('Enter the number of people sharing the expense: ')) 21 | 22 | # Call the function to calculate the split with currency set to rupees 23 | calculate_split(total_amount, number_of_people, currency="₹") 24 | 25 | except ValueError as e: 26 | print(f'Error: {e}') 27 | 28 | 29 | # Run the main function 30 | if __name__ == "__main__": 31 | main() 32 | -------------------------------------------------------------------------------- /Expense Splitter/runtme.txt: -------------------------------------------------------------------------------- 1 | Python 3.12.3 -------------------------------------------------------------------------------- /Extractive Text Summarization/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # 📝 Advanced Extractive Text Summarization Model 3 | 4 | Welcome to the **Advanced Extractive Text Summarization Model**! This project uses **Natural Language Processing (NLP)** techniques to automatically distill essential points from lengthy content, making it an invaluable tool for handling reports, research papers, news articles, and more. 5 | 6 | ## 🚀 Project Overview 7 | 8 | This model leverages NLP to: 9 | - **Extract key sentences** from a body of text. 10 | - **Score sentences** based on their importance using features like **TF-IDF**, sentence length, position, and presence of named entities. 11 | - **Cluster related sentences** via **K-means** to highlight critical points from various thematic groups. 12 | 13 | ### Why It Matters 14 | In today’s information-dense world, quickly understanding critical points from long documents is essential. This model saves time and boosts productivity by providing concise summaries while preserving core insights. 15 | 16 | --- 17 | 18 | ## 📊 Features 19 | 20 | 1. **Preprocessing** 21 | - Cleans and prepares text data for effective summarization. 22 | 23 | 2. **Scoring & Ranking** 24 | - Scores sentences based on TF-IDF, sentence structure, and key entities. 25 | 26 | 3. **Clustering & Key Point Extraction** 27 | - Uses K-means clustering to group sentences by topic and select key sentences for each group. 28 | 29 | 4. **Summary Generation** 30 | - Combines top-ranked sentences from each cluster to create a coherent, impactful summary. 31 | 32 | --- 33 | 34 | ## 🔧 How It Works 35 | 36 | 1. **Data Preprocessing:** Initial cleaning (e.g., removing stop words, punctuation). 37 | 2. **Sentence Scoring:** Uses TF-IDF, sentence structure, and named entity recognition to evaluate sentence importance. 38 | 3. **K-means Clustering:** Groups related sentences to capture diverse perspectives within the text. 39 | 4. **Summarization:** Extracts top sentences across clusters to create a balanced summary. 40 | 41 | --- 42 | 43 | ## 🛠️ Installation 44 | 45 | 1. **Clone the Repository:** 46 | ```bash 47 | git clone https://github.com/one-alive/extractive_text_summarization.git 48 | cd extractive_text_summarization 49 | ``` 50 | 51 | 2. **Install Dependencies:** 52 | ```bash 53 | pip install -r requirements.txt 54 | ``` 55 | 56 | --- 57 | 58 | ## ▶️ Usage 59 | 60 | 1. **Run the Model on a Sample Text:** 61 | ```bash 62 | python summarize.py 63 | ``` 64 | 65 | 2. **Adjust Parameters:** You can tune parameters such as the number of clusters, sentence selection criteria, and summary length for better results based on the text type. 66 | 67 | --- 68 | 69 | ## ⚙️ Next Steps 70 | 71 | - **Parameter Tuning:** Experiment with different clustering techniques and scoring weights. 72 | - **Expand Dataset Compatibility:** Optimize for specific types of documents like research papers or news articles. 73 | - **Add Fine-Tuning:** Integrate more NLP models to improve summarization accuracy. 74 | 75 | --- 76 | 77 | ## 🤝 Contributing 78 | 79 | Contributions are welcome! If you have ideas or suggestions, please create a pull request or open an issue. 80 | 81 | --- 82 | 83 | ## 📬 Contact 84 | 85 | If you have questions or want to explore collaboration opportunities, feel free to reach out! 86 | 87 | --- -------------------------------------------------------------------------------- /Extractive Text Summarization/requirements.txt: -------------------------------------------------------------------------------- 1 | nltk==3.9.1 2 | numpy==2.1.3 3 | scikit_learn==1.5.2 4 | spacy==3.8.2 5 | -------------------------------------------------------------------------------- /Facebook Video Downloader/main.py: -------------------------------------------------------------------------------- 1 | import os, re, requests, wget 2 | 3 | root = os.path.dirname(os.path.abspath(__file__)) 4 | path = os.path.join(root, "Downloads") 5 | if not os.path.exists(path): 6 | os.mkdir(path) 7 | 8 | link = input("Enter video link: ") 9 | try: 10 | r = requests.get(link) 11 | if r.status_code == requests.codes.ok: 12 | try: 13 | sd_url = re.search('sd_src:"(.+?)"', r.text)[1] 14 | url = ( 15 | re.search('hd_src:"(.+?)"', r.text)[1] if "hd_src" in r.text else sd_url 16 | ) 17 | print("Downloading... Please wait...") 18 | wget.download(url, path) 19 | except Exception as e: 20 | print(e) 21 | else: 22 | print("Invalid Link!") 23 | 24 | except Exception as e: 25 | print(e) 26 | -------------------------------------------------------------------------------- /Facebook Video Downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.26.0 2 | wget==3.2 -------------------------------------------------------------------------------- /Facebook Video Downloader/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Geographic Distance/README.md: -------------------------------------------------------------------------------- 1 | # Geographic Distance and Travel Time Calculator 2 | 3 | This Python script calculates the geodesic distance between two geographic coordinates and estimates travel time based on a given average speed. It uses the geopy library to compute distances. 4 | 5 | ## Features 6 | 7 | - Input coordinates for two locations (latitude and longitude) interactively. 8 | - Calculate the distance between the two coordinates in kilometers. 9 | - Estimate the travel time based on a given average speed (in km/h). 10 | 11 | ## Prerequisites 12 | 13 | - Python 3.x installed on your system. 14 | 15 | ## Setup 16 | 17 | 1. Clone the repository 18 | 19 | ```bash 20 | git clone https://github.com/king04aman/All-In-One-Python-Projects.git 21 | cd All-In-One-Python-Projects/Geographic Distance 22 | ``` 23 | 24 | 2. Create and activate a virtual environment 25 | 26 | - For macOS/Linux: 27 | 28 | ```bash 29 | python3 -m venv venv 30 | source venv/bin/activate 31 | ``` 32 | 33 | - For Windows: 34 | 35 | ```bash 36 | python -m venv venv 37 | venv\Scripts\activate 38 | ``` 39 | 40 | 3. Install the required dependencies 41 | 42 | The required packages are listed in requirements.txt. Install them using the following command: 43 | 44 | ```bash 45 | pip install -r requirements.txt 46 | ``` 47 | 48 | Note: The main dependency is geopy for calculating distances based on geodesic coordinates. 49 | 50 | ## Usage 51 | 52 | 1. Run the script: 53 | 54 | ```bash 55 | python geographic_distance.py 56 | ``` 57 | 58 | 2. Enter the coordinates (latitude and longitude) of the two locations when prompted. 59 | 3. Enter the average speed in km/h to calculate the travel time. 60 | 61 | Example input: 62 | 63 | ``` 64 | Enter the latitude and longitude of the first location (lat1, lon1) Example: 40.7128, -74.006: 52.5200, 13.4050 65 | Enter the latitude and longitude of the second location (lat2, lon2) Example: 37.7749, -122.4194: 48.8566, 2.3522 66 | Enter the average speed in km/h Example: 60: 80 67 | ``` 68 | 69 | Example output: 70 | 71 | ``` 72 | Distance between the two coordinates: 878.84 kilometers 73 | Estimated travel time: 10.99 hours 74 | ``` 75 | 76 | ## Requirements 77 | 78 | Here’s a list of Python dependencies in requirements.txt: 79 | 80 | ``` 81 | geopy==2.2.0 82 | pytest==8.3.3 83 | ``` 84 | -------------------------------------------------------------------------------- /Geographic Distance/geographic_distance.py: -------------------------------------------------------------------------------- 1 | from geopy.distance import geodesic 2 | 3 | 4 | def calculate_distance_and_time(coord1, coord2, avg_speed): 5 | """ 6 | Calculate the distance between two coordinates and estimate travel time. 7 | :param coord1: Tuple containing the latitude and longitude of the first location (lat1, lon1) 8 | :param coord2: Tuple containing the latitude and longitude of the second location (lat2, lon2) 9 | :param avg_speed: Average speed in km/h for estimating travel time 10 | :return: Distance in kilometers and estimated travel time in hours 11 | """ 12 | 13 | # Calculate geodesic distance 14 | distance = geodesic(coord1, coord2).kilometers 15 | # Estimate travel time (distance / speed) 16 | travel_time = distance / avg_speed 17 | 18 | return distance, travel_time 19 | 20 | 21 | def main(): 22 | # Coordinates (latitude, longitude) 23 | try: 24 | coord1 = tuple(map(float, input('Enter the latitude and longitude of the first location (lat1, lon1) Example: 40.7128, -74.006: ').split(','))) 25 | coord2 = tuple(map(float, input('Enter the latitude and longitude of the second location (lat2, lon2) Example: 37.7749, -122.4194: ').split(','))) 26 | except ValueError as e: 27 | raise ValueError("Coordinates must be in the format 'lat, lon'") from e 28 | 29 | if not all(-90 <= x <= 90 for x in (coord1[0], coord2[0])) or not all(-180 <= x <= 180 for x in (coord1[1], coord2[1])): 30 | raise ValueError('Invalid coordinates') 31 | 32 | # Speed in km/h (e.g., driving speed) 33 | try: 34 | avg_speed = float(input('Enter the average speed in km/h Example: 60: ')) 35 | except ValueError as e: 36 | raise ValueError('Average speed must be a number') from e 37 | 38 | if avg_speed <= 0: 39 | raise ValueError('Average speed must be greater than 0.') 40 | 41 | # Calculate the distance and travel time 42 | distance, travel_time = calculate_distance_and_time(coord1, coord2, avg_speed) 43 | 44 | print(f'Distance between the two coordinates: {distance:.2f} kilometers') 45 | print(f'Estimated travel time: {travel_time:.2f} hours') 46 | 47 | 48 | if __name__ == '__main__': 49 | main() 50 | -------------------------------------------------------------------------------- /Geographic Distance/requirements.txt: -------------------------------------------------------------------------------- 1 | geopy==2.4.1 2 | pytest==8.3.3 3 | -------------------------------------------------------------------------------- /Geographic Distance/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.12.7 -------------------------------------------------------------------------------- /Geographic Distance/test_geographic_distance.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | import pytest 4 | from geographic_distance import calculate_distance_and_time, main 5 | 6 | 7 | def test_calculate_distance_and_time(): 8 | # Test with valid coordinates and speed 9 | coord1 = (40.7128, -74.006) 10 | coord2 = (37.7749, -122.4194) 11 | avg_speed = 60 12 | distance, travel_time = calculate_distance_and_time(coord1, coord2, avg_speed) 13 | assert distance > 0 14 | assert travel_time > 0 15 | 16 | 17 | def test_calculate_distance_and_time_invalid_speed(): 18 | # Test with invalid speed (zero) 19 | coord1 = (40.7128, -74.006) 20 | coord2 = (37.7749, -122.4194) 21 | avg_speed = 0 22 | with pytest.raises(ValueError): 23 | calculate_distance_and_time(coord1, coord2, avg_speed) 24 | 25 | 26 | def test_calculate_distance_and_time_same_coordinates(): 27 | # Test with same coordinates 28 | coord1 = (40.7128, -74.006) 29 | coord2 = (40.7128, -74.006) 30 | avg_speed = 60 31 | distance, travel_time = calculate_distance_and_time(coord1, coord2, avg_speed) 32 | assert distance == 0 33 | assert travel_time == 0 34 | 35 | 36 | @pytest.fixture 37 | def mock_input(): 38 | with patch('builtins.input', side_effect=['40.7128, -74.006', '37.7749, -122.4194', '60']): 39 | yield 40 | 41 | 42 | def test_main(mock_input, capsys): 43 | main() 44 | captured = capsys.readouterr() 45 | assert 'Distance between the two coordinates:' in captured.out 46 | assert 'Estimated travel time:' in captured.out 47 | 48 | 49 | def test_main_invalid_coordinates(mock_input, capsys): 50 | with patch('builtins.input', side_effect=['abc, def', '37.7749, -122.4194', '60']): 51 | with pytest.raises(ValueError): 52 | main() 53 | 54 | 55 | def test_main_invalid_speed(mock_input, capsys): 56 | with patch('builtins.input', side_effect=['40.7128, -74.006', '37.7749, -122.4194', 'abc']): 57 | with pytest.raises(ValueError): 58 | main() 59 | 60 | 61 | def test_main_zero_speed(mock_input, capsys): 62 | with patch('builtins.input', side_effect=['40.7128, -74.006', '37.7749, -122.4194', '0']): 63 | with pytest.raises(ValueError): 64 | main() 65 | 66 | 67 | def test_main_same_coordinates(mock_input, capsys): 68 | with patch('builtins.input', side_effect=['40.7128, -74.006', '40.7128, -74.006', '60']): 69 | main() 70 | captured = capsys.readouterr() 71 | assert 'Distance between the two coordinates: 0.00 kilometers' in captured.out 72 | assert 'Estimated travel time: 0.00 hours' in captured.out 73 | -------------------------------------------------------------------------------- /Gesture-Based-Game-Controller/main.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import mediapipe as mp 3 | import numpy as np 4 | import time 5 | 6 | # Initialize MediaPipe hands module 7 | mp_hands = mp.solutions.hands 8 | hands = mp_hands.Hands() 9 | mp_drawing = mp.solutions.drawing_utils 10 | 11 | # Gesture mappings 12 | GESTURES = { 13 | "forward": "Move Forward", 14 | "backward": "Move Backward", 15 | "left": "Move Left", 16 | "right": "Move Right", 17 | "up": "Jump" 18 | } 19 | 20 | # Define a function to calculate the direction based on landmarks 21 | def detect_direction(landmarks): 22 | # Get coordinates of wrist and index finger tip 23 | wrist = landmarks[0] # Wrist coordinates 24 | index_finger_tip = landmarks[8] # Index finger tip 25 | 26 | # Calculate relative positions of index finger to wrist 27 | x_diff = index_finger_tip.x - wrist.x # Difference in X-axis 28 | y_diff = index_finger_tip.y - wrist.y # Difference in Y-axis 29 | 30 | # Use thresholds to determine the direction 31 | if abs(x_diff) > abs(y_diff): # Horizontal movement dominates 32 | if x_diff > 0.1: # Index finger is to the right of the wrist 33 | return "right" 34 | elif x_diff < -0.1: # Index finger is to the left of the wrist 35 | return "left" 36 | else: # Vertical movement dominates 37 | if y_diff > 0.1: # Fingers are below wrist 38 | return "backward" 39 | elif y_diff < -0.1: # Fingers are above wrist 40 | return "up" 41 | 42 | # If no significant difference in X or Y, assume pointing forward 43 | return "forward" 44 | 45 | # Video capture for hand gesture recognition 46 | cap = cv2.VideoCapture(0) 47 | prev_time = 0 # To implement delay between gesture changes 48 | delay_interval = 1.0 # 1 second delay between actions 49 | 50 | while True: 51 | ret, frame = cap.read() 52 | if not ret: 53 | break 54 | 55 | # Flip the frame horizontally for natural movement 56 | frame = cv2.flip(frame, 1) 57 | frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) 58 | 59 | # Detect hands 60 | results = hands.process(frame_rgb) 61 | 62 | landmark_list = [] 63 | 64 | # If hand landmarks are detected 65 | if results.multi_hand_landmarks: 66 | for hand_landmarks in results.multi_hand_landmarks: 67 | mp_drawing.draw_landmarks(frame, hand_landmarks, mp_hands.HAND_CONNECTIONS) 68 | 69 | # Collect hand landmark data 70 | for lm in hand_landmarks.landmark: 71 | landmark_list.append(lm) 72 | 73 | # Detect direction based on the landmarks 74 | direction = detect_direction(landmark_list) 75 | 76 | # Check for time delay between actions 77 | current_time = time.time() 78 | if current_time - prev_time > delay_interval: 79 | print(GESTURES[direction]) # Output corresponding action 80 | prev_time = current_time 81 | 82 | # Display the frame with landmarks 83 | cv2.imshow('Hand Gesture Recognition', frame) 84 | 85 | # Quit if 'q' is pressed 86 | if cv2.waitKey(1) & 0xFF == ord('q'): 87 | break 88 | 89 | cap.release() 90 | cv2.destroyAllWindows() 91 | -------------------------------------------------------------------------------- /Gesture-Based-Game-Controller/readme.md: -------------------------------------------------------------------------------- 1 | # Hand Gesture Control Using Computer Vision 2 | 3 | This project uses computer vision and machine learning to detect hand gestures and map them to simple game controls like moving forward, left, right, jumping, and moving backward. 4 | 5 | The project uses **OpenCV** and **MediaPipe** for hand landmark detection and gesture recognition. 6 | 7 | ## Features 8 | 9 | - Detects hand gestures in real-time. 10 | - Maps gestures to game controls: 11 | - **Move Forward**: Fingers pointing towards the screen. 12 | - **Move Left**: Fingers pointing left. 13 | - **Move Right**: Fingers pointing right. 14 | - **Move Backward**: Fingers pointing downward. 15 | - **Jump**: Fingers pointing upward. 16 | - Implements a delay between actions to prevent rapid switching of game controls. 17 | 18 | ## Requirements 19 | 20 | - Python 3.7 or higher 21 | - OpenCV 22 | - MediaPipe 23 | - NumPy 24 | 25 | 26 | -------------------------------------------------------------------------------- /Gesture-Based-Game-Controller/requirements.txt: -------------------------------------------------------------------------------- 1 | opencv-python==4.8.0.74 2 | mediapipe==0.10.0 3 | numpy==1.24.2 4 | -------------------------------------------------------------------------------- /Gesture-Based-Game-Controller/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.12.7 -------------------------------------------------------------------------------- /Handwritten-Assignments/main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # Author: Aman Kumar 4 | # Version: 1.0.0 5 | 6 | import pywhatkit as pw 7 | 8 | text_to_convert = """ 9 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque varius morbi enim nunc faucibus. Porta nibh venenatis cras sed felis eget velit. Sem viverra aliquet eget sit amet tellus. Volutpat lacus laoreet non curabitur gravida arcu ac tortor. Scelerisque felis imperdiet proin fermentum leo vel orci porta non. Est ullamcorper eget nulla facilisi etiam dignissim diam quis enim. Vitae turpis massa sed elementum tempus egestas sed. Egestas integer eget aliquet nibh praesent. Risus sed vulputate odio ut enim blandit volutpat maecenas. Vitae congue eu consequat ac felis. Aliquet eget sit amet tellus cras. Vel fringilla est ullamcorper eget nulla facilisi. Tristique senectus et netus et malesuada fames ac. Nullam eget felis eget nunc. Tincidunt praesent semper feugiat nibh sed pulvinar proin gravida hendrerit. Enim eu turpis egestas pretium aenean pharetra magna. 10 | """ 11 | 12 | pw.text_to_handwriting(text_to_convert, 'demo.png',[0,0,135]) 13 | print("Converted !!") 14 | -------------------------------------------------------------------------------- /Handwritten-Assignments/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Handwritten-Assignments/requirements.txt -------------------------------------------------------------------------------- /Handwritten-Assignments/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Headlight Detection/headlightDetection.py: -------------------------------------------------------------------------------- 1 | from shutil import which 2 | import numpy as np 3 | from matplotlib import pyplot as plt 4 | import cv2, time 5 | 6 | def wait(t): 7 | time.sleep() 8 | 9 | #List includes path for images representing differenct scenarios 10 | mlist = ['bus_coming.hpg','going.jpg','both.jpg'] 11 | 12 | #codition: no vehicle 13 | def scenario(condition): 14 | image = cv2.imread(condition) 15 | gray_image = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) 16 | cv2.imwrite('gray_image.png',gray_image) 17 | cv2.imshow('color_image',image) 18 | blur_image = cv2.blur(gray_image,(15,15)) 19 | cv2.imwrite('blur_image.png',blur_image) 20 | ret , thresh = cv2.threshold(blur_image,150,255,0) 21 | contour_image , contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) 22 | cv2.drwaContours(blur_image,contours,-1,(0,255,0),3) 23 | cv2.imshow('blur_image.png',blur_image) 24 | moments = [cv2.moments(cnt) for cnt in contours] 25 | y_centroids = [int(round(m['m01']/m['m00'])) for m in moments] 26 | x = len(y_centroids) 27 | i=0 28 | while ia>span')] 49 | 50 | # Fix ratings 51 | try: 52 | movieDetails['rating'] = f"{bs.find( 53 | 'div', {'data-testid': 'hero-rating-bar__aggregate-rating__score'}).span.text}/10 ({bs.find('div', {'class': 'sc-bde20123-3 gPVQxL'}).text})" 54 | movieDetails['runtime'] = box[2].text.strip() 55 | except AttributeError: 56 | movieDetails['rating'] = 'Not yet rated' 57 | movieDetails['runtime'] = 'Not available' 58 | 59 | # To get movie release date 60 | movie_release_dates_url= f"{url}{box[0].a.attrs['href']}" 61 | soup = requestUrl_and_bs4(movie_release_dates_url) 62 | 63 | movieDetails['release_date'] = soup.select_one('#rel_1 > div > ul > li > span.ipc-metadata-list-item__list-content-item').text 64 | 65 | creditSummary = bs.select('div.ipc-metadata-list-item__content-container > ul') 66 | 67 | movieDetails['directors'] = [i.text for i in creditSummary[0].select('li>a')] 68 | 69 | try: 70 | movieDetails['cast'] = [i.text for i in creditSummary[2].select('li>a')] 71 | movieDetails['writers'] = [i.text for i in creditSummary[1].select('li>a')] 72 | 73 | except IndexError: 74 | movieDetails['cast']=movieDetails['writers'] 75 | movieDetails['writers']='Not found' 76 | 77 | movieDetails['plot'] = bs.find('span', {'data-testid': 'plot-l'}).text.strip() 78 | 79 | return movieDetails 80 | 81 | def main(): 82 | movieName = input('Enter the movie name : \n') 83 | movieDetails = getMovieDetails(movieName) 84 | if movieDetails is None: 85 | print('No movie found with given name!!!!!') 86 | quit() 87 | print('\n{movie} ({year})'.format( 88 | movie=movieDetails['name'], year=movieDetails['year'])) 89 | print('Rating:', movieDetails['rating']) 90 | print('Runtime:', movieDetails['runtime']) 91 | print('Release Date:', movieDetails['release_date']) 92 | print('Genres:', ', '.join(movieDetails['genres'])) 93 | print('Director:', ', '.join(movieDetails['directors'])) 94 | print('Writer:', ', '.join(movieDetails['writers'])) 95 | print('Cast:', ', '.join(movieDetails['cast'])) 96 | print('Plot Summary:\n', movieDetails['plot']) 97 | 98 | if __name__ == "__main__": 99 | main() 100 | -------------------------------------------------------------------------------- /My-Personal-Journal/README.md: -------------------------------------------------------------------------------- 1 | # Personal Journal 2 | 3 | A simple web-based application for maintaining a personal journal. Users can create entries, tag them, and search through past entries by date or keywords. The application is built using Flask and SQLite for a lightweight and efficient experience. 4 | 5 | ## Features 6 | 7 | - **Add New Entries**: Users can add journal entries with mood, content, and tags. 8 | - **Search Entries**: Search through entries using keywords or specific dates. 9 | - **Tag Management**: Create and view tags associated with each entry, and filter entries by tags. 10 | - **User-Friendly Interface**: A clean and professional UI for easy navigation and use. 11 | 12 | ## Technologies Used 13 | 14 | - Python 15 | - Flask 16 | - SQLite 17 | - HTML/CSS 18 | 19 | ## Installation 20 | 21 | 1. **Clone the Repository**: 22 | ```bash 23 | git clone 24 | cd your_project 25 | 26 | 2. **Install Required Packages: Make sure you have Python installed (preferably Python 3). Install the required packages using pip**: 27 | ```bash 28 | pip install -r requirements.txt 29 | 30 | 3. **Run the Application: Start the Flask application**: 31 | ```bash 32 | python app.py 33 | 34 | 4. **Access the App: Open your web browser and navigate to http://127.0.0.1:8080 to access the application.** 35 | -------------------------------------------------------------------------------- /My-Personal-Journal/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, request, redirect, url_for 2 | from journal_app import add_entry, search_entries 3 | from datetime import datetime 4 | import sqlite3 5 | 6 | app = Flask(__name__) 7 | 8 | # Route to show the home page 9 | @app.route('/') 10 | def index(): 11 | return render_template('index.html') 12 | 13 | # Route to add a new journal entry 14 | @app.route('/add', methods=['GET', 'POST']) 15 | def add(): 16 | if request.method == 'POST': 17 | mood = request.form['mood'] 18 | content = request.form['content'] 19 | tags = request.form['tags'] 20 | add_entry("user_1", mood, content, tags) 21 | return redirect(url_for('index')) 22 | return render_template('add.html') 23 | 24 | # Route to search journal entries 25 | 26 | 27 | @app.route('/search', methods=['GET', 'POST']) 28 | def search(): 29 | if request.method == 'POST': 30 | search_input = request.form['search_term'] 31 | 32 | # Try to parse the input as a date 33 | try: 34 | search_date = datetime.strptime(search_input, '%Y-%m-%d').date() 35 | results = search_entries("user_1", date=search_date) 36 | except ValueError: 37 | # If parsing fails, treat it as a search term 38 | results = search_entries("user_1", search_term=search_input) 39 | 40 | return render_template('search_results.html', results=results) 41 | 42 | return render_template('search.html') 43 | 44 | 45 | # Route to list all unique tags 46 | @app.route('/tags') 47 | def list_tags(): 48 | conn = sqlite3.connect('journal.db') 49 | cursor = conn.cursor() 50 | 51 | # Fetch unique tags from all entries 52 | cursor.execute("SELECT DISTINCT tags FROM journal_entries") 53 | tags_data = cursor.fetchall() 54 | conn.close() 55 | 56 | # Flatten the tags and remove duplicates 57 | tags = set() 58 | for row in tags_data: 59 | if row[0]: 60 | tags.update(tag.strip() for tag in row[0].split(',')) 61 | 62 | return render_template('tags.html', tags=sorted(tags)) 63 | 64 | # Route to show journal entries by tag 65 | @app.route('/tags/') 66 | def entries_by_tag(tag): 67 | conn = sqlite3.connect('journal.db') 68 | cursor = conn.cursor() 69 | 70 | # Search for entries that contain the selected tag 71 | cursor.execute("SELECT * FROM journal_entries WHERE tags LIKE ?", ('%' + tag + '%',)) 72 | results = cursor.fetchall() 73 | conn.close() 74 | 75 | return render_template('search_results.html', results=results) 76 | 77 | if __name__ == '__main__': 78 | app.run(debug=True, port=8080) 79 | -------------------------------------------------------------------------------- /My-Personal-Journal/database.py: -------------------------------------------------------------------------------- 1 | from sqlalchemy.orm import sessionmaker 2 | from models import JournalEntry, Base 3 | from sqlalchemy import create_engine 4 | 5 | engine = create_engine('sqlite:///journal.db') 6 | Base.metadata.create_all(engine) 7 | Session = sessionmaker(bind=engine) 8 | session = Session() 9 | 10 | def add_entry(user_id, mood, content, tags): 11 | entry = JournalEntry(user_id=user_id, mood=mood, content=content, tags=tags) 12 | session.add(entry) 13 | session.commit() 14 | 15 | def search_entries(user_id, search_term=None, date=None): 16 | query = session.query(JournalEntry).filter(JournalEntry.user_id == user_id) 17 | if search_term: 18 | query = query.filter(JournalEntry.content.contains(search_term)) 19 | if date: 20 | query = query.filter(JournalEntry.date == date) 21 | return query.all() 22 | -------------------------------------------------------------------------------- /My-Personal-Journal/journal_app.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | from datetime import datetime 3 | 4 | DB_NAME = "journal.db" 5 | 6 | def connect_db(): 7 | return sqlite3.connect(DB_NAME) 8 | 9 | def create_table(): 10 | with connect_db() as conn: 11 | cursor = conn.cursor() 12 | cursor.execute(''' 13 | CREATE TABLE IF NOT EXISTS journal_entries ( 14 | id INTEGER PRIMARY KEY AUTOINCREMENT, 15 | user_id TEXT, 16 | date TEXT, 17 | mood TEXT, 18 | content TEXT, 19 | tags TEXT 20 | ) 21 | ''') 22 | conn.commit() 23 | 24 | def add_entry(user_id, mood, content, tags): 25 | with connect_db() as conn: 26 | cursor = conn.cursor() 27 | cursor.execute(''' 28 | INSERT INTO journal_entries (user_id, date, mood, content, tags) 29 | VALUES (?, ?, ?, ?, ?) 30 | ''', (user_id, datetime.now().strftime('%Y-%m-%d %H:%M:%S'), mood, content, tags)) 31 | conn.commit() 32 | 33 | def search_entries(user_id, search_term=None, date=None): 34 | with connect_db() as conn: 35 | cursor = conn.cursor() 36 | 37 | if search_term: 38 | query = ''' 39 | SELECT * FROM journal_entries 40 | WHERE user_id = ? AND (content LIKE ? OR tags LIKE ?) 41 | ''' 42 | cursor.execute(query, (user_id, f'%{search_term}%', f'%{search_term}%')) 43 | elif date: 44 | query = ''' 45 | SELECT * FROM journal_entries 46 | WHERE user_id = ? AND date(date) = ? 47 | ''' 48 | cursor.execute(query, (user_id, date.strftime('%Y-%m-%d'))) 49 | else: 50 | return [] 51 | 52 | return cursor.fetchall() 53 | 54 | # Create the journal table at the start 55 | create_table() 56 | -------------------------------------------------------------------------------- /My-Personal-Journal/requirements.txt: -------------------------------------------------------------------------------- 1 | flask 2 | sqlalchemy 3 | # sqlite3 4 | bcrypt 5 | pandas 6 | matplotlib 7 | # tkinter 8 | flask -------------------------------------------------------------------------------- /My-Personal-Journal/templates/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Add New Entry 7 | 8 | 9 | 10 |
11 |

Add New Journal Entry

12 |
13 |
14 |
15 |
16 | 17 | 18 |
19 |
20 | 21 | 22 |
23 |
24 | 25 | 33 |
34 |
35 | 36 | 37 |
38 | 39 |
40 |
41 |
42 |

© 2024 Personal Journal

43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /My-Personal-Journal/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Personal Journal 7 | 8 | 9 | 10 |
11 |

Welcome to Your Personal Journal

12 |
13 |
14 | 19 |
20 |
21 |

© 2024 Personal Journal

22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /My-Personal-Journal/templates/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Search Journal Entries 5 | 6 | 7 | 8 | 9 |
10 |

Search Journal Entries

11 |
12 | Search by keyword or date (YYYY-MM-DD):
13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /My-Personal-Journal/templates/search_results.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Search Results 5 | 6 | 7 | 8 | 9 |

Journal Entries

10 | 11 |
12 | {% for result in results %} 13 |

Date: {{ result[2] }}, Mood: {{ result[3] }}, Tags: {{ result[5] }}

14 |

{{ result[4] }}

15 |
16 | {% else %} 17 |

No entries found.

18 | {% endfor %} 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /My-Personal-Journal/templates/tags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tags 5 | 6 | 7 | 8 | 9 |

Tags

10 |
    11 | {% for tag in tags %} 12 |
  • {{ tag }}
  • 13 | {% else %} 14 |
  • No tags found.
  • 15 | {% endfor %} 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /Notepad/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import filedialog, messagebox 3 | 4 | root = Tk() 5 | root.geometry("700x500") 6 | root.title("Aman's Notepad") 7 | 8 | def save_file(): 9 | open_file = filedialog.asksaveasfile(mode='w', defaultextension=".txt") 10 | if open_file is None: 11 | return 12 | text = str(entry.get(1.0, END)) 13 | open_file.write(text) 14 | open_file.close() 15 | 16 | def clear(): 17 | messagebox.showinfo("Cleared", "Cleared all contents !") 18 | entry.delete(1.0, END) 19 | 20 | def open_file(): 21 | file = filedialog.askopenfile(mode='r', filetype=[('text files', '*.txt')]) 22 | if file is not None: 23 | content = file.read() 24 | entry.insert(INSERT, content) 25 | 26 | b1 = Button(root, text="Save", command=save_file) 27 | b1.place(x=10, y=10) 28 | 29 | b2 = Button(root, text="Clear", command=clear) 30 | b2.place(x=70, y=10) 31 | 32 | b3 = Button(root, text="Open", command=open_file) 33 | b3.place(x=120, y=10) 34 | 35 | entry = Text(root, height=60, width=70, wrap=WORD, bg="black", fg="green", selectbackground="red", 36 | font="Courier 15", insertbackground="violet") 37 | entry.place(x=10, y=50) 38 | 39 | root.mainloop() 40 | -------------------------------------------------------------------------------- /Notepad/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Notepad/requirements.txt -------------------------------------------------------------------------------- /Notepad/runtime.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Notepad/runtime.txt -------------------------------------------------------------------------------- /OCR Image-to-Text Conversion/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | Image Text Extractor is a Python application that utilizes Tesseract OCR to extract text from images. This application allows users to input the path to an image file and receive the extracted text in return. 4 | 5 | ## Requirements 6 | 7 | - Python 3.x 8 | - Libraries: 9 | - `pytesseract` 10 | - `PIL` (Pillow) 11 | 12 | You can install the required libraries by running: 13 | 14 | ```bash 15 | pip install pytesseract Pillow 16 | ``` 17 | 18 | ## Installation Instructions for All Operating Systems 19 | 20 | ### Windows 21 | 22 | 1. **Install Python**: 23 | 24 | - Download and install Python from the [official website](https://www.python.org/downloads/). 25 | - During installation, make sure to check the box that says "Add Python to PATH". 26 | 27 | 2. **Install Tesseract OCR**: 28 | 29 | - Download the Tesseract installer from the [Tesseract GitHub releases page](https://github.com/tesseract-ocr/tesseract/releases). 30 | - Run the installer and note the installation path (usually `C:\Program Files\Tesseract-OCR`). 31 | 32 | 3. **Set Tesseract Path**: 33 | 34 | - Add the Tesseract installation path to your system environment variables. 35 | - Right-click on "This PC" or "My Computer" > Properties > Advanced system settings > Environment Variables. 36 | - Under "System variables", find the `Path` variable and click Edit. Add the Tesseract path. 37 | 38 | 4. **Install Required Libraries**: 39 | - Open Command Prompt and run: 40 | ```bash 41 | pip install pytesseract Pillow 42 | ``` 43 | 44 | ### macOS 45 | 46 | 1. **Install Homebrew** (if not already installed): 47 | 48 | - Open Terminal and run: 49 | ```bash 50 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 51 | ``` 52 | 53 | 2. **Install Python**: 54 | 55 | - Use Homebrew to install Python: 56 | ```bash 57 | brew install python 58 | ``` 59 | 60 | 3. **Install Tesseract OCR**: 61 | 62 | - Install Tesseract using Homebrew: 63 | ```bash 64 | brew install tesseract 65 | ``` 66 | 67 | 4. **Install Required Libraries**: 68 | - In Terminal, run: 69 | ```bash 70 | pip install pytesseract Pillow 71 | ``` 72 | 73 | ### Linux (Ubuntu/Debian) 74 | 75 | 1. **Install Python** (if not already installed): 76 | 77 | - Open Terminal and run: 78 | ```bash 79 | sudo apt update 80 | sudo apt install python3 python3-pip 81 | ``` 82 | 83 | 2. **Install Tesseract OCR**: 84 | 85 | - Install Tesseract using: 86 | ```bash 87 | sudo apt install tesseract-ocr 88 | ``` 89 | 90 | 3. **Install Required Libraries**: 91 | - In Terminal, run: 92 | ```bash 93 | pip3 install pytesseract Pillow 94 | ``` 95 | 96 | ## Usage Instructions 97 | 98 | After completing the installation, follow the usage instructions below to run the application. 99 | 100 | 1. Open Command Prompt. 101 | 2. Navigate to the directory where the script is located using the `cd` command: 102 | ```bash 103 | cd path\to\your\script 104 | ``` 105 | 3. Run the Python script 106 | ```bash 107 | python image_text_extractor.py - mine is main.py 108 | ``` -------------------------------------------------------------------------------- /OCR Image-to-Text Conversion/main.py: -------------------------------------------------------------------------------- 1 | import pytesseract 2 | from PIL import Image 3 | import os 4 | 5 | def extract_text_from_image(image_path): 6 | """Extracts text from an image file using Tesseract OCR.""" 7 | try: 8 | # Open the image file 9 | with Image.open(image_path) as img: 10 | # Use pytesseract to do OCR on the image 11 | extracted_text = pytesseract.image_to_string(img) 12 | return extracted_text 13 | except Exception as e: 14 | print(f"Error processing the image: {e}") 15 | return None 16 | 17 | def main(): 18 | 19 | image_path = input("Enter the path to the image file: ") 20 | 21 | if not os.path.isfile(image_path): 22 | print("File does not exist. Please check the path and try again.") 23 | return 24 | text = extract_text_from_image(image_path) 25 | 26 | if text: 27 | print("Extracted Text:") 28 | print(text) 29 | 30 | if __name__ == "__main__": 31 | main() 32 | -------------------------------------------------------------------------------- /OCR Image-to-Text Conversion/requirements.txt: -------------------------------------------------------------------------------- 1 | pillow==11.0.0 2 | pytesseract==0.3.13 -------------------------------------------------------------------------------- /Password Generator/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from random import choice 3 | import string 4 | 5 | class App: 6 | def __init__(self): 7 | self.window = Tk() 8 | self.window.title('password_generator') 9 | self.window.iconbitmap('logo.ico') 10 | self.window.iconphoto(False, PhotoImage(file='logo.png')) 11 | self.window.geometry('500x255') 12 | self.window.config(bg='gray') 13 | 14 | self.label() 15 | self.entry() 16 | self.button() 17 | 18 | def label(self): 19 | label_title = Label(self.window, text='Welcome to password generator', font=('Courrier', 20), bg='gray', fg='black') 20 | label_title.pack() 21 | 22 | def entry(self): 23 | self.password_entry = Entry(self.window, font=('Courrier', 25), bg='white', fg='black', width=30, relief='solid') 24 | self.password_entry.pack(pady=50) 25 | 26 | def button(self): 27 | password_generator = Button(self.window, text="Generate_password", font=('Courrier', 12), bg='white', fg='black', width=25, command=self.generate_password) 28 | password_generator.pack() 29 | 30 | def generate_password(self): 31 | characters = string.ascii_letters + string.punctuation + string.digits 32 | password = "" 33 | for x in range(28): 34 | password+=choice(characters) 35 | self.password_entry.delete(0, END) 36 | self.password_entry.insert(0, password) 37 | 38 | app = App() 39 | app.window.mainloop() 40 | -------------------------------------------------------------------------------- /Password Generator/requirements.txt: -------------------------------------------------------------------------------- 1 | tk==0.1.0 2 | -------------------------------------------------------------------------------- /Password Generator/runtime.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Password Generator/runtime.txt -------------------------------------------------------------------------------- /Plagiarism-Checker/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | from sklearn.feature_extraction.text import TfidfVectorizer 3 | from sklearn.metrics.pairwise import cosine_similarity 4 | 5 | student_files = [doc for doc in os.listdir() if doc.endswith('.txt')] 6 | student_notes = [open(_file, encoding='utf-8').read() 7 | for _file in student_files] 8 | 9 | 10 | def vectorize(Text): return TfidfVectorizer().fit_transform(Text).toarray() 11 | def similarity(doc1, doc2): return cosine_similarity([doc1, doc2]) 12 | 13 | 14 | vectors = vectorize(student_notes) 15 | s_vectors = list(zip(student_files, vectors)) 16 | plagiarism_results = set() 17 | 18 | 19 | def check_plagiarism(): 20 | global s_vectors 21 | for student_a, text_vector_a in s_vectors: 22 | new_vectors = s_vectors.copy() 23 | current_index = new_vectors.index((student_a, text_vector_a)) 24 | del new_vectors[current_index] 25 | for student_b, text_vector_b in new_vectors: 26 | sim_score = similarity(text_vector_a, text_vector_b)[0][1] 27 | student_pair = sorted((student_a, student_b)) 28 | score = (student_pair[0], student_pair[1], sim_score) 29 | plagiarism_results.add(score) 30 | return plagiarism_results 31 | 32 | 33 | for data in check_plagiarism(): 34 | print(data) 35 | -------------------------------------------------------------------------------- /Plagiarism-Checker/requirements.txt: -------------------------------------------------------------------------------- 1 | scikit_learn==0.24.2 -------------------------------------------------------------------------------- /Plagiarism-Checker/runtime.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Plagiarism-Checker/runtime.txt -------------------------------------------------------------------------------- /Plagiarism-Checker/test1.txt: -------------------------------------------------------------------------------- 1 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. -------------------------------------------------------------------------------- /Plagiarism-Checker/test2.txt: -------------------------------------------------------------------------------- 1 | It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). -------------------------------------------------------------------------------- /Pomodoro Timer/README.md: -------------------------------------------------------------------------------- 1 | # Pomodoro Timer 2 | 3 | A simple, customizable command line pomodoro timer built in Python. 4 | 5 | ## Features 6 | 7 | - Customizable work, short and long breaks intervals: Define your own durations for each cycle. 8 | - Pause whenever you want: Pause the timer when you want to take a break. 9 | - Cycles: Run Multiple cycles of work and break intervals 10 | - Console output: Show work and break intervals in the console. 11 | 12 | ## How it works 13 | 14 | The Pomodoro Timer follow these steps: 15 | 1. Set your work and break intervals. 16 | 2. Take a short break every work interval. 17 | 3. After a set number of cycles, take a long break. 18 | 19 | ## Usage 20 | 21 | 1. Clone this repository to your machine. 22 | 2. Run the Python script from the command line. 23 | '''python pomodoro_timer.py''' 24 | 25 | ## Author 26 | 27 | [MeuHubPython](https://github.com/MeuHubPython) 28 | 29 | -------------------------------------------------------------------------------- /Pomodoro Timer/main.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | 4 | def countdown(minutes, label): 5 | total_seconds = minutes * 60 6 | while total_seconds: 7 | mins, secs = divmod(total_seconds, 60) 8 | timer = f"{mins:02d}:{secs:02d}" 9 | print(f"{label} Timer: {timer}", end="\r") 10 | time.sleep(1) 11 | total_seconds -= 1 12 | print(f"\n{label} finished!") 13 | 14 | 15 | def handle_pause_stop(): 16 | while True: 17 | user_input = input( 18 | "\nPress 'p' to pause, 's' to stop, or 'Enter' to continue: " 19 | ).lower() 20 | if user_input == "p": 21 | print("Timer paused. Press 'Enter' to resume.") 22 | input() 23 | elif user_input == "s": 24 | print("Timer stopped.") 25 | return True # Return True to signal that the timer should stop 26 | else: 27 | return False # Return False to continue with the timer 28 | 29 | 30 | def pomodoro_timer(work_min, short_break_min, long_break_min, cycles): 31 | for i in range(cycles): 32 | print(f"\nCycle {i+1} of {cycles}") 33 | countdown(work_min, "Work") 34 | if i < cycles - 1: 35 | print("\nStarting short break...") 36 | if handle_pause_stop(): 37 | return 38 | countdown(short_break_min, "Short Break") 39 | else: 40 | print("\nStarting long break...") 41 | if handle_pause_stop(): 42 | return 43 | countdown(long_break_min, "Long Break") 44 | if not repeat_or_end(): 45 | return 46 | 47 | 48 | def repeat_or_end(): 49 | user_input = input( 50 | "\nCycle finished. Would you like to repeat the cycle? (y/n): " 51 | ).lower() 52 | return user_input == "y" 53 | 54 | 55 | def get_valid_input(prompt): 56 | while True: 57 | try: 58 | value = int(input(prompt)) 59 | if value <= 0: 60 | raise ValueError 61 | return value 62 | except ValueError: 63 | print("Invalid input. Please enter a positive integer.") 64 | 65 | 66 | if __name__ == "__main__": 67 | work_minutes = get_valid_input("Enter work interval in minutes: ") 68 | short_break_minutes = get_valid_input("Enter short break interval in minutes: ") 69 | long_break_minutes = get_valid_input("Enter long break interval in minutes: ") 70 | cycles = get_valid_input("Enter the number of cycles: ") 71 | 72 | pomodoro_timer(work_minutes, short_break_minutes, long_break_minutes, cycles) 73 | -------------------------------------------------------------------------------- /Pomodoro Timer/runtime.txt: -------------------------------------------------------------------------------- 1 | Python 3.10.12 2 | -------------------------------------------------------------------------------- /QR Code Generator/advanceQR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/QR Code Generator/advanceQR.png -------------------------------------------------------------------------------- /QR Code Generator/advanceQrGenerator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # Author: Aman Kumar 4 | # Version: 1.0.0 5 | 6 | import qrcode 7 | from PIL import Image 8 | 9 | qr = qrcode.QRCode(version=1, error_correction=qrcode.ERROR_CORRECT_H, box_size=10, border=4) 10 | 11 | qr.add_data("https://github.com/king04aman/all-in-one-python-projects") 12 | qr.make(fit=True) 13 | img = qr.make_image(fill_color='blue', back_color='white') 14 | img.save('./advanceQR.png') -------------------------------------------------------------------------------- /QR Code Generator/basicQrGenerator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # Author: Aman Kumar 4 | # Version: 1.0.0 5 | 6 | import qrcode as qr 7 | 8 | qrImg = qr.make("https://github.com/king04aman/All-In-One-Python-Projects/") 9 | qrImg.save('demo.png') 10 | -------------------------------------------------------------------------------- /QR Code Generator/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/QR Code Generator/demo.png -------------------------------------------------------------------------------- /QR Code Generator/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/QR Code Generator/requirements.txt -------------------------------------------------------------------------------- /QR Code Generator/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

All-In-One-Python-Projects

2 | 3 | 4 | ![All-In-One-Python-Projects] 5 | 6 | 7 | [![BuiltByDev](https://forthebadge.com/images/badges/built-by-developers.svg)](https://github.com/king04aman) 8 | [![BuiltWithLov](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/king04aman) 9 | [![MadeWithPy](https://forthebadge.com/images/badges/made-with-python.svg)](https://github.com/king04aman) 10 |
11 | ![Issues](https://img.shields.io/github/issues/king04aman/All-In-One-Python-Projects.svg) 12 | ![Contributors](https://img.shields.io/github/contributors/king04aman/All-In-One-Python-Projects.svg) 13 | ![SizeInBytes](https://img.shields.io/github/repo-size/king04aman/All-In-One-Python-Projects.svg) 14 | ![TopLanguage](https://img.shields.io/github/languages/top/king04aman/All-In-One-Python-Projects.svg) 15 | ![PullRequests](https://img.shields.io/github/issues-pr/king04aman/All-In-One-Python-Projects.svg) 16 | 17 | 18 |

Description

19 | 20 | _All-In-One-Python-Projects is a collection of all scripts starting from very basic to advance scripts. This is your personal zone where you may search or add any new scripts that can simplify your or other developer's life and give them something to do when they're bored. Start producing exciting scripts that benefit the community._ 21 | 22 |
23 | 24 | ## Getting Started 25 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. 26 | 27 | ## Prerequisites 28 | - Python 3.x 29 | 30 | ## Installing 31 | 1. Clone the repository to your local machine 32 | ```bash 33 | git clone https://github.com/king04aman/All-In-One-Python-Projects.git 34 | ``` 35 | 2. Change directory into the cloned repository 36 | ```bash 37 | cd All-In-One-Python-Projects/ 38 | ``` 39 | 3. Install the required libraries 40 | ```bash 41 | pip install -r requirements.txt 42 | ``` 43 | 4. Run the program using 44 | ```bash 45 | python3 .py 46 | ``` 47 | 48 |
49 | 50 |

Contribution Guide

51 | 52 | - Have a look at [Contributing Guidelines](CONTRIBUTING.md). 53 | - Take a look at the existing issues or create your own issues. 54 | - Avoid making pull request unless you are assigned with the issue. 55 | - Select the project on which you want to work or you can add your own project. 56 | - Create an issue with description on which project you want to work and wait for approval. 57 | - While making pull request add issue number with `#` (for example `#04`) 58 | - After approval fork this repository, add your changes then make pull request with issue number and wait for review. 59 | - Star this repository. 🌟 60 | 61 | 62 |

Awesome Contributors 🤩

63 | 64 | Thanks go to these **Wonderful Contributors** ✨✨: 65 | 66 | 67 | 68 | 73 | 74 |
69 | 70 | 71 | 72 |
75 | 76 |
77 | 78 |

Project Maintainer

79 | 80 | 81 | 82 | 88 | 89 |
83 | 84 | 85 |
86 |

Aman Kumar

87 |
90 | 91 | ## License 92 | *This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details.* 93 | 94 | 95 |
96 |

🎉 😃 Happy Hacking 😃 🎉

97 | -------------------------------------------------------------------------------- /Random Movie Selector/main.py: -------------------------------------------------------------------------------- 1 | from imdb import IMDb 2 | import random 3 | 4 | 5 | class ChooseMovie(object): 6 | def __init__(self): 7 | self.cursor = IMDb() 8 | self.top250 = self.cursor.get_top250_movies() 9 | 10 | def __repr__(self): 11 | num = int(random.randint(0, 249)) 12 | return str(f"\n\n\t{num}: {self.top250[num]}\n\n") 13 | 14 | 15 | if __name__ == '__main__': 16 | print(ChooseMovie()) -------------------------------------------------------------------------------- /Random Movie Selector/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Random Movie Selector/requirements.txt -------------------------------------------------------------------------------- /Random Movie Selector/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Random Quotes Generator/quotes.py: -------------------------------------------------------------------------------- 1 | from bs4 import BeautifulSoup 2 | import requests 3 | import csv 4 | 5 | url='http://quotes.toscrape.com' 6 | 7 | html=requests.get(url) 8 | bs=BeautifulSoup(html.text,'html.parser') 9 | 10 | try: 11 | csv_file=open('quote_list.csv','w') 12 | fieldnames=['quote','author','tags'] 13 | dictwriter=csv.DictWriter(csv_file,fieldnames=fieldnames) 14 | 15 | dictwriter.writeheader() 16 | 17 | while True: 18 | for quote in bs.findAll('div',{'class':'quote'}): 19 | text=quote.find('span',{'class':'text'}).text 20 | author=quote.find('small',{'class':'author'}).text 21 | tags=[] 22 | for tag in quote.findAll('a',{'class':'tag'}): 23 | tags.append(tag.text) 24 | dictwriter.writerow({'quote':text,'author':author,'tags':tags}) 25 | 26 | next=bs.find('li',{'class':'next'}) 27 | if not next: 28 | break 29 | 30 | html=requests.get(url+next.a.attrs['href']) 31 | bs=BeautifulSoup(html.text,'html.parser') 32 | except: 33 | print('Unknown Error!!!') 34 | finally: 35 | csv_file.close() 36 | -------------------------------------------------------------------------------- /Random Quotes Generator/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Random Quotes Generator/requirements.txt -------------------------------------------------------------------------------- /Random Quotes Generator/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Real-Time Cryptocurrency Price Tracker/Readme.md: -------------------------------------------------------------------------------- 1 | # Cryptocurrency Price Tracker with CoinGecko API 2 | 3 | ## Project Overview 4 | 5 | The **Real-Time Cryptocurrency Price Tracker** is a Python script that allows users to retrieve real-time cryptocurrency prices, percentage price changes, and historical price data using the CoinGecko public API. The script also offers a simple visualization of historical price trends. Refer to [CoinGecko API](https://docs.coingecko.com/v3.0.1/reference/introduction) and [CoinGecko Coins List](https://api.coingecko.com/api/v3/coins/list) for more information. 6 | 7 | ## Features 8 | 9 | - **Real-Time Price Retrieval**: Input the name of a cryptocurrency (eg. bitcoin) to retrieve its current price in USD 10 | - **24-Hour Price Change**: Displays the 24-hour percentage change in price for the selected cryptocurrency 11 | - **Historical Price Data**: Retrieve historical price data for a specified number of days (eg. 1 day, 7 days, or 30 days) and visualize it in a chart 12 | - **Data Visualization**: Uses matplotlib to generate a line chart displaying the historical price data 13 | 14 | 15 | ## Technologies Used 16 | 17 | - **Python**: The core programming language used to build the script 18 | - **CoinGecko API**: A free API used to fetch cryptocurrency prices, percentage changes, and historical data 19 | - **Requests**: A Python library for making HTTP requests to the CoinGecko API 20 | - **Matplotlib**: A Python library used to visualize historical cryptocurrency price data in a line chart format 21 | - **Datetime**: Python datetime module is used to convert and handle timestamps when retrieving historical price data 22 | 23 | ## Prerequisites 24 | 25 | Before running the application, ensure you have the following: 26 | 27 | - [Python 3.x](https://www.python.org/downloads/) installed on your system 28 | - `requests` and `matplotlib` libraries are installed. Refer to `requirements.txt` for a specific version 29 | 30 | -------------------------------------------------------------------------------- /Real-Time Cryptocurrency Price Tracker/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import matplotlib.pyplot as plt 3 | import datetime 4 | 5 | COINGECKO_API_URL = "https://api.coingecko.com/api/v3" 6 | 7 | 8 | def get_crypto_price(crypto_symbol): 9 | headers = {"accept": "application/json"} 10 | response = requests.get(f"{COINGECKO_API_URL}/simple/price", params={ 11 | 'ids': crypto_symbol, 12 | 'vs_currencies': 'usd', 13 | 'include_24hr_change': 'true' 14 | }, headers=headers) 15 | 16 | if response.status_code == 200: 17 | data = response.json() 18 | if crypto_symbol in data: 19 | price = data[crypto_symbol]['usd'] 20 | change_percentage = data[crypto_symbol]['usd_24h_change'] 21 | return price, change_percentage 22 | else: 23 | raise ValueError(f"Cryptocurrency '{crypto_symbol}' not found.") 24 | else: 25 | raise Exception(f"Failed to fetch data: {response.status_code} - {response.reason}") 26 | 27 | 28 | def get_historical_data(crypto_symbol, days): 29 | response = requests.get(f"{COINGECKO_API_URL}/coins/{crypto_symbol}/market_chart", params={ 30 | 'vs_currency': 'usd', 31 | 'days': days 32 | }) 33 | 34 | if response.status_code == 200: 35 | data = response.json() 36 | if 'prices' in data: 37 | return data['prices'] # Returns price data over the days 38 | else: 39 | raise ValueError(f"No historical data available for '{crypto_symbol}'.") 40 | else: 41 | raise Exception(f"Failed to fetch historical data: {response.status_code} - {response.reason}") 42 | 43 | 44 | def plot_historical_data(historical_data, crypto_symbol): 45 | dates = [datetime.datetime.fromtimestamp(item[0] / 1000) for item in historical_data] 46 | prices = [item[1] for item in historical_data] 47 | 48 | plt.figure(figsize=(10, 6)) 49 | plt.plot(dates, prices, marker='o', linestyle='-', color='b') 50 | plt.title(f'Historical Price Data for {crypto_symbol.capitalize()}') 51 | plt.xlabel('Date') 52 | plt.ylabel('Price (USD)') 53 | plt.xticks(rotation=45) 54 | plt.grid(True) 55 | plt.tight_layout() 56 | plt.show() 57 | 58 | 59 | def main(): 60 | crypto = input("Enter cryptocurrency symbol (eg. bitcoin, ethereum): ").lower() 61 | 62 | try: 63 | # Get real-time price and 24-hour change 64 | price, change = get_crypto_price(crypto) 65 | print(f"Current price of {crypto}: ${price}") 66 | print(f"24-hour change: {change:.2f}%") 67 | except ValueError as e: 68 | print(f"Error: {e}") 69 | return 70 | except Exception as e: 71 | print(f"Error fetching price data: {e}") 72 | return 73 | 74 | # Validate and get historical data 75 | while True: 76 | try: 77 | days = int(input("Enter the number of days for historical data (eg. 1, 7, 30): ")) 78 | if days <= 0: 79 | raise ValueError("The number of days must be a positive integer.") 80 | break 81 | except ValueError as e: 82 | print(f"Invalid input: {e}. Please enter a valid number.") 83 | 84 | try: 85 | historical_data = get_historical_data(crypto, days) 86 | print("Historical data retrieved successfully.") 87 | plot_historical_data(historical_data, crypto) 88 | except ValueError as e: 89 | print(f"Error: {e}") 90 | except Exception as e: 91 | print(f"Error fetching historical data: {e}") 92 | 93 | 94 | if __name__ == "__main__": 95 | main() 96 | -------------------------------------------------------------------------------- /Real-Time Cryptocurrency Price Tracker/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.32.3 2 | matplotlib==3.9.2 -------------------------------------------------------------------------------- /Real-Time Cryptocurrency Price Tracker/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.9.20 -------------------------------------------------------------------------------- /Recipe Finder with Meal Planner/Readme.md: -------------------------------------------------------------------------------- 1 | # Meal Planner with Spoonacular API 2 | 3 | ## Project Overview 4 | 5 | The **Meal Planner** is a command-line application that helps users plan their meals based on available ingredients. By using the [Spoonacular API](https://spoonacular.com/food-api), users can search for recipes, view recipe details, and generate meal plans for the week. It also provides important details like cooking time and servings for each recipe. This tool makes meal planning efficient and fun while minimizing food waste. 6 | 7 | ## Features 8 | 9 | - **Search Recipes by Ingredients**: Input the ingredients you have, and the app will find up to 10 recipes that include those ingredients. 10 | - **View Recipe Details**: Get detailed information about the selected recipes, including preparation time and servings. 11 | - **Plan Meals for the Week**: Generate a random meal plan for up to 7 days based on the available recipes. 12 | - **Interactive User Interface**: Provides a simple, interactive command-line interface for easy input and output. 13 | 14 | ## Technologies Used 15 | 16 | - **Python**: Core programming language used to build the app. 17 | - **Spoonacular API**: API used for fetching recipes and detailed information about them. 18 | - **Requests**: Python library for making HTTP requests to the Spoonacular API. 19 | 20 | ## Prerequisites 21 | 22 | Before running the application, ensure you have the following: 23 | 24 | - [Python 3.x](https://www.python.org/downloads/) installed on your system. 25 | - `requests` library installed. You can install it using: 26 | 27 | -------------------------------------------------------------------------------- /Recipe Finder with Meal Planner/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import random 3 | 4 | # Replace 'your_api_key_here' with your actual Spoonacular API key 5 | API_KEY = "74de4b7826b74b70b4d3a0fe3191239a" 6 | BASE_URL = "https://api.spoonacular.com/recipes" 7 | 8 | def find_recipes(ingredients): 9 | """Search for recipes based on ingredients using the Spoonacular API.""" 10 | url = f"{BASE_URL}/findByIngredients" 11 | params = { 12 | 'ingredients': ','.join(ingredients), 13 | 'number': 10, # Get up to 10 recipes 14 | 'apiKey': API_KEY 15 | } 16 | response = requests.get(url, params=params) 17 | 18 | if response.status_code == 200: 19 | recipes = response.json() 20 | return [(recipe['title'], recipe['id']) for recipe in recipes] 21 | else: 22 | print(f"Error: {response.status_code}") 23 | return [] 24 | 25 | def get_recipe_details(recipe_id): 26 | """Get details of a specific recipe by its ID.""" 27 | url = f"{BASE_URL}/{recipe_id}/information" 28 | params = {'apiKey': API_KEY} 29 | response = requests.get(url, params=params) 30 | 31 | if response.status_code == 200: 32 | return response.json() 33 | else: 34 | print(f"Error: {response.status_code}") 35 | return None 36 | 37 | def plan_meals(ingredients): 38 | """Plan meals for the week based on available ingredients.""" 39 | recipes = find_recipes(ingredients) 40 | 41 | if not recipes: 42 | return "No recipes found with the given ingredients." 43 | 44 | meals = random.sample(recipes, min(7, len(recipes))) 45 | return meals 46 | 47 | def user_interface(): 48 | print("Welcome to the Meal Planner!") 49 | print("Enter the ingredients you have, separated by commas:") 50 | 51 | ingredients = input().split(",") 52 | ingredients = [ingredient.strip().lower() for ingredient in ingredients] 53 | 54 | print("\nSearching for recipes based on your ingredients...\n") 55 | recipes = find_recipes(ingredients) 56 | 57 | if recipes: 58 | print(f"Found the following recipes with your ingredients:") 59 | for i, (title, _) in enumerate(recipes): 60 | print(f"{i + 1}. {title}") 61 | else: 62 | print("No recipes found with the given ingredients.") 63 | 64 | print("\nDo you want to plan meals for the week with these ingredients? (yes/no)") 65 | if input().strip().lower() == "yes": 66 | meals = plan_meals(ingredients) 67 | print("\nHere is your meal plan for the week:") 68 | for i, (title, recipe_id) in enumerate(meals, 1): 69 | print(f"Day {i}: {title}") 70 | recipe_details = get_recipe_details(recipe_id) 71 | if recipe_details: 72 | print(f" - Ready in: {recipe_details['readyInMinutes']} minutes") 73 | print(f" - Servings: {recipe_details['servings']}") 74 | else: 75 | print("No meal plan generated.") 76 | 77 | if __name__ == "__main__": 78 | user_interface() 79 | -------------------------------------------------------------------------------- /Recipe Finder with Meal Planner/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.9.18 2 | -------------------------------------------------------------------------------- /Resume Builder/README.md: -------------------------------------------------------------------------------- 1 | # Interactive Resume Builder 2 | 3 | This Python project is a command-line interface (CLI) tool for building professional resumes. The tool allows users to interactively input various sections of their resume, such as contact information, work experience, education, skills, projects, certifications, and achievements. The resume is then formatted and exported as a PDF file. 4 | 5 | ## Features 6 | 7 | - Interactive CLI for entering resume data (contact info, work experience, education, etc.). 8 | - Ability to add, update, and modify multiple resume sections. 9 | - Automatically generates a well-formatted PDF resume. 10 | - Includes functionality to add detailed descriptions for work experience and projects. 11 | - Supports multiple certifications and achievements. 12 | - Simple and intuitive navigation using `prompt_toolkit` for menu interactions. 13 | 14 | ## Prerequisites 15 | 16 | - Python 3.x must be installed on your system. 17 | 18 | ## Setup Instructions 19 | 20 | 1. **Clone the repository**: 21 | ```bash 22 | git clone https://github.com/username/your-repo.git 23 | cd your-repo 24 | ``` 25 | 26 | 2. **Create and activate a virtual environment**: 27 | 28 | For macOS/Linux: 29 | ```bash 30 | python3 -m venv venv 31 | source venv/bin/activate 32 | ``` 33 | 34 | For Windows: 35 | ```bash 36 | python -m venv venv 37 | venv\Scripts\activate 38 | ``` 39 | 40 | 3. **Install the necessary dependencies**: 41 | ```bash 42 | pip install -r requirements.txt 43 | ``` 44 | 45 | 4. **Run the application**: 46 | ```bash 47 | python resume_builder.py 48 | ``` 49 | 50 | ## Usage 51 | 52 | - **Interactive Menu**: The program presents a menu to select which section of the resume you want to edit or add. 53 | - **PDF Generation**: Once all sections are filled, you can generate a PDF with all the input data. 54 | - **Options**: 55 | - Add or edit Contact Information, Work Experience, Education, Skills, Projects, Certifications, and Achievements. 56 | - Generate the PDF after completing the resume input. 57 | 58 | ## Dependencies 59 | 60 | - `geopy`: For any geographic distance calculation (if needed for future features). 61 | - `prompt_toolkit`: A library for building beautiful command-line applications. 62 | - `fpdf`: A library for generating PDF documents from the entered resume data. 63 | 64 | ## License 65 | 66 | This project is licensed under the MIT License. 67 | -------------------------------------------------------------------------------- /Resume Builder/requirements.txt: -------------------------------------------------------------------------------- 1 | geopy==2.2.0 2 | prompt_toolkit==3.0.8 3 | fpdf==1.7.2 4 | -------------------------------------------------------------------------------- /Simple Assistant/assistant.py: -------------------------------------------------------------------------------- 1 | import pyttsx3,datetime,os,random,requests 2 | import wikipedia,webbrowser,sys,pywhatkit 3 | import speech_recognition as sr 4 | 5 | 6 | engine = pyttsx3.init('sapi5') 7 | voices = engine.getProperty("voices") 8 | engine.setProperty('voice',voices[1].id) 9 | 10 | 11 | # To convdert text into voice 12 | def speak(audio): 13 | engine.say(audio) 14 | print(audio) 15 | engine.runAndWait() 16 | 17 | # To convert voice into text 18 | def takecommand(): 19 | r = sr.Recognizer() 20 | with sr.Microphone() as source: 21 | print("Listening...") 22 | r.pause_threshold = 1 23 | audio = r.listen(source,timeout=2,phrase_time_limit=5) 24 | 25 | try: 26 | print("Recognizing...") 27 | query = r.recognize_google(audio,language='en-in') 28 | except Exception: 29 | speak("Can you please say that again ... ") 30 | return 'none' 31 | return query 32 | 33 | # To wish 34 | def wish(): 35 | hour = int(datetime.datetime.now().hour) 36 | if hour >=0 and hour<=12: 37 | speak("Good morning Sir") 38 | elif hour>12 and hour<16: 39 | speak("Good afternoon Sir") 40 | elif hour>16 and hour<22: 41 | speak("Good evening Sir") 42 | speak("I am jarvis, Please tell me how can i help you !") 43 | 44 | 45 | if __name__ == "__main__": 46 | wish() 47 | if 1: 48 | query = takecommand().lower() 49 | 50 | if 'open notepad' in query: 51 | npath = 'C:\\Windows\\System32\\notepad.exe' 52 | os.startfile(npath) 53 | speak("Please wait ! While I am opening notepad for you!") 54 | 55 | elif "open cmd" in query: 56 | os.system('start cmd') 57 | speak("Opening Command Promte") 58 | 59 | elif "play music" in query: 60 | music_dir = 'D:\\Songs' 61 | songs = os.listdir(music_dir) 62 | rd = random.choice(songs) 63 | os.startfile(os.path.join(music_dir,rd)) 64 | speak("Playing Music") 65 | 66 | elif "ip address" in query: 67 | ip = requests.get("https://api.ipify.org").text 68 | speak(f"Your Ip address is {ip}") 69 | 70 | elif 'wikipedia' in query: 71 | speak("Searching in wikipedia") 72 | query = query.replace("wikipedia","") 73 | results = wikipedia.summary(query,sentences=5) 74 | speak(f"according to wikipedia {results}") 75 | 76 | elif "open youtube" in query: 77 | webbrowser.open('www.youtube.com/') 78 | 79 | elif "open instagram" in query: 80 | webbrowser.open('www.instagram.com/') 81 | 82 | elif "open facebook" in query: 83 | webbrowser.open('www.facebook.com/') 84 | 85 | elif "open twitter" in query: 86 | webbrowser.open('www.twitter.com/') 87 | 88 | elif "open google" in query: 89 | speak('Sir what should i search on google ! ') 90 | varg = takecommand().lower() 91 | webbrowser.open(varg) 92 | 93 | # elif 'send message' in query: 94 | # pywhatkit.sendwhatmsg("+919988776655",'Hello I am Jarvis ! How are you Sir ?',18,33,10,True) 95 | 96 | # elif 'play song on youtube' in query: 97 | # speak("Which song would you like to play on youtube ? ") 98 | # song = takecommand().lower() 99 | # pywhatkit.playonyt(song) 100 | 101 | # elif 'play video' in query: 102 | # speak("Which video would you like to play on youtube ? ") 103 | # vsong = takecommand().lower() 104 | # pywhatkit.playonyt(vsong) 105 | 106 | 107 | elif 'nothing' in query or 'abort' in query or 'stop' in query: 108 | speak('okay') 109 | speak('Bye Sir, have a good day.') 110 | sys.exit() 111 | 112 | elif 'hello' in query: 113 | speak('Hello Sir') 114 | 115 | elif 'bye' in query: 116 | speak('Bye Sir, have a good day.') 117 | sys.exit() 118 | 119 | 120 | elif "what\'s up" in query or 'how are you' in query: 121 | stMsgs = ['Just doing my thing!', 'I am fine!', 'Nice!', 'I am nice and full of energy'] 122 | speak(random.choice(stMsgs)) 123 | 124 | -------------------------------------------------------------------------------- /Simple Assistant/raj_mistry01/Readme.md: -------------------------------------------------------------------------------- 1 | # Jarvis - A Personal Voice Assistant 🗣️💻 2 | 3 | This **Jarvis Personal Assistant** is a Python-based virtual assistant that can execute commands, automate tasks, and provide information at your request. It can help you manage files, open applications, search Wikipedia, forecast weather, and much more—all through voice commands. 4 | 5 | ## 🚀 Features 6 | 7 | 1. **Voice & Text Interaction** 8 | - Provides **voice recognition** using Google Speech Recognition API. 9 | - Users can **switch to text mode** if speech recognition fails. 10 | 11 | 2. **Application Management** 12 | - Open or close **Notepad** and **Command Prompt**. 13 | - Manage system **battery levels** with alerts and suggestions. 14 | 15 | 3. **Information Retrieval** 16 | - Get **Wikipedia summaries** for any topic. 17 | - **Weather forecasts** by city or location-based. 18 | - Check your **IP address** using an online API. 19 | 20 | 4. **Entertainment & Media** 21 | - Search for **movie details** via IMDb, including cast, plot, and ratings. 22 | - Open **YouTube** and automate subscriptions. 23 | 24 | 5. **System Control** 25 | - Adjust **volume controls**: Increase, decrease, or mute. 26 | - Minimize or maximize windows using **keyboard automation**. 27 | - Track **internet speed** with Speedtest integration. 28 | 29 | 6. **Utility Features** 30 | - Control **Webcam** access and capture videos. 31 | - Perform calculations using **Wolfram Alpha**. 32 | - Automatically **open websites** using Chrome. 33 | - Monitor **system processes** and terminate them on command. 34 | 35 | --- 36 | 37 | ## 🔧 Setup Instructions 38 | 39 | 1. **Clone the Repository** 40 | ```bash 41 | git clone https://github.com/yourusername/jarvis-assistant.git 42 | cd jarvis-assistant 43 | ``` 44 | 45 | 2. **Install Dependencies** 46 | Install all necessary Python packages using: 47 | ```bash 48 | pip install -r requirements.txt 49 | ``` 50 | 51 | 3. **Add Paths for Applications** 52 | Set the paths for: 53 | - **Chrome browser**: `"C:/Program Files/Google/Chrome/Application/chrome.exe"` 54 | - **Notepad**: `"C:/Windows/System32/notepad.exe"` 55 | - **Visual Studio Code** (optional): Adjust the path as per your installation. 56 | 57 | 4. **Get API Keys** 58 | - **OpenWeather API**: [Sign up here](https://openweathermap.org/) and replace `apiKey` in the code. 59 | - **Wolfram Alpha API**: Get an API key [here](https://products.wolframalpha.com/api/). 60 | 61 | --- 62 | 63 | ## 🧑‍💻 Usage Instructions 64 | 65 | 1. **Launch the Assistant** 66 | Run the script: 67 | ```bash 68 | python jarvis.py 69 | ``` 70 | 71 | 2. **Speak Commands**: 72 | - "Open Notepad" – Launches Notepad. 73 | - "What is the weather report?" – Gives the weather of your current location. 74 | - "Search for Titanic on Wikipedia" – Provides a brief Wikipedia summary. 75 | - "Close Command Prompt" – Terminates the Command Prompt if running. 76 | - "What's my IP address?" – Provides your public IP address. 77 | 78 | 3. **Text Mode** 79 | If the voice input isn't recognized, type your queries when prompted. 80 | 81 | 4. **Pause or Stop Listening**: 82 | - Say **"Stop listening"**: Pauses the assistant. 83 | - Resume by pressing **Ctrl + Alt + K**. 84 | - Say **"No query, thanks"** to exit the assistant. 85 | 86 | --- 87 | 88 | ## 🌦️ Example Queries 89 | 90 | - **"How are you, Jarvis?"** 91 | → Jarvis responds and continues the conversation. 92 | 93 | - **"Open Command Prompt"** 94 | → Opens the Command Prompt window. 95 | 96 | - **"Mute the volume"** 97 | → Mutes system volume. 98 | 99 | --- 100 | 101 | ## 🎯 Known Issues and Limitations 102 | 103 | - Some queries require accurate phrasing. 104 | - Voice recognition may fail in noisy environments. 105 | - Web automation depends on having Chrome installed. 106 | - Weather reports return temperature in **Kelvin** by default (can be adjusted). 107 | 108 | --- 109 | 110 | ## 💡 Future Improvements 111 | 112 | - Add **Gmail** integration to send emails. 113 | - Support for **natural conversations** with chat history. 114 | - **Alarm feature** implementation. 115 | 116 | --- 117 | 118 | ## 🤖 Contribution 119 | 120 | Feel free to submit pull requests or report bugs/issues. Contributions are welcome to make this assistant smarter and more responsive! 121 | 122 | --- 123 | 124 | 125 | ## 🛠️ Prerequisites 126 | 127 | - **Python 3.7+** 128 | - Required Packages (install via `pip`): 129 | ```bash 130 | pip install -r requirements.txt 131 | 132 | --- 133 | ## 🛠️ Api Credits 134 | 135 | Wolfram Api 136 | OpenWheather Api 137 | 138 | 139 | - **Python 3.7+** 140 | - Required Packages (install via `pip`): 141 | ```bash 142 | pip install -r requirements.txt 143 | 144 | Enjoy using **Jarvis Personal Assistant**! 😊 145 | -------------------------------------------------------------------------------- /Simple Assistant/raj_mistry01/requirements.txt: -------------------------------------------------------------------------------- 1 | pyttsx3 2 | wmi 3 | SpeechRecognition 4 | wolframalpha 5 | numpy 6 | pyautogui 7 | requests 8 | wikipedia-api 9 | pywhatkit 10 | smtplib3 11 | psutil 12 | keyboard 13 | speedtest-cli 14 | opencv-python 15 | imdbpy -------------------------------------------------------------------------------- /Simple Assistant/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Simple Assistant/requirements.txt -------------------------------------------------------------------------------- /Simple Assistant/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Snake-Game/README.md: -------------------------------------------------------------------------------- 1 | # Snake Game 🐍 2 | 3 | A classic Snake Game built using Python. Control the snake, collect food, and try to achieve the highest score without colliding with the walls or yourself. 4 | 5 | ## Features 6 | - Interactive gameplay. 7 | - Score tracking. 8 | - Simple and user-friendly interface. 9 | 10 | ## Installation 11 | 1. Clone this repository: 12 | ```bash 13 | git clone 14 | 2. Navigate the project folder 15 | ```bash 16 | cd snake-game 17 | 3. Run the game 18 | ```bash 19 | python snake_game.py 20 | 21 | # How to Play 22 | 1. Use Arrow Keys to control the direction of the snake: 23 | 1. Up: Move up. 24 | 2. Down: Move down. 25 | 3. Left: Move left. 26 | 4. Right: Move right. 27 | 2. Collect food to increase your score. 28 | 3. Avoid colliding with: 29 | 1. Walls 30 | 2. The snake’s body. 31 | 4. Goal: Achieve the highest score possible! 32 | 33 | # Technologies Used 34 | Python 35 | 36 | -------------------------------------------------------------------------------- /Snake-Game/Snake.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | STARTING_POSITIONS = [(0, 0), (-20, 0), (-40, 0)] 3 | MOVE_DISTANCE = 20 4 | UP = 90 5 | DOWN = 270 6 | RIGHT = 0 7 | LEFT = 180 8 | 9 | 10 | class Snake: 11 | def __init__(self): 12 | self.segments = [] 13 | self.x = 0 14 | self.create_snake() 15 | self.head = self.segments[0] 16 | 17 | def create_snake(self): 18 | for position in STARTING_POSITIONS: 19 | self.add_segment(position) 20 | def add_segment(self, position): 21 | new_segment = Turtle("square") 22 | new_segment.color("white") 23 | new_segment.penup() 24 | new_segment.goto(position) 25 | self.segments.append(new_segment) 26 | def reset(self): 27 | for seg in self.segments: 28 | seg.goto(1000, 1000) 29 | self.segments.clear() 30 | self.create_snake() 31 | self.head = self.segments[0] 32 | def extend(self): 33 | self.add_segment(self.segments[-1].position()) 34 | def move(self): 35 | 36 | for seg_num in range(len(self.segments)-1, 0,-1): 37 | new_x = self.segments[seg_num-1].xcor() 38 | new_y = self.segments[seg_num - 1].ycor() 39 | self.segments[seg_num].goto(new_x, new_y) 40 | 41 | self.head.forward(MOVE_DISTANCE) 42 | 43 | def up(self): 44 | if self.head.heading() != DOWN: 45 | self.head.setheading(UP) 46 | 47 | def down(self): 48 | if self.head.heading() != UP: 49 | self.head.setheading(DOWN) 50 | 51 | def left(self): 52 | if self.head.heading() != RIGHT: 53 | self.head.setheading(LEFT) 54 | 55 | def right(self): 56 | if self.head.heading() != LEFT: 57 | self.head.setheading(RIGHT) 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Snake-Game/__pycache__/Snake.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Snake-Game/__pycache__/Snake.cpython-312.pyc -------------------------------------------------------------------------------- /Snake-Game/__pycache__/food.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Snake-Game/__pycache__/food.cpython-312.pyc -------------------------------------------------------------------------------- /Snake-Game/__pycache__/scoreboard.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Snake-Game/__pycache__/scoreboard.cpython-312.pyc -------------------------------------------------------------------------------- /Snake-Game/data.py: -------------------------------------------------------------------------------- 1 | from scoreboard import Score 2 | score = Score() 3 | HighScore = score.high_score -------------------------------------------------------------------------------- /Snake-Game/data.txt: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /Snake-Game/food.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | import random 3 | 4 | 5 | class Food(Turtle): 6 | 7 | def __init__(self): 8 | super().__init__() 9 | self.shape("circle") 10 | self.penup() 11 | self.shapesize(stretch_wid=0.5, stretch_len=0.5) 12 | self.color("blue") 13 | self.speed("fastest") 14 | self.refresh() 15 | 16 | def refresh(self): 17 | random_x = random.randrange(-270,270) 18 | random_y = random.randrange(-270, 270) 19 | self.goto(random_x, random_y) 20 | -------------------------------------------------------------------------------- /Snake-Game/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | import time 3 | from food import Food 4 | from Snake import Snake 5 | from scoreboard import Score 6 | screen = Screen() 7 | screen.setup(width=600, height=600) 8 | screen.title("My Snake Game") 9 | screen.bgcolor("black") 10 | screen.tracer(0) 11 | snake = Snake() 12 | food = Food() 13 | score = Score() 14 | screen.listen() 15 | screen.onkey(snake.up, "Up") 16 | screen.onkey(snake.down, "Down") 17 | screen.onkey(snake.right, "Right") 18 | screen.onkey(snake.left, "Left") 19 | 20 | is_game_on = True 21 | while is_game_on: 22 | screen.update() 23 | time.sleep(0.1) 24 | snake.move() 25 | # collision with food 26 | if snake.head.distance(food) < 15: 27 | food.refresh() 28 | snake.extend() 29 | score.increase_score() 30 | # collision with wall 31 | if snake.head.xcor() < -280 or snake.head.xcor() > 280 or snake.head.ycor() < -280 or snake.head.ycor() > 280: 32 | score.reset() 33 | data = str(score.high_score) 34 | with open("data.txt", mode="w") as file: 35 | file.write(data) 36 | snake.reset() 37 | # collision with wall 38 | for segment in snake.segments[1:]: 39 | if snake.head.distance(segment) < 10: 40 | score.reset() 41 | data = str(score.high_score) 42 | with open("data.txt", mode="w") as file: 43 | file.write(data) 44 | snake.reset() 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | screen.exitonclick() 54 | -------------------------------------------------------------------------------- /Snake-Game/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | class Score(Turtle): 4 | 5 | 6 | def __init__(self): 7 | self.score = 0 8 | with open("data.txt") as file: 9 | self.HighScore = int(file.read()) 10 | self.high_score = self.HighScore 11 | super().__init__() 12 | self.color("white") 13 | self.penup() 14 | self.goto(0, 265) 15 | self.hideturtle() 16 | self.update_score() 17 | def update_score(self): 18 | self.clear() 19 | self.write(f"Score: {self.score} High Score:{self.high_score}", align='center', font=('Arial', 24, 'normal')) 20 | def reset(self): 21 | if self.score > self.high_score: 22 | self.high_score = self.score 23 | self.score = 0 24 | self.update_score() 25 | def increase_score(self): 26 | self.score += 1 27 | self.update_score() 28 | 29 | # def game_over(self): 30 | # self.goto(0, 0) 31 | # self.write("GAME OVER", align='center', font=('Arial', 24, 'normal')) -------------------------------------------------------------------------------- /Speech To Text/main.py: -------------------------------------------------------------------------------- 1 | import speech_recognition 2 | 3 | def record_voice(): 4 | microphone = speech_recognition.Recognizer() 5 | 6 | with speech_recognition.Microphone() as live_phone: 7 | microphone.adjust_for_ambient_noise(live_phone) 8 | print("I'm trying to hear you: ") 9 | audio = microphone.listen(live_phone) 10 | try: 11 | phrase = microphone.recognize_google(audio, language='en') 12 | return phrase 13 | except speech_recognition.UnkownValueError: 14 | return "I didn't understand what you said" 15 | 16 | if __name__ == '__main__': 17 | phrase = record_voice() 18 | 19 | with open('you_said_this.txt','w') as file: 20 | file.write(phrase) 21 | 22 | print('The last sentence you spoke was saved in you_said_this.txt') 23 | -------------------------------------------------------------------------------- /Speech To Text/requirements.txt: -------------------------------------------------------------------------------- 1 | PyAudio==0.2.11 2 | SpeechRecognition==3.8.1 -------------------------------------------------------------------------------- /Speech To Text/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Spell Checker/main.py: -------------------------------------------------------------------------------- 1 | from textblob import TextBlob 2 | 3 | t = 1 4 | while t: 5 | a = input("Enter the word to be checked:- ") 6 | print("Original text: "+str(a)) 7 | 8 | b = TextBlob(a) 9 | print("Corrected text: "+str(b.correct())) 10 | t = int(input("Try Again? 1 : 0 ")) -------------------------------------------------------------------------------- /Spell Checker/requirements.txt: -------------------------------------------------------------------------------- 1 | textblob==0.17.1 -------------------------------------------------------------------------------- /Spell Checker/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Telegram Bot/main.py: -------------------------------------------------------------------------------- 1 | # Importing modules 2 | import os, requests 3 | from apscheduler.schedulers.background import BackgroundScheduler 4 | import telebot 5 | 6 | # Golbal Variables 7 | CITY_NAME = "Delhi,IN" 8 | # Get Telegram Bot Token From Here: https://telegram.me/BotFather 9 | BOT_TOKEN = os.environ['BOT_TOKEN'] 10 | # Get Your API Key From Here: https://openweathermap.org/api 11 | WEATHER_API_KEY = os.environ['WEATHER_API_KEY'] 12 | 13 | scheduler = BackgroundScheduler() 14 | 15 | # Initialize bot object 16 | bot = telebot.TeleBot(BOT_TOKEN) 17 | 18 | 19 | # get weather data 20 | def getWeather(): 21 | url = f"https://api.openweathermap.org/data/2.5/weather?q={CITY_NAME}&appid={WEATHER_API_KEY}" 22 | response = requests.get(url) 23 | weather_data = response.json() 24 | 25 | weather_text = "" 26 | 27 | if weather_data['cod'] == 200: 28 | weather_text += f"City : {weather_data['name']}, {weather_data['sys']['country']}\n" 29 | weather_text += f"Coordinate : {weather_data['coord']['lon']} °N, {weather_data['coord']['lat']} °E\n" 30 | weather_text += f"Weather : {weather_data['weather'][0]['main']}\n" 31 | weather_text += f"Temperature : {weather_data['main']['temp']} °F\n" 32 | weather_text += f"Pressure : {weather_data['main']['pressure']} hPa\n" 33 | weather_text += f"Humidity : {weather_data['main']['humidity']} %\n" 34 | weather_text += f"Min-Temp : {weather_data['main']['temp_min']} °F\n" 35 | weather_text += f"Max-Temp : {weather_data['main']['temp_max']} °F\n" 36 | weather_text += f"Wind Speed : {weather_data['wind']['speed']} m/s\n" 37 | weather_text += f"Wind Direction : {weather_data['wind']['deg']}°\n" 38 | weather_text += f"Visibility : {weather_data['visibility']} m\n" 39 | else: 40 | weather_text += f"Error: {weather_data['message']} " 41 | 42 | return weather_text 43 | 44 | 45 | # send weather data 46 | def sendWeather(message): 47 | weather_text = getWeather() 48 | bot.send_message( 49 | message, 50 | text="The current weather details in Delhi is: \n\n" + weather_text) 51 | 52 | 53 | # Start Weather updates 54 | @bot.message_handler(commands=['start']) 55 | def start(message): 56 | bot.reply_to(message, "Weather updates started successfully.") 57 | scheduler.add_job(sendWeather(message.chat.id), 'interval', hours=1) 58 | scheduler.start() 59 | 60 | 61 | # Stop weather updates 62 | @bot.message_handler(commands=['stop']) 63 | def stop(message): 64 | scheduler.remove_all_jobs() 65 | bot.send_message(message.chat.id, text="Weather updates stopped successfully.") 66 | 67 | 68 | # Test command 69 | @bot.message_handler(commands=['test']) 70 | def send_welcome(message): 71 | bot.reply_to(message, "Hello, I am ready to serve you.") 72 | 73 | 74 | # Set the listener 75 | bot.set_update_listener(start) 76 | bot.set_update_listener(stop) 77 | # Run the bot 78 | bot.infinity_polling() 79 | -------------------------------------------------------------------------------- /Telegram Bot/requirements.txt: -------------------------------------------------------------------------------- 1 | pyTelegramBotAPI==4.9.0 2 | APScheduler==3.9.1 3 | -------------------------------------------------------------------------------- /Telegram Bot/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Text Summarizer/requirements.txt: -------------------------------------------------------------------------------- 1 | networkx==3.3 2 | nltk==3.9.1 3 | numpy==2.1.2 4 | pandas==2.2.3 5 | Requests==2.32.3 6 | scikit_learn==1.5.2 7 | tqdm==4.66.5 8 | -------------------------------------------------------------------------------- /Text Summarizer/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Text To Speech/README.md: -------------------------------------------------------------------------------- 1 | # Script Name 2 | **Text to Speech Converter using gTTS** 3 | 4 | - This script converts text into speech using Google’s Text-to-Speech (gTTS) API and saves the output as an audio file (e.g., `.mp3` format). 5 | - It allows for customization of language, speech speed, accents, and other pre-processing and tokenizing options. 6 | - Features: 7 | - Support for multiple languages using IETF language tags. 8 | - Localized accents via different Google Translate top-level domains (`tld`). 9 | - Option to slow down speech for easier comprehension. 10 | - Custom text pre-processing and tokenization options. 11 | - Timeout control for network requests. 12 | - Automatic playing of the audio file after saving (optional). 13 | 14 | # Description 15 | This script provides a convenient interface for converting text into speech using the `gTTS` library. The text can be read in multiple languages, at different speeds, and with various localized accents. The script also includes advanced options for pre-processing the input text and customizing how it's tokenized before being sent to the gTTS API. 16 | 17 | ### Key Features: 18 | - **Multilingual Support**: Specify different languages using IETF language tags (`en`, `es`, etc.). 19 | - **Accents**: Use top-level domains (`tld`), such as `com`, `co.uk`, etc., to localize the accent. 20 | - **Custom Speed**: Option to slow down the speech for better understanding. 21 | - **Pre-Processing**: Built-in support for text pre-processing (e.g., removing punctuation). 22 | - **Timeout**: Set timeout limits for the API request. 23 | 24 | # Prerequisites 25 | The following libraries are required to run the script: 26 | ```bash 27 | pip install gtts 28 | ``` 29 | 30 | Additionally, the script uses built-in libraries like `os`. 31 | 32 | # Installing Instructions 33 | 1. **Clone the Repository**: 34 | Clone this repository to your local machine using: 35 | ```bash 36 | git clone 37 | ``` 38 | 39 | 2. **Install Dependencies**: 40 | Navigate to the project directory and install the required packages: 41 | ```bash 42 | pip install -r requirements.txt 43 | ``` 44 | 45 | 3. **Run the Script**: 46 | After cloning and installing dependencies, you can run the script directly: 47 | ```bash 48 | python text_to_speech.py 49 | ``` 50 | 51 | 4. **Customize the Script**: 52 | You can modify the input text, language, speed, and other options directly in the script: 53 | ```python 54 | text_to_speech("Hello, welcome to the gTTS Python tutorial.", lang='en', slow=False) 55 | ``` 56 | 57 | # Output 58 | ### Example output: 59 | After running the script with the text `"Hello, welcome to the gTTS Python tutorial."`, the output file `output.mp3` is generated. 60 | 61 | 62 | # Author 63 | **[Himanshu Mahajan](https://github.com/himanshumahajan138)** 64 | -------------------------------------------------------------------------------- /Text To Speech/requirements.txt: -------------------------------------------------------------------------------- 1 | gTTS==2.5.2 2 | -------------------------------------------------------------------------------- /Text To Speech/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Text To Speech/text_to_speech.py: -------------------------------------------------------------------------------- 1 | from gtts import gTTS 2 | import os 3 | 4 | 5 | def text_to_speech( 6 | text, 7 | lang="en", 8 | tld="com", 9 | slow=False, 10 | lang_check=True, 11 | pre_processor_funcs=None, 12 | tokenizer_func=None, 13 | timeout=None, 14 | output_file="output.mp3", 15 | ): 16 | """ 17 | Convert the provided text to speech and save it as an audio file. 18 | 19 | Args: 20 | text (string): The text to be read. 21 | lang (string, optional): The language (IETF language tag) to read the text in. Default is 'en'. 22 | tld (string, optional): Top-level domain for Google Translate host (e.g., 'com', 'co.uk'). 23 | This affects accent localization. Default is 'com'. 24 | slow (bool, optional): If True, reads the text more slowly. Default is False. 25 | lang_check (bool, optional): If True, enforces valid language, raising a ValueError if unsupported. Default is True. 26 | pre_processor_funcs (list, optional): List of pre-processing functions to modify the text before tokenizing. 27 | Defaults to a list of built-in pre-processors. 28 | tokenizer_func (callable, optional): Function to tokenize the text. Defaults to a built-in tokenizer. 29 | timeout (float or tuple, optional): Seconds to wait for server response. Can be a float or a (connect, read) tuple. 30 | Default is None (wait indefinitely). 31 | output_file (string): Path for the output audio file (default: 'output.mp3'). 32 | 33 | Raises: 34 | AssertionError: When text is None or empty. 35 | ValueError: When lang_check is True and lang is unsupported. 36 | """ 37 | 38 | # Use default pre-processor functions if not provided 39 | if pre_processor_funcs is None: 40 | pre_processor_funcs = [ 41 | # Example built-in functions from gTTS: 42 | # Converts tone marks, abbreviations, and deals with word substitutions 43 | lambda text: text.replace( 44 | ".", "" 45 | ), # You can define more or use built-ins from gTTS 46 | ] 47 | 48 | # Use default tokenizer if not provided 49 | if tokenizer_func is None: 50 | tokenizer_func = lambda text: text.split() # Basic tokenizer example 51 | 52 | try: 53 | # Create the gTTS object with the provided arguments 54 | tts = gTTS( 55 | text=text, 56 | lang=lang, 57 | tld=tld, 58 | slow=slow, 59 | lang_check=lang_check, 60 | pre_processor_funcs=pre_processor_funcs, 61 | tokenizer_func=tokenizer_func, 62 | timeout=timeout, 63 | ) 64 | 65 | # Save the audio file 66 | tts.save("Text To Speech/"+output_file) 67 | print(f"Audio saved at Text To Speech/{output_file}") 68 | 69 | # Optionally, play the audio file (Windows or Linux/MacOS) 70 | # if os.name == "nt": # Windows 71 | # os.system(f"start {output_file}") 72 | # else: # macOS/Linux 73 | # os.system(f"xdg-open {output_file}") 74 | 75 | except AssertionError as ae: 76 | print(f"Assertion Error: {ae}") 77 | except ValueError as ve: 78 | print(f"Value Error: {ve}") 79 | except RuntimeError as re: 80 | print(f"Runtime Error: {re}") 81 | 82 | 83 | if __name__ == "__main__": 84 | # Example usage of the text_to_speech function with various arguments 85 | 86 | # Basic example (English, default options) 87 | text = "Hello, welcome to the gTTS Python tutorial." 88 | text_to_speech(text) 89 | 90 | # # Custom example (Spanish, slow speech, and custom file name) 91 | # text_to_speech( 92 | # "Hola, bienvenido al tutorial de gTTS.", 93 | # lang="es", 94 | # slow=True, 95 | # output_file="spanish_slow.mp3", 96 | # ) 97 | 98 | # # Custom example with localized accent (UK English) 99 | # text_to_speech( 100 | # "Hello! How are you today?", 101 | # lang="en", 102 | # tld="co.uk", 103 | # output_file="british_accent.mp3", 104 | # ) 105 | 106 | # # You can pass custom pre-processor functions to modify the text before it’s tokenized. 107 | # text_to_speech( 108 | # "Dr. Smith is a great person.", 109 | # pre_processor_funcs=[lambda x: x.replace(".", "")], 110 | # output_file="custom_pre-processor.mp3", 111 | # ) 112 | 113 | # # You can set a timeout to limit how long the request to Google Translate waits. 114 | # text_to_speech( 115 | # "This will timeout after 5 seconds.", 116 | # output_file="timeout.mp3", 117 | # timeout=5.0 118 | # ) 119 | -------------------------------------------------------------------------------- /Text to Morse Code/main.py: -------------------------------------------------------------------------------- 1 | symbols = { 2 | "a": ".-", 3 | "b": "-...", 4 | "c": "-.-.", 5 | "d": "-..", 6 | "e": ".", 7 | "f": "..-.", 8 | "g": ".-", 9 | "h": "....", 10 | "i": "..", 11 | "j": ".---", 12 | "k": "-.-", 13 | "l": ".-..", 14 | "m": "--", 15 | "n": "-.", 16 | "o": "---", 17 | "p": ".--.", 18 | "q": "--.-", 19 | "r": ".-.", 20 | "s": "...", 21 | "t": "-", 22 | "u": "..-", 23 | "v": "...-", 24 | "w": ".--", 25 | "x": "-..-", 26 | "y": "-.--", 27 | "z": "--..", 28 | } 29 | 30 | ask = input("Enter a word: ") 31 | length = len(ask) 32 | output = "" 33 | 34 | for i in range(length): 35 | if ask[i] in symbols.keys(): 36 | output = output + " " + symbols.get(ask[i]) 37 | 38 | print(output) 39 | -------------------------------------------------------------------------------- /Text to Morse Code/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Text_Adventure_Game/readme.md: -------------------------------------------------------------------------------- 1 | # Text-Based Adventure Game 2 | 3 | Welcome to the **Text-Based Adventure Game**! This Python game is a simple interactive adventure where players explore rooms, collect items, and engage in combat with opponents like goblins and dragons. Each decision you make will affect your inventory and how you handle future challenges. 4 | 5 | ## Features 6 | 7 | - **Two distinct types of doors**: Players can choose between doors, which may lead to hidden items such as swords or shields. 8 | - **Combat System**: Engage in battle with different opponents: 9 | - **Goblin**: A weak opponent that requires strategy. 10 | - **Dragon**: A formidable final boss with special attacks. 11 | - **Inventory Management**: Pick up and use items like swords and shields to aid in combat. 12 | - **Game Save & Load**: Your progress is automatically saved, so you can load it later and continue from where you left off. 13 | 14 | ## Gameplay 15 | 16 | - Players start the game by entering their name. 17 | - You are presented with two doors to choose from, each leading to different experiences. 18 | - Items like swords and shields can be found to help you in combat. 19 | - Random encounters with goblins and dragons will test your decision-making skills. 20 | - The game automatically saves your progress, allowing you to resume your adventure later. 21 | 22 | ## How to Play 23 | 24 | 1. **Choose a door**: When prompted, choose either the left or right door. Each door may contain hidden treasures like a sword or shield. 25 | 2. **Make choices**: Decide whether to pick up items or face challenges. 26 | 3. **Combat**: Engage in combat with either a goblin or dragon. Use your sword and shield to protect yourself or defeat enemies. 27 | 4. **Save your progress**: The game will automatically save after each major action. 28 | 5. **Reload your game**: If you exit the game, you can load it from the last saved point when you return. 29 | 30 | ## Setup and Installation 31 | 32 | 1. Ensure you have Python 3 installed on your machine. 33 | 2. Clone this repository to your local machine. 34 | 3. Navigate to the project directory. 35 | 4. Run the text_adventure_game.py file. 36 | 37 | 38 | ## Code Overview 39 | 40 | The game is built using Python, and its logic is divided into several components: 41 | 42 | - **Opponent Class**: The base class for both weak and strong opponents. Handles basic attack logic. 43 | - **WeakOpponent Class**: A class for weaker opponents like the goblin. Overrides the attack method to reflect weaker attacks. 44 | - **FinalBoss Class**: A subclass of Opponent designed for more challenging enemies like the dragon, with special powers. 45 | - **Combat and Exploration**: Players can choose doors, explore rooms, collect items, and engage in combat. 46 | - **Saving and Loading**: The game state is saved to a file (`game_save.txt`), and players can load this file to continue their progress. 47 | 48 | ## Error Handling 49 | 50 | The game is designed with basic error handling using `try-except` blocks: 51 | - If there are issues with file saving or loading, an error message is displayed. 52 | - Combat logic is wrapped in error handling to prevent crashes due to unexpected input. 53 | 54 | Enjoy your adventure! 55 | -------------------------------------------------------------------------------- /Tic-Tac-Toc using AI (min-max)/README.md: -------------------------------------------------------------------------------- 1 | # Tic-Tac-Toe Game with AI 2 | 3 | This project is a Tic-Tac-Toe game implemented in Python using the Pygame library. The game presents a classic, engaging experience where players can compete against either an AI opponent or another human player. The AI leverages the Minimax algorithm, a decision-making algorithm used in game theory, to evaluate potential moves and choose the best possible action at each turn. This guarantees that the AI will always make optimal moves, creating a challenging and competitive environment for players of all skill levels. 4 | 5 | ### Key Features: 6 | - **Two Players**: Play against an AI or another human player. 7 | - **Minimax Algorithm**: The AI makes optimal moves based on the Minimax strategy. 8 | - **Graphical User Interface**: A simple and intuitive GUI using Pygame. 9 | - **Reset Option**: Restart the game easily at any time. 10 | 11 | # Prerequisites 12 | The following libraries are required to run the script: 13 | ```bash 14 | pip install pygame numpy 15 | ``` 16 | 17 | # Installing Instructions 18 | 1. **Clone the Repository**: 19 | Clone this repository to your local machine using: 20 | ```bash 21 | git clone 22 | ``` 23 | 24 | 2. **Install Dependencies**: 25 | Navigate to the project directory and install the required packages: 26 | ```bash 27 | pip install pygame numpy 28 | ``` 29 | 30 | 3. **Run the Script**: 31 | After cloning and installing dependencies, you can run the script directly: 32 | ```bash 33 | python tic_tac_toe.py 34 | ``` 35 | 36 | 4. **Customize the Script**: 37 | You can modify game settings, such as board size and player options, directly in the script. 38 | 39 | # Gameplay Instructions 40 | - **Player vs AI:**: Click on the grid to make your move. The AI will respond automatically. 41 | - **AI Difficulty Levels**: You can adjust the difficulty of the AI in the game settings to suit your skill level. Higher levels make the AI more challenging. 42 | - **Restart Game**: Press the R key to restart the game at any time. 43 | 44 | # Usage 45 | **Player vs AI**: Click on the grid to make your move. The AI will respond automatically. 46 | 47 | **Restart Game**: Press the R key to restart the game at any time. 48 | 49 | # Example 50 | After starting the game, you can play by clicking on the grid cells. The AI will make its move following your turn, and the game will continue until one player wins or the game ends in a draw. 51 | ![Game Screen](screenshots/screenshot1.png) 52 | ![Winning State](screenshots/screenshot2.png) 53 | 54 | 55 | # Author 56 | **[Naumantamboli](https://github.com/Naumantamboli)** 57 | -------------------------------------------------------------------------------- /Tic-Tac-Toc using AI (min-max)/requirements.txt: -------------------------------------------------------------------------------- 1 | pygame==2.1.3 2 | numpy==1.23.5 3 | -------------------------------------------------------------------------------- /To Do List/README.md: -------------------------------------------------------------------------------- 1 | # To-Do List App 2 | 3 | This is a simple To-Do List app built with Python using `tkinter` for the user interface and `sqlite3` for data storage. 4 | 5 | ## Features 6 | 7 | - Add tasks 8 | - View tasks 9 | - Delete tasks 10 | - Save tasks to database 11 | 12 | ## Requirements 13 | 14 | - Python 3.8.10 15 | - `tkinter` 16 | - `sqlite3` 17 | 18 | ## Installation 19 | 20 | 1. Clone the repository: 21 | ```bash 22 | git clone 23 | -------------------------------------------------------------------------------- /To Do List/RithwikBejadi/To Do App/README.md: -------------------------------------------------------------------------------- 1 | **#To-Do List Application** 2 | A simple and intuitive To-Do List application built with Python's Tkinter library for the GUI and SQLite for persistent task storage. This application helps you manage tasks with categories, due dates, and priority levels, allowing easy organization of daily activities. 3 | 4 | **Features** 5 | 6 | Add Tasks: Add tasks with a description, category, due date, and priority level (High, Medium, Low). 7 | 8 | View Tasks: View all tasks, or filter tasks to see only completed or pending ones. 9 | 10 | Search Tasks: Quickly search tasks by their name or category using the search bar. 11 | 12 | Toggle Theme: Switch between dark and light themes to match your preference. 13 | 14 | Mark Tasks as Complete: Mark tasks as completed to keep track of what’s done. 15 | 16 | Persistent Storage: All tasks are saved in an SQLite database, ensuring data is saved even after closing the app. 17 | 18 | 19 | **Prerequisites** 20 | 21 | Python 3.6+ 22 | Tkinter (Usually included with Python) 23 | SQLite (Included in Python’s standard library) 24 | tkcalendar: Install using pip install tkcalendar 25 | 26 | **Usage Instructions** 27 | 28 | 1. Add a Task 29 | Enter a task description in the Task field. 30 | Specify the Category for better organization. 31 | Select a Due Date from the date picker. 32 | Choose a Priority from the drop-down menu (High, Medium, Low). 33 | Click Add Task to save it. 34 | 35 | 2. View All Tasks 36 | Click on View All Tasks in the sidebar to display a list of all tasks. 37 | Tasks are displayed with their description, category, due date, and priority level. 38 | 39 | 3. View Completed Tasks 40 | Click View Completed Tasks in the sidebar to see tasks that have been marked as complete. 41 | 42 | 4. View Pending Tasks 43 | Click View Pending Tasks in the sidebar to view tasks that are yet to be completed. 44 | 45 | 5. Search Tasks 46 | Use the Search bar in the sidebar to find tasks by their description or category. 47 | The list of tasks will update as you type, showing only those that match the search term. 48 | 49 | 6. Mark Tasks as Complete 50 | Select a task from the list and click Mark as Complete (add this button in your application). 51 | Completed tasks will no longer appear in the pending tasks view. 52 | 53 | 7. Toggle Dark/Light Theme 54 | Click Toggle Theme in the sidebar to switch between dark and light modes. 55 | This changes the background color, text color, and button styles for a better visual experience. 56 | 57 | 8. Close the Application 58 | Close the application by clicking the window close button (X) or selecting Exit. 59 | The application safely saves your tasks and closes the database connection. 60 | 61 | 62 | **Database Structure** 63 | The application uses an SQLite database with the following table structure: 64 | 65 | Table Name: tasks 66 | 67 | Column Name Type Description 68 | 69 | id INTEGER Primary key, unique task ID 70 | task TEXT Description of the task 71 | category TEXT Category of the task (e.g., Work, Home) 72 | due_date TEXT Due date of the task 73 | priority TEXT Priority level (High, Medium, Low) 74 | completed INTEGER Status (0 = Pending, 1 = Completed) 75 | 76 | **License** 77 | This project is licensed under the MIT License. See the LICENSE file for details. 78 | 79 | **Acknowledgments** 80 | Thanks to the Python community for their extensive libraries and documentation. 81 | Special thanks to the creators of tkcalendar for providing a simple date picker widget for Tkinter. 82 | -------------------------------------------------------------------------------- /To Do List/RithwikBejadi/To Do App/requirements.txt: -------------------------------------------------------------------------------- 1 | tkinter==8.6 2 | sqlite3==3.45.3 3 | -------------------------------------------------------------------------------- /To Do List/RithwikBejadi/To Do App/runtime.txt: -------------------------------------------------------------------------------- 1 | Python 3.12.4 -------------------------------------------------------------------------------- /To Do List/RithwikBejadi/To Do App/tasks.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/To Do List/RithwikBejadi/To Do App/tasks.db -------------------------------------------------------------------------------- /To Do List/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | import sqlite3 3 | 4 | root = Tk() 5 | root.title("To-Do List App") 6 | root.geometry("400x400") 7 | 8 | conn = sqlite3.connect('todolist.db') 9 | c = conn.cursor() 10 | 11 | # Create table 12 | c.execute('''CREATE TABLE IF NOT EXISTS tasks 13 | (id INTEGER PRIMARY KEY, task TEXT NOT NULL)''') 14 | 15 | def add_task(): 16 | task = task_entry.get() 17 | if task: 18 | c.execute("INSERT INTO tasks (task) VALUES (?)", (task,)) 19 | conn.commit() 20 | task_entry.delete(0, END) 21 | populate_tasks() 22 | 23 | def delete_task(): 24 | task_id = task_list.get(ACTIVE).split('.')[0] 25 | c.execute("DELETE FROM tasks WHERE id=?", (task_id,)) 26 | conn.commit() 27 | populate_tasks() 28 | 29 | def populate_tasks(): 30 | task_list.delete(0, END) 31 | c.execute("SELECT * FROM tasks") 32 | tasks = c.fetchall() 33 | for task in tasks: 34 | task_list.insert(END, f"{task[0]}. {task[1]}") 35 | 36 | # Task entry 37 | task_entry = Entry(root, width=50) 38 | task_entry.pack(pady=10) 39 | 40 | # Add task button 41 | add_task_button = Button(root, text="Add Task", command=add_task) 42 | add_task_button.pack(pady=5) 43 | 44 | # Task list 45 | task_list = Listbox(root, width=50, height=15) 46 | task_list.pack(pady=10) 47 | 48 | # Delete task button 49 | delete_task_button = Button(root, text="Delete Task", command=delete_task) 50 | delete_task_button.pack(pady=5) 51 | 52 | # Populate tasks on startup 53 | populate_tasks() 54 | 55 | # Run the main loop 56 | root.mainloop() 57 | 58 | conn.close() 59 | -------------------------------------------------------------------------------- /To Do List/requirement.txt: -------------------------------------------------------------------------------- 1 | tk 2 | sqlite3 3 | -------------------------------------------------------------------------------- /To Do List/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.8.10 2 | -------------------------------------------------------------------------------- /Translator/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Translator/requirements.txt -------------------------------------------------------------------------------- /Translator/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Translator/translate.py: -------------------------------------------------------------------------------- 1 | from tabulate import tabulate 2 | from googletrans import Translator 3 | 4 | class TranslateClass(object): 5 | def __init__(self, word, lang): 6 | self.word = word 7 | self.lang = lang 8 | self.Trans = Translator(service_urls=["translate.google.com"]) 9 | 10 | def __repr__(self): 11 | translated = self.Trans.translate(self.word, dest=self.lang).text 12 | data = [ 13 | ['Language:', "Sentence"], 14 | ['English', self.word], 15 | ['Hindi', str(translated)]] 16 | table = str(tabulate(data, headers="firstrow", tablefmt="grid")) 17 | return table 18 | 19 | 20 | if __name__ == '__main__': 21 | translate = input('Enter Sentence: ') 22 | language = 'hi' 23 | print(TranslateClass(translate, language)) -------------------------------------------------------------------------------- /URL Sortener/main.py: -------------------------------------------------------------------------------- 1 | import pyshorteners 2 | 3 | 4 | def shorten_url(url): 5 | return pyshorteners.Shortener().tinyurl.short(url) 6 | 7 | 8 | url = input("Please enter URL: ") 9 | print("URL after Shortening : ", shorten_url(url)) 10 | -------------------------------------------------------------------------------- /URL Sortener/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/URL Sortener/requirements.txt -------------------------------------------------------------------------------- /URL Sortener/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Validate-Email/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Validate-Email/validate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # Author: Aman Kumar 4 | # Version: 1.0.0 5 | 6 | import re 7 | 8 | email_conditions = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$' 9 | user_email = input("Enter your email: ") 10 | 11 | isValid = re.search(email_conditions, user_email) 12 | 13 | if(isValid): 14 | print("Valid Email") 15 | else: 16 | print("Invalid Email") 17 | -------------------------------------------------------------------------------- /Video Processor/README.md: -------------------------------------------------------------------------------- 1 | # Video Processing Tool 2 | 3 | In this Python tool processes a video file by extracting short clips, applying filters and effects, and generating subtitles for each clip. The processed clips are saved as new video files along with corresponding subtitle files. 4 | 5 | ## Features 6 | 7 | - Extracts clips of a specified duration from the input video. 8 | - Applies image processing effects including brightness, contrast, saturation adjustments, and blurring. 9 | - Generates simple subtitle files for each clip. 10 | 11 | ## Requirements 12 | 13 | To run this script, you'll need the following Python packages: 14 | 15 | - `opencv-python` 16 | - `pysrt` 17 | 18 | You can install these using pip: 19 | 20 | ```bash 21 | pip install opencv-python pysrt 22 | ``` 23 | 24 | ## Usage 25 | 26 | 1. **Input Video**: The script prompts you to enter the link to a YouTube video. Make sure to use a video URL that is accessible and can be downloaded. 27 | 28 | 2. **Clip Duration**: The default duration for each extracted clip is set to 10 seconds. You can modify this value in the script as needed. 29 | 30 | 3. **Run the Script**: Execute the script using Python: 31 | 32 | ```bash 33 | python video_processor.py 34 | ``` 35 | 36 | 4. **Output**: 37 | - The processed clips will be saved as `clip0_out.mp4`, `clip1_out.mp4`, etc. 38 | - Corresponding subtitle files will be saved as `clip0_subtitle.srt`, `clip1_subtitle.srt`, etc. 39 | 40 | ## Code Explanation 41 | 42 | - **Video Capture**: The script uses OpenCV to read frames from the video. 43 | - **Image Processing**: Each frame within the clip duration is processed using filters and effects: 44 | - **Brightness and Contrast**: Adjusts the brightness and contrast of the frame. 45 | - **Saturation**: Modifies the saturation of the frame. 46 | - **Blurring**: Applies Gaussian blur and combines with a weighted blend for a smoother look. 47 | 48 | - **Subtitle Generation**: For each clip, a simple subtitle text ("This is a sample subtitle") is generated and saved in a `.srt` file format. 49 | 50 | ## Limitations 51 | 52 | - The script assumes the video file can be read directly via OpenCV, which may not be applicable for all YouTube links without prior downloading. 53 | - Subtitle text is static; you may want to customize it based on the content of each clip. 54 | 55 | -------------------------------------------------------------------------------- /Video Processor/requirements.txt: -------------------------------------------------------------------------------- 1 | opencv-python==4.8.0.76 2 | pysrt==1.1.2 3 | -------------------------------------------------------------------------------- /Video Processor/video_processor.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import pysrt 3 | 4 | # Load the input video 5 | input_file = input("Enter the YouTube video link: ") 6 | cap = cv2.VideoCapture(input_file) 7 | 8 | # Set the start and end times for each short video clip 9 | clip_duration = 10.0 10 | clip_start_time = 0.0 11 | clip_end_time = clip_start_time + clip_duration 12 | 13 | # Set up OpenCV for video processing 14 | kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3,3)) 15 | brightness = 30 16 | contrast = 1.5 17 | saturation = 1.5 18 | 19 | # Process each short video clip 20 | i = 0 21 | while cap.isOpened(): 22 | # Read the next frame from the input video 23 | ret, frame = cap.read() 24 | if not ret: 25 | break 26 | 27 | # Get the current time in seconds 28 | current_time = cap.get(cv2.CAP_PROP_POS_MSEC) / 1000.0 29 | 30 | # If the current time is within the current clip, process the frame 31 | if current_time >= clip_start_time and current_time <= clip_end_time: 32 | # Apply the filters and effects 33 | frame = cv2.filter2D(frame, -1, kernel) 34 | frame = cv2.convertScaleAbs(frame, alpha=contrast, beta=brightness) 35 | frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) 36 | h, s, v = cv2.split(frame) 37 | s = cv2.convertScaleAbs(s, alpha=saturation, beta=0) 38 | frame = cv2.merge((h, s, v)) 39 | frame = cv2.cvtColor(frame, cv2.COLOR_HSV2BGR) 40 | frame = cv2.GaussianBlur(frame, (5,5), 0) 41 | frame = cv2.addWeighted(frame, 1.5, cv2.blur(frame, (10,10)), -0.5, 0) 42 | 43 | # Write the modified frame to a new video file 44 | out = cv2.VideoWriter('clip' + str(i) + '_out.mp4', cv2.VideoWriter_fourcc(*'mp4v'), cap.get(cv2.CAP_PROP_FPS), (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)))) 45 | out.write(frame) 46 | out.release() 47 | 48 | # Generate subtitles for the clip 49 | subtitle_text = "This is a sample subtitle" 50 | subtitle_duration = clip_duration 51 | subtitle_file = pysrt.SubRipFile() 52 | subtitle = pysrt.SubRipItem(index=1, start=0, end=subtitle_duration, text=subtitle_text) 53 | subtitle_file.append(subtitle) 54 | subtitle_file.save('clip' + str(i) + '_subtitle.srt') 55 | 56 | # Move to the next clip 57 | i += 1 58 | clip_start_time += clip_duration 59 | clip_end_time += clip_duration 60 | 61 | # If the current time is past the end of the current clip, move to the next clip 62 | elif current_time > clip_end_time: 63 | clip_start_time += clip_duration 64 | clip_end_time += clip_duration 65 | 66 | # Release the resources 67 | cap.release() 68 | cv2.destroyAllWindows() 69 | -------------------------------------------------------------------------------- /Video To Audio/main.py: -------------------------------------------------------------------------------- 1 | import moviepy 2 | from tkinter.filedialog import * 3 | 4 | askForVideo = askopenfilename() 5 | video = moviepy.editor.VideoFileClip(askForVideo) 6 | 7 | audio = video.audio 8 | audio.write_audiofile("demo.mp3") 9 | 10 | print("Conversion Completed !!") 11 | -------------------------------------------------------------------------------- /Video To Audio/requirement.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/python-project/910dd5ca6d0942734da9aa34d4c805d6a8068dad/Video To Audio/requirement.txt -------------------------------------------------------------------------------- /Video To Audio/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Weather Alert/.env.example: -------------------------------------------------------------------------------- 1 | OPEN_WEATHER_MAP_API_KEY= -------------------------------------------------------------------------------- /Weather Alert/README.md: -------------------------------------------------------------------------------- 1 | # Weather Alert Script 🌦️ 2 | 3 | A simple Python script that fetches weather data for your city and alerts you if the temperature or wind speed crosses your set thresholds. Perfect for staying on top of weather changes and preparing for unexpected conditions! 🚀 4 | 5 | ## Features 6 | 7 | - **Fetch Weather Data**: Retrieves up-to-date weather information for any city using the OpenWeatherMap API. 8 | - **Custom Alerts**: Set your own temperature and wind speed thresholds. If the weather conditions exceed these, the script will alert you! 9 | - **Hourly Updates**: The script automatically checks the weather every hour, so you’re always in the loop. 10 | 11 | ## Getting Started 12 | 13 | ### Prerequisites 14 | 15 | - Python 3.x 16 | - `requests` and `python-dotenv` libraries 17 | 18 | Install the required libraries using: 19 | 20 | ```bash 21 | pip install requests python-dotenv 22 | ``` 23 | 24 | ## Setup 25 | 26 | - Clone or download this repository. 27 | - Get an API key from OpenWeatherMap. (It’s free!) 28 | - Create a .env file in the root directory and add your API key like shown in `.env.example` 29 | - Run the script 30 | 31 | ``` 32 | python weather_alert.py 33 | ``` 34 | 35 | ## Troubleshooting 36 | 37 | - Missing API Key Error: Double-check that your .env file contains the correct OPEN_WEATHER_MAP_API_KEY. Make sure there are no typos or extra spaces. 38 | - Error fetching data: This could happen if the API key is incorrect or if the city name is misspelled. Verify both and try again. 39 | -------------------------------------------------------------------------------- /Weather Alert/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import time 4 | import os 5 | from dotenv import load_dotenv 6 | 7 | # Load environment variables from .env file 8 | load_dotenv() 9 | 10 | # Load API key from environment variable (security fix) 11 | API_KEY = os.getenv('OPEN_WEATHER_MAP_API_KEY') 12 | 13 | if not API_KEY: 14 | raise ValueError("Missing environment variable 'OPEN_WEATHER_MAP_API_KEY'") 15 | 16 | UNIT = 'metric' 17 | BASE_URL = 'https://api.openweathermap.org/data/2.5/find' 18 | 19 | 20 | def fetch_weather(city): 21 | """Fetches weather data for a given city. 22 | 23 | Args: 24 | city (str): Name of the city. 25 | 26 | Returns: 27 | dict: Weather data if successful, None otherwise. 28 | """ 29 | 30 | url = f"{BASE_URL}?q={city}&appid={API_KEY}&units={UNIT}" 31 | response = requests.get(url) 32 | 33 | if response.status_code == 200: 34 | return response.json() 35 | else: 36 | print(f"Error fetching data: {response.status_code}") 37 | return None 38 | 39 | 40 | def check_alerts(data, temp_threshold, wind_speed_threshold): 41 | """Checks for temperature and wind speed alerts in weather data. 42 | 43 | Args: 44 | data (dict): Weather data. 45 | temp_threshold (float): Temperature threshold in °C. 46 | wind_speed_threshold (float): Wind speed threshold in m/s. 47 | 48 | Prints alerts if any, otherwise prints a message indicating normal weather conditions. 49 | """ 50 | 51 | if not data or 'list' not in data or not data['list']: 52 | print("No data available to check alerts.") 53 | return 54 | 55 | weather_info = data['list'][0] 56 | temp = weather_info['main']['temp'] 57 | wind_speed = weather_info['wind']['speed'] 58 | 59 | alerts = [] 60 | if temp > temp_threshold: 61 | alerts.append(f"Temperature alert! Current temperature: {temp}°C") 62 | if wind_speed > wind_speed_threshold: 63 | alerts.append(f"Wind speed alert! Current wind speed: {wind_speed} m/s") 64 | 65 | if alerts: 66 | print("\n".join(alerts)) 67 | else: 68 | print("No alerts. Weather conditions are normal.") 69 | 70 | 71 | def main(): 72 | """Prompts user for city name, temperature and wind speed thresholds, 73 | and continuously checks for alerts. 74 | """ 75 | 76 | city = input("Enter city name: ") 77 | temp_threshold = float(input("Enter temperature threshold (°C): ")) 78 | wind_speed_threshold = float(input("Enter wind speed threshold (m/s): ")) 79 | 80 | while True: 81 | weather_data = fetch_weather(city) 82 | check_alerts(weather_data, temp_threshold, wind_speed_threshold) 83 | print("Waiting for the next check...") 84 | time.sleep(3600) # check every hour 85 | 86 | 87 | if __name__ == "__main__": 88 | main() -------------------------------------------------------------------------------- /Weather Alert/requirement.txt: -------------------------------------------------------------------------------- 1 | requests 2 | python-dotenv -------------------------------------------------------------------------------- /Weather Alert/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Word_frequency_counter/README.md: -------------------------------------------------------------------------------- 1 | # Word Frequency Counter 2 | 3 | A simple python script that counts the number of words in a given text document and prints the top 10 words according to their frequency, along with their frequency of occurence. 4 | 5 | --- 6 | 7 | - **Input :** Path of the text file to be processed 8 | - **Output :** List of top 10 words according to their frequency, along with their frequency of occurence. 9 | 10 | --- 11 | 12 | ## Features : 13 | 14 | - User friendly interface 15 | - Output is in tabular format 16 | - Case insensitive processing of words 17 | - Get the Top 10 words in the text file which occur most frequntly, along with their counts 18 | 19 | --- 20 | 21 | ## Usage : 22 | 23 | 1. Clone the repository 24 | 2. Navigate to the project folder 25 | 3. Run the command : 26 | 27 | ```python 28 | python3 main.py 29 | ``` -------------------------------------------------------------------------------- /Word_frequency_counter/main.py: -------------------------------------------------------------------------------- 1 | import regex as re 2 | from collections import Counter 3 | 4 | def find_words_frequency(file_path): 5 | ''' 6 | This script takes the path of the text file to be processed as input 7 | and prints the top ten words and also prints their counts in the given text file. 8 | ''' 9 | with open(file_path, 'r', encoding='utf-8') as file: 10 | text = file.read().lower() 11 | 12 | # Use `regex`'s findall function 13 | all_words = re.findall(r'\b\p{L}+\b', text) 14 | word_frequency = Counter(all_words) 15 | most_common_words = word_frequency.most_common(10) 16 | 17 | # Print in tabular format 18 | print(f"{'Word':<15} {'Count':<5}") 19 | print("-" * 20) 20 | for word, count in most_common_words: 21 | print(f"{word:<15} {count:<5}") 22 | 23 | def main(): 24 | file_path = input("Enter the path of file : ") 25 | find_words_frequency(file_path) 26 | 27 | if __name__ == "__main__": 28 | main() 29 | -------------------------------------------------------------------------------- /Word_frequency_counter/requirments.txt: -------------------------------------------------------------------------------- 1 | regex=2.5.147 2 | -------------------------------------------------------------------------------- /Word_frequency_counter/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.7 -------------------------------------------------------------------------------- /Youtube Video Downloader/Readme.md: -------------------------------------------------------------------------------- 1 | # YouTube Video Downloader with yt-dlp Integration 2 | 3 | ## Project Overview 4 | 5 | This project is a command-line based YouTube Video Downloader that integrates with `yt-dlp` to allow users to download videos from YouTube. It enables downloading in various formats and resolutions, giving users flexibility in managing their video downloads. 6 | 7 | ## Features 8 | 9 | - **Download YouTube Videos**: Download videos in various resolutions (360p, 720p, 1080p, etc.). 10 | - **Audio Extraction**: Extract and download only the audio from a YouTube video. 11 | - **Multiple Formats**: Support for multiple video formats like MP4, WebM, and audio formats like MP3, M4A. 12 | - **Batch Downloading**: Download multiple videos at once by providing a list of URLs. 13 | - **Simple Command-Line Interface**: Easy-to-use command-line input for seamless user experience. 14 | 15 | ## Technologies Used 16 | 17 | - **Python**: The core programming language. 18 | - **yt-dlp**: The powerful Python package used for downloading videos and audio from YouTube and other platforms. 19 | 20 | ## Installation 21 | 22 | To get started with this project, follow these steps: 23 | 24 | 1. **Clone the Repository**: 25 | ```bash 26 | git clone https://github.com/yourusername/YouTube-Video-Downloader.git 27 | -------------------------------------------------------------------------------- /Youtube Video Downloader/main.py: -------------------------------------------------------------------------------- 1 | import yt_dlp 2 | 3 | def download_video(url, resolution='highest'): 4 | try: 5 | # Set yt-dlp options for video download 6 | ydl_opts = { 7 | 'format': f'bestvideo[height<={resolution}]+bestaudio/best[height<={resolution}]' if resolution != 'highest' else 'best', 8 | 'outtmpl': '%(title)s.%(ext)s', # Output file name template 9 | } 10 | 11 | # Download video with yt-dlp 12 | with yt_dlp.YoutubeDL(ydl_opts) as ydl: 13 | ydl.download([url]) 14 | print("Download completed!") 15 | except Exception as e: 16 | print(f"Error: {e}") 17 | 18 | if __name__ == "__main__": 19 | video_url = input("Enter YouTube URL: ") 20 | video_resolution = input("Enter resolution (e.g., 720p or leave blank for highest): ").strip() 21 | 22 | # Download the video with specified resolution 23 | download_video(video_url, video_resolution or 'highest') 24 | -------------------------------------------------------------------------------- /Youtube Video Downloader/requirements.txt: -------------------------------------------------------------------------------- 1 | yt-dlp 2 | -------------------------------------------------------------------------------- /Youtube Video Downloader/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.10.12 2 | -------------------------------------------------------------------------------- /personal-finance-tracker/README.md: -------------------------------------------------------------------------------- 1 | Personal Finance Tracker 2 | 3 | Project Overview: 4 | The Personal Finance Tracker is a simple command-line application that helps users track their income, expenses, and savings goals. It also provides visualizations of spending patterns to better understand financial habits. The project uses SQLite for data storage and Matplotlib for creating various financial charts. 5 | 6 | Features: 7 | Add Income: Record income entries with descriptions and amounts. 8 | Add Expense: Record expenses, categorize them, and add descriptions. 9 | View Summary: View a summary of total income, expenses, and balance. 10 | Set Savings Goals: Define and track savings goals. 11 | Visualize Spending: Generate various charts (bar chart, pie chart, line chart, etc.) to better understand your spending habits. 12 | 13 | Technologies Used: 14 | Python: Core programming language. 15 | SQLite3: Local database for storing transaction records. 16 | Matplotlib: Python library for generating visualizations. 17 | 18 | 19 | To run the program: 20 | 1] Clone the repository 21 | 2] Navigate to Personal Finance Tracker folder 22 | 3] Run the main.py file 23 | 24 | When you run the application, a menu will appear with the following options: 25 | 26 | Add Income: Enter the amount and description of your income. 27 | Add Expense: Enter the amount, category, and description of the expense. 28 | View Summary: See your total income, expenses, and remaining balance. 29 | Set Savings Goal: Set a savings goal to track progress. 30 | Visualize Spending: Choose from various charts to visualize your spending patterns. -------------------------------------------------------------------------------- /personal-finance-tracker/database.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | DB_FILE = "data/finance.db" 4 | 5 | def get_connection(): 6 | conn = sqlite3.connect(DB_FILE) 7 | return conn 8 | 9 | def initialize_database(): 10 | conn = get_connection() 11 | cursor = conn.cursor() 12 | 13 | # Create income and expense table 14 | cursor.execute(''' 15 | CREATE TABLE IF NOT EXISTS transactions ( 16 | id INTEGER PRIMARY KEY AUTOINCREMENT, 17 | type TEXT NOT NULL, 18 | category TEXT NOT NULL, 19 | amount REAL NOT NULL, 20 | date TIMESTAMP DEFAULT CURRENT_TIMESTAMP 21 | ) 22 | ''') 23 | 24 | # Create table for savings goal 25 | cursor.execute(''' 26 | CREATE TABLE IF NOT EXISTS savings_goal ( 27 | id INTEGER PRIMARY KEY, 28 | goal_amount REAL NOT NULL 29 | ) 30 | ''') 31 | 32 | conn.commit() 33 | conn.close() 34 | -------------------------------------------------------------------------------- /personal-finance-tracker/main.py: -------------------------------------------------------------------------------- 1 | import tracker 2 | import savings 3 | import visualization 4 | import database 5 | 6 | def main_menu(): 7 | while True: 8 | print("\n--- Personal Finance Tracker ---") 9 | print("1. Add Income") 10 | print("2. Add Expense") 11 | print("3. View Summary") 12 | print("4. Set Savings Goal") 13 | print("5. Visualize Spending") 14 | print("6. Exit") 15 | 16 | choice = input("Choose an option: ") 17 | 18 | if choice == "1": 19 | tracker.add_income() 20 | elif choice == "2": 21 | tracker.add_expense() 22 | elif choice == "3": 23 | tracker.view_summary() 24 | elif choice == "4": 25 | savings.set_goal() 26 | elif choice == "5": 27 | visualization.visualize_data() 28 | elif choice == "6": 29 | print("Exiting...") 30 | break 31 | else: 32 | print("Invalid option. Please try again.") 33 | 34 | if __name__ == "__main__": 35 | database.initialize_database() 36 | main_menu() 37 | -------------------------------------------------------------------------------- /personal-finance-tracker/savings.py: -------------------------------------------------------------------------------- 1 | from database import get_connection 2 | 3 | def set_goal(): 4 | goal_amount = float(input("Enter your savings goal: ")) 5 | 6 | conn = get_connection() 7 | cursor = conn.cursor() 8 | 9 | cursor.execute("INSERT OR REPLACE INTO savings_goal (id, goal_amount) VALUES (1, ?)", (goal_amount,)) 10 | conn.commit() 11 | conn.close() 12 | 13 | print(f"Savings goal of {goal_amount} set successfully!") 14 | 15 | def track_savings_progress(balance): 16 | conn = get_connection() 17 | cursor = conn.cursor() 18 | 19 | cursor.execute("SELECT goal_amount FROM savings_goal WHERE id = 1") 20 | goal_row = cursor.fetchone() 21 | conn.close() 22 | 23 | if goal_row: 24 | goal_amount = goal_row[0] 25 | remaining = goal_amount - balance 26 | if remaining > 0: 27 | print(f"You need to save {remaining} more to reach your goal.") 28 | else: 29 | print(f"Congratulations! You've reached your savings goal.") 30 | else: 31 | print("No savings goal set.") 32 | -------------------------------------------------------------------------------- /personal-finance-tracker/tracker.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | from database import get_connection 3 | 4 | def add_income(): 5 | category = input("Enter income source (e.g., Salary, Freelance): ") 6 | amount = float(input("Enter amount: ")) 7 | 8 | conn = get_connection() 9 | cursor = conn.cursor() 10 | 11 | cursor.execute("INSERT INTO transactions (type, category, amount) VALUES (?, ?, ?)", 12 | ("Income", category, amount)) 13 | conn.commit() 14 | conn.close() 15 | 16 | print("Income added successfully!") 17 | 18 | def add_expense(): 19 | category = input("Enter expense category (e.g., Rent, Groceries): ") 20 | amount = float(input("Enter amount: ")) 21 | 22 | conn = get_connection() 23 | cursor = conn.cursor() 24 | 25 | cursor.execute("INSERT INTO transactions (type, category, amount) VALUES (?, ?, ?)", 26 | ("Expense", category, amount)) 27 | conn.commit() 28 | conn.close() 29 | 30 | print("Expense added successfully!") 31 | 32 | def view_summary(): 33 | conn = get_connection() 34 | cursor = conn.cursor() 35 | 36 | cursor.execute("SELECT SUM(amount) FROM transactions WHERE type = 'Income'") 37 | total_income = cursor.fetchone()[0] or 0.0 38 | 39 | cursor.execute("SELECT SUM(amount) FROM transactions WHERE type = 'Expense'") 40 | total_expenses = cursor.fetchone()[0] or 0.0 41 | 42 | balance = total_income - total_expenses 43 | 44 | conn.close() 45 | 46 | print(f"\nTotal Income: {total_income}") 47 | print(f"Total Expenses: {total_expenses}") 48 | print(f"Balance: {balance}") 49 | -------------------------------------------------------------------------------- /personal-finance-tracker/visualization.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | from database import get_connection 3 | 4 | def bar_chart_expense(): 5 | conn = get_connection() 6 | cursor = conn.cursor() 7 | 8 | cursor.execute("SELECT category, SUM(amount) FROM transactions WHERE type = 'Expense' GROUP BY category") 9 | rows = cursor.fetchall() 10 | conn.close() 11 | 12 | if rows: 13 | categories = [row[0] for row in rows] 14 | amounts = [row[1] for row in rows] 15 | 16 | plt.bar(categories, amounts) 17 | plt.xlabel('Category') 18 | plt.ylabel('Amount') 19 | plt.title('Spending by Category') 20 | plt.xticks(rotation=45) 21 | plt.tight_layout() 22 | plt.show() 23 | else: 24 | print("No expenses recorded yet.") 25 | 26 | def pie_chart_expense(): 27 | conn = get_connection() 28 | cursor = conn.cursor() 29 | 30 | cursor.execute("SELECT category, SUM(amount) FROM transactions WHERE type = 'Expense' GROUP BY category") 31 | rows = cursor.fetchall() 32 | conn.close() 33 | 34 | if rows: 35 | categories = [row[0] for row in rows] 36 | amounts = [row[1] for row in rows] 37 | 38 | plt.pie(amounts, labels=categories, autopct='%1.1f%%', startangle=90) 39 | plt.title('Spending by Category') 40 | plt.tight_layout() 41 | plt.show() 42 | else: 43 | print("No expenses recorded yet.") 44 | 45 | def line_chart_expense_over_time(): 46 | conn = get_connection() 47 | cursor = conn.cursor() 48 | 49 | cursor.execute("SELECT date, SUM(amount) FROM transactions WHERE type = 'Expense' GROUP BY date") 50 | rows = cursor.fetchall() 51 | conn.close() 52 | 53 | if rows: 54 | dates = [row[0] for row in rows] 55 | amounts = [row[1] for row in rows] 56 | 57 | plt.plot(dates, amounts, marker='o') 58 | plt.xlabel('Date') 59 | plt.ylabel('Amount') 60 | plt.title('Expenses Over Time') 61 | plt.xticks(rotation=45) 62 | plt.tight_layout() 63 | plt.show() 64 | else: 65 | print("No expenses recorded yet.") 66 | 67 | def stacked_bar_chart_income_expense(): 68 | conn = get_connection() 69 | cursor = conn.cursor() 70 | 71 | cursor.execute("SELECT date, SUM(amount) FROM transactions WHERE type = 'Income' GROUP BY date") 72 | income_rows = cursor.fetchall() 73 | 74 | cursor.execute("SELECT date, SUM(amount) FROM transactions WHERE type = 'Expense' GROUP BY date") 75 | expense_rows = cursor.fetchall() 76 | 77 | conn.close() 78 | 79 | if income_rows and expense_rows: 80 | income_dates = [row[0] for row in income_rows] 81 | income_amounts = [row[1] for row in income_rows] 82 | expense_dates = [row[0] for row in expense_rows] 83 | expense_amounts = [row[1] for row in expense_rows] 84 | 85 | plt.bar(income_dates, income_amounts, label='Income') 86 | plt.bar(expense_dates, expense_amounts, bottom=income_amounts, label='Expense') 87 | 88 | plt.xlabel('Date') 89 | plt.ylabel('Amount') 90 | plt.title('Income vs Expenses Over Time') 91 | plt.xticks(rotation=45) 92 | plt.legend() 93 | plt.tight_layout() 94 | plt.show() 95 | else: 96 | print("Not enough data to generate this chart.") 97 | 98 | def histogram_expense_distribution(): 99 | conn = get_connection() 100 | cursor = conn.cursor() 101 | 102 | cursor.execute("SELECT amount FROM transactions WHERE type = 'Expense'") 103 | rows = cursor.fetchall() 104 | conn.close() 105 | 106 | if rows: 107 | amounts = [row[0] for row in rows] 108 | 109 | plt.hist(amounts, bins=10) 110 | plt.xlabel('Expense Amount') 111 | plt.ylabel('Frequency') 112 | plt.title('Expense Distribution') 113 | plt.tight_layout() 114 | plt.show() 115 | else: 116 | print("No expenses recorded yet.") 117 | 118 | def visualize_data(): 119 | print("\n--- Visualization Menu ---") 120 | print("1. Bar Chart (Spending by Category)") 121 | print("2. Pie Chart (Spending by Category)") 122 | print("3. Line Chart (Expenses Over Time)") 123 | print("4. Stacked Bar Chart (Income vs Expenses)") 124 | print("5. Histogram (Expense Distribution)") 125 | 126 | choice = input("Select a visualization option (1-5): ") 127 | 128 | if choice == "1": 129 | bar_chart_expense() 130 | elif choice == "2": 131 | pie_chart_expense() 132 | elif choice == "3": 133 | line_chart_expense_over_time() 134 | elif choice == "4": 135 | stacked_bar_chart_income_expense() 136 | elif choice == "5": 137 | histogram_expense_distribution() 138 | else: 139 | print("Invalid choice. Please select a valid option.") 140 | --------------------------------------------------------------------------------