memoryfm.from_lastfmstats#

memoryfm.from_lastfmstats(file, file_type, tz=None)#

Create a ScrobbleLog from a JSON/CSV export obtained from lastfmstats.

Parameters:
filePathLike or TextIOBase object.
  • A pathlib path, or

  • A string corresponding to a path, such as /home/username/Documents/filename, or

  • A TextIOBase object having a read() method.

file_typeLiteral[“json”, “csv”]

The type of file must either be ‘json’ or ‘csv’.

tzstr, default None

IANA Timezone string.

If not passed, attempt to use tzlocal.get_localzone_name to calculate it. If tzlocal is not found, default to ‘Etc/UTC’.

Returns:
ScrobbeLog