This project is a virtual library management system developed in Python, which uses object-oriented programming (OOP) principles to efficiently manage loans, inventory, and notifications. The goal is to provide a smooth experience for users and facilitate interaction with publications.
- 👥 User and publication management
- 📖 Loan and return control
- 🔔 Personalized notifications
- 🏗️ Modular code organization using classes, inheritance, encapsulation, polymorphism, and abstraction
- 🔧 Extensible system with a class hierarchy that includes:
- 5 main classes:
Usuario,Publicacion,Prestamo,Notificacion, andEvento - 50 specific subclasses that implement various functionalities
- 5 main classes:
- Python 3.8 or higher
- Python standard libraries (no external dependencies required)
-
Clone this repository:
git clone https://github.com/yourusername/virtual-library-system.git cd virtual-library-system -
Run the main system script:
python library_system.py
-
Interact with the main menu to perform actions such as:
- ➕ Add users
- 📚 Register publications
- 🔄 Request and return loans
- 📊 Check inventory
- 📧 Send notifications
Click the following link to run the project directly in Google Colab, without additional setup:
Sensitive attributes are protected using double underscore prefixes (__) and are only accessed through methods defined in the classes. Example:
class Usuario:
def __init__(self, nombre, id_usuario):
self.__nombre = nombre
self.__id_usuario = id_usuarioThe system structure uses inheritance to promote code reusability. For example, several subclasses of Publicacion like Libro and Revista share common attributes and methods.
class Libro(Publicacion):
def consultar_disponibilidad(self):
return f"The book '{self._titulo}' is {'available' if self._disponible else 'not available'}."Methods are redefined in subclasses to provide specific behaviors according to context.
class NotificacionCorreo(Notificacion):
def enviar_notificacion(self):
return f"Sending email to {self._usuario}: {self._mensaje}"Abstract classes define interfaces that must be implemented by their subclasses.
from abc import ABC, abstractmethod
class Notificacion(ABC):
@abstractmethod
def enviar_notificacion(self):
passOption 2: Add publication
Title: "One Hundred Years of Solitude"
Author: "Gabriel García Márquez"Option 3: Request loan
User: "Karen Cardiel"
Publication: "One Hundred Years of Solitude"Option 6: Check availability
Result: "The book 'One Hundred Years of Solitude' is not available."| Component | Description |
|---|---|
| Main Classes | Core system functionality |
| Subclasses | Specialized implementations |
| Interfaces | Abstract method definitions |
| Inheritance Tree | Hierarchical class relationships |
virtual-library-system/
├── 📝 library_system.py
├── 👥 usuario.py
├── 📚 publicacion.py
├── 🔄 prestamo.py
├── 🔔 notificacion.py
├── 📅 evento.py
└── 📖 README.md
The system was successfully developed, implementing OOP pillars and facilitating efficient management of a virtual library. This project also improved practical understanding of advanced OOP concepts and motivated research on software design best practices.
- Karen Cardiel Olea
- Elisabet Arelly Sulú Vela
- Professor: Ernesto Manuel Ihuit Dzib
- Universidad Politécnica de Yucatán
- Subject: Programming Paradigms
October 13, 2024
Note: This program was developed as part of an academic project. We hope it's useful for learning more about object-oriented programming and virtual library management! 🎓
⭐ Star this repository if you find it helpful!