Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fi-mihej/cengal_app_dir_path_finder

A Python module offering a unified API for easy retrieval of OS-specific application directories, enhancing data management across Windows, Linux, and macOS
https://github.com/fi-mihej/cengal_app_dir_path_finder

app-directory appdir-pathfinder application-data-paths application-support-directories cengal cross-platform cross-platform-directory-access directory directory-management directory-utilities pathfinder platform-agnostic-paths program-data-storage python universal-path-resolver

Last synced: 9 days ago
JSON representation

A Python module offering a unified API for easy retrieval of OS-specific application directories, enhancing data management across Windows, Linux, and macOS

Awesome Lists containing this project

README

        

![GitHub tag (with filter)](https://img.shields.io/github/v/tag/FI-Mihej/cengal_app_dir_path_finder) ![Static Badge](https://img.shields.io/badge/OS-Linux_%7C_Windows_%7C_macOS-blue)

![PyPI - Version](https://img.shields.io/pypi/v/cengal_app_dir_path_finder) ![PyPI - Format](https://img.shields.io/pypi/format/cengal-light?color=darkgreen) ![Static Badge](https://img.shields.io/badge/wheels-Linux_%7C_Windows_%7C_macOS-blue) ![Static Badge](https://img.shields.io/badge/Architecture-x86__64_%7C_ARM__64-blue) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cengal-light) ![Static Badge](https://img.shields.io/badge/PyPy-3.8_%7C_3.9_%7C_3.10-blue) ![PyPI - Implementation](https://img.shields.io/pypi/implementation/cengal-light)

![GitHub License](https://img.shields.io/github/license/FI-Mihej/cengal_app_dir_path_finder?color=darkgreen) ![Static Badge](https://img.shields.io/badge/API_status-Stable-darkgreen)

# cengal_app_dir_path_finder package

> cengal_app_dir_path_finder is a part of the [Cengal](https://github.com/FI-Mihej/Cengal) library. If you have any questions or would like to participate in discussions, feel free to join the [Cengal Discord](https://discord.gg/TAy7xNgR). Your support and involvement are greatly appreciated as Cengal evolves.

`cengal_app_dir_path_finder` is a cross-platform Python module designed to simplify the process of locating OS-recommended directories for application data, cache, logs, and more. It seamlessly integrates with Windows, Linux, and macOS, utilizing platform-specific standards like `KNOWNFOLDERID constants` on Windows, `XDG standards` on Linux, and `NSSearchPathForDirectoriesInDomains` on macOS. This module offers a unified API for accessing various types of directories, such as local, roaming, and program-specific paths, enhancing application compatibility and data management across different operating systems.

# Installation

```bash
pip install cengal_app_dir_path_finder
```

# Documentation

## Import

```python
from cengal_app_dir_path_finder import AppDirectoryType, AppDirPath
```

## Usage

```python
import os
from cengal_app_dir_path_finder import AppDirectoryType, AppDirPath

app_dir_path: AppDirPath = AppDirPath()
local_data_dir_path: str = app_dir_path(AppDirectoryType.local_data, 'MyApplicationName')
settings_json_path: str = os.path.join(local_data_dir_path, 'settings.json')
with open(settings_json_path, 'w') as file:
file.write(my_app_settings)
```

## API State

Stable. Guaranteed to not have braking changes in the future (see bellow for details).

Any hypothetical further API-breaking changes will lead to new module creation within the package. An old version will continue its existence and continue to be importable by an explicit address (see Details bellow).

Details

The current (currently latest) version can be imported either by:

```python
from cengal_app_dir_path_finder import *
```

or by

```python
from cengal_app_dir_path_finder.versions.v_0 import *
```

If further braking changes will be made to the API - a new (`v_1`) version will be made. As result:

Current (`v_0`) version will continue to be accessible by an explicit address:

```python
from cengal_app_dir_path_finder.versions.v_0 import *
```

Latest (`v_1`) version will be accessible by either:

```python
from cengal_app_dir_path_finder import *
```

or by

```python
from cengal_app_dir_path_finder.versions.v_1 import *
```

This is a general approach across the entire [Cengal](https://github.com/FI-Mihej/Cengal) library. It gives me the ability to effectively work on its huge codebase, even by myself.

By the way. I'm finishing an implementation of [CengalPolyBuild](https://github.com/FI-Mihej/CengalPolyBuild) - my package creation system which provides same approach to users. It is a comprehensive and hackable build system for multilingual Python packages: Cython (including automatic conversion from Python to Cython), C/C++, Objective-C, Go, and Nim, with ongoing expansions to include additional languages. Basically, it will provide easy access to all the same features I'm already using in the Cengal library package creation and management processes.

## Supported foler types

`AppDirectoryType` is an enum of all supported kinds of directories.

`AppDirectoryType` Fields:

* Static Data. Your user-specific static data such as application's icons, static text or non-executable binary files, etc.:
* `local_static_data`: Static data specific to the local user, not frequently modified.
* `local_low_static_data`: Static data for lower privilege user applications.
* `roaming_static_data`: User-specific static data that may sync across devices.
* `program_static_data`: Static data shared among all users and applications.

* Local Data. Your main user-specific data storage:
* `local_data`: Local user-specific data storage, not shared across users, ideal for storing user preferences, game scores, etc.
* `local_cache`: Stores temporary, user-specific cache data that can be regenerated as needed.
* `local_config`: Configuration files and settings for the current user.
* `local_log`: Logs and operation records for the current user.
* `local_temp`: Temporary files and data specific to the current user.
* `local_runtime`: User-specific runtime data like sockets and named pipes.

* System-wide Data. For system services and other hi privilege applications:
* `program_data`: Non-static data shared among users, like shared databases.
* `program_cache`: Cache for shared applications and services.
* `program_config`: Configuration files for system-wide applications.
* `program_log`: Log files for system-wide applications.
* `program_temp`: Temporary files for shared applications.
* `program_runtime`: System-wide runtime data like global sockets and named pipes.

* Local Low Data. User-specific low privilege local data storage for sandboxed or security-sensitive applications. For example for web browsers:
* `local_low_data`: Low privilege local data storage for sandboxed or security-sensitive applications.
* `local_low_cache`: Similar to local_cache but for applications requiring lower access privileges.
* `local_low_config`: Configuration for applications with lower privileges.
* `local_low_log`: Logs for low privilege applications.
* `local_low_temp`: Temporary files for applications with lower privileges.
* `local_low_runtime`: Runtime data for applications with lower privileges.

* Roaming Data. User-specific data that may sync across devices:
* `roaming_data`: User-specific data that may sync across devices, suitable for configurations and settings.
* `roaming_cache`: User-specific cache data that could be shared and synced across devices.
* `roaming_config`: Configurations that might be synced across a user's devices.
* `roaming_log`: User-specific logs that might be shared across devices.
* `roaming_temp`: Temporary user-specific files that might be synced across devices.
* `roaming_runtime`: User-specific runtime data that could be synced across devices.

* `program_files`: Static data shared among all users, like application binaries.
* `program_files_common`: Shared libraries and common resources for multiple applications.

* `user_profile_data`: User-specific application data within the user's home directory. (`/home//.` in case of Linux)
* `user_profile_program_files`: Static data specific to user-installed applications. Executable files, etc.
* `user_profile_program_files_common`: Shared resources for user-specific applications. Shared libraries, components, etc.

## Static data

### Short Description

* `Purpose`: To store data that remains unchanged throughout the application's lifecycle. This includes configuration files, default settings, templates, and read-only resources that are essential for the application's operation but do not require modification or updates after the initial deployment.
* `Use Case`: Particularly valuable for applications that rely on a set of immutable resources for functionality—such as image editing software that includes a library of default filters and effects, or a document processing application that uses a collection of templates for various document types. This ensures that these resources are available to the application regardless of user-specific data or settings, providing a consistent foundation upon which the application's features and functionalities operate.

### Windows Folders

* `local_static_data`: Stores static data that doesn't change during the application lifecycle and doesn't need to roam.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Local\\static_data`
* `with_structure=False`: `C:\Users\\AppData\Local\`
* `app_name_or_path=None`: `C:\Users\\AppData\Local`
* `local_low_static_data`: Static data for lower privilege user applications.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppDataLow`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\LocalLow\\static_data`
* `with_structure=False`: `C:\Users\\AppData\LocalLow\`
* `app_name_or_path=None`: `C:\Users\\AppData\LocalLow`
* `roaming_static_data`: Similar to roaming_data but specifically for static data that should be available across sessions and machines.
* KNOWNFOLDERID of the base directory: `FOLDERID_RoamingAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Roaming\\static_data`
* `with_structure=False`: `C:\Users\\AppData\Roaming\`
* `app_name_or_path=None`: `C:\Users\\AppData\Roaming`
* `program_static_data`: Stores static data similar to program_data, but explicitly indicates its static nature.
* KNOWNFOLDERID of the base directory: `FOLDERID_ProgramData`
* Examples:
* `with_structure=True`: `C:\ProgramData\\static_data`
* `with_structure=False`: `C:\ProgramData\`
* `app_name_or_path=None`: `C:\ProgramData`

### Linux Folders

* `local_static_data`: Stores static data that doesn't change during the application lifecycle and doesn't need to roam.
* Base directory: `os.environ.get('XDG_DATA_HOME', os.path.join(os.path.expanduser('~'), '.local', 'share'))`
* Examples:
* `with_structure=True`: `/home//.local/share//local/static_data`
* `with_structure=False`: `/home//.local/share/`
* `app_name_or_path=None`: `/home//.local/share`
* `local_low_static_data`: Static data for lower privilege user applications.
* Base directory: `os.environ.get('XDG_DATA_HOME', os.path.join(os.path.expanduser('~'), '.local', 'share'))`
* Examples:
* `with_structure=True`: `/home//.local/share//local_low/static_data`
* `with_structure=False`: `/home//.local/share/`
* `app_name_or_path=None`: `/home//.local/share`
* `roaming_static_data`: Similar to roaming_data but specifically for static data that should be available across sessions and machines.
* Base directory: `os.environ.get('XDG_DATA_HOME', os.path.join(os.path.expanduser('~'), '.local', 'share'))`
* Examples:
* `with_structure=True`: `/home//.local/share//roaming/static_data`
* `with_structure=False`: `/home//.local/share/`
* `app_name_or_path=None`: `/home//.local/share`
* `program_static_data`: Stores static data similar to program_data, but explicitly indicates its static nature.
* Base directory: `'/usr/share'`
* Examples:
* `with_structure=True`: `/usr/share//static_data`
* `with_structure=False`: `/usr/share/`
* `app_name_or_path=None`: `/usr/share`

### macOS Folders

* `local_static_data`: Stores static data that doesn't change during the application lifecycle and doesn't need to roam.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local/static_data`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `local_low_static_data`: Static data for lower privilege user applications.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local_low/static_data`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `roaming_static_data`: Similar to roaming_data but specifically for static data that should be available across sessions and machines.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//roaming/static_data`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `program_static_data`: Stores static data similar to program_data, but explicitly indicates its static nature.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `localDomainMask`
* Examples:
* `with_structure=True`: `/Library/Application Support//static_data`
* `with_structure=False`: `/Library/Application Support/`
* `app_name_or_path=None`: `/Library/Application Support`

## Local App Data

### Short Description

* `Purpose`: To store user-specific application data that is local to a machine. Ideal for data that is too large to roam or that is only relevant to the specific device.
* `Use Case`: Commonly used for storing temporary files, cache, application logs, and other user-specific data that does not need to be synced across multiple devices.

### Windows Folders

* `local_data`: Stores application data that doesn't roam with the user. Typically used for storing large datasets or files that are specific to a machine.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Local\\data`
* `with_structure=False`: `C:\Users\\AppData\Local\`
* `app_name_or_path=None`: `C:\Users\\AppData\Local`
* `local_cache`: Used for storing temporary files that enhance application startup and operation. Cache files can be deleted without affecting application functionality.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Local\\cache`
* `with_structure=False`: `C:\Users\\AppData\Local\`
* `app_name_or_path=None`: `C:\Users\\AppData\Local`
* `local_config`: Stores configuration files. These files usually include settings that are specific to the machine.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Local\\config`
* `with_structure=False`: `C:\Users\\AppData\Local\`
* `app_name_or_path=None`: `C:\Users\\AppData\Local`
* `local_log`: Used for storing log files generated by the application. Useful for troubleshooting and monitoring application behavior.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Local\\log`
* `with_structure=False`: `C:\Users\\AppData\Local\`
* `app_name_or_path=None`: `C:\Users\\AppData\Local`
* `local_temp`: Intended for temporary files that are needed during the application's execution but not beyond that. These files can be cleared to free up space.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Local\\temp`
* `with_structure=False`: `C:\Users\\AppData\Local\`
* `app_name_or_path=None`: `C:\Users\\AppData\Local`
* `local_runtime`: Stores files required by the application at runtime. These could include dynamic libraries or runtime configurations.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppData`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\Local\\runtime`
* `with_structure=False`: `C:\Users\\AppData\Local\`
* `app_name_or_path=None`: `C:\Users\\AppData\Local`

### Linux Folders

* `local_data`: Stores application data that doesn't roam with the user. Typically used for storing large datasets or files that are specific to a machine.
* Base directory: `os.environ.get('XDG_STATE_HOME', os.path.join(os.path.expanduser('~'), '.local', 'state'))`
* Examples:
* `with_structure=True`: `/home//.local/state//local/data`
* `with_structure=False`: `/home//.local/state/`
* `app_name_or_path=None`: `/home//.local/state`
* `local_cache`: Used for storing temporary files that enhance application startup and operation. Cache files can be deleted without affecting application functionality.
* Base directory: `os.environ.get('XDG_CACHE_HOME', os.path.join(os.path.expanduser('~'), '.cache'))`
* Examples:
* `with_structure=True`: `/home//.cache//local/cache`
* `with_structure=False`: `/home//.cache/`
* `app_name_or_path=None`: `/home//.cache`
* `local_config`: Stores configuration files. These files usually include settings that are specific to the machine.
* Base directory: `os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config'))`
* Examples:
* `with_structure=True`: `/home//.config//local/config`
* `with_structure=False`: `/home//.config/`
* `app_name_or_path=None`: `/home//.config`
* `local_log`: Used for storing log files generated by the application. Useful for troubleshooting and monitoring application behavior.
* Base directory: `os.environ.get('XDG_STATE_HOME', os.path.join(os.path.expanduser('~'), '.local', 'state'))`
* Examples:
* `with_structure=True`: `/home//.local/state//local/log`
* `with_structure=False`: `/home//.local/state/`
* `app_name_or_path=None`: `/home//.local/state`
* `local_temp`: Intended for temporary files that are needed during the application's execution but not beyond that. These files can be cleared to free up space.
* Base directory: `os.environ.get('XDG_RUNTIME_DIR', os.path.join(os.path.expanduser('~'), '.tmp'))`
* Examples:
* `with_structure=True`: `/home//.tmp//local/temp`
* `with_structure=False`: `/home//.tmp/`
* `app_name_or_path=None`: `/home//.tmp`
* `local_runtime`: Stores files required by the application at runtime. These could include dynamic libraries or runtime configurations.
* Base directory: `os.environ.get('XDG_RUNTIME_DIR', os.path.join(os.path.expanduser('~'), '.tmp'))`
* Examples:
* `with_structure=True`: `/home//.tmp//local/runtime`
* `with_structure=False`: `/home//.tmp/`
* `app_name_or_path=None`: `/home//.tmp`

### macOS Folders

* `local_data`: Stores application data that doesn't roam with the user. Typically used for storing large datasets or files that are specific to a machine.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local/data`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `local_cache`: Used for storing temporary files that enhance application startup and operation. Cache files can be deleted without affecting application functionality.
* FileManager.SearchPathDirectory: `cachesDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Caches//local/cache`
* `with_structure=False`: `/Users//Library/Caches/`
* `app_name_or_path=None`: `/Users//Library/Caches`
* `local_config`: Stores configuration files. These files usually include settings that are specific to the machine.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local/config`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `local_log`: Used for storing log files generated by the application. Useful for troubleshooting and monitoring application behavior.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local/log`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `local_temp`: Intended for temporary files that are needed during the application's execution but not beyond that. These files can be cleared to free up space.
* FileManager.SearchPathDirectory: `cachesDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Caches//local/temp`
* `with_structure=False`: `/Users//Library/Caches/`
* `app_name_or_path=None`: `/Users//Library/Caches`
* `local_runtime`: Stores files required by the application at runtime. These could include dynamic libraries or runtime configurations.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local/runtime`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`

## Program Data

### Short Description

* `Purpose`: To store application data, settings, and resources that need to be shared across all users on a single computer. Used for global application settings and data.
* `Use Case`: Ideal for system servicess and applications that require storing configuration files, templates, shared databases, or other data that should be accessible system-wide, regardless of the current user.

### Windows Folders

* `program_data`: For data that is shared across all users on the machine. Often used for application data that doesn't contain user-specific settings.
* KNOWNFOLDERID of the base directory: `FOLDERID_ProgramData`
* Examples:
* `with_structure=True`: `C:\ProgramData\\data`
* `with_structure=False`: `C:\ProgramData\`
* `app_name_or_path=None`: `C:\ProgramData`
* `program_cache`: Cache for shared applications and services.
* KNOWNFOLDERID of the base directory: `FOLDERID_ProgramData`
* Examples:
* `with_structure=True`: `C:\ProgramData\\cache`
* `with_structure=False`: `C:\ProgramData\`
* `app_name_or_path=None`: `C:\ProgramData`
* `program_config`: Configuration files for system-wide applications.
* KNOWNFOLDERID of the base directory: `FOLDERID_ProgramData`
* Examples:
* `with_structure=True`: `C:\ProgramData\\config`
* `with_structure=False`: `C:\ProgramData\`
* `app_name_or_path=None`: `C:\ProgramData`
* `program_log`: Log files for system-wide applications.
* KNOWNFOLDERID of the base directory: `FOLDERID_ProgramData`
* Examples:
* `with_structure=True`: `C:\ProgramData\\log`
* `with_structure=False`: `C:\ProgramData\`
* `app_name_or_path=None`: `C:\ProgramData`
* `program_temp`: Temporary files for shared applications.
* KNOWNFOLDERID of the base directory: `FOLDERID_ProgramData`
* Examples:
* `with_structure=True`: `C:\ProgramData\\temp`
* `with_structure=False`: `C:\ProgramData\`
* `app_name_or_path=None`: `C:\ProgramData`
* `program_runtime`: System-wide runtime data like global sockets and named pipes.
* KNOWNFOLDERID of the base directory: `FOLDERID_ProgramData`
* Examples:
* `with_structure=True`: `C:\ProgramData\\runtime`
* `with_structure=False`: `C:\ProgramData\`
* `app_name_or_path=None`: `C:\ProgramData`

### Linux Folders

* `program_data`: For data that is shared across all users on the machine. Often used for application data that doesn't contain user-specific settings.
* Base directory: `'/var/lib'`
* Examples:
* `with_structure=True`: `/var/lib//data`
* `with_structure=False`: `/var/lib/`
* `app_name_or_path=None`: `/var/lib`
* `program_cache`: Cache for shared applications and services.
* Base directory: `'/var/cache'`
* Examples:
* `with_structure=True`: `/var/cache//cache`
* `with_structure=False`: `/var/cache/`
* `app_name_or_path=None`: `/var/cache`
* `program_config`: Configuration files for system-wide applications.
* Base directory: `'/etc'`
* Examples:
* `with_structure=True`: `/etc//config`
* `with_structure=False`: `/etc/`
* `app_name_or_path=None`: `/etc`
* `program_log`: Log files for system-wide applications.
* Base directory: `'/var/log'`
* Examples:
* `with_structure=True`: `/var/log//log`
* `with_structure=False`: `/var/log/`
* `app_name_or_path=None`: `/var/log`
* `program_temp`: Temporary files for shared applications.
* Base directory: `'/tmp'`
* Examples:
* `with_structure=True`: `/tmp//temp`
* `with_structure=False`: `/tmp/`
* `app_name_or_path=None`: `/tmp`
* `program_runtime`: System-wide runtime data like global sockets and named pipes.
* Base directory: `'/var/run'`
* Examples:
* `with_structure=True`: `/var/run//runtime`
* `with_structure=False`: `/var/run/`
* `app_name_or_path=None`: `/var/run`

### macOS Folders

* `program_data`: For data that is shared across all users on the machine. Often used for application data that doesn't contain user-specific settings.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `localDomainMask`
* Examples:
* `with_structure=True`: `/Library/Application Support//data`
* `with_structure=False`: `/Library/Application Support/`
* `app_name_or_path=None`: `/Library/Application Support`
* `program_cache`: Cache for shared applications and services.
* Note: static path is used as a base directory
* Base directory: `'/Library/Caches'`
* Examples:
* `with_structure=True`: `/Library/Caches//cache`
* `with_structure=False`: `/Library/Caches/`
* `app_name_or_path=None`: `/Library/Caches`
* `program_config`: Configuration files for system-wide applications.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `localDomainMask`
* Examples:
* `with_structure=True`: `/Library/Application Support//config`
* `with_structure=False`: `/Library/Application Support/`
* `app_name_or_path=None`: `/Library/Application Support`
* `program_log`: Log files for system-wide applications.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `localDomainMask`
* Examples:
* `with_structure=True`: `/Library/Application Support//log`
* `with_structure=False`: `/Library/Application Support/`
* ``app_name_or_path=None`: `/Library/Application Support`
* `program_temp`: Temporary files for shared applications.
* Note: static path is used as a base directory
* Base directory: `'/tmp'`
* Examples:
* `with_structure=True`: `/tmp//temp`
* `with_structure=False`: `/tmp/`
* `app_name_or_path=None`: `/tmp`
* `program_runtime`: System-wide runtime data like global sockets and named pipes.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `localDomainMask`
* Examples:
* `with_structure=True`: `/Library/Application Support//runtime`
* `with_structure=False`: `/Library/Application Support/`
* `app_name_or_path=None`: `/Library/Application Support`

## Local App Data Low

### Short Description

* `Purpose`: For storing application data that doesn't require high integrity levels, helping to segregate data based on trust levels and application privileges.
* `Use Case`: Commonly used by web browsers and other applications that execute code or process content from less trusted sources.

### Windows Folders

* `local_low_data`: Low privilege local data storage for sandboxed or security-sensitive applications.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppDataLow`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\LocalLow\\data`
* `with_structure=False`: `C:\Users\\AppData\LocalLow\`
* `app_name_or_path=None`: `C:\Users\\AppData\LocalLow`
* `local_low_cache`: Similar to local_cache but for applications requiring lower access privileges.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppDataLow`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\LocalLow\\cache`
* `with_structure=False`: `C:\Users\\AppData\LocalLow\`
* `app_name_or_path=None`: `C:\Users\\AppData\LocalLow`
* `local_low_config`: Configuration for applications with lower privileges.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppDataLow`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\LocalLow\\config`
* `with_structure=False`: `C:\Users\\AppData\LocalLow\`
* `app_name_or_path=None`: `C:\Users\\AppData\LocalLow`
* `local_low_log`: Logs for low privilege applications.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppDataLow`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\LocalLow\\log`
* `with_structure=False`: `C:\Users\\AppData\LocalLow\`
* `app_name_or_path=None`: `C:\Users\\AppData\LocalLow`
* `local_low_temp`: Temporary files for applications with lower privileges.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppDataLow`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\LocalLow\\temp`
* `with_structure=False`: `C:\Users\\AppData\LocalLow\`
* `app_name_or_path=None`: `C:\Users\\AppData\LocalLow`
* `local_low_runtime`: Runtime data for applications with lower privileges.
* KNOWNFOLDERID of the base directory: `FOLDERID_LocalAppDataLow`
* Examples:
* `with_structure=True`: `C:\Users\\AppData\LocalLow\\runtime`
* `with_structure=False`: `C:\Users\\AppData\LocalLow\`
* `app_name_or_path=None`: `C:\Users\\AppData\LocalLow`

### Linux Folders

* `local_low_data`: Low privilege local data storage for sandboxed or security-sensitive applications.
* Base directory: `os.environ.get('XDG_STATE_HOME', os.path.join(os.path.expanduser('~'), '.local', 'state'))`
* Examples:
* `with_structure=True`: `/home//.local/state//local_low/data`
* `with_structure=False`: `/home//.local/state/`
* `app_name_or_path=None`: `/home//.local/state`
* `local_low_cache`: Similar to local_cache but for applications requiring lower access privileges.
* Base directory: `os.environ.get('XDG_CACHE_HOME', os.path.join(os.path.expanduser('~'), '.cache'))`
* Examples:
* `with_structure=True`: `/home//.cache//local_low/cache`
* `with_structure=False`: `/home//.cache/`
* `app_name_or_path=None`: `/home//.cache`
* `local_low_config`: Configuration for applications with lower privileges.
* Base directory: `os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config'))`
* Examples:
* `with_structure=True`: `/home//.config//local_low/config`
* `with_structure=False`: `/home//.config/`
* `app_name_or_path=None`: `/home//.config`
* `local_low_log`: Logs for low privilege applications.
* Base directory: `os.environ.get('XDG_STATE_HOME', os.path.join(os.path.expanduser('~'), '.local', 'state'))`
* Examples:
* `with_structure=True`: `/home//.local/state//local_low/log`
* `with_structure=False`: `/home//.local/state/`
* `app_name_or_path=None`: `/home//.local/state`
* `local_low_temp`: Temporary files for applications with lower privileges.
* Base directory: `os.environ.get('XDG_RUNTIME_DIR', os.path.join(os.path.expanduser('~'), '.tmp'))`
* Examples:
* `with_structure=True`: `/home//.tmp//local_low/temp`
* `with_structure=False`: `/home//.tmp/`
* `app_name_or_path=None`: `/home//.tmp`
* `local_low_runtime`: Runtime data for applications with lower privileges.
* Base directory: `os.environ.get('XDG_RUNTIME_DIR', os.path.join(os.path.expanduser('~'), '.tmp'))`
* Examples:
* `with_structure=True`: `/home//.tmp//local_low/runtime`
* `with_structure=False`: `/home//.tmp/`
* `app_name_or_path=None`: `/home//.tmp`

### macOS Folders

* `local_low_data`: Low privilege local data storage for sandboxed or security-sensitive applications.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local_low/data`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `local_low_cache`: Similar to local_cache but for applications requiring lower access privileges.
* FileManager.SearchPathDirectory: `cachesDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Caches//local_low/cache`
* `with_structure=False`: `/Users//Library/Caches/`
* `app_name_or_path=None`: `/Users//Library/Caches`
* `local_low_config`: Configuration for applications with lower privileges.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support//local_low/config`
* `with_structure=False`: `/Users//Library/Application Support/`
* `app_name_or_path=None`: `/Users//Library/Application Support`
* `local_low_log`: Logs for low privilege applications.
* FileManager.SearchPathDirectory: `applicationSupportDirectory`
* FileManager.SearchPathDomainMask: `userDomainMask`
* Examples:
* `with_structure=True`: `/Users//Library/Application Support/