A collection of Python programs demonstrating Object-Oriented Programming (OOP) concepts such as classes, objects, inheritance, polymorphism, encapsulation, and abstraction.
This repository was created for learning and practicing OOP in Python.
This project is a simple Music Library Management System built using Object-Oriented Programming (OOP) concepts in Python. It demonstrates how classes and objects can be used to model real-world entities such as songs, artists, and a music library.
The project focuses on organizing songs by artists and displaying them in a structured format while applying core OOP principles.
-
Create song objects with:
- Title
- Duration (minutes and seconds)
- Release date
-
Create artist objects that can manage multiple songs.
-
Store multiple artists in a music library.
-
Display all artists along with their songs.
-
Search for artists in the library (basic implementation).
The project defines three main classes:
- Song – Represents a song with its title, duration, and release date.
- Artist – Represents an artist and maintains a collection of songs.
- MusicLibrary – Represents the overall music library containing multiple artists.
Each class stores its own data and provides methods to interact with that data instead of accessing it directly.
An Artist contains multiple Song objects, and a MusicLibrary contains multiple Artist objects. This demonstrates object composition, where larger objects are built using smaller related objects.
Each class initializes its attributes through constructors, ensuring every object starts with the required information.
Methods such as add_songs(), add_artist(), pr_song(), pr_artist(), and list_all_songs() define the behavior of each object.
MusicLibrary
│
├── Artist
│ ├── Song 1
│ ├── Song 2
│ └── ...
│
├── Artist
│ ├── Song 1
│ └── ...
--- Library Song List ---
Artist of these songs is: "Kaavish" | Songs are 2
The title of song is "dekkho" and the duration is 3:45 minutes and song released on 2008-03-01.
The title of song is "morey saiyan" and the duration is 4:05 minutes and song released on 2008-03-01.
Artist of these songs is: "Atif" | Songs are 1
The title of song is "Tery bin" and the duration is 4:13 minutes and song released on 2006-08-07.
- Python 3
datetimemodule
- Improve the artist search functionality.
- Add support for albums and playlists.
- Read and save data using files or a database.
- Implement song deletion and editing.
- Add a menu-driven or graphical user interface.
This project helped reinforce the following Python concepts:
- Object-Oriented Programming (OOP)
- Classes and Objects
- Constructors
- Lists of Objects
- Composition
- Method Design
- Working with Python's
datetimemodule
This project was created as a practice exercise to strengthen Python OOP fundamentals by building a simple yet organized music library system.