from __future__ import annotations

import os
from pathlib import Path

DATA_DIR_NAME = ".smartwallet"
DATA_FILE_NAME = "budget.json"
DATA_PATH_ENV = "SMARTWALLET_DATA_PATH"


def get_data_path() -> Path:
    override = os.getenv(DATA_PATH_ENV)
    if override:
        return Path(override).expanduser()

    return Path.home() / DATA_DIR_NAME / DATA_FILE_NAME
