🚧 Sprout is still in active development and evolving quickly, so the documentation and functionality may not work as described and could undergo substantial changes 🚧
Creates a valid properties object for the specified resource.
This function sets up and structures a new resource property by taking the fields given in the properties argument to fill them and prepare them to be added to the datapackage.json file.
Parameters
path:Path
The path to the resource id folder; use path_resource() to provide the correct path or use the output of create_resource_structure().
properties:ResourceProperties
The properties of the resource; must be given as a ResourceProperties object following the Data Package specification. See the ResourceProperties help documentation for details on what can or needs to be filled in.
Returns
ResourceProperties
The properties object, verified and updated.
Raises
NotADirectoryError
If path does not point to a directory.
ExceptionGroup
If there is an error in the properties. A group of CheckErrors, one error per failed check.
Examples
import tempfilefrom pathlib import Pathimport seedcase_sprout.core as sp# Create a temporary directory for the examplewith tempfile.TemporaryDirectory() as temp_dir: temp_path = Path(temp_dir)# Create a package and resource structure first sp.create_package_structure(path=temp_path) sp.create_resource_structure(path=temp_path /"1"/"resources")# Create resource properties sp.create_resource_properties( path=temp_path /"1"/"resources"/"1", properties=sp.ResourceProperties( name="new-resource-name", path="data.parquet", title="Resource Title", description="This resource contains data about...", ), )