lastfm_archive v0.7.1 LastfmArchive.Transform View Source

This module provides functions for reading and transforming downloaded Lastfm data.

Link to this section Summary

Functions

Read and parse a raw Lastfm JSON file from the archive for a Lastfm user

Transform a downloaded raw JSON page into a list of tab-delimited track data

Link to this section Functions

Link to this function read(user, filename) View Source
read(binary(), binary()) :: {:ok, map()} | {:error, :file.posix()}

Read and parse a raw Lastfm JSON file from the archive for a Lastfm user.

Link to this function transform(user, filename, mode \\ :tsv) View Source
transform(binary(), binary(), :atom) :: [binary()] | {:error, :file.posix()}

Transform a downloaded raw JSON page into a list of tab-delimited track data.

Example

  # transform a page of scrobbles from the file archive
  LastfmArchive.Transform.transform("a_lastfm_user", "2007/200_1.gz")

A row of tab-delimited track currently contains (if any):

  • id auto-generated by the system to uniquely identify a scrobble
  • name the track name
  • scrobble_date Unix timestamp of the scrobble date
  • scrobble_date_iso scrobble date in ISO 8601 datetime format
  • mbid MusicBrainz identifier for the track
  • url web address of the track on Last.fm
  • artist
  • artist_mbid MusicBrainz identifier for the artist
  • artist_url web address of the artist on Last.fm
  • album
  • album_mbid MusicBrainz identifier for the album