path_properties

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_properties(path: Path = Path.cwd())

Gets the absolute path to the specified package’s properties file.

Parameters

path : Path = Path.cwd()

Provide a path to the package directory. Defaults to the current working directory.

Returns

Path

The absolute path to the data package’s properties file.

Examples

import os
import tempfile
from pathlib import Path

import seedcase_sprout.core as sp

# Create a temporary directory for the example
with tempfile.TemporaryDirectory() as temp_dir:
    temp_path = Path(temp_dir)
    # Create a package structure first
    sp.create_package_properties(
        properties=sp.example_package_properties(),
        path=temp_path
    )

    sp.path_properties(path=temp_path)
PosixPath('/tmp/tmp4g2lol5v/datapackage.json')
PosixPath('/tmp/tmp4g2lol5v/datapackage.json')