Website Availability & Uptime Tracker

 import requests

import schedule

import time

import smtplib

from email.mime.text import MIMEText


# List of websites to track

websites = {

    "Google": "https://www.google.com",

    "My Portfolio": "https://yourportfolio.com"

}


# Email Config

EMAIL_ADDRESS = "your_email@gmail.com"

EMAIL_PASSWORD = "your_app_password"

TO_EMAIL = "recipient_email@example.com"


def send_email_alert(site):

    msg = MIMEText(f"Alert: {site} is DOWN!")

    msg["Subject"] = f"๐Ÿšจ {site} is Down!"

    msg["From"] = EMAIL_ADDRESS

    msg["To"] = TO_EMAIL


    with smtplib.SMTP_SSL("smtp.gmail.com", 465) as smtp:

        smtp.login(EMAIL_ADDRESS, EMAIL_PASSWORD)

        smtp.send_message(msg)

        print(f"Email sent: {site} is down.")


def check_sites():

    for name, url in websites.items():

        try:

            response = requests.get(url, timeout=5)

            if response.status_code != 200:

                print(f"[{name}] Status: {response.status_code}")

                send_email_alert(name)

            else:

                print(f"[{name}] is up ✅")

        except requests.exceptions.RequestException:

            print(f"[{name}] is unreachable ❌")

            send_email_alert(name)


# Check every 5 minutes

schedule.every(5).minutes.do(check_sites)


print("๐Ÿ” Website Uptime Tracker Started...")

while True:

    schedule.run_pending()

    time.sleep(1)



Twilio SMS Integration


from twilio.rest import Client

account_sid = "your_sid"
auth_token = "your_token"
twilio_number = "+1234567890"
receiver_number = "+91999xxxxxxx"

def send_sms_alert(site):
    client = Client(account_sid, auth_token)
    client.messages.create(
        body=f"๐Ÿšจ {site} is DOWN!",
        from_=twilio_number,
        to=receiver_number
    )

Document Similarity Checker

 import streamlit as st

from sklearn.feature_extraction.text import TfidfVectorizer

from sklearn.metrics.pairwise import cosine_similarity

import spacy


nlp = spacy.load("en_core_web_sm")


st.title("๐Ÿ“„ Document Similarity Checker")


def preprocess(text):

    doc = nlp(text)

    return " ".join([token.lemma_ for token in doc if not token.is_stop and token.is_alpha])


file1 = st.file_uploader("Upload First Document", type=["txt"])

file2 = st.file_uploader("Upload Second Document", type=["txt"])


if file1 and file2:

    text1 = file1.read().decode("utf-8")

    text2 = file2.read().decode("utf-8")


    clean_text1 = preprocess(text1)

    clean_text2 = preprocess(text2)


    tfidf = TfidfVectorizer()

    tfidf_matrix = tfidf.fit_transform([clean_text1, clean_text2])

    sim_score = cosine_similarity(tfidf_matrix[0:1], tfidf_matrix[1:2])[0][0]


    st.subheader("๐Ÿงฎ Similarity Score")

    st.write(f"**{sim_score:.2f}** (1 = identical, 0 = completely different)")


    if sim_score > 0.75:

        st.success("The documents are quite similar! ๐ŸŸข")

    elif sim_score > 0.4:

        st.info("The documents are moderately similar. ๐ŸŸก")

    else:

        st.warning("The documents are quite different. ๐Ÿ”ด")


Smart Calendar CLI App

 import click

import requests

from datetime import datetime, timedelta


# Placeholder for real GCal and weather integration

EVENTS = [

    {"title": "Standup Meeting", "time": "10:00", "date": "2025-04-16", "location": "Remote"},

    {"title": "Doctor Appointment", "time": "15:00", "date": "2025-04-16", "location": "City Clinic"},

]


@click.group()

def cli():

    pass


@cli.command()

def today():

    click.echo("๐Ÿ“… Today's Events:")

    today = datetime.today().strftime('%Y-%m-%d')

    for e in EVENTS:

        if e["date"] == today:

            click.echo(f"- {e['time']}: {e['title']} ๐Ÿ“ {e['location']}")


@cli.command()

@click.option('--title', prompt='Event title')

@click.option('--date', prompt='Event date (YYYY-MM-DD)')

@click.option('--time', prompt='Event time (HH:MM)')

@click.option('--location', prompt='Event location')

def add(title, date, time, location):

    EVENTS.append({"title": title, "date": date, "time": time, "location": location})

    click.echo("✅ Event created successfully!")


@cli.command()

def forecast():

    if not EVENTS:

        click.echo("No events to check weather for.")

        return

    event = EVENTS[-1]

    click.echo(f"๐ŸŒฆ Forecast for: {event['title']}")

    weather = get_weather(event['location'])

    click.echo(f"๐Ÿ“ Location: {event['location']} | Date: {event['date']}")

    click.echo(f"☁️ Weather Forecast: {weather}")


def get_weather(city):

    API_KEY = "your_openweathermap_api_key"

    url = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&units=metric"

    r = requests.get(url)

    if r.status_code == 200:

        data = r.json()

        return f"{data['weather'][0]['main']}, {data['main']['temp']}°C"

    return "Weather data unavailable"


if __name__ == '__main__':

    cli()


Voice-Controlled Notes App

import speech_recognition as sr

import pyttsx3

import os


notes = {}


engine = pyttsx3.init()


def speak(text):

    engine.say(text)

    engine.runAndWait()


def listen_command():

    r = sr.Recognizer()

    with sr.Microphone() as source:

        speak("Listening...")

        audio = r.listen(source)

    try:

        command = r.recognize_google(audio)

        return command.lower()

    except:

        speak("Sorry, I didn't catch that.")

        return ""


def create_note():

    speak("What should I name the note?")

    title = listen_command()

    speak("What is the content?")

    content = listen_command()

    notes[title] = content

    speak(f"Note '{title}' created.")


def read_notes():

    if notes:

        for title, content in notes.items():

            speak(f"{title}: {content}")

    else:

        speak("No notes found.")


def delete_note():

    speak("Which note should I delete?")

    title = listen_command()

    if title in notes:

        del notes[title]

        speak(f"Note '{title}' deleted.")

    else:

        speak("Note not found.")


def main():

    speak("Voice Notes App Started.")

    while True:

        speak("Say a command: create, read, delete, or exit.")

        command = listen_command()


        if "create" in command:

            create_note()

        elif "read" in command:

            read_notes()

        elif "delete" in command:

            delete_note()

        elif "exit" in command:

            speak("Goodbye!")

            break

        else:

            speak("Unknown command.")


if __name__ == "__main__":

    main()


Chemistry Molecule Visualizer

 import streamlit as st

from rdkit import Chem

from rdkit.Chem import Draw, Descriptors

import py3Dmol


def mol_to_3d_view(smiles):

    mol = Chem.MolFromSmiles(smiles)

    mb = Chem.AddHs(mol)

    Chem.EmbedMolecule(mb)

    mol_block = Chem.MolToMolBlock(mb)


    viewer = py3Dmol.view(width=400, height=400)

    viewer.addModel(mol_block, 'mol')

    viewer.setStyle({'stick': {}})

    viewer.zoomTo()

    return viewer


st.title("๐Ÿงช Chemistry Molecule Visualizer")


smiles = st.text_input("Enter SMILES string", "CC(=O)O")  # Acetic Acid


if smiles:

    mol = Chem.MolFromSmiles(smiles)

    

    if mol:

        st.subheader("๐Ÿ“Œ Molecular Structure (2D)")

        st.image(Draw.MolToImage(mol, size=(300, 300)))


        st.subheader("๐Ÿ”ฌ Properties")

        st.markdown(f"**Formula**: {Chem.rdMolDescriptors.CalcMolFormula(mol)}")

        st.markdown(f"**Molecular Weight**: {Descriptors.MolWt(mol):.2f} g/mol")


        st.subheader("๐Ÿงฌ 3D Structure")

        viewer = mol_to_3d_view(smiles)

        viewer_html = viewer._make_html()

        st.components.v1.html(viewer_html, height=450)

    else:

        st.error("Invalid SMILES string. Try again.")


Receipt Text Extractor & Analyzer

 OCR using pytesseract

from PIL import Image

import pytesseract


def extract_text_from_image(image_path):

    image = Image.open(image_path)

    text = pytesseract.image_to_string(image)

    return text

Parse Items and Prices with re

import re

def parse_items(raw_text):
    # Match lines like: "Bread 2.50" or "Milk ....... 1.25"
    pattern = r"([A-Za-z\s]+)\s+([\d]+\.\d{2})"
    matches = re.findall(pattern, raw_text)
    
    items = [{"item": item.strip(), "price": float(price)} for item, price in matches]
    
    total = sum(i["price"] for i in items)
    avg = total / len(items) if items else 0
    
    return items, total, avg

(Optional) Step 3: Streamlit Interface


import streamlit as st
from utils.text_parser import extract_text_from_image, parse_items
import tempfile
import pandas as pd

st.title("๐Ÿงพ Receipt Text Extractor & Analyzer")
uploaded_file = st.file_uploader("Upload Receipt Image", type=["jpg", "png", "jpeg"])

if uploaded_file:
    with tempfile.NamedTemporaryFile(delete=False) as tmp:
        tmp.write(uploaded_file.read())
        tmp_path = tmp.name

    raw_text = extract_text_from_image(tmp_path)
    items, total, avg = parse_items(raw_text)

    df = pd.DataFrame(items)
    st.subheader("๐Ÿ›’ Items Detected:")
    st.table(df)

    st.markdown(f"**Total Cost:** ₹{total:.2f}")
    st.markdown(f"**Average Item Cost:** ₹{avg:.2f}")

    # Download as CSV
    csv = df.to_csv(index=False).encode()
    st.download_button("๐Ÿ“ฅ Download CSV", csv, "receipt_data.csv", "text/csv")

Music Genre Classifier

 # utils/feature_extractor.py

import librosa

import numpy as np


def extract_features(file_path):

    y, sr = librosa.load(file_path, duration=30)

    mfccs = librosa.feature.mfcc(y=y, sr=sr, n_mfcc=40)

    mfccs_mean = np.mean(mfccs.T, axis=0)

    return mfccs_mean


from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
import pandas as pd
import joblib

# Load features (extracted previously)
df = pd.read_csv("features_dataset.csv")  # Your dataset with MFCC + genre
X = df.drop('genre', axis=1)
y = df['genre']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

clf = RandomForestClassifier()
clf.fit(X_train, y_train)

# Save model
joblib.dump(clf, "model/genre_model.pkl")


# app.py
import streamlit as st
import joblib
import numpy as np
from utils.feature_extractor import extract_features
import tempfile

# Load model
model = joblib.load("model/genre_model.pkl")

st.title("๐ŸŽต Music Genre Classifier")
st.write("Upload a music file to predict its genre")

uploaded_file = st.file_uploader("Choose a file", type=["mp3", "wav"])

if uploaded_file:
    # Save temporarily
    with tempfile.NamedTemporaryFile(delete=False) as tmp:
        tmp.write(uploaded_file.read())
        tmp_path = tmp.name

    # Extract features and predict
    features = extract_features(tmp_path)
    prediction = model.predict([features])[0]
    proba = model.predict_proba([features])

    st.success(f"Predicted Genre: **{prediction}**")
    st.bar_chart(proba[0])

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)