from attr import attrib, attrs @attrs class Track: artists = attrib(type=list) id = attrib(type=str) change = attrib(type=int) is_starred_track = attrib(type=bool) is_sony = attrib(type=bool) isrc = attrib(type=str) is_re_enter = attrib(type=bool) chart_date = attrib(type=str) is_new = attrib(type=bool) artist = attrib(type=str) position = attrib(type=int) image_url = attrib(type=str) name = attrib(type=str) streams = attrib(default=None) trend = attrib(type=int, default=None) distributed_by = attrib(default=None) @attrs class ChartMovesResponse: count = attrib(type=int) previous = attrib(type=int) next = attrib(type=int) tracks = attrib(converter=lambda kvs: [Track(**kv) for kv in kvs]) chart_date = attrib(type=str) available = attrib(type=bool)