An abstraction layer for reading and writing from URI file resources.


Keywords
lsst, abstraction-layer, hacktoberfest, python
License
BSD-1-Clause
Install
pip install lsst-resources==26.2023.4900

Documentation

lsst.resources

pypi codecov

This package provides a simple interface to local or remote files using URIs.

from lsst.resources import ResourcePath

file_uri = ResourcePath("/data/file.txt")
contents = file_uri.read()

s3_uri = ResourcePath("s3://bucket/data/file.txt")
contents = s3_uri.read()

The package currently understands file, s3, gs, http[s], and resource (Python package resource) URI schemes as well as a scheme-less URI (relative local file path).

The package provides the main file abstraction layer in the Rubin Observatory Data Butler datastore.

PyPI: lsst-resources