LocationFactory

class lsst.daf.butler.LocationFactory(datastoreRoot: str | ParseResult | ResourcePath | Path)

Bases: object

Factory for Location instances.

The factory is constructed from the root location of the datastore. This location can be a path on the file system (absolute or relative) or as a URI.

Parameters:
datastoreRootstr

Root location of the Datastore either as a path in the local filesystem or as a URI. File scheme URIs can be used. If a local filesystem path is used without URI scheme, it will be converted to an absolute path and any home directory indicators expanded. If a file scheme is used with a relative path, the path will be treated as a posixpath but then converted to an absolute path.

Attributes Summary

netloc

Return the network location of root location of the Datastore.

Methods Summary

fromPath(path, *[, trusted_path])

Create a Location from a POSIX path.

from_uri(uri, *[, trusted_path])

Attributes Documentation

netloc

Return the network location of root location of the Datastore.

Methods Documentation

fromPath(path: str | ParseResult | ResourcePath | Path, *, trusted_path: bool = False) Location

Create a Location from a POSIX path.

Parameters:
pathstr or lsst.resources.ResourcePath

A standard POSIX path, relative to the Datastore root. If it is a lsst.resources.ResourcePath it must not be absolute. Is assumed to refer to a file and not a directory in the datastore.

trusted_pathbool, optional

If True, the path is not checked to see if it is really inside the datastore.

Returns:
locationLocation

The equivalent Location.

from_uri(uri: ResourcePath, *, trusted_path: bool = False) Location