Recently used files

XDG recent file storage specification

class xdg.RecentFiles.RecentFiles[source]
addFile(item, mimetype, groups=None, private=False)[source]

Add a recently used file.

item should be the URI of the file, typically starting with file:///.


Remove a recently used file, by URI, from the list.

getFiles(mimetypes=None, groups=None, limit=0)[source]

Get a list of recently used files.

The parameters can be used to filter by mime types, by group, or to limit the number of items returned. By default, the entire list is returned, except for items marked private.


Parse a list of recently used files.

filename defaults to ~/.recently-used.


Write the list of recently used files to disk.

If the instance is already associated with a file, filename can be omitted to save it there again.

class xdg.RecentFiles.RecentFile[source]

The URI of the file; typically starts with file:///.


A Mime type, such as ‘text/plain’.


Unix timestamp of when the file was added to the list.


Boolean indicating whether the entry is private, meaning that it will only be shown if it is in a selected group.


A list of groups this entry belongs to.