In this “mini-project” you will be creating your own command-line based music search utility using Python3 and the Mutagen ID3tag library.
Using the example attached example code (and previous python labs) as a starting point, write a Python program which can be invoked as follows:
(python) musicSearch.py [–artist=artistname] [–song=songname] [–album=albumname] fileGlob.
- You should be able to search for “artist”, “song”, or “album” (and any others that you wish to add).
- If you wish, you may limit the search to just one of artist, song, album at a time, or allow for multiple parameters.
- The search target should be a regular expression.
- The “FileGlob” should search for the correct file type in the specified directory.
For example, the command: musicSearch.py –artist=”^.*sh$” c:temp
(NOTE: Depending on the command shell, you may need to “quote” any arguments that could be interpreted as a special symbol by the shell interpreter itself, just like you would for spaces in a filename.)
for example: musicSearch.py “–artist=^.*sh$” “c:some_folder”
Yields (as a sample):
File Title Artist Album
Bouncing.mp3 Bouncing Around the Room Phish A Live One
Gumbo.mp3 Gumbo Phish A Live One
Simple.mp3 Simple Phish A Live One
Landlady.mp3 The Landlady Phish A Picture of Nectar
Glide.mp3 Glide Phish A Picture of Nectar
Tweezer_Reprise.mp3 Tweezer Reprise Phish A Picture of Nectar
Free.mp3 Free Phish Billy Breathes
Character_Zero.mp3 Character Zero Phish Billy Breathes
Steep.mp3 Steep Phish Billy Breathes
Caspian.mp3 Prince Caspian Phish Billy Breathes
The_Curtain_With.mp3 The Curtain With Phish Colorado ’88 (disc1)
The_Sloth.mp3 The Sloth Phish Colorado ’88 (disc1)
Corinna.mp3 Corinna Phish Colorado ’88 (Disc 3)
Thank_You.mp3 Thank You Phish Colorado ’88 (Disc 3)
Farmhouse.mp3 Farmhouse Phish Farmhouse
Twist.mp3 Twist Phish Farmhouse
Bug.mp3 Bug Phish Farmhouse
Finding_My_Way.mp3 Finding My Way Rush Chronicles
Working_Man.mp3 Working Man Rush Chronicles
Fly_by_Night.mp3 Fly by Night Rush Chronicles
Anthem.mp3 Anthem Rush Chronicles
Fly_By_Night.mp3 Fly By Night Rush Different Stages (disk 3)
Cinderella_Man.mp3 Cinderella Man Rush Different Stages (disk 3)
Natural_Science.mp3 Natural Science Rush Different Stages [Disc 2]
The_Spirit_Of_Radio.mp3 The Spirit Of Radio Rush Different Stages [Disc 2]
Tom_Sawyer.mp3 Tom Sawyer Rush Different Stages [Disc 2]
YYZ.mp3 YYZ Rush Different Stages [Disc 2]
Summertime_Blues.mp3 Summertime Blues Rush Feedback
Crossroads.mp3 Crossroads Rush Feedback
Found 29 Matches