beeware/toga

Add path shortcuts for common user-space paths

Open

#3,551 opened on Jun 13, 2025

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Python (3,615 stars) (624 forks)batch import
enhancementgood first issue

Description

What is the problem or limitation you are having?

Toga has a paths module that provides an anchor point for paths in the app, and for common "sandbox" locations such as config, data, and logs.

However, there's no anchor for common "user space" locations, such as "Documents", "Pictures" or "Desktop". These are all locations that an app may want to use; and are cross platform (on desktop, anyway).

Describe the solution you'd like

paths.desktop, paths.pictures, and paths.desktop should all return appropriate user-specific file system anchors.

Describe alternatives you've considered

We could pass responsibility for this off to platformdirs, as it provides analogous functionality.

Additional context

  • On Linux, the FreeDesktop specification defines "known locations". The implementation provided by platformdirs could be used to inform what directories should be used, even if we don't actually use platformdirs in the implementation.
  • On macOS, permissions are often required to access Desktop, Documents etc; we should check if those permissions are requested automatically on first access, or if an explicit permission check is required.
  • On iOS (and Android?), there's probably not a folder that can be used for these paths. If there's no viable path, a platform should raise an exception.

Contributor guide