Skip to content

Latest commit

 

History

History

README.md

Python Decorators Projects

This repository contains practical Python projects demonstrating the use of decorators for improving code quality, debugging, monitoring, and application logging.

Decorators are an important feature of Python and are widely used in web frameworks, APIs, machine learning pipelines, automation scripts, and production applications.


Projects Included

1. Performance Profiler

Measure the execution time of Python functions using a custom Timing Decorator.

Features

  • Measure execution time
  • Decorate multiple functions
  • Display runtime statistics
  • Improve performance analysis

Topics Covered

  • Decorators
  • Nested Functions
  • Wrapper Functions
  • *args and **kwargs
  • time module

2. Application Logger

Automatically log function execution details using a custom Logging Decorator.

Features

  • Log function calls
  • Log arguments
  • Log return values
  • Handle exceptions
  • Save logs to a file

Topics Covered

  • Decorators
  • Logging Module
  • Exception Handling
  • Wrapper Functions
  • File Logging

Python Concepts Covered

  • Decorators
  • Wrapper Functions
  • Nested Functions
  • *args
  • **kwargs
  • Logging
  • Performance Monitoring
  • Exception Handling

Technologies

  • Python 3
  • Google Colab

Learning Outcomes

After completing these projects you will understand:

  • How decorators work internally
  • How to write reusable decorators
  • Measuring execution time
  • Logging function execution
  • Improving debugging and maintainability
  • Real-world use of decorators in production applications