Docs

real world projects

šŸš€ Real-World Projects

šŸ“Œ What You'll Learn

  • •Apply everything from previous modules
  • •Build complete, production-quality applications
  • •Follow professional development practices
  • •Work with real-world tools and workflows

šŸŽÆ Capstone Project Ideas

1. 🌐 Web Scraper & Data Pipeline

Build a system that scrapes websites, processes data, and stores it in a database.

Technologies: BeautifulSoup/Scrapy, PostgreSQL, Celery, Pandas

Features to Implement:

# Project structure
web_scraper/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ scrapers/          # Website-specific scrapers
│   │   ā”œā”€ā”€ base.py        # Base scraper class
│   │   └── news.py        # News site scraper
│   ā”œā”€ā”€ pipeline/          # Data processing
│   │   ā”œā”€ā”€ cleaners.py    # Data cleaning functions
│   │   └── transformers.py
│   ā”œā”€ā”€ storage/           # Database operations
│   │   ā”œā”€ā”€ models.py      # SQLAlchemy models
│   │   └── repository.py  # CRUD operations
│   └── scheduler.py       # Celery tasks
ā”œā”€ā”€ tests/
ā”œā”€ā”€ config.py
└── main.py

Key Skills:

  • • Parse HTML with BeautifulSoup
  • • Handle rate limiting and retries
  • • Store data in PostgreSQL
  • • Schedule periodic tasks with Celery
  • • Visualize data with Matplotlib/Plotly

2. šŸ“Š REST API with Authentication

Build a complete REST API with user authentication, database, and deployment.

Technologies: FastAPI, SQLAlchemy, JWT, Docker, PostgreSQL

Features to Implement:

# Project structure
api_project/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ api/
│   │   ā”œā”€ā”€ routes/
│   │   │   ā”œā”€ā”€ auth.py    # Login, register, refresh
│   │   │   ā”œā”€ā”€ users.py   # User CRUD
│   │   │   └── items.py   # Item CRUD
│   │   └── dependencies.py # Auth, DB session
│   ā”œā”€ā”€ core/
│   │   ā”œā”€ā”€ config.py      # Settings
│   │   └── security.py    # JWT, hashing
│   ā”œā”€ā”€ db/
│   │   ā”œā”€ā”€ models.py      # SQLAlchemy models
│   │   └── session.py     # Database connection
│   └── schemas/           # Pydantic models
ā”œā”€ā”€ tests/
ā”œā”€ā”€ alembic/               # Database migrations
ā”œā”€ā”€ Dockerfile
ā”œā”€ā”€ docker-compose.yml
└── main.py

Key Skills:

  • • Design RESTful endpoints
  • • Implement JWT authentication
  • • Use SQLAlchemy ORM
  • • Write database migrations
  • • Add input validation with Pydantic
  • • Write API tests with pytest
  • • Containerize with Docker
  • • Document with OpenAPI

3. šŸ¤– Discord/Slack Bot

Build an interactive bot with commands, events, and database storage.

Technologies: discord.py/slack-bolt, SQLite, async Python

Features to Implement:

# Example bot features
class MyBot:
    async def on_message(self, message):
        """Handle incoming messages."""
        pass

    @command("reminder")
    async def set_reminder(self, ctx, time: str, message: str):
        """Set a reminder: !reminder 1h Do homework"""
        pass

    @command("stats")
    async def show_stats(self, ctx, user: str = None):
        """Show user statistics."""
        pass

    @command("poll")
    async def create_poll(self, ctx, question: str, *options):
        """Create a poll: !poll "Favorite color?" Red Blue Green"""
        pass

Key Skills:

  • • Handle async events
  • • Parse commands and arguments
  • • Store data persistently
  • • Schedule background tasks
  • • Handle rate limits
  • • Deploy to cloud (Heroku, Railway)

4. šŸ“ File Sync Tool

Build a tool that syncs files between local and cloud storage.

Technologies: watchdog, boto3 (AWS S3), argparse, asyncio

Features to Implement:

# CLI interface
$ filesync init --bucket my-bucket
$ filesync watch /path/to/folder
$ filesync sync --direction upload
$ filesync status
$ filesync restore file.txt --version 2

Key Skills:

  • • Monitor filesystem changes
  • • Calculate file checksums
  • • Upload/download from S3
  • • Handle conflicts
  • • Build CLI with argparse/click
  • • Implement retry logic

5. šŸ“ˆ Personal Finance Tracker

Build an app to track expenses, income, and generate reports.

Technologies: SQLite, Pandas, Matplotlib, Typer

Features to Implement:

# CLI interface
$ finance add expense --amount 50.00 --category food --description "Groceries"
$ finance add income --amount 3000 --category salary
$ finance report monthly --month 2024-01
$ finance budget set --category food --amount 500
$ finance budget status
$ finance export --format csv --output expenses.csv

Key Skills:

  • • Design database schema
  • • Build CLI interface
  • • Generate reports with Pandas
  • • Create visualizations
  • • Export to CSV/Excel
  • • Add budget alerts

6. šŸ” Password Manager

Build a secure password manager with encryption.

Technologies: cryptography, SQLite, Typer, pyperclip

Features to Implement:

# CLI interface
$ pwm init  # Set master password
$ pwm add github --username user@email.com
$ pwm get github  # Copies password to clipboard
$ pwm list
$ pwm generate --length 20 --symbols
$ pwm export --encrypted backup.pwm
$ pwm import backup.pwm

Key Skills:

  • • Implement AES encryption
  • • Secure master password handling
  • • Generate strong passwords
  • • Clipboard integration
  • • Encrypted backups

šŸ“ Professional Project Structure

my_project/
ā”œā”€ā”€ src/                    # Source code
│   └── my_project/
│       ā”œā”€ā”€ __init__.py
│       ā”œā”€ā”€ main.py         # Entry point
│       ā”œā”€ā”€ config.py       # Configuration
│       ā”œā”€ā”€ models/         # Data models
│       ā”œā”€ā”€ services/       # Business logic
│       ā”œā”€ā”€ utils/          # Helper functions
│       └── exceptions.py   # Custom exceptions
│
ā”œā”€ā”€ tests/                  # Test files
│   ā”œā”€ā”€ __init__.py
│   ā”œā”€ā”€ conftest.py         # Fixtures
│   ā”œā”€ā”€ test_models.py
│   └── test_services.py
│
ā”œā”€ā”€ docs/                   # Documentation
│   ā”œā”€ā”€ index.md
│   └── api.md
│
ā”œā”€ā”€ scripts/                # Utility scripts
│   ā”œā”€ā”€ setup_db.py
│   └── seed_data.py
│
ā”œā”€ā”€ .github/
│   └── workflows/
│       ā”œā”€ā”€ ci.yml          # CI pipeline
│       └── deploy.yml      # Deployment
│
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ .env.example            # Environment template
ā”œā”€ā”€ Dockerfile
ā”œā”€ā”€ docker-compose.yml
ā”œā”€ā”€ Makefile                # Common commands
ā”œā”€ā”€ pyproject.toml          # Project config
ā”œā”€ā”€ README.md
└── LICENSE

šŸ› ļø Development Workflow

1. Git Workflow

# Feature branch workflow
git checkout -b feature/add-user-auth
# Make changes
git add .
git commit -m "feat: add user authentication"
git push origin feature/add-user-auth
# Create Pull Request

Commit Message Convention

feat: add user registration
fix: resolve login redirect issue
docs: update API documentation
test: add unit tests for auth
refactor: extract validation logic
chore: update dependencies

2. Code Review Checklist

  • • Code follows project style guide
  • • All tests pass
  • • New code has test coverage
  • • Documentation updated
  • • No security vulnerabilities
  • • No hardcoded secrets
  • • Error handling is appropriate
  • • Performance is acceptable

3. Testing Strategy

# Unit tests - test individual functions
def test_calculate_discount():
    assert calculate_discount(100, 10) == 90

# Integration tests - test components together
def test_create_user_in_database(db_session):
    user = UserService(db_session).create_user(data)
    assert db_session.query(User).get(user.id) is not None

# End-to-end tests - test full workflows
def test_user_registration_flow(client):
    # Register
    response = client.post("/register", json=user_data)
    assert response.status_code == 201

    # Login
    response = client.post("/login", json=credentials)
    assert "access_token" in response.json()

šŸ“‹ Project Checklist

Before Starting:

  • • Define clear requirements
  • • Create project repository
  • • Set up virtual environment
  • • Initialize pyproject.toml
  • • Create basic project structure
  • • Add .gitignore

During Development:

  • • Write tests alongside code
  • • Commit frequently with clear messages
  • • Document functions and modules
  • • Review code before merging
  • • Keep dependencies updated

Before Release:

  • • All tests pass
  • • Documentation is complete
  • • README includes setup instructions
  • • Configuration is externalized
  • • Secrets are not in code
  • • Error handling is thorough
  • • Performance is acceptable
  • • Security review completed

šŸŽ“ Makefile for Common Tasks

.PHONY: install test lint format run clean

install:
	pip install -e ".[dev]"

test:
	pytest tests/ -v --cov=src

lint:
	ruff check src tests
	mypy src

format:
	ruff format src tests

run:
	python -m src.my_project.main

docker-build:
	docker build -t my_project .

docker-run:
	docker-compose up -d

clean:
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete
	rm -rf .pytest_cache .coverage htmlcov .mypy_cache

šŸ† Next Steps After Completing Projects

  1. •Open Source - Contribute to Python projects on GitHub
  2. •Specialization - Deep dive into web dev, data science, or DevOps
  3. •System Design - Learn to design larger systems
  4. •Advanced Topics - Explore async, metaprogramming, C extensions
  5. •Teaching - Help others learn Python

šŸŽ‰ Congratulations!

You've completed the Python Learning Curriculum! You now have the skills to:

  • ā€¢āœ… Write clean, Pythonic code
  • ā€¢āœ… Handle data structures and algorithms
  • ā€¢āœ… Build web applications and APIs
  • ā€¢āœ… Work with databases
  • ā€¢āœ… Write tests and documentation
  • ā€¢āœ… Debug and profile applications
  • ā€¢āœ… Deploy to production
  • ā€¢āœ… Build real-world projects

Keep building, keep learning, and happy coding! šŸ

Real World Projects - Python Tutorial | DeepML