path_sprout_global

Warning

🚧 Sprout is still in active development and evolving quickly, so the documentation and functionality may not work as described and could undergo substantial changes 🚧

core.path_sprout_global()

Gets Sprout’s global path location.

If the SPROUT_GLOBAL environment variable isn’t provided, this function will return the default path to where data packages will be stored. The default locations are dependent on the operating system. This function also creates the necessary directory if it doesn’t exist.

Returns

Path

The path to Sprout’s global directory.

Examples

import tempfile
import os

import seedcase_sprout.core as sp

# Create a temporary directory for the example
with tempfile.TemporaryDirectory() as temp_dir:
    os.environ["SPROUT_GLOBAL"] = temp_dir

    # Get the path to Sprout's global directory
    sp.path_sprout_global()
PosixPath('/tmp/tmpskrqtemw')