spinetoolbox.project_item_resource

Provides the ProjectItemResource class.

authors:
  1. Marin (KTH)
date:

29.4.2020

Module Contents

Classes

ProjectItemResource Class to hold a resource made available by a project item
class spinetoolbox.project_item_resource.ProjectItemResource(provider, type_, url='', metadata=None)[source]

Class to hold a resource made available by a project item and that may be consumed by another project item.

Parameters:
  • provider (ProjectItem or ExecutionItem) – The item that provides the resource
  • type (str) –

    The resource type, currently available types:

    • ”file”: url points to the file’s path
    • ”database”: url is the databases url
    • ”transient_file”: a file that may not yet be available or may change its location; url points to latest version or is empty, metadata contains the “label” key and an optional “pattern” key
    • ”file_pattern”: a file pattern with wildcards that acts as a placeholder; url is empty, metadata contains the “label” key
  • url (str) – The url of the resource
  • metadata (dict) –

    Some metadata providing extra information about the resource. Currently available keys:

    • label (str): a textual label
    • pattern (str): a file pattern if the file is part of that pattern
path[source]

Returns the resource path in the local syntax, as obtained from parsing the url.

scheme[source]

Returns the resource scheme, as obtained from parsing the url.

__eq__(self, other)[source]

Return self==value.

__repr__(self)[source]

Return repr(self).