paper_firehose.core.paths

Utilities for locating runtime data and built-in system assets.

Functions

ensure_data_dir()

Ensure the data directory exists on disk and return it.

get_data_dir()

Return the configured runtime data directory.

get_system_dir()

Return the repository's bundled system directory.

get_system_path(*relative)

Return a path inside the repository's system directory.

resolve_data_dir(*relative[, ensure_exists])

Resolve a directory inside the runtime data directory.

resolve_data_file(path[, ensure_parent])

Resolve a configured file path against the data directory.

resolve_data_path(*relative[, ensure_parent])

Resolve a path underneath the runtime data directory.

paper_firehose.core.paths.ensure_data_dir()[source]

Ensure the data directory exists on disk and return it.

Return type:

Path

paper_firehose.core.paths.get_data_dir()[source]

Return the configured runtime data directory.

Honors the PAPER_FIREHOSE_DATA_DIR environment variable; otherwise defaults to ~/.paper_firehose on the current platform.

Return type:

Path

paper_firehose.core.paths.get_system_dir()[source]

Return the repository’s bundled system directory.

Return type:

Path

paper_firehose.core.paths.get_system_path(*relative)[source]

Return a path inside the repository’s system directory.

Return type:

Path

Parameters:

relative (str)

paper_firehose.core.paths.resolve_data_dir(*relative, ensure_exists=False)[source]

Resolve a directory inside the runtime data directory.

Return type:

Path

Parameters:
  • relative (str)

  • ensure_exists (bool)

paper_firehose.core.paths.resolve_data_file(path, ensure_parent=False)[source]

Resolve a configured file path against the data directory.

Absolute paths (or explicit ones containing a drive letter on Windows) are used as-is. Relative paths are interpreted relative to the runtime data dir, with legacy “assets/” prefixes stripped for backward compatibility.

Return type:

Path

Parameters:
paper_firehose.core.paths.resolve_data_path(*relative, ensure_parent=False)[source]

Resolve a path underneath the runtime data directory.

Accepts legacy prefixes such as “assets/” to ease migration of existing configuration values.

Return type:

Path

Parameters:
  • relative (str)

  • ensure_parent (bool)