Custom Dictionary Builder

 db.py

import sqlite3


def init_db():

    conn = sqlite3.connect("words.db")

    cursor = conn.cursor()

    cursor.execute('''CREATE TABLE IF NOT EXISTS dictionary (

                        id INTEGER PRIMARY KEY AUTOINCREMENT,

                        word TEXT,

                        language TEXT,

                        meaning TEXT,

                        synonyms TEXT,

                        audio_file TEXT)''')

    conn.commit()

    conn.close()


def add_word(word, lang, meaning, synonyms, audio_file):

    conn = sqlite3.connect("words.db")

    cursor = conn.cursor()

    cursor.execute("INSERT INTO dictionary (word, language, meaning, synonyms, audio_file) VALUES (?, ?, ?, ?, ?)",

                   (word, lang, meaning, synonyms, audio_file))

    conn.commit()

    conn.close()


def search_word(word):

    conn = sqlite3.connect("words.db")

    cursor = conn.cursor()

    cursor.execute("SELECT * FROM dictionary WHERE word = ?", (word,))

    result = cursor.fetchone()

    conn.close()

    return result

tts.py

from gtts import gTTS

import os


def generate_audio(word, lang='en'):

    tts = gTTS(text=word, lang=lang)

    audio_file = f"audio/{word}_{lang}.mp3"

    tts.save(audio_file)

    return audio_file

app.py

import tkinter as tk

from db import init_db, add_word, search_word

from tts import generate_audio

import os

from playsound import playsound


init_db()


def submit_word():

    word = entry_word.get()

    lang = entry_lang.get()

    meaning = entry_meaning.get()

    synonyms = entry_synonyms.get()

    audio_path = generate_audio(word, lang)

    add_word(word, lang, meaning, synonyms, audio_path)

    label_status.config(text="✅ Word added!")


def play_audio():

    word = entry_word.get()

    result = search_word(word)

    if result and os.path.exists(result[5]):

        playsound(result[5])

    else:

        label_status.config(text="❌ Audio not found.")


# GUI Setup

window = tk.Tk()

window.title("📚 Custom Dictionary Builder")

window.geometry("400x400")


entry_word = tk.Entry(window)

entry_word.insert(0, "Word")

entry_word.pack(pady=5)


entry_lang = tk.Entry(window)

entry_lang.insert(0, "Language Code (e.g., en, es)")

entry_lang.pack(pady=5)


entry_meaning = tk.Entry(window)

entry_meaning.insert(0, "Meaning")

entry_meaning.pack(pady=5)


entry_synonyms = tk.Entry(window)

entry_synonyms.insert(0, "Synonyms")

entry_synonyms.pack(pady=5)


tk.Button(window, text="Add Word", command=submit_word).pack(pady=10)

tk.Button(window, text="Play Pronunciation", command=play_audio).pack(pady=5)


label_status = tk.Label(window, text="")

label_status.pack(pady=10)


window.mainloop()



Language Codes for gTTS:

  • English: en

  • Hindi: hi

  • Spanish: es

  • French: fr

  • Malayalam: ml

  • Tamil: ta

Mindfulness & Focus Timer App

 main.py

import tkinter as tk

from timer import start_pomodoro

from breathing import start_breathing

from prompts import get_prompt


window = tk.Tk()

window.title("🧠 Mindfulness & Focus Timer")

window.geometry("400x300")


label = tk.Label(window, text="Welcome to Focus Time!", font=("Helvetica", 16))

label.pack(pady=10)


tk.Button(window, text="Start Pomodoro", command=start_pomodoro).pack(pady=10)

tk.Button(window, text="Breathing Exercise", command=start_breathing).pack(pady=10)

tk.Button(window, text="Get Mindfulness Prompt", command=lambda: label.config(text=get_prompt())).pack(pady=10)


window.mainloop()

timer.py

import time
import pygame
import threading

def play_sound():
    pygame.init()
    pygame.mixer.init()
    pygame.mixer.music.load("sounds/ding.wav")
    pygame.mixer.music.play()

def start_pomodoro():
    def run():
        print("Focus time started!")
        for i in range(25 * 60, 0, -1):
            mins, secs = divmod(i, 60)
            print(f"{mins:02d}:{secs:02d}", end='\r')
            time.sleep(1)
        play_sound()
        print("\nTime for a break!")

    threading.Thread(target=run).start()

breathing.py

import time
import threading

def start_breathing():
    def run():
        print("Follow the breathing pattern:")
        for _ in range(4):
            print("Inhale... 🫁")
            time.sleep(4)
            print("Hold... ✋")
            time.sleep(4)
            print("Exhale... 😮‍💨")
            time.sleep(4)
    threading.Thread(target=run).start()

prompts.py

import random

prompts = [
    "Breathe in clarity, breathe out stress.",
    "Focus on one thing at a time.",
    "You are in control of your day.",
    "Be here now. 🌱",
    "Let go of what you can't control."
]

def get_prompt():
    return random.choice(prompts)


AI Image Caption Generator

 import numpy as np

import tensorflow as tf

from tensorflow.keras.applications.inception_v3 import InceptionV3, preprocess_input

from tensorflow.keras.preprocessing import image

from tensorflow.keras.models import Model, load_model

import pickle

import cv2

import streamlit as st

from PIL import Image


# Load Pretrained InceptionV3 Model for Image Feature Extraction

base_model = InceptionV3(weights='imagenet')

model = Model(inputs=base_model.input, outputs=base_model.layers[-2].output)


# Load Pretrained Captioning Model

captioning_model = load_model("image_captioning_model.h5")


# Load Tokenizer & Word Mappings

with open("tokenizer.pickle", "rb") as handle:

    tokenizer = pickle.load(handle)


max_length = 35  # Max caption length


# Extract Features from Image

def extract_features(img_path):

    img = image.load_img(img_path, target_size=(299, 299))

    img = image.img_to_array(img)

    img = np.expand_dims(img, axis=0)

    img = preprocess_input(img)

    feature_vector = model.predict(img)

    return feature_vector


# Generate Caption

def generate_caption(img_path):

    image_features = extract_features(img_path)

    caption = "startseq"

    

    for i in range(max_length):

        sequence = [tokenizer.word_index[word] for word in caption.split() if word in tokenizer.word_index]

        sequence = tf.keras.preprocessing.sequence.pad_sequences([sequence], maxlen=max_length)

        predicted_index = np.argmax(captioning_model.predict([image_features, sequence]), axis=-1)

        word = tokenizer.index_word.get(predicted_index[0], "")

        if word == "endseq":

            break

        caption += " " + word

    

    return caption.replace("startseq", "").replace("endseq", "").strip()


# Streamlit Web Interface

st.title("🖼️ AI Image Caption Generator")

uploaded_file = st.file_uploader("Upload an image...", type=["jpg", "png", "jpeg"])


if uploaded_file is not None:

    img = Image.open(uploaded_file)

    st.image(img, caption="Uploaded Image", use_column_width=True)

    

    # Save the uploaded image temporarily

    img_path = "temp.jpg"

    img.save(img_path)

    

    # Generate Caption

    with st.spinner("Generating Caption..."):

        caption_text = generate_caption(img_path)

    

    st.subheader("📝 Generated Caption:")

    st.write(caption_text)


AI Resume Scorer

 import fitz  # PyMuPDF for PDF parsing

import docx2txt

import spacy

import re

from collections import Counter

import tkinter as tk

from tkinter import filedialog, messagebox


# Load NLP Model (English)

nlp = spacy.load("en_core_web_sm")


# Job Description (Example)

job_description = """

We are looking for a Data Scientist with expertise in Python, Machine Learning, and Data Analysis.

Candidates must have experience with Pandas, NumPy, and Scikit-learn.

Strong communication and teamwork skills are required.

"""


# Function to extract text from PDF

def extract_text_from_pdf(pdf_path):

    text = ""

    doc = fitz.open(pdf_path)

    for page in doc:

        text += page.get_text()

    return text


# Function to extract text from DOCX

def extract_text_from_docx(docx_path):

    return docx2txt.process(docx_path)


# Function to clean and preprocess text

def clean_text(text):

    text = re.sub(r"\s+", " ", text)  # Remove extra spaces

    text = text.lower()  # Convert to lowercase

    return text


# Function to extract keywords using NLP

def extract_keywords(text):

    doc = nlp(text)

    keywords = [token.text for token in doc if token.is_alpha and not token.is_stop]

    return Counter(keywords)


# Function to score the resume

def score_resume(resume_text, job_description):

    resume_keywords = extract_keywords(resume_text)

    job_keywords = extract_keywords(job_description)


    # Calculate Keyword Match Score

    matched_keywords = sum((resume_keywords & job_keywords).values())

    total_keywords = sum(job_keywords.values())

    keyword_score = (matched_keywords / total_keywords) * 100 if total_keywords else 0


    # Readability Score (Basic: Word Count / Sentence Count)

    sentence_count = len(re.findall(r"[.!?]", resume_text))

    word_count = len(resume_text.split())

    readability_score = (word_count / (sentence_count + 1)) * 2  # Simplified readability measure


    # Final Score Calculation (Weighted Average)

    final_score = (keyword_score * 0.7) + (readability_score * 0.3)

    return round(final_score, 2), keyword_score, readability_score


# GUI for File Upload

def upload_file():

    file_path = filedialog.askopenfilename(filetypes=[("PDF Files", "*.pdf"), ("Word Files", "*.docx")])

    

    if file_path:

        if file_path.endswith(".pdf"):

            resume_text = extract_text_from_pdf(file_path)

        elif file_path.endswith(".docx"):

            resume_text = extract_text_from_docx(file_path)

        else:

            messagebox.showerror("Error", "Unsupported file format!")

            return

        

        # Clean and score resume

        cleaned_resume = clean_text(resume_text)

        final_score, keyword_score, readability_score = score_resume(cleaned_resume, job_description)

        

        # Show results

        messagebox.showinfo("Resume Score", f"📄 Resume Score: {final_score}%\n\n"

                                             f"🔑 Keyword Match: {keyword_score:.2f}%\n"

                                             f"📖 Readability Score: {readability_score:.2f}%")


# GUI Setup

root = tk.Tk()

root.title("AI Resume Scorer")

root.geometry("300x200")


upload_btn = tk.Button(root, text="Upload Resume", command=upload_file, padx=10, pady=5)

upload_btn.pack(pady=20)


root.mainloop()


Job Application Tracker

 import tkinter as tk

from tkinter import ttk, messagebox

import sqlite3

import pandas as pd

import smtplib


# Database Setup

conn = sqlite3.connect("job_tracker.db")

cursor = conn.cursor()

cursor.execute("""

    CREATE TABLE IF NOT EXISTS jobs (

        id INTEGER PRIMARY KEY AUTOINCREMENT,

        company TEXT,

        role TEXT,

        date_applied TEXT,

        status TEXT

    )

""")

conn.commit()


# GUI Application

class JobTrackerApp:

    def __init__(self, root):

        self.root = root

        self.root.title("Job Application Tracker")

        self.root.geometry("600x400")


        # Labels

        ttk.Label(root, text="Company:").grid(row=0, column=0)

        ttk.Label(root, text="Role:").grid(row=1, column=0)

        ttk.Label(root, text="Date Applied:").grid(row=2, column=0)

        ttk.Label(root, text="Status:").grid(row=3, column=0)


        # Entry Fields

        self.company_entry = ttk.Entry(root)

        self.role_entry = ttk.Entry(root)

        self.date_entry = ttk.Entry(root)

        self.status_combo = ttk.Combobox(root, values=["Pending", "Interview", "Rejected", "Hired"])

        

        self.company_entry.grid(row=0, column=1)

        self.role_entry.grid(row=1, column=1)

        self.date_entry.grid(row=2, column=1)

        self.status_combo.grid(row=3, column=1)


        # Buttons

        ttk.Button(root, text="Add Job", command=self.add_job).grid(row=4, column=0)

        ttk.Button(root, text="Show Jobs", command=self.show_jobs).grid(row=4, column=1)

        ttk.Button(root, text="Export to CSV", command=self.export_csv).grid(row=5, column=0)

        ttk.Button(root, text="Send Follow-up", command=self.send_followup).grid(row=5, column=1)


    def add_job(self):

        company = self.company_entry.get()

        role = self.role_entry.get()

        date = self.date_entry.get()

        status = self.status_combo.get()


        if not company or not role or not date or not status:

            messagebox.showerror("Error", "All fields are required!")

            return

        

        cursor.execute("INSERT INTO jobs (company, role, date_applied, status) VALUES (?, ?, ?, ?)", 

                       (company, role, date, status))

        conn.commit()

        messagebox.showinfo("Success", "Job Application Added!")


    def show_jobs(self):

        jobs_window = tk.Toplevel(self.root)

        jobs_window.title("Job Applications")

        tree = ttk.Treeview(jobs_window, columns=("ID", "Company", "Role", "Date", "Status"), show="headings")

        tree.heading("ID", text="ID")

        tree.heading("Company", text="Company")

        tree.heading("Role", text="Role")

        tree.heading("Date", text="Date Applied")

        tree.heading("Status", text="Status")

        tree.pack(fill="both", expand=True)


        cursor.execute("SELECT * FROM jobs")

        for row in cursor.fetchall():

            tree.insert("", "end", values=row)


    def export_csv(self):

        cursor.execute("SELECT * FROM jobs")

        data = cursor.fetchall()

        df = pd.DataFrame(data, columns=["ID", "Company", "Role", "Date Applied", "Status"])

        df.to_csv("job_applications.csv", index=False)

        messagebox.showinfo("Exported", "Job Applications saved as CSV!")


    def send_followup(self):

        email = "your-email@gmail.com"  # Change to your email

        password = "your-password"  # Use App Password for security


        cursor.execute("SELECT company, role FROM jobs WHERE status='Pending'")

        pending_jobs = cursor.fetchall()


        if not pending_jobs:

            messagebox.showinfo("No Follow-ups", "No pending applications to follow up on.")

            return

        

        msg = "Subject: Follow-up on Job Applications\n\n"

        msg += "Here are your pending job applications:\n"

        for company, role in pending_jobs:

            msg += f"- {role} at {company}\n"


        try:

            server = smtplib.SMTP("smtp.gmail.com", 587)

            server.starttls()

            server.login(email, password)

            server.sendmail(email, email, msg)

            server.quit()

            messagebox.showinfo("Email Sent", "Follow-up email sent successfully!")

        except Exception as e:

            messagebox.showerror("Error", f"Failed to send email: {e}")


# Run App

root = tk.Tk()

app = JobTrackerApp(root)

root.mainloop()