calliope.tracker

Export data from the Tracker desktop search engine.

See also: cpe tracker command.

Package Contents

Classes

ContentResolver

Interface for modules that can resolve playable tracks.

TrackerClient

Helper functions for querying from the user's Tracker database.

Functions

annotate_images(tracker, playlist)

Resolve images from local media-art cache.

resolve_content(tracker, playlist, *args, **kwargs)

Resolve content locations from the local filesystem.

resolve_image(tracker, playlist)

Resolve image from local media-art cache.

expand_tracks(tracker, playlist)

Expand an album item into a list of the album's tracks.

Attributes

TRACKER_INDEXER

class calliope.tracker.ContentResolver

Interface for modules that can resolve playable tracks.

abstract authenticate()
abstract resolve_content(playlist)
Parameters:

playlist (calliope.playlist.Playlist) –

Return type:

calliope.playlist.Playlist

calliope.tracker.TRACKER_INDEXER = 'org.freedesktop.Tracker3.Miner.Files'
class calliope.tracker.TrackerClient(http_endpoint=None)

Bases: calliope.interface.ContentResolver

Helper functions for querying from the user’s Tracker database.

This class caches a TrackerSparqlConnection and prepared SPARQL statements. For that reason it should only be used from a single thread. Create multiple instances if you need to use this from multiple threads.

QUERIES_PATH
MAX_ROW_COUNT
authenticate()

No-op as this is a local service.

query(query)

Run a single SPARQL query.

Parameters:

query (str) –

Return type:

gi.repository.Tracker.SparqlCursor

artist_id(artist_name)

Return the Tracker URN for a given artist.

Parameters:

artist_name (str) –

Return type:

str

artist_name(artist_id)

Return the name of a given artist.

Parameters:

artist_id (str) –

Return type:

str

artists_by_number_of_songs(limit=None)

Return a list of artists by number of songs known.

Parameters:

limit (int) –

albums(filter_artist_name=None, filter_album_name=None)

Return a list of releases.

Parameters:
  • filter_artist_name (str) –

  • filter_album_name (str) –

track(artist_name, track_name)

Find a specific track by name.

Tries to find a track matching the given artist and title.

Returns a playlist entry, or None.

Parameters:
  • artist_name (str) –

  • track_name (str) –

Return type:

calliope.playlist.Item

tracks(filter_artist_name=None, filter_album_name=None)

Return a list of tracks.

Parameters:
  • filter_artist_name (str) –

  • filter_album_name (str) –

Return type:

calliope.playlist.Playlist

tracks_grouped_by_album(filter_artist_name=None, filter_album_name=None, filter_track_name=None)

Return all songs matching specific search criteria.

These are grouped into their respective releases. Any tracks that aren’t present on any releases will appear last. Any tracks that appear on multiple releases will appear multiple times.

Parameters:
  • filter_artist_name (str) –

  • filter_album_name (str) –

  • filter_track_name (str) –

Return type:

calliope.playlist.Playlist

artists()

Return all artists who have at least one track available locally.

Return type:

calliope.playlist.Playlist

search(search_text)

Return a list of tracks which match ‘search_text’.

The text may be matched in the artist name, track title or album name.

Parameters:

search_text (str) –

Return type:

calliope.playlist.Playlist

resolve_content(playlist)

Resolve content locations from the local filesystem.

Parameters:

playlist (calliope.playlist.Playlist) –

Return type:

calliope.playlist.Playlist

calliope.tracker.annotate_images(tracker, playlist)

Resolve images from local media-art cache.

Parameters:
Return type:

calliope.playlist.Playlist

calliope.tracker.resolve_content(tracker, playlist, *args, **kwargs)

Resolve content locations from the local filesystem.

Parameters:

tracker (TrackerClient) –

Return type:

calliope.playlist.Playlist

calliope.tracker.resolve_image(tracker, playlist)

Resolve image from local media-art cache.

Parameters:
Return type:

calliope.playlist.Playlist

calliope.tracker.expand_tracks(tracker, playlist)

Expand an album item into a list of the album’s tracks.

Parameters:
Return type:

calliope.playlist.Playlist