ResourceProperties

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.ResourceProperties(
    self,
    name: str | None = None,
    path: str | None = None,
    type: Literal['table'] | None = None,
    title: str | None = None,
    description: str | None = None,
    sources: list[SourceProperties] | None = None,
    licenses: list[LicenseProperties] | None = None,
    format: str | None = None,
    mediatype: str | None = None,
    encoding: str | None = None,
    bytes: int | None = None,
    hash: str | None = None,
    dialect: TableDialectProperties | None = None,
    schema: TableSchemaProperties | None = None,
)

A data resource.

A simple format to describe and package a single data resource such as an individual table or file. The essence of a data resource is a locator for the data it describes. A range of other properties can be declared to provide a richer set of metadata.

Creates a dataclass object with all the necessary properties for a resource, which would be given in the resources field of a PackageProperties dataclass.

Attributes

name : str | None

A simple name or identifier to be used for this resource. Should consist only of lowercase English alphanumeric characters plus characters in .-_.

path : str | None

A path pointing to the data for this resource.

type : Literal['table'] | None

Specifies the type of the resource.

title : str | None

A human-readable title.

description : str | None

A text description. Markdown is encouraged.

sources : list[SourceProperties] | None

The raw sources for this resource.

licenses : list[LicenseProperties] | None

The license(s) under which the resource is published.

format : str | None

The file format of this resource. Expected to be the standard file extension.

mediatype : str | None

The media type of this resource. Can be any valid media type listed with IANA.

encoding : str | None

The file encoding of this resource.

bytes : int | None

The size of this resource in bytes.

hash : str | None

The MD5 hash of this resource. Indicate other hashing algorithms with the {algorithm}:{hash} format.

dialect : TableDialectProperties | None

The tabular dialect of the resource data.

schema : TableSchemaProperties | None

A table schema for the resource data, compliant with the table schema specification.

Examples

import seedcase_sprout.core as sp
print(sp.ResourceProperties())
print(sp.ResourceProperties(name="Blood samples", path="data.csv"))
ResourceProperties(name=None, path=None, type=None, title=None, description=None, sources=None, licenses=None, format=None, mediatype=None, encoding=None, bytes=None, hash=None, dialect=None, schema=None)
ResourceProperties(name='Blood samples', path='data.csv', type=None, title=None, description=None, sources=None, licenses=None, format=None, mediatype=None, encoding=None, bytes=None, hash=None, dialect=None, schema=None)

Methods

Name Description
default Creates a ResourcesProperties dataclass with default values.

default

core.ResourceProperties.default()

Creates a ResourcesProperties dataclass with default values.

Returns

Self

A ResourceProperties dataclass with default values.