View Source LastfmArchive.Behaviour.Archive behaviour (lastfm_archive v0.10.3)

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

Optionally applies post-archive side effects such as archive transformation or loading.

Archives all scrobbles data for a Lastfm user.

Returns metadata of an existing archive.

Read access to the archive, returns an Explorer DataFrame for further data manipulation.

Writes latest metadata to file.

Types

Callbacks

Link to this callback

after_archive(metadata, transformer, options)

View Source (optional)
@callback after_archive(metadata(), transformer(), options()) ::
  {:ok, metadata()} | {:error, term()}

Optionally applies post-archive side effects such as archive transformation or loading.

Link to this callback

archive(metadata, options, api)

View Source (optional)
@callback archive(metadata(), options(), api()) :: {:ok, metadata()} | {:error, term()}

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.

@callback describe(user(), options()) :: {:ok, metadata()} | {:error, term()}

Returns metadata of an existing archive.

@callback read(metadata(), options()) :: {:ok, Explorer.DataFrame.t()} | {:error, term()}

Read access to the archive, returns an Explorer DataFrame for further data manipulation.

Link to this callback

update_metadata(metadata, options)

View Source
@callback update_metadata(metadata(), options()) :: {:ok, metadata()} | {:error, term()}

Writes latest metadata to file.