API reference#

Classes#

Main classes#

Client(*, client, file_transfer, profile)

SciCat client to communicate with a server.

Dataset([type, access_groups, ...])

Metadata and linked data files for a measurement, simulation, or analysis.

File(local_path, remote_path, remote_gid, ...)

Store local and remote paths and metadata for a file.

File transfer#

transfer.copy.CopyFileTransfer(*[, ...])

Upload / download files by copying files on the same filesystem.

transfer.link.LinkFileTransfer(*[, ...])

Upload / download files by creating symlinks.

transfer.select.SelectFileTransfer(children, *)

Upload / download files using a suitable transfer.

transfer.sftp.SFTPFileTransfer(*, host[, ...])

Upload / download files using SFTP.

Auxiliary classes#

client.ScicatClient(url, token, timeout, *)

Low-level client to call the SciCat API.

datablock.OrigDatablock([...])

Dataclass for an orig datablock.

dataset.DatablockUploadModels(orig_datablocks)

Pydantic models for (orig) datablocks.

PID(*, pid[, prefix])

Stores the persistent identifier of a database item.

Profile(url, file_transfer[, frontend_url, ...])

Parameters for connecting to a specific instance of SciCat.

RemotePath(*path_segments)

A path on the remote filesystem.

Thumbnail(mime[, data, _encoded_data])

Encodes an image to be used as a thumbnail in SciCat.

Exceptions#

AuthError

Raised when authentication fails.

FileNotAccessibleError(*args, remote_path)

Raised when a remote file is inaccessible.

FileUploadError

Raised when file upload fails.

IntegrityError

Raised when a dataset or file is broken.

ScicatCommError

Raised when communication with SciCat fails.

Submodules#

auth

Authentication with SciCat and file servers.

model

Models for communication with SciCat and user facing dataclasses.

ontology

Tools for working with ontologies.

testing

Helpers for testing code with Scitacean.

typing

Definitions for type checking.

Miscellaneous#

filesystem.checksum_of_file(path, *, algorithm)

Compute the checksum of a local file.

filesystem.escape_path(path)

Escape disallowed characters for file paths.

filesystem.file_size(path)

Return the size of a local file in bytes.

filesystem.file_modification_time(path)

Return the time in UTC when a local file was last modified.

logging.logger_name()

Return the name of Scitacean's logger.

logging.get_logger()

Return the logger used by Scitacean.

util.formatter.DatasetPathFormatter()

Formatter that inserts dataset fields and escapes paths.