This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
descStr = """ | |
This program creates a histogram of track year from an XML playlist file | |
exported from iTunes. | |
""" | |
parser = argparse.ArgumentParser(description=descStr) | |
group = parser.add_mutually_exclusive_group() | |
group.add_argument('--years', dest='plFile', required=False) | |
args = parser.parse_args() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plotYearHisto(fileName): | |
""" | |
Plot year histogram using XML playlist from iTunes. | |
""" | |
plist = plistlib.readPlist(fileName) | |
tracks = plist['Tracks'] | |
years = [] | |
for trackId, track in tracks.items(): | |
try: | |
years.append(track['Year']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from matplotlib import pyplot as plt | |
import plistlib | |
import numpy as np |