🚧 Sprout is still in active development and evolving quickly, so the documentation and functionality may not work as described and could undergo substantial changes 🚧
create_resource_properties
dict) core.create_resource_properties(path: 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; usepath_resource()
to provide the correct path or use the output ofcreate_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 theResourceProperties
help documentation for details on what can or needs to be filled in.
Returns
: dict
-
The properties object, verified and updated
Raises
: NotADirectoryError
-
If path does not point to a directory.
: NotPropertiesError
-
If properties are not correct Frictionless resource properties.