Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Day 05 – Object-Oriented Python for DevOps (Basics)

Task

Today’s goal is to introduce Object-Oriented Programming (OOP) in a simple and practical way.

You will take your Day 04 Log Analyzer script and refactor it using a class-based approach.

You will:

  • Create a class to represent a Log Analyzer
  • Move related logic into class methods
  • Instantiate the class and run the analysis
  • Keep the implementation simple and readable

This task helps you understand how DevOps tools are structured internally.

Expected Output

  • One Python script (example: log_analyzer_oop.py)
  • Script should:
    • Use a class
    • Have at least 2–3 methods
    • Produce the same output as Day 04
  • Output visible in terminal (and file if you choose)

Guidelines

  • Use:
    • class to group related logic
    • __init__() to initialize values (log file path, counters, etc.)
    • Instance methods for operations (read logs, analyze logs, write summary)
  • Keep OOP light and practical
  • Do NOT use:
    • Inheritance
    • Abstract classes
    • Advanced OOP patterns
  • Follow PEP8 and Python best practices

Resources

Why This Matters for DevOps

In real DevOps work:

  • Automation scripts grow into tools
  • Tools need structure to stay maintainable
  • OOP helps group logic, state, and behavior together

Most internal DevOps tools and platforms are written using simple, practical OOP, not complex theory.

Submission

  1. Add your OOP-based script inside the day-05 folder
  2. Ensure the script runs successfully
  3. Verify output matches Day 04 behavior
  4. Commit and push your changes to your fork

Learn in Public

Share your progress on LinkedIn:

  • Post a small snippet showing your class definition
  • Mention how OOP improved code structure
  • Write 2–3 lines on what you learned today

Optional:

  • Tag TrainWithShubham or Shubham Londhe
  • Use hashtags: #PythonForDevOps #TrainWithShubham #DevOpsKaJosh (Helps me to filter and engage)

Happy Learning
TrainWithShubham