README
š 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
- ā¢Open Source - Contribute to Python projects on GitHub
- ā¢Specialization - Deep dive into web dev, data science, or DevOps
- ā¢System Design - Learn to design larger systems
- ā¢Advanced Topics - Explore async, metaprogramming, C extensions
- ā¢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! š