Welcome to the Fail-Proof, Hands-On Python Learning Plan for DevOps Engineers! This repo is designed to help you build real-world automation skills in Python, step by step.
β±οΈ Avg Time: 30 mins/day | π Format: Concept β Code β Real Use | π» Focus: DevOps, Infra, Automation
| Day | Topic | Concepts | Mini Project/Script |
|---|---|---|---|
| 1 | Setup & Print | Python install, VS Code, print() |
Hello Python DevOps Script |
| 2 | Variables | str, int, bool, list |
Server inventory with metadata |
| 3 | Input + f-strings | input(), f"..." |
Ask server name, print status |
| 4 | Conditions | if/elif/else |
Health checker logic |
| 5 | Loops | for, while |
Service restart loop |
| 6 | Functions | def, return |
Wrap logic into check_status() |
| 7 | Modules | os, sys |
File Checker Module |
| Day | Topic | Concepts | Mini Project/Script |
|---|---|---|---|
| 8 | Read Files | open(), read() |
Read server list from file |
| 9 | Write/Append | 'w', 'a' |
Write output to log file |
| 10 | CLI Args | sys.argv |
Pass input/output file to script |
| 11 | Exceptions | try/except |
Handle missing files |
| 12 | Shell Commands | subprocess.run() |
Run ping, kubectl |
| 13 | JSON Configs | json.load() |
Read config.json |
| 14 | YAML Parsing | pyyaml, configparser |
Parse NGINX config |
| Day | Topic | Concepts | Mini Project/Script |
|---|---|---|---|
| 15 | System Monitor | psutil |
Alert on CPU > 80% |
| 16 | File Backup | shutil, os.path |
Backup config with timestamp |
| 17 | Email Alert | smtplib |
Email on disk full |
| 18 | API Calls | requests.get() |
Get GitHub user data |
| 19 | Git Automate | subprocess |
Git pull & log checker |
| 20 | HTTP Server | http.server |
Serve local log files |
| 21 | Env Vars | os.environ |
Load credentials securely |
| Day | Topic | Concepts | Mini Project/Script |
|---|---|---|---|
| 22 | Errors Deep Dive | Custom exceptions | Retry on connection fail |
| 23 | Dictionaries | dict, loops |
Server metadata handler |
| 24 | OOP Basics | class, __init__ |
Server class abstraction |
| 25 | External Libs | pip install, tabulate |
Pretty report |
| 26 | SDKs & Cloud | azure, boto3 |
List Azure/AWS resources |
| 27 | CI/CD Scripts | GitHub/Jenkins logic | Version bump, tag script |
| 28 | Logging | logging |
Replace print in scripts |
| 29 | Templating | jinja2 |
Generate config from template |
| 30 | Review & Reflect | Git cleanup, README | Final commit, push to GitHub |
-
Clone the Repository
git clone https://github.com/yourusername/python-30days.git cd python-30days
-
Set Up Environment
python -m venv venv .\venv\Scripts\Activate.ps1 pip install -r requirements.txt
-
Start Learning!
- Begin with Week 1, Day 1
- Complete daily challenges
- Track your progress
- Share your solutions
- Day 1: Hello DevOps - Your First Automation Script
- Day 2: Server Inventory Management
- Day 3: Interactive Status Checker
- Day 4: Health Monitoring System
- Day 5: Service Management
- Day 6: Status Check Functions
- Day 7: File Operations & Logging
- Day 8-9: Robust Error Handling & Logging
- Day 10-11: Configuration Management
- Day 12: Log Analysis with Regex
- Day 13: Unit Testing Your Code
- Day 14: REST API Integration
- Day 15: Database Operations
- Day 16: Parallel Processing
- Day 17: SSH Operations
- Day 18: Alert System
- Day 19: Web Dashboard
- Day 20: Data Visualization
- Day 21: Task Scheduler
- Day 22: Docker Management
- Day 23: AWS Automation
- Day 24: Kubernetes Operations
- Day 25: CI/CD Pipeline
- Day 26: Monitoring Integration
- Day 27: Security Automation
- Day 28-30: Final Project
- Languages: Python 3.8+
- Cloud: AWS, Docker, Kubernetes
- Databases: SQLite, PostgreSQL
- Tools: Git, CI/CD, Monitoring
- Libraries: boto3, paramiko, flask
- π Detailed explanations
- π» Practical examples
- π Progressive difficulty
- π― Clear learning goals
- π Real-world projects
-
Foundation (Week 1)
- Python basics for automation
- System operations
- File handling
-
Building Blocks (Week 2)
- Error handling
- Testing
- API integration
-
Advanced Topics (Week 3)
- Database management
- Web development
- Task automation
-
Professional Skills (Week 4)
- Cloud integration
- Container orchestration
- Security automation
Your contributions are welcome! Please read our Contributing Guidelines to get started.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
- Python Documentation
- DevOps Best Practices
- AWS Documentation
- Docker Documentation
- Kubernetes Documentation
- Use pen & paper to draw flowcharts for any script
- Use
print()orlogging.debug()for step-by-step tracing - Write
assertstatements to test your logic early
python-for-devops-30day/
βββ week1/
β βββ day1_hello.py
β βββ day2_variables.py
β βββ ...
βββ week2/
βββ week3/
βββ week4/
βββ config/
β βββ config.json
β βββ config.yaml
βββ logs/
βββ README.md- π Log File Parser (Regex, File I/O)
- π Health Monitor + Email (System monitor + Alert)
- βοΈ Auto Config Generator (Template engine)
- π DevOps Toolbox CLI (OOP + CLI args + subprocess)
- Clone the repository and create a Python virtual environment
- Install required packages:
pip install -r requirements.txt - Start with Week 1, Day 1 and progress through each day
- Complete the challenges and exercises
- Use the hints and documentation when needed
Master Python for DevOps through hands-on projects! This practical, project-based course takes you from basics to advanced DevOps automation in 30 days.
- Week 1: Python Fundamentals & System Operations
- Week 2: Advanced Error Handling & API Integration
- Week 3: Database Operations & Task Automation
- Week 4: Cloud & Container Orchestration
- π¨ Practical Projects: Real-world automation tasks
- π Progressive Learning: From basics to advanced
- π οΈ Modern Tools: Docker, Kubernetes, AWS, and more
- π₯ Community Driven: Share and learn together
- Challenge: Create a simple Python script that prints "Hello DevOps" and the current time
- Skills: Basic Python syntax, importing modules (time module)
- File:
week1/day1_hello_devops.py
- Challenge: Read and display server inventory from a JSON file
- Skills: JSON handling, file operations, data structures
- File:
week1/day2_server_inventory.py - Hint: Use the
jsonmodule to parse the inventory file
- Challenge: Allow users to input server names and display their details
- Skills: User input handling, string manipulation, conditional statements
- File:
week1/day3_input_status.py - Hint: Use
.split()for handling comma-separated input
- Challenge: Create a script to check server health status
- Skills: Boolean operations, dictionaries, error handling
- File:
week1/day4_health_checker.py
- Challenge: Monitor multiple services running on servers
- Skills: Loops, lists, conditional statements
- File:
week1/day5_service_loops.py
- Challenge: Create reusable functions for checking server status
- Skills: Functions, parameters, return values
- File:
week1/day6_check_status_function.py
- Challenge: Work with system files and perform basic operations
- Skills: File handling, path operations, error handling
- File:
week1/day7_file_checker.py
- Challenge: Implement proper error handling in server operations
- Skills: Try-except blocks, raising exceptions
- File:
week2/day8_error_handling.py
- Challenge: Add logging to server monitoring scripts
- Skills: Python logging module, file handlers
- File:
week2/day9_logging_impl.py
- Challenge: Create a configuration management system
- Skills: ConfigParser, YAML handling
- File:
week2/day10_config_management.py
- Challenge: Add CLI arguments to your scripts
- Skills: argparse module, command line interfaces
- File:
week2/day11_cli_arguments.py
- Challenge: Use regex for log parsing
- Skills: re module, pattern matching
- File:
week2/day12_regex_parser.py
- Challenge: Write tests for your server monitoring functions
- Skills: unittest module, assertions
- File:
week2/day13_unit_testing.py
- Challenge: Interact with a REST API
- Skills: requests module, HTTP methods
- File:
week2/day14_api_interaction.py
- Challenge: Store server data in a SQLite database
- Skills: SQL, sqlite3 module
- File:
week3/day15_database_ops.py
- Challenge: Implement parallel server checks
- Skills: multiprocessing, threading
- File:
week3/day16_parallel_proc.py
- Challenge: Execute commands over SSH
- Skills: paramiko module, SSH protocol
- File:
week3/day17_ssh_operations.py
- Challenge: Send email alerts for server status
- Skills: smtplib, email formatting
- File:
week3/day18_email_notifications.py
- Challenge: Create a simple web dashboard for server status
- Skills: Flask framework, basic HTML
- File:
week3/day19_web_dashboard.py
- Challenge: Create graphs of server metrics
- Skills: matplotlib, data visualization
- File:
week3/day20_data_visualization.py
- Challenge: Schedule periodic server checks
- Skills: schedule module, cron-like operations
- File:
week3/day21_scheduled_tasks.py
- Challenge: Create Docker container management scripts
- Skills: Docker SDK for Python
- File:
week4/day22_docker_integration.py
- Challenge: Work with AWS services using boto3
- Skills: boto3, AWS SDK
- File:
week4/day23_aws_integration.py
- Challenge: Manage Kubernetes resources
- Skills: kubernetes-client
- File:
week4/day24_kubernetes_integration.py
- Challenge: Create a script for CI/CD pipeline tasks
- Skills: Git integration, pipeline automation
- File:
week4/day25_cicd_pipeline.py
- Challenge: Integrate with monitoring systems
- Skills: Prometheus, Grafana APIs
- File:
week4/day26_monitoring_integration.py
- Challenge: Implement security scanning scripts
- Skills: Security tools integration
- File:
week4/day27_security_scanning.py
- Challenge: Build a complete DevOps automation tool
- Skills: All previous concepts combined
- Files:
week4/day28_final_project_part1.pyweek4/day29_final_project_part2.pyweek4/day30_final_project_part3.py
- Clone this repository
- Create a Python virtual environment
- Install required packages:
pip install -r requirements.txt - Complete each day's challenge
- Check the hints and documentation when needed
- Each script builds upon skills learned in previous days
- Focus on writing clean, well-documented code
- Test your scripts thoroughly
- Use proper error handling
- Follow Python best practices
- Basic Python automation
- System operations
- Error handling
- API integration
- Database operations
- Cloud automation
- Mobile app integration
- AI/ML integration
Need help? Check out:
- FAQ.md for common questions
- TROUBLESHOOTING.md for technical issues
- CONTRIBUTING.md for contribution guidelines