Applied Portfolios (The Project Core)
Project 1: Enterprise Scripting & Automation Engine
- The Problem: Manual file handling and weak password security are major overheads for IT departments.
- The Solution: A multi-tool engine that automates image optimization, secures PDFs with watermarks, and audits password safety via the "Have I Been Pwned" API. Demonstrates file manipulation, digital security wrappers, and automated alerts.
import os
from pathlib import Path
from PIL import Image
from PyPDF2 import PdfReader, PdfWriter
import hashlib
import requests
import smtplib
from email.message import EmailMessage
# 1. Image Processing: Automatic Optimization
def process_project_images(image_path):
# Splits file path names to dynamically update extension string tags from .jpg to .png
stem_name = Path(image_path).stem
with Image.open(image_path) as raw_img:
raw_img.thumbnail((500, 500))
raw_img.save(f"{stem_name}_converted.png", "PNG")
# 2. PDF Security: Programmatic Watermarking
def merge_pdf_security_watermark(input_pdf, watermark_pdf, output_pdf_name):
# Allocates read/write stream layers inside temporary buffer blocks
pdf_reader = PdfReader(input_pdf)
watermark_reader = PdfReader(watermark_pdf)
pdf_writer = PdfWriter()
watermark_page = watermark_reader.pages[0]
for page in pdf_reader.pages:
page.merge_page(watermark_page) # Blends security layer over content
pdf_writer.add_page(page)
with open(output_pdf_name, 'wb') as out_file:
pdf_writer.write(out_file)
# 3. Security Audit: k-Anonymity Password Checker
def audit_password_safety(password_string):
# Hash password to SHA-1
sha1_hash = hashlib.sha1(password_string.encode()).hexdigest().upper()
# Check API using ONLY the first 5 chars to maintain privacy (k-Anonymity)
prefix, suffix = sha1_hash[:5], sha1_hash[5:]
response = requests.get(f"[https://api.pwnedpasswords.com/range/](https://api.pwnedpasswords.com/range/){prefix}")
if response.status_code == 200 and suffix in response.text:
print("Warning: Password leak vector discovered in memory matching metrics.")
# 4. Communications: Automated System Dispatch
def send_system_alert(recipient_email, alert_message_body):
msg = EmailMessage()
msg['Subject'] = 'Automation Script Action Alert Report'
msg['From'] = 'automation-runner@domain.com'
msg['To'] = recipient_email
msg.set_content(alert_message_body)
# Authenticate credentials and route automated transactional emails across network pathways safely
with smtplib.SMTP('smtp.gmail.com', 587) as server:
server.starttls()
server.login("automation-runner@domain.com", "mock_secure_token")
server.send_message(msg)
Recruiter Note: k-Anonymity Privacy: By sending only the first 5 characters of the password hash to the API, this implementation guarantees absolute user privacy during security audits.
Project 2: Custom Web Scraping Pipeline
- The Problem: Businesses need to track competitor pricing or news but don't have time to browse manually.
- The Solution: A robust scraper that mimics a real browser to bypass bot-detection and exports clean, structured JSON data. Demonstrates downloading data from public websites and navigating code maps safely.
import requests
from bs4 import BeautifulSoup
import json
def run_custom_web_scraper_pipeline(target_url):
# Mocking a real browser header to avoid 403 Forbidden errors
custom_browser_headers = {
'User-Agent': 'Mozilla/5.0 (Googlebot) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Safari/537.36'
}
# Programmatically fetch index source template views over remote addresses
response = requests.get(target_url, headers=custom_browser_headers)
if response.status_code != 200:
return "Network connection blockade or server error detected."
# Ingest layout contents to build an active interactive tree mapping elements
soup = BeautifulSoup(response.text, 'html.parser')
scraped_dataset = []
# Targeting elements using CSS selectors for precision (.item-row)
rows = soup.select('.item-row')
for row in rows:
title_element = row.find('h2', class_='headline-text')
link_element = row.find('a', href=True)
if title_element and link_element:
# Isolates inner nested string contents away from structural visual layout tag tags
scraped_dataset.append({
"title": title_element.get_text(strip=True),
"link": link_element['href']
})
return json.dumps(scraped_dataset, indent=4)
Recruiter Note:
Anti-Fingerprinting Protocols: Implementing custom browser metadata signatures (User-Agent) shows a clear understanding of web operations and how to prevent immediate automated anti-bot responses.
Project 3: Full-Stack Web Server Architecture
- The Problem: Modern applications need a reliable way to collect, process, and log user registrations without losing data during concurrent traffic.
- The Solution: A lightweight Flask server that handles multi-method HTTP requests, parses web forms safely, and manages a persistent local database log using Python's native filesystem tools. Demonstrates web server routing, online form tracking, and simple data storage.
from flask import Flask, render_template, request, redirect, url_for
import csv
# Initialize core web application architectural server scope blocks
app = Flask(__name__)
# Register exact application route entry pathways along with acceptable HTTP client verbs
@app.route('/register', methods=['GET', 'POST'])
def process_client_registration():
if request.method == 'POST':
# Safely parse multipart incoming user web forms into clean key-value dictionary maps
form_payload = request.form.to_dict()
# Open lower filesystem disk files to record incoming state tracking matrices natively
with open('database_logs.csv', mode='a', newline='', encoding='utf-8') as database_file:
csv_writer = csv.writer(database_file)
csv_writer.writerow([form_payload.get('username'), form_payload.get('email')])
# Redirect route structures to clean view templates
return redirect(url_for('process_client_registration', status='success'))
# Ingest assets, combine dynamic Jinja attributes, and flush clean string HTML rows to browsers
return render_template('register.html', title="Account Onboarding Matrix Space")
if __name__ == '__main__':
app.run(port=8080)
Recruiters Note: Post-Redirect-Get (PRG) Pattern: By using redirect(url_for(...)), it shows a web design practice that prevent accidental duplicate database entries.
Project 4: Web Automation & Testing Suite
- The Problem: Manual UI testing is slow, expensive, and prone to human error when verifying core e-commerce or user portal functions.
- The Solution: An automated Quality Assurance (QA) script that launches an independent browser instance, navigates complex element maps, and simulates human interactions reliably. Demonstrates frontend testing and programmatic control over desktop browser windows.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def execute_automated_qa_test_pipeline():
# 1. ORCHESTRATION: Spawn a fresh desktop Google Chrome browser instance controlled by code
driver = webdriver.Chrome()
# 2. NAVIGATION: Direct the browser to the target application dashboard
driver.get("https://platform-enterprise-portal.com/dashboard")
try:
# 3. EXPLICIT ASYNC WAIT: Pause execution for up to 15 seconds until the button is clickable
# This prevents the script from crashing due to slow network lag or delayed UI animations
actionable_button = WebDriverWait(driver, 15).until(
EC.element_to_be_clickable((By.CSS_SELECTOR, "button.checkout-action-trigger"))
)
# 4. USER SIMULATION: Fire a physical programmatic mouse click on the targeted button
actionable_button.click()
# 5. XPATH TARGETING: Locate the input field using structural HTML coordinate layout maps
input_data_field = driver.find_element(By.開, "//input[@name='invoice-id-field']")
# 6. KEYBOARD SIMULATION: Type raw text strings directly into the active text input box
input_data_field.send_keys("INV-2026-00981")
# Submit the transactional form by locating its unique DOM ID attribute
driver.find_element(By.ID, "submit-transaction-form").click()
print("UI automation completed successfully with zero active race conditions.")
except Exception as automated_test_pipeline_error:
# 7. ERROR CATCHING: Gracefully capture any failures (like a missing button or server timeout)
print(f"Automation execution halted: {automated_test_pipeline_error}")
finally:
# 8. RESOURCE CLEANUP: Always shut down the browser engine threads and free up system memory
driver.quit()
Recruiter Note:
Dynamic Synchronization (Explicit Waits): Avoided the mistake of using hard-coded time.sleep(). Utilizing WebDriverWait demonstrates the ability to build fast, robust automation that dynamically syncs with network latency and asynchronous UI rendering.
Project 5: Predictive Data Science Pipeline
- The Problem: Raw data is messy and useless until it is cleaned and turned into a predictive tool.
- The Solution: A pipeline that ingests CSV files, cleans missing data on the fly, trains a K-Nearest Neighbors model, and saves the "brain" for instant reuse. Demonstrates loading data spreadsheets, training mathematical algorithms, and saving intelligence.
import pandas as pd
import joblib
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
def build_predictive_pipeline(csv_path):
# 1. INGEST & CLEAN: Load spreadsheet and fix empty cells by copying the row above
df = pd.read_csv(csv_path)
df = df.fillna(method='ffill')
# 2. FEATURE SELECTION: Split table vertically into inputs (X) and answers (y)
X = df.iloc[:, :-1].values # All columns except the last one
y = df.iloc[:, -1].values # Only the very last column
# 3. TRAIN/TEST SPLIT: Reserve 25% of data for a final exam to prevent cheating/memorization
# random_state=42 guarantees the data shuffles the exact same way every time
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=42)
# 4. MODEL COMPUTATION: Initialize KNN (plots data and classifies by 5 closest neighbors)
# .fit() handles the actual mathematical training phase
model = KNeighborsClassifier(n_neighbors=5)
model.fit(X_train, y_train)
# 5. SERIALIZATION: Freeze the trained model into a reusable file for production
joblib.dump(model, 'predictive_engine.pkl')
# Calculate accuracy score against the hidden test data
accuracy = model.score(X_test, y_test) * 100
print(f"Model saved! Test Accuracy: {accuracy:.2f}%")
if __name__ == '__main__':
build_predictive_pipeline('user_data.csv')
Recruiter Note:
Model Serialization (joblib): Freezing the model as a binary file separates the heavy data-training phase from instant real-time web deployment.
Reproducible Workflows: Using a fixed random seed ensures completely consistent accuracy scores and data shuffles across different systems.