<commit_before>from datetime import datetime
import spotipy


class SpotifyItem(object):

    def __init__(self, **entries):
        self.__dict__.update(entries)
        self._client = spotipy.Spotify()


class Artist(SpotifyItem):

    def __init__(self, **entries):
        super(Artist, self).__init__(**entries)


class Album(SpotifyItem):

    def __init__(self, **entries):
        super(Album, self).__init__(**entries)


class Track(SpotifyItem):

    def __init__(self, **entries):
        super(Track, self).__init__(**entries)
        self.album = Album(**self.album)
        self.artists = [Artist(**a) for a in self.artists]


class PlaylistEntry(SpotifyItem):

    def __init__(self, **entries):
        super(PlaylistEntry, self).__init__(**entries)
        self.track = Track(**self.track)
        self.added_at = datetime.strptime(self.added_at, '%Y-%m-%dT%H:%M:%SZ')
        self.added_date = self.added_at.date()<commit_msg>Add playlist class<commit_after>from datetime import datetime
import spotipy


class SpotifyItem(object):

    def __init__(self, **entries):
        self.__dict__.update(entries)
        self._client = spotipy.Spotify()


class Artist(SpotifyItem):

    def __init__(self, **entries):
        super(Artist, self).__init__(**entries)

    def __repr__(self):
        return 'Artist: {0}'.format(self.name)


class Album(SpotifyItem):

    def __init__(self, **entries):
        super(Album, self).__init__(**entries)

    def __repr__(self):
        return 'Album: {0}'.format(self.name)


class Track(SpotifyItem):

    def __init__(self, **entries):
        super(Track, self).__init__(**entries)
        self.album = Album(**self.album)
        self.artists = [Artist(**a) for a in self.artists]

    def __repr__(self):
        return 'Track: {0}'.format(self.name)


class Playlist(SpotifyItem):

    def __init__(self, **entries):
        super(Playlist, self).__init__(**entries)
        self.url = self.external_urls['spotify']
        del self.external_urls

    def __repr__(self):
        return 'Playlist: {0}'.format(self.name)


class PlaylistEntry(SpotifyItem):

    def __init__(self, **entries):
        super(PlaylistEntry, self).__init__(**entries)
        self.track = Track(**self.track)
        self.added_at = datetime.strptime(self.added_at, '%Y-%m-%dT%H:%M:%SZ')
        self.added_date = self.added_at.date()

    def __repr__(self):
        return 'PlaylistEntry: {0}'.format(self.track.name)
{'fraction_non_alphanumeric': 0.146163215590743, 'fraction_numerical': 0.0020300446609825416, 'mean_word_length': 3.361061946902655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4466874', 'n_tokens_mistral': 835, 'n_tokens_neox': 787, 'n_words': 151}