View Source LastfmArchive.Behaviour.Archive behaviour (lastfm_archive v1.2.1)
Behaviour of a Lastfm archive.
An archive contains transformed or scrobbles data retrieved from Lastfm API. It can be based upon various storage implementation such as file systems and databases.
Summary
Callbacks
Archives all scrobbles data for a Lastfm user.
Returns metadata of an existing archive.
Optionally applies post-archive side effects such as transformation into columnar storage.
Read access to the archive, returns an Explorer DataFrame for further data manipulation.
Writes latest metadata to file.
Types
@type api() :: LastfmArchive.LastfmClient.LastfmApi.t()
@type metadata() :: LastfmArchive.Archive.Metadata.t()
@type options() :: keyword()
@type scrobbles() :: map()
@type transformer() :: module()
@type user() :: binary()
Callbacks
Archives all scrobbles data for a Lastfm user.
Optional for post-hoc archives that are based on existing local archive such as CSV, Parquet archives.
Returns metadata of an existing archive.
@callback post_archive(metadata(), transformer(), options()) :: {:ok, metadata()} | {:error, term()}
Optionally applies post-archive side effects such as transformation into columnar storage.
@callback read(metadata(), options()) :: {:ok, Explorer.DataFrame.t()} | {:error, term()}
Read access to the archive, returns an Explorer DataFrame for further data manipulation.
Writes latest metadata to file.