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.create_resource_properties

core.create_resource_properties

Functions

Name Description
create_resource_properties Creates a valid properties object for the specified resource.

create_resource_properties

core.create_resource_properties.create_resource_properties(path, properties)

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 : dict

the properties of the resource; must be given as a JSON object following the Data Package specification; use the ResourceProperties class to provide the correct fields. See the ResourceProperties help documentation for details on what can or needs to be filled in.

Raises

: NotADirectoryError

if path does not point to a directory.

: NotPropertiesError

if properties are not correct Frictionless resource properties.

Returns

: dict

the properties object, verified and updated