https://github.com/lsst/resources
Generic interface for accessing local and remote file resources
https://github.com/lsst/resources
abstraction-layer hacktoberfest python
Last synced: over 1 year ago
JSON representation
Generic interface for accessing local and remote file resources
- Host: GitHub
- URL: https://github.com/lsst/resources
- Owner: lsst
- License: other
- Created: 2021-11-29T22:24:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T23:58:09.000Z (about 2 years ago)
- Last Synced: 2024-05-29T14:10:45.180Z (about 2 years ago)
- Topics: abstraction-layer, hacktoberfest, python
- Language: Python
- Homepage:
- Size: 961 KB
- Stars: 0
- Watchers: 64
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lsst.resources
[](https://pypi.org/project/lsst-resources/)
[](https://codecov.io/gh/lsst/resources)
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](https://github.com/lsst/daf_butler) datastore.
PyPI: [lsst-resources](https://pypi.org/project/lsst-resources/)