Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_fs
Commits
4e27be18
Commit
4e27be18
authored
Jun 17, 2024
by
WeidenthalerMatthias
Committed by
戚攀
Jun 17, 2024
Browse files
Merge pull request !2 from WeidenthalerMatthias/feature.info
parents
3891ad2c
8484c28e
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
4e27be18
...
...
@@ -47,6 +47,9 @@ s3_fs.get('s3://csst-prod/gaia/test/requirements.txt', 'requirements.txt', s3_op
# folder
s3_fs
.
get
(
's3://csst-prod/gaia/data'
,
'./'
,
recursive
=
True
)
s3_fs
.
get
(
's3://csst-prod/gaia/data'
,
'./'
,
s3_options
=
s3_options
,
recursive
=
True
)
# get file or folder info
s3_fs
.
info
(
's3://csst-prod/gaia/data'
)
s3_fs
.
info
(
's3://csst-prod/gaia/test/requirements.txt'
,
s3_options
=
s3_options
)
```
## astropy直接读写s3的写法适配
...
...
csst_fs/s3_fs.py
View file @
4e27be18
...
...
@@ -7,4 +7,8 @@ def put(lpath, rpath, recursive=False, callback=fsspec.callbacks.DEFAULT_CALLBAC
def
get
(
rpath
,
lpath
,
recursive
=
False
,
callback
=
fsspec
.
callbacks
.
DEFAULT_CALLBACK
,
maxdepth
=
None
,
s3_options
=
load_s3_options
(),
**
kwargs
,):
s3_fs
=
fsspec
.
filesystem
(
's3'
,
**
s3_options
)
s3_fs
.
get
(
rpath
,
lpath
,
recursive
,
callback
,
maxdepth
,
**
kwargs
)
\ No newline at end of file
s3_fs
.
get
(
rpath
,
lpath
,
recursive
,
callback
,
maxdepth
,
**
kwargs
)
def
info
(
path
,
bucket
=
None
,
key
=
None
,
refresh
=
False
,
version_id
=
None
,
s3_options
=
load_s3_options
())
->
dict
:
s3_fs
=
fsspec
.
filesystem
(
's3'
,
**
s3_options
)
return
s3_fs
.
info
(
path
,
bucket
,
key
,
refresh
,
version_id
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment