Author: Prasanna Kumar
This repository covers fundamental and intermediate Python topics, providing a structured learning path for Python enthusiasts. Each section focuses on a specific aspect of Python programming.
-
Basics 🖥️
- Introduction to Python and basic concepts.
-
Lists 📋
- Understanding lists and their usage in Python.
-
Tuples 📦
- Exploring tuples and their characteristics.
-
Dictionaries 🗃️
- Understanding dictionaries and their applications.
-
Sets 🧮
- An introduction to sets in Python and their usage.
-
Strings 📝
- Manipulating and working with strings in Python.
-
Collections 🗂️
- Overview of Python's collection modules (e.g.,
collections
).
- Overview of Python's collection modules (e.g.,
-
Itertools 🔁
- Understanding the
itertools
module for efficient iteration.
- Understanding the
-
Lambda Functions 💼
- Introduction to lambda functions for functional programming.
-
Exceptions and Errors ❌
- Handling exceptions and errors in Python.
- Logging 📜
- Utilizing the logging module for effective logging practices.
- JSON 🧾
- Working with JSON data in Python.
- Random Numbers 🎲
- Generating random numbers in Python.
- Decorators 🎨
- Understanding and using decorators in Python.
Feel free to explore each topic in detail, and don't hesitate to contribute or provide feedback. Happy learning in the Python world!
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
- SRP (Single Responsibility Principle)
- OCP (Open/Closed Principle)
- LSP (Liskov Substitution Principle)
- DIP (Dependency Inversion Principle)
- DI (Dependency Injection)
- Factory Pattern
- Singleton Pattern
- Repository Pattern
- Object Composition
- DTOs
- Decorators
- Use Case: Ensuring each data pipeline component handles only one aspect of data processing, like data cleaning or data transformation, to simplify maintenance and improve readability.
- Use Case: Designing data processing modules that can be extended with new data formats or processing algorithms without modifying existing code, facilitating easier upgrades and enhancements.
- Use Case: Using interchangeable components for data storage (like SQL databases and NoSQL databases) that can be swapped without altering the overall system behavior.
- Use Case: Decoupling data processing logic from specific data storage implementations by relying on abstractions, enabling easier changes to storage solutions without affecting the processing logic.
- Use Case: Injecting database connections or data source configurations into data processing classes to enhance testability and reduce hard dependencies on specific implementations.
- Use Case: Creating different data parser objects (like CSVParser, JSONParser) dynamically at runtime based on the input data type, without changing the core data ingestion logic.
- Use Case: Ensuring a single instance of a database connection pool or a configuration manager is used throughout a data application to manage resources efficiently.
- Use Case: Abstracting data access logic in a data warehouse or data lake, allowing business logic to interact with data storage in a uniform way, regardless of the underlying storage technology.
- Use Case: Building complex data processing workflows by composing simple, reusable data transformation objects, promoting code reuse and flexibility.
- Use Case: Using DTOs to transfer data between different layers of a data application (like between the data access layer and the business logic layer) to ensure a clean separation of concerns.
- Use Case: Adding functionalities such as logging, data validation, or caching to data processing functions dynamically without modifying their core logic.
This repository contains Jupyter notebooks covering various Object-Oriented Programming (OOP) concepts in Python. The notebooks are organized into categories such as Principles, Patterns, Encapsulation types, Core OOP Concepts, and Additional Concepts.
- Notebook: Single_Responsibility_Principle.ipynb
- Description: This principle states that a class should have only one reason to change, meaning that a class should only have one job or responsibility.
- Notebook: Open_Closed_Principle_(OCP).ipynb
- Description: This principle states that software entities should be open for extension but closed for modification.
- Notebook: Liskov_Substitution_Principle_(LSP).ipynb
- Description: This principle states that objects of a superclass should be replaceable with objects of a subclass without affecting the functionality.
- Notebook: Dependency_Inversion_Principle_(DIP).ipynb
- Description: This principle states that high-level modules should not depend on low-level modules. Both should depend on abstractions.
- Notebook: Dependency_Injection_(DI)_principle.ipynb
- Description: Dependency Injection is a technique where one object supplies the dependencies of another object.
- Notebook: Factory_pattern.ipynb
- Description: The Factory pattern is used to create objects without specifying the exact class of the object that will be created.
- Notebook: Singleton_pattern.ipynb
- Description: The Singleton pattern ensures that a class has only one instance and provides a global point of access to it.
- Notebook: Repository_Pattern.ipynb
- Description: The Repository pattern mediates between the domain and data mapping layers, acting like an in-memory domain object collection.
- Notebook: Encapsulation_private_attribute.ipynb
- Description: Encapsulation using private attributes hides the internal state of an object and only allows access through public methods.
- Notebook: Encapsulation_protected_attribute.ipynb
- Description: Encapsulation using protected attributes allows access within the same package or subclasses.
- Notebook: Encapsulation_public_attribute.ipynb
- Description: Encapsulation using public attributes allows unrestricted access to the attribute.
- Notebook: Abstraction.ipynb
- Description: Abstraction involves hiding complex implementation details and showing only the necessary features of an object.
- Notebook: Inheritance.ipynb
- Description: Inheritance allows a new class to inherit the properties and methods of an existing class.
- Notebook: Polymorphism.ipynb
- Description: Polymorphism allows objects of different classes to be treated as objects of a common superclass, typically using methods to perform different tasks based on the object’s class.
- Notebook: Object_Composition.ipynb
- Description: Object Composition is a design principle where objects are composed of other objects to achieve functionality.
- Notebook: Data_Transfer_Objects_(DTOs).ipynb
- Description: DTOs are objects that carry data between processes to reduce the number of method calls.
- Notebook: Decorators.ipynb
- Description: Decorators are a design pattern in Python that allows a user to add new functionality to an existing object without modifying its structure.
This repository serves as a comprehensive resource for understanding and implementing key OOP concepts in Python. Each notebook provides detailed explanations, examples, and code snippets to help you grasp these fundamental principles and patterns.