:py:mod:`calliope.lastfm.lastexport` ==================================== .. py:module:: calliope.lastfm.lastexport .. autoapi-nested-parse:: Script for exporting tracks through audioscrobbler API. Usage: lastexport.py -u USER [-o OUTFILE] [-p STARTPAGE] [-s SERVER] Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: calliope.lastfm.lastexport.get_options calliope.lastfm.lastexport.connect_server calliope.lastfm.lastexport.get_pageinfo calliope.lastfm.lastexport.get_tracklist calliope.lastfm.lastexport.parse_track calliope.lastfm.lastexport.write_tracks calliope.lastfm.lastexport.get_tracks calliope.lastfm.lastexport.main Attributes ~~~~~~~~~~ .. autoapisummary:: calliope.lastfm.lastexport.__version__ calliope.lastfm.lastexport.parser .. py:data:: __version__ :value: '0.0.4' .. py:function:: get_options(parser) Define command line options. .. py:function:: connect_server(server, username, startpage, sleep_func=time.sleep, tracktype='recenttracks', retry_on_error=True) Connect to server and get a XML page. .. py:function:: get_pageinfo(response, tracktype='recenttracks') Check how many pages of tracks and total tracks the user has. .. py:function:: get_tracklist(response) Read XML page and get a list of tracks and their info. .. py:function:: parse_track(trackelement) Extract info from every track entry and output to list. .. py:function:: write_tracks(tracks, outfileobj) Write tracks to an open file .. py:function:: get_tracks(server, username, startpage=1, sleep_func=time.sleep, tracktype='recenttracks', retry_on_error=True) .. py:function:: main(server, username, startpage, outfile, infotype='recenttracks') .. py:data:: parser