An open API service indexing awesome lists of open source software.

https://github.com/jarrarshahid/oop

OOP is a comprehensive repository covering OOP principles, SOLID design patterns, real-world applications, and API development with Flask & FastAPI. It includes advanced concepts like metaclasses, multiple inheritance, and dependency injection, along with full-fledged projects using SQLite/PostgreSQL. Perfect for begginers and advanced programmers.
https://github.com/jarrarshahid/oop

advanced-python backend-development cli-tools design-patterns employee-management fastapi flask inventory-management-system object-oriented-programming object-oriented-programming-python oop python real-world-applications software-architecture solid-principles sqlalchemy sqlite todo-app

Last synced: 25 days ago
JSON representation

OOP is a comprehensive repository covering OOP principles, SOLID design patterns, real-world applications, and API development with Flask & FastAPI. It includes advanced concepts like metaclasses, multiple inheritance, and dependency injection, along with full-fledged projects using SQLite/PostgreSQL. Perfect for begginers and advanced programmers.

Awesome Lists containing this project

README

          

# OOP ๐Ÿš€
A **comprehensive** repository showcasing **Object-Oriented Programming (OOP) in Python**, including **fundamental concepts, SOLID principles, design patterns, real-world applications, and advanced topics**.

## ๐Ÿ“Œ Features
โœ” **OOP Fundamentals** - Encapsulation, Inheritance, Polymorphism, and Abstraction
โœ” **SOLID Principles** - Best practices for writing maintainable OOP code
โœ” **Design Patterns** - Singleton, Factory, Observer, Strategy, and more
โœ” **Real-World Applications** - Bank management, E-commerce, Student management
โœ” **Advanced OOP Topics** - Metaclasses, Dependency Injection, Operator Overloading
โœ” **Mini Projects** - To-Do App, Employee Management, Inventory System
โœ” **API Development** - OOP with Flask & FastAPI
โœ” **Interactive Learning** - Jupyter Notebooks with in-depth explanations
โœ” **Automated Testing** - Unit tests with `pytest`
โœ” **CI/CD Pipeline** - GitHub Actions for continuous integration

---

## ๐Ÿ“‚ Folder Structure

```
OOP/
โ”‚โ”€โ”€ README.md # Overview of the repo and concepts covered
โ”‚โ”€โ”€ requirements.txt # List of dependencies
โ”‚โ”€โ”€ main.py # Entry point for OOP demonstration
โ”‚โ”€โ”€ .gitignore # Ignore unnecessary files
โ”‚
โ”œโ”€โ”€ basics/ # Fundamental OOP concepts
โ”‚ โ”œโ”€โ”€ encapsulation.py
โ”‚ โ”œโ”€โ”€ inheritance.py
โ”‚ โ”œโ”€โ”€ polymorphism.py
โ”‚ โ”œโ”€โ”€ abstraction.py
โ”‚
โ”œโ”€โ”€ solid_principles/ # SOLID principles in OOP
โ”‚ โ”œโ”€โ”€ single_responsibility.py
โ”‚ โ”œโ”€โ”€ open_closed.py
โ”‚ โ”œโ”€โ”€ liskov_substitution.py
โ”‚ โ”œโ”€โ”€ interface_segregation.py
โ”‚ โ”œโ”€โ”€ dependency_inversion.py
โ”‚
โ”œโ”€โ”€ design_patterns/ # Common design patterns
โ”‚ โ”œโ”€โ”€ singleton.py
โ”‚ โ”œโ”€โ”€ factory.py
โ”‚ โ”œโ”€โ”€ observer.py
โ”‚ โ”œโ”€โ”€ strategy.py
โ”‚ โ”œโ”€โ”€ adapter.py
โ”‚ โ”œโ”€โ”€ command.py
โ”‚ โ”œโ”€โ”€ prototype.py
โ”‚ โ”œโ”€โ”€ mediator.py
โ”‚ โ”œโ”€โ”€ composite.py
โ”‚ โ”œโ”€โ”€ mvc_pattern.py
โ”‚
โ”œโ”€โ”€ real_world_examples/ # Practical implementations
โ”‚ โ”œโ”€โ”€ bank_management.py
โ”‚ โ”œโ”€โ”€ e_commerce.py
โ”‚ โ”œโ”€โ”€ student_management.py
โ”‚ โ”œโ”€โ”€ game_dev.py # OOP in game development (Pygame)
โ”‚ โ”œโ”€โ”€ ml_pipeline.py # OOP in ML (Scikit-Learn)
โ”‚ โ”œโ”€โ”€ gui_app.py # OOP in GUI development (Tkinter/PyQt)
โ”‚
โ”œโ”€โ”€ flask_api/ # OOP in API development with Flask
โ”‚ โ”œโ”€โ”€ models.py
โ”‚ โ”œโ”€โ”€ routes.py
โ”‚ โ”œโ”€โ”€ app.py
โ”‚
โ”œโ”€โ”€ fastapi/ # OOP with FastAPI
โ”‚ โ”œโ”€โ”€ models.py
โ”‚ โ”œโ”€โ”€ routes.py
โ”‚ โ”œโ”€โ”€ main.py
โ”‚
โ”œโ”€โ”€ advanced/ # Advanced OOP concepts
โ”‚ โ”œโ”€โ”€ metaclasses.py
โ”‚ โ”œโ”€โ”€ multiple_inheritance.py
โ”‚ โ”œโ”€โ”€ operator_overloading.py
โ”‚ โ”œโ”€โ”€ dependency_injection.py
โ”‚
โ”œโ”€โ”€ projects/ # Mini OOP-based projects
โ”‚ โ”œโ”€โ”€ todo_app/
โ”‚ โ”œโ”€โ”€ employee_management/
โ”‚ โ”œโ”€โ”€ inventory_system/
โ”‚
โ”œโ”€โ”€ tests/ # Unit tests for OOP concepts
โ”‚ โ”œโ”€โ”€ test_basics.py
โ”‚ โ”œโ”€โ”€ test_design_patterns.py
โ”‚ โ”œโ”€โ”€ test_real_world_examples.py
โ”‚ โ”œโ”€โ”€ helpers.py # Reusable test utilities
โ”‚
โ”œโ”€โ”€ notebooks/ # Jupyter Notebooks for interactive learning
โ”‚ โ”œโ”€โ”€ OOP_Introduction.ipynb
โ”‚ โ”œโ”€โ”€ SOLID_Principles.ipynb
โ”‚ โ”œโ”€โ”€ Design_Patterns.ipynb
โ”‚
โ”œโ”€โ”€ docs/ # Additional documentation & UML diagrams
โ”‚ โ”œโ”€โ”€ OOP_Concepts.md
โ”‚ โ”œโ”€โ”€ SOLID_Principles.md
โ”‚ โ”œโ”€โ”€ Design_Patterns.md
โ”‚ โ”œโ”€โ”€ UML_Diagrams/
โ”‚
โ””โ”€โ”€ .github/workflows/ # GitHub Actions for CI/CD
โ”œโ”€โ”€ ci.yml # Automated testing workflow
```

---

## ๐ŸŽฏ How to Use

### ๐Ÿ”ง Setup
1. Clone the repository:
```sh
git clone https://github.com/JarrarShahid/OOP.git
cd OOP
```
2. Create a virtual environment (optional but recommended):
```sh
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
```
3. Install dependencies:
```sh
pip install -r requirements.txt
```

### ๐Ÿš€ Running the Project
- To explore OOP concepts, run:
```sh
python main.py
```
- To execute a specific example, run the corresponding Python script:
```sh
python basics/encapsulation.py
```

### ๐Ÿงช Running Tests
- Execute unit tests using `pytest`:
```sh
pytest tests/
```

---

## ๐Ÿ“– Resources
- [Python OOP Documentation](https://docs.python.org/3/tutorial/classes.html)
- [SOLID Principles Explained](https://en.wikipedia.org/wiki/SOLID)
- [Design Patterns in Python](https://refactoring.guru/design-patterns/python)

---

## ๐Ÿ“œ License
This project is licensed under the **MIT License**. Feel free to use and modify it.

---

## โญ Contributing
Contributions are welcome! If you'd like to improve this project, please follow these steps:
1. Fork the repo
2. Create a new branch (`git checkout -b feature-branch`)
3. Commit your changes (`git commit -m "Added new feature"`)
4. Push to your fork and submit a **Pull Request**

---

## ๐ŸŽฏ Contact
If you have any questions, feel free to reach out:
๐Ÿ“ง Email: jarrarshahid@gmail.com
๐Ÿ™ GitHub: JarrarShahid

---

๐Ÿ”ฅ **This repo is the ultimate resource for mastering OOP in Python. Give it a star โญ if you find it useful!** ๐Ÿš€